|
ATLAS Offline Software
|
Go to the documentation of this file.
11 #include "uuid/uuid.h"
13 static const char*
const fmt_Guid =
"%08X-%04hX-%04hX-%02hhX%02hhX-%02hhX%02hhX%02hhX%02hhX%02hhX%02hhX";
16 static const Guid clid_null(std::string(
"00000000-0000-0000-0000-000000000000"));
25 char* envv =
getenv(
"POOL_GUID_TIME");
27 envv =
getenv(
"POOL_GUID_RANDOM");
41 ::uuid_generate_time(me_);
47 unsigned int *
d1 = (
unsigned int*)me_;
48 unsigned short *
d2 = (
unsigned short*)(me_ + 4);
49 unsigned short *d3 = (
unsigned short*)(me_ + 6);
53 for (
unsigned int i = 0;
i < 8;
i++) {
54 guid.m_data4[
i] = me_[
i + 8];
62 return std::string(
text,
s);
71 for (
unsigned int i = 0;
i < 8;
i++) {
79 return ::memcmp(&
g.m_data1, &
m_data1, 16) < 0;
static const Guid & null()
NULL-Guid: static class method.
static GuidGenMethod initGuidGenMethod()
Checks for POOL_GUID_TIME or POOL_GUID_RANDOM env variables.
const std::string toString() const
Automatic conversion to string representation.
static void create(Guid &guid, GuidGenMethod method=GuidGenDefault)
Create a new Guid default method is currently Random, can be changed by param, API or environment.
bool operator<(const Guid &g) const
Smaller operator.
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
std::string getenv(const std::string &variableName)
get an environment variable
static const GuidGenMethod m_guidGenMethod
const Guid & fromString(const std::string &s)
Automatic conversion from string representation.
This file contains the class definition for the Guid class (migrated from POOL).