From 74b68e0be99c74b8f59ef97a3a9162d5a8dfe257 Mon Sep 17 00:00:00 2001 From: Kenneth Anthony Giusti Date: Fri, 23 Apr 2010 20:27:27 +0000 Subject: 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 --- cpp/src/qmf/engine/EventImpl.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'cpp/src/qmf/engine/EventImpl.cpp') 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); + } } -- cgit v1.2.1