31 #include <boost/uuid/uuid_io.hpp>
38 boost::uuids::nil_generator UUID::nilGen =
39 boost::uuids::nil_generator();
41 boost::uuids::basic_random_generator<boost::mt19937> UUID::randomGen =
42 boost::uuids::basic_random_generator<boost::mt19937>();
44 UUID::UUID(
const bool& random) :
53 boost::uuids::string_generator gen;
59 if (uuid !=
string(
"")) {
60 boost::uuids::string_generator gen;
66 memcpy(
id.data, data, 16);
70 id(boost::uuids::name_generator(ns.getId())(name)) {
87 return !(*
this < other) && !(other < *
this);
99 return stream <<
"UUID[" <<
id.id <<
"]";
bool operator==(const UUID &other) const
std::string getIdAsString() const
Returns a string representing the UUID.
Encapsulates the generation and handling of UUIDs.
static boost::uuids::basic_random_generator< boost::mt19937 > randomGen
bool operator!=(const UUID &other) const
UUID(const bool &random=true)
Creates a new UUID object that is either random or the nil UUID.
ostream & operator<<(ostream &stream, const UUID &id)
boost::uuids::uuid getId() const
Returns the contained UUID on boost format.
bool operator<(const UUID &other) const