summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/qmf
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2010-04-23 03:59:52 +0000
committerAndrew Stitcher <astitcher@apache.org>2010-04-23 03:59:52 +0000
commitb4738c5e99ee9e751f45deb177270bc0bb0a775e (patch)
tree492aaa6da19f33540e3aa31d6da166c130e60f55 /qpid/cpp/src/qmf
parent8503ad14763c515f20303c790589d7b5317e4877 (diff)
downloadqpid-python-b4738c5e99ee9e751f45deb177270bc0bb0a775e.tar.gz
QPID-1904: Ensure that all timestamp uses are correctly relative to 1/1/1970 epoch.
- Removed the hacky way to access the internal time value in AbsTime now that there is a defined AbsTime value EPOCH. - Changed all the code to use Duration(EPOCH, abtime) git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@937147 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/qmf')
-rw-r--r--qpid/cpp/src/qmf/engine/Agent.cpp4
-rw-r--r--qpid/cpp/src/qmf/engine/ObjectImpl.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/qpid/cpp/src/qmf/engine/Agent.cpp b/qpid/cpp/src/qmf/engine/Agent.cpp
index fe9b84c565..7667213e5e 100644
--- a/qpid/cpp/src/qmf/engine/Agent.cpp
+++ b/qpid/cpp/src/qmf/engine/Agent.cpp
@@ -348,7 +348,7 @@ void AgentImpl::heartbeat()
Buffer buffer(outputBuffer, MA_BUFFER_SIZE);
Protocol::encodeHeader(buffer, Protocol::OP_HEARTBEAT_INDICATION);
- buffer.putLongLong(uint64_t(Duration(now())));
+ buffer.putLongLong(uint64_t(Duration(EPOCH, now())));
stringstream key;
key << "console.heartbeat." << assignedBrokerBank << "." << assignedAgentBank;
sendBufferLH(buffer, QMF_EXCHANGE, key.str());
@@ -484,7 +484,7 @@ void AgentImpl::raiseEvent(Event& event)
Protocol::encodeHeader(buffer, Protocol::OP_EVENT_INDICATION);
event.impl->encodeSchemaKey(buffer);
- buffer.putLongLong(uint64_t(Duration(now())));
+ buffer.putLongLong(uint64_t(Duration(EPOCH, now())));
event.impl->encode(buffer);
string key(event.impl->getRoutingKey(assignedBrokerBank, assignedAgentBank));
diff --git a/qpid/cpp/src/qmf/engine/ObjectImpl.cpp b/qpid/cpp/src/qmf/engine/ObjectImpl.cpp
index cae0e0da68..45925cb804 100644
--- a/qpid/cpp/src/qmf/engine/ObjectImpl.cpp
+++ b/qpid/cpp/src/qmf/engine/ObjectImpl.cpp
@@ -27,7 +27,7 @@ using namespace qmf::engine;
using namespace qpid::sys;
using qpid::framing::Buffer;
-ObjectImpl::ObjectImpl(const SchemaObjectClass* type) : objectClass(type), broker(0), createTime(uint64_t(Duration(now()))), destroyTime(0), lastUpdatedTime(createTime)
+ObjectImpl::ObjectImpl(const SchemaObjectClass* type) : objectClass(type), broker(0), createTime(uint64_t(Duration(EPOCH, now()))), destroyTime(0), lastUpdatedTime(createTime)
{
int propCount = objectClass->getPropertyCount();
int statCount = objectClass->getStatisticCount();
@@ -93,7 +93,7 @@ ObjectImpl::~ObjectImpl()
void ObjectImpl::destroy()
{
- destroyTime = uint64_t(Duration(now()));
+ destroyTime = uint64_t(Duration(EPOCH, now()));
// TODO - flag deletion
}