CGEM BOSS 6.6.5.f
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)
 
virtual void set (const std::string &id)
 build from a string form - hexadecimal
 
virtual void clear ()
 Reset to invalid state.
 
 operator value_type (void) const
 
value_type get_value () const
 
virtual bool operator== (const Identifier &other) const
 
virtual bool operator!= (const Identifier &other) const
 
virtual bool operator< (const Identifier &other) const
 
virtual bool operator> (const Identifier &other) const
 
virtual bool is_valid () const
 Check if id is in a valid state.
 
virtual std::string getString () const
 Provide a string form of the identifier - hexadecimal.
 
virtual 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)
 
virtual void set (const std::string &id)
 build from a string form - hexadecimal
 
virtual void clear ()
 Reset to invalid state.
 
 operator value_type (void) const
 
value_type get_value () const
 
virtual bool operator== (const Identifier &other) const
 
virtual bool operator!= (const Identifier &other) const
 
virtual bool operator< (const Identifier &other) const
 
virtual bool operator> (const Identifier &other) const
 
virtual bool is_valid () const
 Check if id is in a valid state.
 
virtual std::string getString () const
 Provide a string form of the identifier - hexadecimal.
 
virtual 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)
 
virtual void set (const std::string &id)
 build from a string form - hexadecimal
 
virtual void clear ()
 Reset to invalid state.
 
 operator value_type (void) const
 
value_type get_value () const
 
virtual bool operator== (const Identifier &other) const
 
virtual bool operator!= (const Identifier &other) const
 
virtual bool operator< (const Identifier &other) const
 
virtual bool operator> (const Identifier &other) const
 
virtual bool is_valid () const
 Check if id is in a valid state.
 
virtual std::string getString () const
 Provide a string form of the identifier - hexadecimal.
 
virtual 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/bak_Identifier-01-02-14/Identifier/Identifier.h.

Member Typedef Documentation

◆ id_type [1/3]

◆ id_type [2/3]

◆ id_type [3/3]


Define public typedefs

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

◆ size_type [1/3]

◆ size_type [2/3]

◆ size_type [3/3]

typedef unsigned int Identifier::size_type

◆ value_type [1/3]

◆ value_type [2/3]

◆ value_type [3/3]

typedef unsigned int Identifier::value_type

Constructor & Destructor Documentation

◆ Identifier() [1/9]

Identifier::Identifier ( )
inline

Default constructor.


Constructors

Definition at line 110 of file DetectorDescription/Identifier/bak_Identifier-01-02-14/Identifier/Identifier.h.

111 : m_id(max_value)
112{}

◆ Identifier() [2/9]

Identifier::Identifier ( value_type  value)
inlineexplicit

Constructor from value_type.

Definition at line 121 of file DetectorDescription/Identifier/bak_Identifier-01-02-14/Identifier/Identifier.h.

122 : m_id(value)
123{
124}

◆ Identifier() [3/9]

Identifier::Identifier ( const Identifier other)
inline

Copy constructor.

Definition at line 115 of file DetectorDescription/Identifier/bak_Identifier-01-02-14/Identifier/Identifier.h.

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

◆ 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]

◆ clear() [2/3]

virtual void Identifier::clear ( )
virtual

Reset to invalid state.

◆ clear() [3/3]

virtual void Identifier::clear ( )
virtual

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
virtual

Provide a string form of the identifier - hexadecimal.


Utilities

Definition at line 17 of file bak_Identifier-01-02-14/src/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}

Referenced by operator<<().

◆ getString() [2/3]

virtual std::string Identifier::getString ( ) const
virtual

Provide a string form of the identifier - hexadecimal.


Utilities

◆ getString() [3/3]

virtual std::string Identifier::getString ( ) const
virtual

Provide a string form of the identifier - hexadecimal.


Utilities

◆ is_valid() [1/3]

bool Identifier::is_valid ( ) const
inlinevirtual

Check if id is in a valid state.


Error management

Definition at line 198 of file DetectorDescription/Identifier/bak_Identifier-01-02-14/Identifier/Identifier.h.

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

Referenced by EmcRec::execute().

◆ is_valid() [2/3]

virtual bool Identifier::is_valid ( ) const
virtual

Check if id is in a valid state.


Error management

◆ is_valid() [3/3]

virtual bool Identifier::is_valid ( ) const
virtual

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 158 of file DetectorDescription/Identifier/bak_Identifier-01-02-14/Identifier/Identifier.h.

159{
160 return (m_id);
161}

◆ 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
inlinevirtual

Definition at line 178 of file DetectorDescription/Identifier/bak_Identifier-01-02-14/Identifier/Identifier.h.

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

◆ operator!=() [2/3]

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

◆ operator!=() [3/3]

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

◆ operator&=() [1/3]

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

Definition at line 145 of file DetectorDescription/Identifier/bak_Identifier-01-02-14/Identifier/Identifier.h.

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

◆ 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
inlinevirtual

Definition at line 184 of file DetectorDescription/Identifier/bak_Identifier-01-02-14/Identifier/Identifier.h.

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

◆ operator<() [2/3]

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

◆ operator<() [3/3]

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

◆ operator=() [1/3]

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

Assignment operator.


Modifications

Definition at line 131 of file DetectorDescription/Identifier/bak_Identifier-01-02-14/Identifier/Identifier.h.

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

◆ 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
inlinevirtual

Comparison operators

Definition at line 171 of file DetectorDescription/Identifier/bak_Identifier-01-02-14/Identifier/Identifier.h.

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

◆ operator==() [2/3]

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

Comparison operators

◆ operator==() [3/3]

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

Comparison operators

◆ operator>() [1/3]

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

Definition at line 192 of file DetectorDescription/Identifier/bak_Identifier-01-02-14/Identifier/Identifier.h.

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

◆ operator>() [2/3]

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

◆ operator>() [3/3]

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

◆ operator|=() [1/3]

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

Bitwise operations.

Definition at line 138 of file DetectorDescription/Identifier/bak_Identifier-01-02-14/Identifier/Identifier.h.

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

◆ 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)
virtual

build from a string form - hexadecimal

Definition at line 10 of file bak_Identifier-01-02-14/src/Identifier.cxx.

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

◆ set() [2/3]

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

build from a string form - hexadecimal

◆ set() [3/3]

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

build from a string form - hexadecimal

◆ show() [1/3]

void Identifier::show ( ) const
virtual

Print out in hex form.

Definition at line 30 of file bak_Identifier-01-02-14/src/Identifier.cxx.

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

◆ show() [2/3]

virtual void Identifier::show ( ) const
virtual

Print out in hex form.

◆ show() [3/3]

virtual void Identifier::show ( ) const
virtual

Print out in hex form.


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