summaryrefslogtreecommitdiff
path: root/cpp/src/qmf/engine/EventImpl.cpp
diff options
context:
space:
mode:
authorKen Giusti <kgiusti@apache.org>2010-04-23 20:27:27 +0000
committerKen Giusti <kgiusti@apache.org>2010-04-23 20:27:27 +0000
commitc9ae79978aab2ae74c03be893d5ed76cb5c1203a (patch)
tree61081a73bc69a38555c902fbb5e3943875dd9cb1 /cpp/src/qmf/engine/EventImpl.cpp
parent79c7b96359d2d8e478d4fb5b6e4836ff3e395775 (diff)
downloadqpid-python-c9ae79978aab2ae74c03be893d5ed76cb5c1203a.tar.gz
QPID-2546: implement event support for ruby wrapper. Python pending...
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@937506 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qmf/engine/EventImpl.cpp')
-rw-r--r--cpp/src/qmf/engine/EventImpl.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/cpp/src/qmf/engine/EventImpl.cpp b/cpp/src/qmf/engine/EventImpl.cpp
index 3509220b0c..4b034e8e83 100644
--- a/cpp/src/qmf/engine/EventImpl.cpp
+++ b/cpp/src/qmf/engine/EventImpl.cpp
@@ -26,7 +26,7 @@ using namespace std;
using namespace qmf::engine;
using qpid::framing::Buffer;
-EventImpl::EventImpl(const SchemaEventClass* type) : eventClass(type)
+EventImpl::EventImpl(const SchemaEventClass* type) : eventClass(type), timestamp(0), severity(0)
{
int argCount = eventClass->getArgumentCount();
int idx;
@@ -38,9 +38,21 @@ EventImpl::EventImpl(const SchemaEventClass* type) : eventClass(type)
}
-EventImpl::EventImpl(const SchemaEventClass* type, Buffer&) :
- eventClass(type)
+EventImpl::EventImpl(const SchemaEventClass* type, Buffer& buffer) :
+ eventClass(type), timestamp(0), severity(0)
{
+ int argCount = eventClass->getArgumentCount();
+ int idx;
+
+ timestamp = buffer.getLongLong();
+ severity = buffer.getOctet();
+
+ for (idx = 0; idx < argCount; idx++)
+ {
+ const SchemaArgument *arg = eventClass->getArgument(idx);
+ Value* pval = ValueImpl::factory(arg->getType(), buffer);
+ arguments[arg->getName()] = ValuePtr(pval);
+ }
}