#include <POOLCore/Guid.h>
Public Member Functions | |
Guid const & | fromString (std::string const &s) |
Automatic conversion to string representation. | |
Guid (Guid const &c) | |
Copy constructor. | |
Guid () | |
Standard constructor (With initializaton) | |
Guid (std::string const &s) | |
Constructor for Guid from string. | |
Guid (bool) | |
Standard constructor (With initialization) | |
Guid (char const *s) | |
Constructor for Guid from char*. | |
bool | operator!= (Guid const &g) const |
Non-equality operator. | |
bool | operator< (Guid const &g) const |
Smaller operator. | |
Guid & | operator= (Guid const &g) |
Assignment operator. | |
bool | operator== (Guid const &g) const |
Equality operator. | |
std::string const | toString () const |
Automatic conversion from string reprentation. | |
Public Attributes | |
unsigned int | Data1 |
unsigned short | Data2 |
unsigned short | Data3 |
unsigned char | Data4 [8] |
Private Member Functions | |
void | init () |
initialize a new Guid |
Encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number). Note: This class may not have a virual destructor
edm::Guid::Guid | ( | ) | [inline] |
edm::Guid::Guid | ( | bool | ) | [inline, explicit] |
edm::Guid::Guid | ( | char const * | s | ) | [inline, explicit] |
Constructor for Guid from char*.
Definition at line 35 of file Guid.h.
References fromString().
{ fromString(s); }
edm::Guid::Guid | ( | std::string const & | s | ) | [inline, explicit] |
Constructor for Guid from string.
Definition at line 37 of file Guid.h.
References fromString().
{ fromString(s); }
edm::Guid::Guid | ( | Guid const & | c | ) | [inline] |
Guid const & edm::Guid::fromString | ( | std::string const & | s | ) |
Automatic conversion to string representation.
Definition at line 52 of file Guid.cc.
References Data1, Data2, Data3, Data4, and evf::evtn::offset().
Referenced by Guid().
{ char const dash = '-'; size_t const iSize = 8; size_t const sSize = 4; size_t const cSize = 2; size_t offset = 0; Data1 = strtol(source.substr(offset, iSize).c_str(), 0, 16); offset += iSize; assert(dash == source[offset++]); Data2 = strtol(source.substr(offset, sSize).c_str(), 0, 16); offset += sSize; assert(dash == source[offset++]); Data3 = strtol(source.substr(offset, sSize).c_str(), 0, 16); offset += sSize; assert(dash == source[offset++]); Data4[0] = strtol(source.substr(offset, cSize).c_str(), 0, 16); offset += cSize; Data4[1] = strtol(source.substr(offset, cSize).c_str(), 0, 16); offset += cSize; assert(dash == source[offset++]); Data4[2] = strtol(source.substr(offset, cSize).c_str(), 0, 16); offset += cSize; Data4[3] = strtol(source.substr(offset, cSize).c_str(), 0, 16); offset += cSize; Data4[4] = strtol(source.substr(offset, cSize).c_str(), 0, 16); offset += cSize; Data4[5] = strtol(source.substr(offset, cSize).c_str(), 0, 16); offset += cSize; Data4[6] = strtol(source.substr(offset, cSize).c_str(), 0, 16); offset += cSize; Data4[7] = strtol(source.substr(offset, cSize).c_str(), 0, 16); offset += cSize; assert(source.size() == offset); return *this; }
void edm::Guid::init | ( | void | ) | [private] |
initialize a new Guid
Initialize a new Guid.
Definition at line 27 of file Guid.cc.
References Data1, Data2, Data3, Data4, and i.
Referenced by Guid().
{ uuid_t me_; ::uuid_generate_time(me_); unsigned int* d1 = reinterpret_cast<unsigned int*>(me_); unsigned short* d2 = reinterpret_cast<unsigned short*>(me_+4); unsigned short* d3 = reinterpret_cast<unsigned short*>(me_+6); Data1 = *d1; Data2 = *d2; Data3 = *d3; for(int i = 0; i < 8; ++i){ Data4[i] = me_[i + 8]; } }
bool edm::Guid::operator!= | ( | Guid const & | g | ) | const [inline] |
Non-equality operator.
Definition at line 68 of file Guid.h.
References operator==().
{ return !(this->operator == (g)); }
bool edm::Guid::operator< | ( | Guid const & | g | ) | const |
Assignment operator.
Definition at line 41 of file Guid.h.
References compareJSON::const, Data1, Data2, Data3, Data4, AlCaHLTBitMon_ParallelJobs::p, and lumiQueryAPI::q.
bool edm::Guid::operator== | ( | Guid const & | g | ) | const [inline] |
Equality operator.
Definition at line 56 of file Guid.h.
References compareJSON::const, Data1, Data2, Data3, Data4, AlCaHLTBitMon_ParallelJobs::p, and lumiQueryAPI::q.
Referenced by operator!=().
{ if (this != & g) { if (Data1 != g.Data1) return false; if (Data2 != g.Data2) return false; if (Data3 != g.Data3) return false; unsigned int const* p = reinterpret_cast<unsigned int const*>(&Data4[0]); unsigned int const* q = reinterpret_cast<unsigned int const*>(&g.Data4[0]); return *p == *q && *(p+1) == *(q+1); } return true; }
std::string const edm::Guid::toString | ( | ) | const |
Automatic conversion from string reprentation.
Definition at line 41 of file Guid.cc.
References edm::bufSize, Data1, Data2, Data3, Data4, edm::fmt_Guid, and runonSM::text.
Referenced by FUShmDQMOutputService::FUShmDQMOutputService(), and edm::FUShmOutputModule::FUShmOutputModule().
unsigned int edm::Guid::Data1 |
Definition at line 25 of file Guid.h.
Referenced by fromString(), init(), operator<(), operator=(), operator==(), and toString().
unsigned short edm::Guid::Data2 |
Definition at line 26 of file Guid.h.
Referenced by fromString(), init(), operator=(), operator==(), and toString().
unsigned short edm::Guid::Data3 |
Definition at line 27 of file Guid.h.
Referenced by fromString(), init(), operator=(), operator==(), and toString().
unsigned char edm::Guid::Data4[8] |
Definition at line 28 of file Guid.h.
Referenced by fromString(), init(), operator=(), operator==(), and toString().