activemq-cpp-3.6.0
activemq::util::IdGenerator Class Reference

#include <src/main/activemq/util/IdGenerator.h>

Public Member Functions

 IdGenerator ()
 IdGenerator (const std::string &prefix)
virtual ~IdGenerator ()
std::string generateId () const

Static Public Member Functions

static std::string getHostname ()
 Since the initialization of this object results in the retrieval of the machine's host name we can quickly return it here.
static std::string getSeedFromId (const std::string &id)
 Gets the seed value from a Generated Id, the count portion is removed.
static long long getSequenceFromId (const std::string &id)
 Gets the count value from a Generated Id, the seed portion is removed.
static int compare (const std::string &id1, const std::string &id2)
 Compares two generated id values.

Friends

class activemq::library::ActiveMQCPP

Constructor & Destructor Documentation

activemq::util::IdGenerator::IdGenerator ( )
activemq::util::IdGenerator::IdGenerator ( const std::string &  prefix)
virtual activemq::util::IdGenerator::~IdGenerator ( )
virtual

Member Function Documentation

static int activemq::util::IdGenerator::compare ( const std::string &  id1,
const std::string &  id2 
)
static

Compares two generated id values.

Parameters
id1The first id to compare, or left hand side.
id2The second id to compare, or right hand side.
Returns
zero if ids are equal or positove if id1 > id2...
std::string activemq::util::IdGenerator::generateId ( ) const
Returns
a newly generated unique id.
static std::string activemq::util::IdGenerator::getHostname ( )
static

Since the initialization of this object results in the retrieval of the machine's host name we can quickly return it here.

Returns
the previously retrieved host name.
static std::string activemq::util::IdGenerator::getSeedFromId ( const std::string &  id)
static

Gets the seed value from a Generated Id, the count portion is removed.

Returns
the seed portion of the Id, minus the count value.
static long long activemq::util::IdGenerator::getSequenceFromId ( const std::string &  id)
static

Gets the count value from a Generated Id, the seed portion is removed.

Returns
the sequence count portion of the id, minus the seed value.

Friends And Related Function Documentation

friend class activemq::library::ActiveMQCPP
friend

The documentation for this class was generated from the following file: