Cheap generic unique keyword identifier class. More...
#include <AtomicId.h>
Public Member Functions | |
AtomicId () throw () | |
AtomicId (const AtomicId &orig) throw () | |
AtomicId (const std::string &arg) throw () | |
constructs an AtomicId from a STL string | |
AtomicId (const char *arg) throw () | |
constructs an AtomicId from a C string | |
operator bool () const throw () | |
null value check operator | |
operator const char * () const throw () | |
implicit cast to a C string | |
operator std::string () const throw () | |
implicit cast to a STL string | |
bool | operator!= (const AtomicId &second) const throw () |
bool | operator< (const AtomicId &second) const throw () |
bool | operator<= (const AtomicId &second) const throw () |
AtomicId & | operator= (const AtomicId &orig) throw () |
bool | operator== (const AtomicId &second) const throw () |
bool | operator> (const AtomicId &second) const throw () |
bool | operator>= (const AtomicId &second) const throw () |
~AtomicId () throw () | |
Static Private Member Functions | |
static AtomicId | build (const char *arg) throw () |
static const char * | lookup (const char *arg) throw () |
Private Attributes | |
const char * | string |
Cheap generic unique keyword identifier class.
AtomicId is a lightweight class intended to be used for key values e.g. in STL maps. An atomic identifier can be transparently constructed from and converted back to a string, but an instance of AtomicId does not occupy and additional memory and the comparator operators are very cheap. An AtomicId instance requires the size of a pointer and is therefore suited for direct inlining.
Definition at line 32 of file AtomicId.h.
PhysicsTools::AtomicId::AtomicId | ( | ) | throw () [inline] |
Definition at line 34 of file AtomicId.h.
: string(0) {}
PhysicsTools::AtomicId::AtomicId | ( | const AtomicId & | orig | ) | throw () [inline] |
Definition at line 35 of file AtomicId.h.
: string(orig.string) {}
PhysicsTools::AtomicId::AtomicId | ( | const char * | arg | ) | throw () [inline] |
PhysicsTools::AtomicId::AtomicId | ( | const std::string & | arg | ) | throw () [inline] |
PhysicsTools::AtomicId::~AtomicId | ( | ) | throw () [inline] |
Definition at line 41 of file AtomicId.h.
{}
static AtomicId PhysicsTools::AtomicId::build | ( | const char * | arg | ) | throw () [inline, static, private] |
Definition at line 66 of file AtomicId.h.
References cmsCodeRulesChecker::arg, lumiQueryAPI::q, and string.
const char * PhysicsTools::AtomicId::lookup | ( | const char * | arg | ) | throw () [static, private] |
Definition at line 67 of file AtomicId.cc.
References PhysicsTools::getAtomicIdCache().
{ if (string) return getAtomicIdCache().findOrInsert(string); return 0; }
PhysicsTools::AtomicId::operator bool | ( | ) | const throw () [inline] |
PhysicsTools::AtomicId::operator const char * | ( | ) | const throw () [inline] |
implicit cast to a C string
Definition at line 47 of file AtomicId.h.
References string.
{ return string; }
PhysicsTools::AtomicId::operator std::string | ( | ) | const throw () [inline] |
implicit cast to a STL string
Definition at line 55 of file AtomicId.h.
References string.
{ return std::string(string); }
bool PhysicsTools::AtomicId::operator!= | ( | const AtomicId & | second | ) | const throw () [inline] |
Definition at line 59 of file AtomicId.h.
References edm::second().
{ return string != second.string; }
bool PhysicsTools::AtomicId::operator< | ( | const AtomicId & | second | ) | const throw () [inline] |
Definition at line 60 of file AtomicId.h.
References edm::second().
{ return string < second.string; }
bool PhysicsTools::AtomicId::operator<= | ( | const AtomicId & | second | ) | const throw () [inline] |
Definition at line 61 of file AtomicId.h.
References edm::second().
{ return string <= second.string; }
Definition at line 43 of file AtomicId.h.
References string.
{ string = orig.string; return *this; }
bool PhysicsTools::AtomicId::operator== | ( | const AtomicId & | second | ) | const throw () [inline] |
Definition at line 58 of file AtomicId.h.
References edm::second().
{ return string == second.string; }
bool PhysicsTools::AtomicId::operator> | ( | const AtomicId & | second | ) | const throw () [inline] |
Definition at line 62 of file AtomicId.h.
References edm::second().
{ return string > second.string; }
bool PhysicsTools::AtomicId::operator>= | ( | const AtomicId & | second | ) | const throw () [inline] |
Definition at line 63 of file AtomicId.h.
References edm::second().
{ return string >= second.string; }
const char* PhysicsTools::AtomicId::string [private] |
Definition at line 69 of file AtomicId.h.
Referenced by build(), operator const char *(), operator std::string(), and operator=().