Classes | Public Member Functions | Static Public Member Functions | Friends

GridClientUuid Class Reference

#include <gridclientuuid.hpp>

Inheritance diagram for GridClientUuid:
GridClientHasheableObject

List of all members.

Classes

class  Impl

Public Member Functions

 GridClientUuid ()
 GridClientUuid (const char *str)
 GridClientUuid (const std::string &str)
 GridClientUuid (const GridClientUuid &other)
GridClientUuid & operator= (const GridClientUuid &rhs)
virtual ~GridClientUuid ()
bool operator< (const GridClientUuid &other) const
bool operator== (const GridClientUuid &other) const
virtual int32_t hashCode () const
const std::string uuid () const
int64_t leastSignificantBits () const
int64_t mostSignificantBits () const
virtual void convertToBytes (std::vector< int8_t > &bytes) const
void rawBytes (std::vector< int8_t > &bytes) const

Static Public Member Functions

static GridClientUuid fromBytes (const std::string &bytes)
static GridClientUuid randomUuid ()

Friends

std::ostream & operator<< (std::ostream &out, const GridClientUuid &u)

Detailed Description

Globally unique universal identifier.


Constructor & Destructor Documentation

GridClientUuid::GridClientUuid (  ) 

Public default constructor. Creates an empty UUID.

GridClientUuid::GridClientUuid ( const char *  str  ) 

Reconstructs UUID from string.

Parameters:
str String representation of UUID.
GridClientUuid::GridClientUuid ( const std::string &  str  ) 

Reconstructs UUID from string.

Parameters:
str String representation of UUID.
GridClientUuid::GridClientUuid ( const GridClientUuid &  other  ) 

Copy constructor.

Parameters:
other Another instance of UUID.
GridClientUuid::~GridClientUuid (  )  [virtual]

Destructor.


Member Function Documentation

virtual void GridClientUuid::convertToBytes ( std::vector< int8_t > &  bytes  )  const [virtual]

Converts this UUID to byte array.

This method is used for hash calculation and uses special byte ordering.

Parameters:
bytes Vector to fill.

Implements GridClientHasheableObject.

static GridClientUuid GridClientUuid::fromBytes ( const std::string &  bytes  )  [static]

Constructs a new UUID from raw bytes.

Parameters:
bytes Raw bytes.
Returns:
A new UUID.
int32_t GridClientUuid::hashCode (  )  const [virtual]

Returns hash code for this UUID following Java conventions.

Returns:
Hash code.

Implements GridClientHasheableObject.

int64_t GridClientUuid::leastSignificantBits (  )  const

Least significant bits in UUID.

Returns:
4 least significant bits packed in 64-bit integer.
int64_t GridClientUuid::mostSignificantBits (  )  const

Most significant bits in UUID.

Returns:
4 most significant bits packed in 64-bit integer.
bool GridClientUuid::operator< ( const GridClientUuid &  other  )  const

Comparison operator for UUID.

Parameters:
other UUID to compare this UUID to.
Returns:
true if this UUID is less than other, false otherwise.
GridClientUuid & GridClientUuid::operator= ( const GridClientUuid &  rhs  ) 

Assignment operator override.

Parameters:
rhs Right-hand side of the assignment operator.
Returns:
This instance of the class.
bool GridClientUuid::operator== ( const GridClientUuid &  other  )  const

Comparison operator for UUID.

Parameters:
other UUID to compare this UUID to.
Returns:
true if this UUID equals another, false otherwise.
GridClientUuid GridClientUuid::randomUuid (  )  [static]

Generates a random UUID.

Returns:
New random UUID.
void GridClientUuid::rawBytes ( std::vector< int8_t > &  bytes  )  const

Reads the UUID raw bytes to byte vector.

Byte order is not changed.

Parameters:
bytes Vector to fill.
std::string const GridClientUuid::uuid (  )  const

Converts UUID to string.

Returns:
String representation iof UUID.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const GridClientUuid &  u 
) [friend]

Prints UUID to stream

Parameters:
out Stream to output UUID to.
u UUID.

The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends