#include <UniqueId.h>
Definition at line 67 of file UniqueId.h.
Public Types | |
typedef long long int | IdType |
The type for the numeric value the unique id is represented in. | |
Public Member Functions | |
UniqueId (const IdType id) throw () | |
Constructor to create a UniqueId with a specific integer value. | |
UniqueId (const std::string idAsString) throw () | |
Constructor to create a UniqueId with a specific string value. | |
Ptr< std::string >::Ref | toDecimalString (void) const throw () |
Return the UniqueId as a string in base 10. | |
bool | operator== (const UniqueId &otherId) const throw () |
Compare this is with an other one. | |
bool | operator!= (const UniqueId &otherId) const throw () |
Compare this is with an other one. | |
bool | operator< (const UniqueId &otherId) const throw () |
Compare this id with an other one. | |
const IdType | getId (void) const throw () |
Return the numeric value of this globally unique id. | |
operator IdType () const throw () | |
Return the numeric value of this globally unique id (alternative syntax). | |
operator std::string () const throw () | |
Return the string value of this globally unique id. | |
Static Public Member Functions | |
static Ptr< UniqueId >::Ref | fromDecimalString (const std::string idStr) throw () |
Create a UniqueId from a numeric value, which is a string representation of the id, in base 10. | |
static Ptr< UniqueId >::Ref | generateId (void) throw () |
Generate a globally unique id. |
typedef long long int LiveSupport::Core::UniqueId::IdType |
The type for the numeric value the unique id is represented in.
This is set to ‘long long int’, i.e., 64-bit signed integers. TODO: change this into something not quite as non-portable.
Definition at line 75 of file UniqueId.h.
LiveSupport::Core::UniqueId::UniqueId | ( | const IdType | id | ) | throw () [inline] |
Constructor to create a UniqueId with a specific integer value.
The argument is expected to be between 0 and 2^31-1 (inclusive).
id | the numeric value of the created id object. |
Definition at line 103 of file UniqueId.h.
LiveSupport::Core::UniqueId::UniqueId | ( | const std::string | idAsString | ) | throw () [inline] |
Constructor to create a UniqueId with a specific string value.
If the argument is not a valid hexadecimal number between 0 and 2^31-1 (inclusive), the integer value of the UniqueId will be bogus.
idAsString | the string value of the created id object, in hexadecimal notation. |
Definition at line 120 of file UniqueId.h.
static Ptr<UniqueId>::Ref LiveSupport::Core::UniqueId::fromDecimalString | ( | const std::string | idStr | ) | throw () [inline, static] |
Create a UniqueId from a numeric value, which is a string representation of the id, in base 10.
If the argument is not a valid decimal number between 0 and 2^31-1 (inclusive), the value of the UniqueId will be bogus.
idStr | the id in base 10, in string from. |
Definition at line 139 of file UniqueId.h.
Generate a globally unique id.
This is used for testing. In real life, unique IDs are generated by the storage server.
Definition at line 60 of file UniqueId.cxx.
References LiveSupport::Core::Uuid::generateId(), LiveSupport::Core::Md5::high64bits(), and LiveSupport::Core::Md5::low64bits().
Referenced by LiveSupport::StorageClient::TestStorageClient::acquirePlaylist(), LiveSupport::StorageClient::TestStorageClient::createPlaylist(), LiveSupport::Core::FadeInfo::FadeInfo(), LiveSupport::Core::PlaylistElement::PlaylistElement(), and LiveSupport::StorageClient::TestStorageClient::storeAudioClip().
const IdType LiveSupport::Core::UniqueId::getId | ( | void | ) | const throw () [inline] |
Return the numeric value of this globally unique id.
Definition at line 217 of file UniqueId.h.
LiveSupport::Core::UniqueId::operator IdType | ( | ) | const throw () [inline] |
Return the numeric value of this globally unique id (alternative syntax).
Definition at line 228 of file UniqueId.h.
LiveSupport::Core::UniqueId::operator std::string | ( | ) | const throw () [inline] |
Return the string value of this globally unique id.
Definition at line 238 of file UniqueId.h.
bool LiveSupport::Core::UniqueId::operator!= | ( | const UniqueId & | otherId | ) | const throw () [inline] |
Compare this is with an other one.
otherId | the other unqiue id to compare to. |
Definition at line 186 of file UniqueId.h.
bool LiveSupport::Core::UniqueId::operator< | ( | const UniqueId & | otherId | ) | const throw () [inline] |
Compare this id with an other one.
otherId | the other unique id to compare to. |
Definition at line 199 of file UniqueId.h.
bool LiveSupport::Core::UniqueId::operator== | ( | const UniqueId & | otherId | ) | const throw () [inline] |
Compare this is with an other one.
otherId | the other unqiue id to compare to. |
Definition at line 173 of file UniqueId.h.
Ptr<std::string>::Ref LiveSupport::Core::UniqueId::toDecimalString | ( | void | ) | const throw () [inline] |
Return the UniqueId as a string in base 10.
Definition at line 156 of file UniqueId.h.