CMS 3D CMS Logo

Guid.h
Go to the documentation of this file.
1 #ifndef FWCOre_Utilities_Guid_h
2 #define FWCOre_Utilities_Guid_h
3 
4 #include <string>
5 
6 /*
7  * copied from pool
8  */
9 namespace edm {
10 
23  class Guid { // size is 16
24  public:
25  unsigned int Data1;
26  unsigned short Data2;
27  unsigned short Data3;
28  unsigned char Data4[8];
29 
31  Guid() { init(); }
33  explicit Guid(bool) { init(); }
35  explicit Guid(char const* s) { fromString(s); }
37  explicit Guid(std::string const& s) { fromString(s); }
39  Guid(Guid const& c) { *this = c; }
41  Guid& operator=(Guid const& g) {
42  if (this != &g) {
43  Data1 = g.Data1;
44  Data2 = g.Data2;
45  Data3 = g.Data3;
46  unsigned int* p = reinterpret_cast<unsigned int*>(&Data4[0]);
47  unsigned int const* q = reinterpret_cast<unsigned int const*>(&g.Data4[0]);
48  *(p + 1) = *(q + 1);
49  *p = *q;
50  }
51  return *this;
52  }
54  bool operator<(Guid const& g) const;
56  bool operator==(Guid const& g) const {
57  if (this != &g) {
58  if (Data1 != g.Data1)
59  return false;
60  if (Data2 != g.Data2)
61  return false;
62  if (Data3 != g.Data3)
63  return false;
64  unsigned int const* p = reinterpret_cast<unsigned int const*>(&Data4[0]);
65  unsigned int const* q = reinterpret_cast<unsigned int const*>(&g.Data4[0]);
66  return *p == *q && *(p + 1) == *(q + 1);
67  }
68  return true;
69  }
71  bool operator!=(Guid const& g) const { return !(this->operator==(g)); }
73  std::string const toString() const;
75  Guid const& fromString(std::string const& s);
77  private:
78  void init();
79  };
80 } // namespace edm
81 #endif
edm::Guid::Guid
Guid(char const *s)
Constructor for Guid from char*.
Definition: Guid.h:35
edm
HLT enums.
Definition: AlignableModifier.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
data-class-funcs.q
q
Definition: data-class-funcs.py:169
edm::Guid::Data1
unsigned int Data1
Definition: Guid.h:25
edm::Guid::toString
const std::string toString() const
Automatic conversion from string reprentation.
Definition: Guid.cc:40
edm::Guid::Data3
unsigned short Data3
Definition: Guid.h:27
alignCSCRings.s
s
Definition: alignCSCRings.py:92
edm::Guid::operator==
bool operator==(Guid const &g) const
Equality operator.
Definition: Guid.h:56
edm::Guid::fromString
Guid const & fromString(std::string const &s)
Automatic conversion to string representation.
Definition: Guid.cc:60
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::Guid::Guid
Guid(Guid const &c)
Copy constructor.
Definition: Guid.h:39
edm::Guid::Guid
Guid(bool)
Standard constructor (With initialization)
Definition: Guid.h:33
edm::Guid::operator!=
bool operator!=(Guid const &g) const
Non-equality operator.
Definition: Guid.h:71
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
edm::Guid
Definition: Guid.h:23
edm::Guid::Data4
unsigned char Data4[8]
Definition: Guid.h:28
edm::Guid::operator=
Guid & operator=(Guid const &g)
Assignment operator.
Definition: Guid.h:41
edm::Guid::Data2
unsigned short Data2
Definition: Guid.h:26
edm::Guid::operator<
bool operator<(Guid const &g) const
Smaller operator.
Definition: Guid.cc:96
edm::Guid::init
void init()
initialize a new Guid
Definition: Guid.cc:26
edm::Guid::Guid
Guid(std::string const &s)
Constructor for Guid from string.
Definition: Guid.h:37
edm::Guid::Guid
Guid()
Standard constructor (With initializaton)
Definition: Guid.h:31
g
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4