ATLAS Offline Software
Loading...
Searching...
No Matches
HWIdentifier32.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5//<doc><file> $Id: HWIdentifier32.h,v 1.3 2004-02-24 13:52:15 schaffer Exp $
6//<version> $Name: not supported by cvs2svn $
7
8#ifndef IDENTIFIER_HWIDENTIFIER32_H
9# define IDENTIFIER_HWIDENTIFIER32_H
10
11#include "Identifier/Identifier.h"
13
15
16public:
17
20
22 explicit HWIdentifier32(value_type value);
23
25 explicit HWIdentifier32(const Identifier32& old);
26
28 explicit HWIdentifier32(unsigned long long value);
29
31 explicit HWIdentifier32(const Identifier& old);
32};
33
34
38
42
46
47inline HWIdentifier32::HWIdentifier32(unsigned long long value)
49{
50 bool hi = (value >> 32);
51 bool lo = (value << 32);
52 if (hi && lo) return; // full 64-bit identifier, so return invalid
53 //if (hi) m_id = (static_cast<value_type>(value >> 32));
54 //else if (lo) m_id = (static_cast<value_type>(value));
55 if (hi) {
56 const HWIdentifier32 myid(value >> 32);
57 this->operator=(myid);
58 } else if (lo) {
59 const HWIdentifier32 myid(value);
60 this->operator=(myid);
61 } else {
62 const HWIdentifier32 myid(static_cast<value_type>(0));
63 this->operator=(myid);
64 }
65}
66
68 : Identifier32::Identifier32(old.get_identifier32().get_compact())
69{ }
70
71#endif // IDENTIFIER_HWIDENTIFIER32_H
HWIdentifier32()
Default constructor.
value_type get_compact() const
Get the compact id.
Identifier32()=default
unsigned int value_type