Public Member Functions | |
UUIDGenerator (std::string nodeName) | |
const std::string | getUUIDHex () |
const char * | getUUID () |
Private Attributes | |
struct timeval | _previousTime |
int | _overrunCounter |
std::string | _nodeName |
unsigned char | _nodeNameHash [20] |
unsigned char | _clockSequence [2] |
This class generates time based type 1 UUIDs, as specified in RFC4122.
Definition at line 42 of file UUIDGenerator.h.
gov::fnal::cd::rms::util::UUIDGenerator::UUIDGenerator | ( | std::string | nodeName | ) |
UUID constructor. Takes the nodename, and generates the hash. Also sets up the clock sequence.
nodeName | The name of the node generating the UUIDs. This should be unique. |
Definition at line 23 of file UUIDGenerator.cpp.
References _clockSequence, _nodeName, _nodeNameHash, _previousTime, msf_helper::generator, sha1_forRMS_finish(), sha1_forRMS_starts(), and sha1_forRMS_update().
const char * gov::fnal::cd::rms::util::UUIDGenerator::getUUID | ( | ) |
Get a UUID from the generator.
Definition at line 129 of file UUIDGenerator.cpp.
References _clockSequence, _nodeNameHash, _overrunCounter, _previousTime, and MECModelEnuComparisons::i.
Referenced by gov::fnal::cd::rms::provider::EpicsMessenger::sendMessage().
const std::string gov::fnal::cd::rms::util::UUIDGenerator::getUUIDHex | ( | ) |
Get a human readable UUID from the generator.
Definition at line 53 of file UUIDGenerator.cpp.
References _clockSequence, _nodeNameHash, _overrunCounter, _previousTime, MECModelEnuComparisons::i, calib::j, fillBadChanDBTables::result, and string.
Referenced by gov::fnal::cd::rms::provider::DDSConnection::getUUID(), and gov::fnal::cd::rms::provider::RmsConnection::getUUID().
|
private |
The clock sequence, a 16 bit random number
Definition at line 75 of file UUIDGenerator.h.
Referenced by getUUID(), getUUIDHex(), and UUIDGenerator().
|
private |
The name of the node that is generating the UUIDs. This should be unique.
Definition at line 65 of file UUIDGenerator.h.
Referenced by UUIDGenerator().
|
private |
An SHA1 hash of the nodename
Definition at line 70 of file UUIDGenerator.h.
Referenced by getUUID(), getUUIDHex(), and UUIDGenerator().
|
private |
This is used to differentiate UUIDs that are generated within the same clock tick
Definition at line 59 of file UUIDGenerator.h.
Referenced by getUUID(), and getUUIDHex().
|
private |
The time at which the last UUID was generated.
Definition at line 53 of file UUIDGenerator.h.
Referenced by getUUID(), getUUIDHex(), and UUIDGenerator().