Visualization Library 2.1.0
A lightweight C++ OpenGL middleware for 2D/3D graphics
|
[Download] [Tutorials] [All Classes] [Grouped Classes] |
Simple implementation of a 16 bytes Universally Unique ID based on http://www.ietf.org/rfc/rfc4122.txt. More...
#include <UUID.hpp>
Public Member Functions | |
UUID () | |
Constructor, by default it is set to all zeros. More... | |
void | generateVersion4 (const Random &random) |
Generates a Version 4 UUID as defined by RFC4122 using the specified random number generator. More... | |
bool | fromString (const char *guid_str) |
Init the UUID from the specified string which must be at least 38 characters long and must be of the form {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}. More... | |
void | fillString (char *guid_str, bool zero_terminate=true) const |
Fills a buffer with an ascii representation of the UUID of type {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}. More... | |
void | toStdString (std::string &guid_str) const |
Fills the given std::string with an ASCII representation of the UUID of type {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}. More... | |
std::string | toStdString () const |
Returns an std::string jwith an ASCII representation of the UUID of type {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}. More... | |
bool | operator== (const UUID &other) const |
bool | operator!= (const UUID &other) const |
bool | operator< (const UUID &other) const |
Public Attributes | |
unsigned int | mTimeLow |
unsigned short | mTimeMid |
unsigned short | mTimeHiAndVersion |
unsigned char | mClockSeqHiAndReserved |
unsigned char | mClockSeqLow |
unsigned char | mNode [6] |
Simple implementation of a 16 bytes Universally Unique ID based on http://www.ietf.org/rfc/rfc4122.txt.
UUID::UUID | ( | ) |
void UUID::fillString | ( | char * | guid_str, |
bool | zero_terminate = true |
||
) | const |
Fills a buffer with an ascii representation of the UUID of type {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}.
guid_str | must point to a buffer of at least 38 byes; if zero_terminate is true (default) then it must be at least 39 bytes large. |
zero_terminate | if true the function inserts a trailing 0 at the end of the string, in this case guid_str must point to a buffer 39 bytes large at least. |
Definition at line 68 of file UUID.cpp.
References mClockSeqHiAndReserved, mClockSeqLow, mNode, mTimeHiAndVersion, mTimeLow, mTimeMid, and VL_CHECK.
Referenced by toStdString().
bool UUID::fromString | ( | const char * | guid_str | ) |
Init the UUID from the specified string which must be at least 38 characters long and must be of the form {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}.
Definition at line 137 of file UUID.cpp.
References mClockSeqHiAndReserved, mClockSeqLow, mNode, mTimeHiAndVersion, mTimeLow, and mTimeMid.
void UUID::generateVersion4 | ( | const Random & | random | ) |
Generates a Version 4 UUID as defined by RFC4122 using the specified random number generator.
Definition at line 45 of file UUID.cpp.
References vl::Random::fillRandom(), mClockSeqHiAndReserved, and mTimeHiAndVersion.
|
inline |
|
inline |
void UUID::toStdString | ( | std::string & | guid_str | ) | const |
Fills the given std::string with an ASCII representation of the UUID of type {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}.
Definition at line 58 of file UUID.cpp.
References fillString().
std::string UUID::toStdString | ( | ) | const |
unsigned char vl::UUID::mClockSeqHiAndReserved |
Definition at line 86 of file UUID.hpp.
Referenced by fillString(), fromString(), and generateVersion4().
unsigned char vl::UUID::mClockSeqLow |
Definition at line 87 of file UUID.hpp.
Referenced by fillString(), and fromString().
unsigned char vl::UUID::mNode[6] |
Definition at line 88 of file UUID.hpp.
Referenced by fillString(), and fromString().
unsigned short vl::UUID::mTimeHiAndVersion |
Definition at line 85 of file UUID.hpp.
Referenced by fillString(), fromString(), and generateVersion4().
unsigned int vl::UUID::mTimeLow |
Definition at line 83 of file UUID.hpp.
Referenced by fillString(), and fromString().
unsigned short vl::UUID::mTimeMid |
Definition at line 84 of file UUID.hpp.
Referenced by fillString(), and fromString().
Visualization Library 2.1.0 Reference Documentation
Updated on Wed Mar 10 2021 16:02:55.
© Copyright Michele Bosi. All rights reserved.