BOSS 7.0.4
BESIII Offline Software System
Loading...
Searching...
No Matches
Identifier Class Reference

#include <Identifier.h>

Public Types

typedef Identifier id_type
 
typedef unsigned int value_type
 
typedef unsigned int size_type
 
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.
 
Identifieroperator= (value_type value)
 Assignment operator.
 
Identifieroperator|= (value_type value)
 Bitwise operations.
 
Identifieroperator&= (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.
 
 Identifier ()
 Default constructor.
 
 Identifier (value_type value)
 Constructor from value_type.
 
 Identifier (const Identifier &other)
 Copy constructor.
 
Identifieroperator= (value_type value)
 Assignment operator.
 
Identifieroperator|= (value_type value)
 Bitwise operations.
 
Identifieroperator&= (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.
 

Detailed Description


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 DetectorDescription/Identifier/Identifier-00-02-17/Identifier/Identifier.h.

Member Typedef Documentation

◆ id_type [1/2]

◆ id_type [2/2]


Define public typedefs

Definition at line 26 of file InstallArea/include/Identifier/Identifier/Identifier.h.

◆ size_type [1/2]

◆ size_type [2/2]

typedef unsigned int Identifier::size_type

◆ value_type [1/2]

◆ value_type [2/2]

typedef unsigned int Identifier::value_type

Constructor & Destructor Documentation

◆ Identifier() [1/6]

Identifier::Identifier ( )
inline

Default constructor.


Constructors

Definition at line 110 of file DetectorDescription/Identifier/Identifier-00-02-17/Identifier/Identifier.h.

111 : m_id(max_value)
112{}

◆ Identifier() [2/6]

Identifier::Identifier ( value_type  value)
inlineexplicit

Constructor from value_type.

Definition at line 121 of file DetectorDescription/Identifier/Identifier-00-02-17/Identifier/Identifier.h.

122 : m_id(value)
123{
124}

◆ Identifier() [3/6]

Identifier::Identifier ( const Identifier other)
inline

Copy constructor.

Definition at line 115 of file DetectorDescription/Identifier/Identifier-00-02-17/Identifier/Identifier.h.

116 : m_id(other.get_value())
117{
118}
Index other(Index i, Index j)
Definition: EvtCyclic3.cc:118

◆ Identifier() [4/6]

Identifier::Identifier ( )

Default constructor.


Constructors

◆ Identifier() [5/6]

Identifier::Identifier ( value_type  value)
explicit

Constructor from value_type.

◆ Identifier() [6/6]

Identifier::Identifier ( const Identifier other)

Copy constructor.

Member Function Documentation

◆ clear() [1/2]

◆ clear() [2/2]

void Identifier::clear ( )

Reset to invalid state.

◆ get_value() [1/2]

◆ get_value() [2/2]

value_type Identifier::get_value ( ) const

◆ getString() [1/2]

std::string Identifier::getString ( ) const

Provide a string form of the identifier - hexadecimal.


Utilities

Definition at line 17 of file Identifier.cxx.

18{
19 std::string result;
20 char temp[20];
21
22 sprintf (temp, "0x%x", (unsigned int)m_id);
23 result += temp;
24 result.insert(2,10-result.length(),'0');
25
26 return (result);
27}
sprintf(cut,"kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_pxy0_em<0.15+%d*0.1&&NGch>=2", j, j)

Referenced by operator<<().

◆ getString() [2/2]

std::string Identifier::getString ( ) const

Provide a string form of the identifier - hexadecimal.


Utilities

◆ is_valid() [1/2]

bool Identifier::is_valid ( ) const
inline

Check if id is in a valid state.


Error management

Definition at line 198 of file DetectorDescription/Identifier/Identifier-00-02-17/Identifier/Identifier.h.

199{
200 return (!(max_value == m_id));
201}

Referenced by EmcRec::execute().

◆ is_valid() [2/2]

bool Identifier::is_valid ( ) const

Check if id is in a valid state.


Error management

◆ operator value_type() [1/2]

Identifier::operator Identifier::value_type ( void  ) const
inline

Accessors

Get the value

Definition at line 158 of file DetectorDescription/Identifier/Identifier-00-02-17/Identifier/Identifier.h.

159{
160 return (m_id);
161}

◆ operator value_type() [2/2]

Identifier::operator value_type ( void  ) const

Accessors

Get the value

◆ operator!=() [1/2]

bool Identifier::operator!= ( const Identifier other) const
inline

Definition at line 178 of file DetectorDescription/Identifier/Identifier-00-02-17/Identifier/Identifier.h.

179{
180 return (m_id != other.get_value());
181}

◆ operator!=() [2/2]

bool Identifier::operator!= ( const Identifier other) const

◆ operator&=() [1/2]

Identifier & Identifier::operator&= ( value_type  value)
inline

Definition at line 145 of file DetectorDescription/Identifier/Identifier-00-02-17/Identifier/Identifier.h.

146{
147 m_id &= value;
148 return (*this);
149}

◆ operator&=() [2/2]

Identifier & Identifier::operator&= ( value_type  value)

◆ operator<() [1/2]

bool Identifier::operator< ( const Identifier other) const
inline

Definition at line 184 of file DetectorDescription/Identifier/Identifier-00-02-17/Identifier/Identifier.h.

186{
187 return (m_id < other.get_value());
188}

◆ operator<() [2/2]

bool Identifier::operator< ( const Identifier other) const

◆ operator=() [1/2]

Identifier & Identifier::operator= ( value_type  value)
inline

Assignment operator.


Modifications

Definition at line 131 of file DetectorDescription/Identifier/Identifier-00-02-17/Identifier/Identifier.h.

132{
133 m_id = value;
134 return (*this);
135}

◆ operator=() [2/2]

Identifier & Identifier::operator= ( value_type  value)

Assignment operator.


Modifications

◆ operator==() [1/2]

bool Identifier::operator== ( const Identifier other) const
inline

Comparison operators

Definition at line 171 of file DetectorDescription/Identifier/Identifier-00-02-17/Identifier/Identifier.h.

172{
173 return (m_id == other.get_value());
174}

◆ operator==() [2/2]

bool Identifier::operator== ( const Identifier other) const

Comparison operators

◆ operator>() [1/2]

bool Identifier::operator> ( const Identifier other) const
inline

Definition at line 192 of file DetectorDescription/Identifier/Identifier-00-02-17/Identifier/Identifier.h.

193{
194 return (m_id > other.get_value());
195}

◆ operator>() [2/2]

bool Identifier::operator> ( const Identifier other) const

◆ operator|=() [1/2]

Identifier & Identifier::operator|= ( value_type  value)
inline

Bitwise operations.

Definition at line 138 of file DetectorDescription/Identifier/Identifier-00-02-17/Identifier/Identifier.h.

139{
140 m_id |= value;
141 return (*this);
142}

◆ operator|=() [2/2]

Identifier & Identifier::operator|= ( value_type  value)

Bitwise operations.

◆ set() [1/2]

void Identifier::set ( const std::string &  id)

build from a string form - hexadecimal

Definition at line 10 of file Identifier.cxx.

11{
12 sscanf (id.c_str(), "0x%x", &m_id);
13}
char * c_str(Index i)
Definition: EvtCyclic3.cc:252

◆ set() [2/2]

void Identifier::set ( const std::string &  id)

build from a string form - hexadecimal

◆ show() [1/2]

void Identifier::show ( ) const

Print out in hex form.

Definition at line 30 of file Identifier.cxx.

31{
32 const Identifier& me = *this;
33 std::cout << me.getString();
34}
const double me
Definition: PipiJpsi.cxx:48

◆ show() [2/2]

void Identifier::show ( ) const

Print out in hex form.


The documentation for this class was generated from the following files: