Collaboration diagram for org::xmlBlaster::util::TimestampFactory:
Public Member Functions | |
~TimestampFactory () | |
Timestamp | getTimestamp () |
Constructs a current timestamp which is guaranteed to be unique in time for this process. | |
Static Public Member Functions | |
static TimestampFactory & | getInstance () |
The method to call to get the singleton Timestamp object. | |
static std::string | toXml (Timestamp timestamp, const std::string &extraOffset="", bool literal=false) |
static std::string | getTimeAsString (Timestamp timestamp) |
Friends | |
TimestampFactory & | getInstance () |
The counter is rewound on any second step (this is different from its omonimous java class since there is no portable way in c++ to get the system time with a millisecond precision yet. Besides this difference, the c++ timestamp is a singleton working as a factory of timestamps (which are of the type long long -> typedef int64_t Timestamp;).
Guarantees that any created Timestamp instance is unique in the current process.
Fails only if
Definition at line 48 of file Timestamp.h.
org::xmlBlaster::util::TimestampFactory::~TimestampFactory | ( | ) |
Definition at line 37 of file Timestamp.cpp.
static TimestampFactory& org::xmlBlaster::util::TimestampFactory::getInstance | ( | ) | [static] |
The method to call to get the singleton Timestamp object.
Timestamp org::xmlBlaster::util::TimestampFactory::getTimestamp | ( | ) |
Constructs a current timestamp which is guaranteed to be unique in time for this process.
Definition at line 48 of file Timestamp.cpp.
References org::xmlBlaster::util::thread::Thread::getCurrentTimestamp().
Referenced by org::xmlBlaster::util::Timeout::addTimeoutListener(), org::xmlBlaster::client::qos::SubscribeQos::generateSubscriptionId(), org::xmlBlaster::util::Global::getInstanceId(), org::xmlBlaster::util::qos::MsgQosData::getRemainingLife(), org::xmlBlaster::util::Timeout::run(), org::xmlBlaster::util::Timeout::spanToTimeout(), org::xmlBlaster::test::TestTimestamp::testTimestamp(), org::xmlBlaster::util::qos::StatusQosData::touchRcvTimestamp(), org::xmlBlaster::util::qos::QosData::touchRcvTimestamp(), and org::xmlBlaster::client::XmlBlasterAccess::XmlBlasterAccess().
static std::string org::xmlBlaster::util::TimestampFactory::toXml | ( | Timestamp | timestamp, | |
const std::string & | extraOffset = "" , |
|||
bool | literal = false | |||
) | [static] |
Referenced by org::xmlBlaster::client::qos::GetReturnQos::getRcvTime().
string org::xmlBlaster::util::TimestampFactory::getTimeAsString | ( | Timestamp | timestamp | ) | [static] |
Definition at line 78 of file Timestamp.cpp.
References org::xmlBlaster::util::Constants::BILLION, and org::xmlBlaster::util::lexical_cast().
TimestampFactory & org::xmlBlaster::util::TimestampFactory::getInstance | ( | ) | [friend] |
Definition at line 41 of file Timestamp.cpp.
Referenced by org::xmlBlaster::client::qos::SubscribeQos::generateSubscriptionId(), org::xmlBlaster::util::Global::getInstanceId(), org::xmlBlaster::util::qos::MsgQosData::getRemainingLife(), org::xmlBlaster::test::TestTimestamp::testTimestamp(), org::xmlBlaster::util::qos::StatusQosData::touchRcvTimestamp(), org::xmlBlaster::util::qos::QosData::touchRcvTimestamp(), and org::xmlBlaster::client::XmlBlasterAccess::XmlBlasterAccess().