You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kg...@apache.org on 2010/04/14 20:57:19 UTC

svn commit: r934117 - in /qpid/trunk/qpid/cpp: examples/qmf-agent/example.cpp examples/qmf-agent/schema.xml managementgen/qmfgen/management-types.xml

Author: kgiusti
Date: Wed Apr 14 18:57:18 2010
New Revision: 934117

URL: http://svn.apache.org/viewvc?rev=934117&view=rev
Log:
QPID-2506: enable map and list method arguments.

Modified:
    qpid/trunk/qpid/cpp/examples/qmf-agent/example.cpp
    qpid/trunk/qpid/cpp/examples/qmf-agent/schema.xml
    qpid/trunk/qpid/cpp/managementgen/qmfgen/management-types.xml

Modified: qpid/trunk/qpid/cpp/examples/qmf-agent/example.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/examples/qmf-agent/example.cpp?rev=934117&r1=934116&r2=934117&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/examples/qmf-agent/example.cpp (original)
+++ qpid/trunk/qpid/cpp/examples/qmf-agent/example.cpp Wed Apr 14 18:57:18 2010
@@ -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::Manageme
     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::Manageme
         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");

Modified: qpid/trunk/qpid/cpp/examples/qmf-agent/schema.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/examples/qmf-agent/schema.xml?rev=934117&r1=934116&r2=934117&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/examples/qmf-agent/schema.xml (original)
+++ qpid/trunk/qpid/cpp/examples/qmf-agent/schema.xml Wed Apr 14 18:57:18 2010
@@ -39,6 +39,12 @@
       <arg name="name"     dir="I" type="sstr"/>
       <arg name="childRef" dir="O" type="objId"/>
     </method>
+
+    <method name="test_method" desc="Test Method with Map and List Arguments">
+      <arg name="aMap"  dir="IO" type="map"/>
+      <arg name="aList"  dir="IO" type="list"/>
+    </method>
+
   </class>
 
 

Modified: qpid/trunk/qpid/cpp/managementgen/qmfgen/management-types.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/managementgen/qmfgen/management-types.xml?rev=934117&r1=934116&r2=934117&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/managementgen/qmfgen/management-types.xml (original)
+++ qpid/trunk/qpid/cpp/managementgen/qmfgen/management-types.xml Wed Apr 14 18:57:18 2010
@@ -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()"/>
 <type name="list"      base="LIST"      cpp="::qpid::types::Variant::List" 
       encode="@.putList(#)"
       decode="@.getList(#)"
       size="::qpid::amqp_0_10::ListCodec::encodedSize(#)"
-      stream="#" accessor="direct" init="::qpid::types::Variant::List()" byRef="y" unmap="::qpid::types::Variant::List(); assert(false); /*TBD*/"/>
+      stream="#" accessor="direct" init="::qpid::types::Variant::List()" byRef="y" unmap="(#).asList()"/>
 
 <type name="hilo8"   base="U8"   cpp="uint8_t"  encode="@.putOctet(#)"    decode="# = @.getOctet()"    style="wm" stream="#" size="1" accessor="counter" init="0"/>
 <type name="hilo16"  base="U16"  cpp="uint16_t" encode="@.putShort(#)"    decode="# = @.getShort()"    style="wm" stream="#" size="2" accessor="counter" init="0"/>



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org