LiveSupport::Core::UniqueId Class Reference

#include <UniqueId.h>

List of all members.


Detailed Description

A class representing globally unique identifiers.

Author:
Author
fgerlits
Version:
Revision
3185

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.


Member Typedef Documentation

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.


Constructor & Destructor Documentation

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).

Parameters:
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.

Parameters:
idAsString the string value of the created id object, in hexadecimal notation.

Definition at line 120 of file UniqueId.h.


Member Function Documentation

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.

Parameters:
idStr the id in base 10, in string from.
Returns:
a new UniqueId with the specified ID value.

Definition at line 139 of file UniqueId.h.

Ptr< UniqueId >::Ref UniqueId::generateId ( void   )  throw () [static]

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.

Returns:
the numeric value of this 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).

Returns:
the numeric value of this id.

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.

Returns:
the string value of this 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.

Parameters:
otherId the other unqiue id to compare to.
Returns:
true if this an otherId do not have the same ID value, false otherwise.

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.

Parameters:
otherId the other unique id to compare to.
Returns:
true if this id is smaller than the other one, false otherwise.

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.

Parameters:
otherId the other unqiue id to compare to.
Returns:
true if this an otherId have the same ID value, false otherwise.

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.

Returns:
a new string containing the value of the UniqueId.

Definition at line 156 of file UniqueId.h.


The documentation for this class was generated from the following files:
Generated on Sat Sep 22 02:00:38 2007 for Campcaster by  1.4.7