BOSS 8.0.0
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
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.
 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/include/Identifier/Identifier.h.

Member Typedef Documentation

◆ id_type [1/3]


Define public typedefs

Definition at line 25 of file DetectorDescription/Identifier/include/Identifier/Identifier.h.

◆ id_type [2/3]


Define public typedefs

Definition at line 25 of file InstallArea/x86_64-el9-gcc13-dbg/include/Identifier/Identifier.h.

◆ id_type [3/3]


Define public typedefs

Definition at line 25 of file InstallArea/x86_64-el9-gcc13-opt/include/Identifier/Identifier.h.

◆ size_type [1/3]

◆ size_type [2/3]

◆ size_type [3/3]

◆ value_type [1/3]

◆ value_type [2/3]

◆ value_type [3/3]

Constructor & Destructor Documentation

◆ Identifier() [1/9]

Identifier::Identifier ( )
inline

Default constructor.


Constructors

Definition at line 105 of file DetectorDescription/Identifier/include/Identifier/Identifier.h.

105: m_id( max_value ) {}

Referenced by Identifier(), operator!=(), operator&=(), operator<(), operator=(), operator==(), operator>(), operator|=(), and show().

◆ Identifier() [2/9]

Identifier::Identifier ( value_type value)
inlineexplicit

Constructor from value_type.

Definition at line 111 of file DetectorDescription/Identifier/include/Identifier/Identifier.h.

111: m_id( value ) {}

◆ Identifier() [3/9]

Identifier::Identifier ( const Identifier & other)
inline

Copy constructor.

Definition at line 108 of file DetectorDescription/Identifier/include/Identifier/Identifier.h.

108: m_id( other.get_value() ) {}
Index other(Index i, Index j)

◆ Identifier() [4/9]

Identifier::Identifier ( )

Default constructor.


Constructors

◆ Identifier() [5/9]

Identifier::Identifier ( value_type value)
explicit

Constructor from value_type.

◆ Identifier() [6/9]

Identifier::Identifier ( const Identifier & other)

Copy constructor.

◆ Identifier() [7/9]

Identifier::Identifier ( )

Default constructor.


Constructors

◆ Identifier() [8/9]

Identifier::Identifier ( value_type value)
explicit

Constructor from value_type.

◆ Identifier() [9/9]

Identifier::Identifier ( const Identifier & other)

Copy constructor.

Member Function Documentation

◆ clear() [1/3]

void Identifier::clear ( )
inline

Reset to invalid state.

Definition at line 131 of file DetectorDescription/Identifier/include/Identifier/Identifier.h.

131{ m_id = max_value; }

Referenced by MdcDedxRecon::execute(), and TrkReco::execute().

◆ clear() [2/3]

void Identifier::clear ( )

Reset to invalid state.

◆ clear() [3/3]

void Identifier::clear ( )

Reset to invalid state.

◆ get_value() [1/3]

◆ get_value() [2/3]

value_type Identifier::get_value ( ) const

◆ get_value() [3/3]

value_type Identifier::get_value ( ) const

◆ getString() [1/3]

std::string Identifier::getString ( ) const

Provide a string form of the identifier - hexadecimal.


Utilities

Definition at line 13 of file Identifier.cxx.

13 {
14 std::string result;
15 char temp[20];
16
17 sprintf( temp, "0x%x", (unsigned int)m_id );
18 result += temp;
19 result.insert( 2, 10 - result.length(), '0' );
20
21 return ( result );
22}
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/3]

std::string Identifier::getString ( ) const

Provide a string form of the identifier - hexadecimal.


Utilities

◆ getString() [3/3]

std::string Identifier::getString ( ) const

Provide a string form of the identifier - hexadecimal.


Utilities

◆ is_valid() [1/3]

bool Identifier::is_valid ( ) const
inline

Check if id is in a valid state.


Error management

Definition at line 159 of file DetectorDescription/Identifier/include/Identifier/Identifier.h.

159{ return ( !( max_value == m_id ) ); }

Referenced by EmcRec::execute().

◆ is_valid() [2/3]

bool Identifier::is_valid ( ) const

Check if id is in a valid state.


Error management

◆ is_valid() [3/3]

bool Identifier::is_valid ( ) const

Check if id is in a valid state.


Error management

◆ operator value_type() [1/3]

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

Accessors

Get the value

Definition at line 134 of file DetectorDescription/Identifier/include/Identifier/Identifier.h.

134{ return ( m_id ); }

◆ operator value_type() [2/3]

Identifier::operator value_type ( void ) const

Accessors

Get the value

◆ operator value_type() [3/3]

Identifier::operator value_type ( void ) const

Accessors

Get the value

◆ operator!=() [1/3]

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

Definition at line 145 of file DetectorDescription/Identifier/include/Identifier/Identifier.h.

145 {
146 return ( m_id != other.get_value() );
147}

◆ operator!=() [2/3]

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

◆ operator!=() [3/3]

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

◆ operator&=() [1/3]

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

Definition at line 126 of file DetectorDescription/Identifier/include/Identifier/Identifier.h.

126 {
127 m_id &= value;
128 return ( *this );
129}

◆ operator&=() [2/3]

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

◆ operator&=() [3/3]

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

◆ operator<() [1/3]

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

Definition at line 150 of file DetectorDescription/Identifier/include/Identifier/Identifier.h.

150 {
151 return ( m_id < other.get_value() );
152}

◆ operator<() [2/3]

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

◆ operator<() [3/3]

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

◆ operator=() [1/3]

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

Assignment operator.


Modifications

Definition at line 116 of file DetectorDescription/Identifier/include/Identifier/Identifier.h.

116 {
117 m_id = value;
118 return ( *this );
119}

◆ operator=() [2/3]

Identifier & Identifier::operator= ( value_type value)

Assignment operator.


Modifications

◆ operator=() [3/3]

Identifier & Identifier::operator= ( value_type value)

Assignment operator.


Modifications

◆ operator==() [1/3]

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

Comparison operators

Definition at line 140 of file DetectorDescription/Identifier/include/Identifier/Identifier.h.

140 {
141 return ( m_id == other.get_value() );
142}

◆ operator==() [2/3]

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

Comparison operators

◆ operator==() [3/3]

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

Comparison operators

◆ operator>() [1/3]

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

Definition at line 155 of file DetectorDescription/Identifier/include/Identifier/Identifier.h.

155 {
156 return ( m_id > other.get_value() );
157}

◆ operator>() [2/3]

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

◆ operator>() [3/3]

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

◆ operator|=() [1/3]

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

Bitwise operations.

Definition at line 121 of file DetectorDescription/Identifier/include/Identifier/Identifier.h.

121 {
122 m_id |= value;
123 return ( *this );
124}

◆ operator|=() [2/3]

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

Bitwise operations.

◆ operator|=() [3/3]

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

Bitwise operations.

◆ set() [1/3]

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

build from a string form - hexadecimal

Definition at line 10 of file Identifier.cxx.

10{ sscanf( id.c_str(), "0x%x", &m_id ); }
char * c_str(Index i)

◆ set() [2/3]

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

build from a string form - hexadecimal

◆ set() [3/3]

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

build from a string form - hexadecimal

◆ show() [1/3]

void Identifier::show ( ) const

Print out in hex form.

Definition at line 25 of file Identifier.cxx.

25 {
26 const Identifier& me = *this;
27 std::cout << me.getString();
28}
double me

◆ show() [2/3]

void Identifier::show ( ) const

Print out in hex form.

◆ show() [3/3]

void Identifier::show ( ) const

Print out in hex form.


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