From 3edf82281ced8fed78945878f771707ab4eaeddf Mon Sep 17 00:00:00 2001 From: Kenneth Anthony Giusti Date: Wed, 14 Apr 2010 18:57:18 +0000 Subject: QPID-2506: enable map and list method arguments. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@934117 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/examples/qmf-agent/example.cpp | 19 +++++++++++++------ cpp/examples/qmf-agent/schema.xml | 6 ++++++ cpp/managementgen/qmfgen/management-types.xml | 4 ++-- 3 files changed, 21 insertions(+), 8 deletions(-) (limited to 'cpp') diff --git a/cpp/examples/qmf-agent/example.cpp b/cpp/examples/qmf-agent/example.cpp index 18f1bf6a90..b432c2a065 100644 --- a/cpp/examples/qmf-agent/example.cpp +++ b/cpp/examples/qmf-agent/example.cpp @@ -28,6 +28,7 @@ #include "qmf/org/apache/qpid/agent/example/Parent.h" #include "qmf/org/apache/qpid/agent/example/Child.h" #include "qmf/org/apache/qpid/agent/example/ArgsParentCreate_child.h" +#include "qmf/org/apache/qpid/agent/example/ArgsParentTest_method.h" #include "qmf/org/apache/qpid/agent/example/EventChildCreated.h" #include "qmf/org/apache/qpid/agent/example/Package.h" @@ -141,7 +142,7 @@ Manageable::status_t CoreClass::ManagementMethod(uint32_t methodId, Args& args, Mutex::ScopedLock _lock(vectorLock); switch (methodId) { - case _qmf::Parent::METHOD_CREATE_CHILD: + case _qmf::Parent::METHOD_CREATE_CHILD: { _qmf::ArgsParentCreate_child& ioArgs = (_qmf::ArgsParentCreate_child&) args; ChildClass *child = new ChildClass(agent, this, ioArgs.i_name); @@ -154,6 +155,16 @@ Manageable::status_t CoreClass::ManagementMethod(uint32_t methodId, Args& args, return STATUS_OK; } + case _qmf::Parent::METHOD_TEST_METHOD: { + _qmf::ArgsParentTest_method& ioArgs = (_qmf::ArgsParentTest_method&) args; + + ioArgs.io_aMap["add"] = "me"; + ioArgs.io_aList.push_back(Variant("Stuff")); + // TBD + return STATUS_OK; + } + } + return STATUS_NOT_IMPLEMENTED; } @@ -181,10 +192,6 @@ int main_int(int argc, char** argv) singleton = new ManagementAgent::Singleton(); const char* host = argc>1 ? argv[1] : "127.0.0.1"; int port = argc>2 ? atoi(argv[2]) : 5672; - qpid::client::ConnectionSettings settings; - - settings.host = host; - settings.port = port; signal(SIGINT, shutdown); @@ -199,7 +206,7 @@ int main_int(int argc, char** argv) // Start the agent. It will attempt to make a connection to the // management broker - agent->init(settings, 5, false, ".magentdata"); + agent->init(host, port, 5, false, ".magentdata"); // Allocate some core objects CoreClass core1(agent, "Example Core Object #1"); diff --git a/cpp/examples/qmf-agent/schema.xml b/cpp/examples/qmf-agent/schema.xml index 3c7755fe83..ad8510106d 100644 --- a/cpp/examples/qmf-agent/schema.xml +++ b/cpp/examples/qmf-agent/schema.xml @@ -39,6 +39,12 @@ + + + + + + diff --git a/cpp/managementgen/qmfgen/management-types.xml b/cpp/managementgen/qmfgen/management-types.xml index 61c91fed2d..f1f1351990 100644 --- a/cpp/managementgen/qmfgen/management-types.xml +++ b/cpp/managementgen/qmfgen/management-types.xml @@ -52,12 +52,12 @@ encode="@.putMap(#)" decode="@.getMap(#)" size="::qpid::amqp_0_10::MapCodec::encodedSize(#)" - stream="#" accessor="direct" init="::qpid::types::Variant::Map()" byRef="y" unmap="::qpid::types::Variant::Map(); assert(false); /*TBD*/"/> + stream="#" accessor="direct" init="::qpid::types::Variant::Map()" byRef="y" unmap="(#).asMap()"/> + stream="#" accessor="direct" init="::qpid::types::Variant::List()" byRef="y" unmap="(#).asList()"/> -- cgit v1.2.1