#include <Identifier.h>
Public Types | |
typedef Identifier | id_type |
typedef unsigned int | value_type |
typedef unsigned int | size_type |
Public Member Functions | |
Identifier () | |
Default constructor. | |
Identifier (value_type value) | |
Constructor from value_type. | |
Identifier (const Identifier &other) | |
Copy constructor. | |
Identifier & | operator= (value_type value) |
Assignment operator. | |
Identifier & | operator|= (value_type value) |
Bitwise operations. | |
Identifier & | operator &= (value_type value) |
void | set (const std::string &id) |
build from a string form - hexadecimal | |
void | clear () |
Reset to invalid state. | |
operator value_type (void) const | |
value_type | get_value () const |
bool | operator== (const Identifier &other) const |
bool | operator!= (const Identifier &other) const |
bool | operator< (const Identifier &other) const |
bool | operator> (const Identifier &other) const |
bool | is_valid () const |
Check if id is in a valid state. | |
std::string | getString () const |
Provide a string form of the identifier - hexadecimal. | |
void | show () const |
Print out in hex form. | |
Private Types | |
max_value = 0xFFFFFFFF | |
enum | max_value_type { max_value = 0xFFFFFFFF } |
Private Attributes | |
value_type | m_id |
Identifier is a simple type-safe 32 bit unsigned integer. An Identifier relies on other classes to encode and decode its information.
The default constructor created an Identifier an invalid state which can be check with the "is_valid" method to allow some error checking.
-----------------------------------------------
Definition at line 20 of file Identifier.h.
typedef Identifier Identifier::id_type |
---------------------------------------------------------------- Define public typedefs ----------------------------------------------------------------
Definition at line 26 of file Identifier.h.
typedef unsigned int Identifier::size_type |
Definition at line 28 of file Identifier.h.
typedef unsigned int Identifier::value_type |
Definition at line 27 of file Identifier.h.
enum Identifier::max_value_type [private] |
Definition at line 94 of file Identifier.h.
00094 { 00095 max_value = 0xFFFFFFFF 00096 } max_value_type;
Identifier::Identifier | ( | ) | [inline] |
Default constructor.
---------------------------------------------------------------- Constructors ----------------------------------------------------------------
Definition at line 110 of file Identifier.h.
Identifier::Identifier | ( | value_type | value | ) | [inline, explicit] |
Constructor from value_type.
Definition at line 121 of file Identifier.h.
00122 : m_id(value) 00123 { 00124 }
Identifier::Identifier | ( | const Identifier & | other | ) | [inline] |
void Identifier::clear | ( | ) | [inline] |
Reset to invalid state.
Definition at line 152 of file Identifier.h.
References m_id, and max_value.
Referenced by RecEmcTofHit::Clear(), RecEmcShower::Clear(), RecEmcCluster::Clear(), RecEmcDigit::RecEmcDigit(), and RecEmcHit::RecEmcHit().
Identifier::value_type Identifier::get_value | ( | ) | const [inline] |
Definition at line 163 of file Identifier.h.
References m_id.
Referenced by MdcTrack::storeTrack(), and TofRawDataProvider::tofDataMapOnlineMode().
00164 { 00165 return (m_id); 00166 }
std::string Identifier::getString | ( | ) | const |
Provide a string form of the identifier - hexadecimal.
---------------------------------------------------------------- Utilities ----------------------------------------------------------------
Definition at line 17 of file Identifier.cxx.
References m_id, deljobs::string, and subSeperate::temp.
Referenced by operator<<().
00018 { 00019 std::string result; 00020 char temp[20]; 00021 00022 sprintf (temp, "0x%x", (unsigned int)m_id); 00023 result += temp; 00024 result.insert(2,10-result.length(),'0'); 00025 00026 return (result); 00027 }
bool Identifier::is_valid | ( | ) | const [inline] |
Check if id is in a valid state.
---------------------------------------------------------------- Error management ----------------------------------------------------------------
Definition at line 198 of file Identifier.h.
References m_id, and max_value.
Referenced by EmcRec::execute().
Identifier & Identifier::operator &= | ( | value_type | value | ) | [inline] |
Definition at line 145 of file Identifier.h.
References m_id.
00146 { 00147 m_id &= value; 00148 return (*this); 00149 }
Identifier::operator Identifier::value_type | ( | void | ) | const [inline] |
---------------------------------------------------------------- Accessors ---------------------------------------------------------------- Get the value
Definition at line 158 of file Identifier.h.
References m_id.
00159 { 00160 return (m_id); 00161 }
bool Identifier::operator!= | ( | const Identifier & | other | ) | const [inline] |
bool Identifier::operator< | ( | const Identifier & | other | ) | const [inline] |
Identifier & Identifier::operator= | ( | value_type | value | ) | [inline] |
Assignment operator.
---------------------------------------------------------------- Modifications ----------------------------------------------------------------
Definition at line 131 of file Identifier.h.
References m_id.
00132 { 00133 m_id = value; 00134 return (*this); 00135 }
bool Identifier::operator== | ( | const Identifier & | other | ) | const [inline] |
---------------------------------------------------------------- Comparison operators ----------------------------------------------------------------
Definition at line 171 of file Identifier.h.
References m_id, and EvtCyclic3::other().
bool Identifier::operator> | ( | const Identifier & | other | ) | const [inline] |
Identifier & Identifier::operator|= | ( | value_type | value | ) | [inline] |
Bitwise operations.
Definition at line 138 of file Identifier.h.
References m_id.
00139 { 00140 m_id |= value; 00141 return (*this); 00142 }
void Identifier::set | ( | const std::string & | id | ) |
build from a string form - hexadecimal
Definition at line 10 of file Identifier.cxx.
References EvtCyclic3::c_str(), and m_id.
void Identifier::show | ( | ) | const |
Print out in hex form.
Definition at line 30 of file Identifier.cxx.
References me.
00031 { 00032 const Identifier& me = *this; 00033 std::cout << me.getString(); 00034 }
value_type Identifier::m_id [private] |
Definition at line 101 of file Identifier.h.
Referenced by clear(), get_value(), getString(), is_valid(), operator &=(), operator value_type(), operator!=(), operator<(), operator=(), operator==(), operator>(), operator|=(), and set().