[openrtm-commit:00425] r218 - in trunk/rtmtools/jp.go.aist.rtm.rtcbuilder: resource/100/CXX/idlmodule resource/100/CXX/idlmodule/serviceArg resource/100/CXX/idlmodule/serviceArgStruct resource/100/CXX/idltype/IDLType1 src/jp/go/aist/rtm/rtcbuilder/manager test/jp/go/aist/rtm/rtcbuilder/_test/_100

openrtm @ openrtm.org openrtm @ openrtm.org
2011年 9月 25日 (日) 15:14:33 JST


Author: sakamoto
Date: 2011-09-25 15:14:33 +0900 (Sun, 25 Sep 2011)
New Revision: 218

Added:
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArg/
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArg/MyServiceModuleTypeDef.idl
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArg/MyServiceModuleTypeDefSVC_impl.cpp
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArg/MyServiceModuleTypeDefSVC_impl.h
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArg/foo.cpp
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArg/foo.h
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArg/fooComp.cpp
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArgStruct/
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArgStruct/MyServiceModuleTypeDef.idl
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArgStruct/MyServiceModuleTypeDefSVC_impl.cpp
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArgStruct/MyServiceModuleTypeDefSVC_impl.h
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArgStruct/foo.cpp
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArgStruct/foo.h
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArgStruct/fooComp.cpp
Modified:
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idltype/IDLType1/TestIDLSVC_impl.cpp
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idltype/IDLType1/TestIDLSVC_impl.h
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/manager/CXXConverter.java
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/test/jp/go/aist/rtm/rtcbuilder/_test/_100/CXXIDLModuleTest.java
Log:
Modify Service Arguments #2259

Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArg/MyServiceModuleTypeDef.idl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArg/MyServiceModuleTypeDef.idl	                        (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArg/MyServiceModuleTypeDef.idl	2011-09-25 06:14:33 UTC (rev 218)
@@ -0,0 +1,14 @@
+module RTC {
+module RTM {
+	struct Time
+	{
+		unsigned long sec;    // sec
+		unsigned long nsec;   // nano sec
+	};
+
+	interface MyService
+	{
+		Time echo(in Time msg, in string str);
+	};
+};
+};

Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArg/MyServiceModuleTypeDefSVC_impl.cpp
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArg/MyServiceModuleTypeDefSVC_impl.cpp	                        (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArg/MyServiceModuleTypeDefSVC_impl.cpp	2011-09-25 06:14:33 UTC (rev 218)
@@ -0,0 +1,43 @@
+// -*-C++-*-
+/*!
+ * @file  MyServiceModuleTypeDefSVC_impl.cpp
+ * @brief Service implementation code of MyServiceModuleTypeDef.idl
+ *
+ */
+
+#include "MyServiceModuleTypeDefSVC_impl.h"
+
+/*
+ * Example implementational code for IDL interface RTC::RTM::MyService
+ */
+MyServiceSVC_impl::MyServiceSVC_impl()
+{
+  // Please add extra constructor code here.
+}
+
+
+MyServiceSVC_impl::~MyServiceSVC_impl()
+{
+  // Please add extra destructor code here.
+}
+
+
+/*
+ * Methods corresponding to IDL attributes and operations
+ */
+RTC::RTM::Time MyServiceSVC_impl::echo(const RTC::RTM::Time& msg, const char* str)
+{
+	RTC::RTM::Time result;
+  // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+  #warning "Code missing in function <RTC::RTM::Time MyServiceSVC_impl::echo(const RTC::RTM::Time& msg, const char* str)>"
+#endif
+  return result;
+}
+
+
+
+// End of example implementational code
+
+
+

Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArg/MyServiceModuleTypeDefSVC_impl.h
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArg/MyServiceModuleTypeDefSVC_impl.h	                        (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArg/MyServiceModuleTypeDefSVC_impl.h	2011-09-25 06:14:33 UTC (rev 218)
@@ -0,0 +1,45 @@
+// -*-C++-*-
+/*!
+ * @file  MyServiceModuleTypeDefSVC_impl.h
+ * @brief Service implementation header of MyServiceModuleTypeDef.idl
+ *
+ */
+
+#include "MyServiceModuleTypeDefSkel.h"
+
+#ifndef MYSERVICEMODULETYPEDEFSVC_IMPL_H
+#define MYSERVICEMODULETYPEDEFSVC_IMPL_H
+ 
+/*!
+ * @class MyServiceSVC_impl
+ * Example class implementing IDL interface RTC::RTM::MyService
+ */
+class MyServiceSVC_impl
+ : public virtual POA_RTC::RTM::MyService,
+   public virtual PortableServer::RefCountServantBase
+{
+ private:
+   // Make sure all instances are built on the heap by making the
+   // destructor non-public
+   //virtual ~MyServiceSVC_impl();
+
+ public:
+  /*!
+   * @brief standard constructor
+   */
+   MyServiceSVC_impl();
+  /*!
+   * @brief destructor
+   */
+   virtual ~MyServiceSVC_impl();
+
+   // attributes and operations
+   RTC::RTM::Time echo(const RTC::RTM::Time& msg, const char* str);
+
+};
+
+
+
+#endif // MYSERVICEMODULETYPEDEFSVC_IMPL_H
+
+

Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArg/foo.cpp
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArg/foo.cpp	                        (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArg/foo.cpp	2011-09-25 06:14:33 UTC (rev 218)
@@ -0,0 +1,166 @@
+// -*- C++ -*-
+/*!
+ * @file  foo.cpp
+ * @brief ModuleDescription
+ * @date $Date$
+ *
+ * $Id$
+ */
+
+#include "foo.h"
+
+// Module specification
+// <rtc-template block="module_spec">
+static const char* foo_spec[] =
+  {
+    "implementation_id", "foo",
+    "type_name",         "foo",
+    "description",       "ModuleDescription",
+    "version",           "1.0.0",
+    "vendor",            "VenderName",
+    "category",          "Category",
+    "activity_type",     "EVENTDRIVEN",
+    "kind",              "DataFlowComponent",
+    "max_instance",      "0",
+    "language",          "C++",
+    "lang_type",         "compile",
+    ""
+  };
+// </rtc-template>
+
+/*!
+ * @brief constructor
+ * @param manager Maneger Object
+ */
+foo::foo(RTC::Manager* manager)
+    // <rtc-template block="initializer">
+  : RTC::DataFlowComponentBase(manager),
+    m_sv_namePort("sv_name")
+
+    // </rtc-template>
+{
+}
+
+/*!
+ * @brief destructor
+ */
+foo::~foo()
+{
+}
+
+
+
+RTC::ReturnCode_t foo::onInitialize()
+{
+  // Registration: InPort/OutPort/Service
+  // <rtc-template block="registration">
+  // Set InPort buffers
+  
+  // Set OutPort buffer
+  
+  // Set service provider to Ports
+  m_sv_namePort.registerProvider("if_name", "RTC::RTM::MyService", m_if_name);
+  
+  // Set service consumers to Ports
+  
+  // Set CORBA Service Ports
+  addPort(m_sv_namePort);
+  
+  // </rtc-template>
+
+  return RTC::RTC_OK;
+}
+
+/*
+RTC::ReturnCode_t foo::onFinalize()
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t foo::onStartup(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t foo::onShutdown(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t foo::onActivated(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t foo::onDeactivated(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t foo::onExecute(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t foo::onAborting(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t foo::onError(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t foo::onReset(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t foo::onStateUpdate(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t foo::onRateChanged(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+
+
+extern "C"
+{
+ 
+  void fooInit(RTC::Manager* manager)
+  {
+    coil::Properties profile(foo_spec);
+    manager->registerFactory(profile,
+                             RTC::Create<foo>,
+                             RTC::Delete<foo>);
+  }
+  
+};
+
+

Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArg/foo.h
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArg/foo.h	                        (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArg/foo.h	2011-09-25 06:14:33 UTC (rev 218)
@@ -0,0 +1,274 @@
+// -*- C++ -*-
+/*!
+ * @file  foo.h
+ * @brief ModuleDescription
+ * @date  $Date$
+ *
+ * $Id$
+ */
+
+#ifndef FOO_H
+#define FOO_H
+
+#include <rtm/Manager.h>
+#include <rtm/DataFlowComponentBase.h>
+#include <rtm/CorbaPort.h>
+#include <rtm/DataInPort.h>
+#include <rtm/DataOutPort.h>
+#include <rtm/idl/BasicDataTypeSkel.h>
+#include <rtm/idl/ExtendedDataTypesSkel.h>
+#include <rtm/idl/InterfaceDataTypesSkel.h>
+
+// Service implementation headers
+// <rtc-template block="service_impl_h">
+#include "MyServiceModuleTypeDefSVC_impl.h"
+
+// </rtc-template>
+
+// Service Consumer stub headers
+// <rtc-template block="consumer_stub_h">
+
+// </rtc-template>
+
+using namespace RTC;
+
+/*!
+ * @class foo
+ * @brief ModuleDescription
+ *
+ */
+class foo
+  : public RTC::DataFlowComponentBase
+{
+ public:
+  /*!
+   * @brief constructor
+   * @param manager Maneger Object
+   */
+  foo(RTC::Manager* manager);
+
+  /*!
+   * @brief destructor
+   */
+  ~foo();
+
+  // <rtc-template block="public_attribute">
+  
+  // </rtc-template>
+
+  // <rtc-template block="public_operation">
+  
+  // </rtc-template>
+
+  /***
+   *
+   * The initialize action (on CREATED->ALIVE transition)
+   * formaer rtc_init_entry() 
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+   virtual RTC::ReturnCode_t onInitialize();
+
+  /***
+   *
+   * The finalize action (on ALIVE->END transition)
+   * formaer rtc_exiting_entry()
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onFinalize();
+
+  /***
+   *
+   * The startup action when ExecutionContext startup
+   * former rtc_starting_entry()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onStartup(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * The shutdown action when ExecutionContext stop
+   * former rtc_stopping_entry()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onShutdown(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * The activated action (Active state entry action)
+   * former rtc_active_entry()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * The deactivated action (Active state exit action)
+   * former rtc_active_exit()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * The execution action that is invoked periodically
+   * former rtc_active_do()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * The aborting action when main logic error occurred.
+   * former rtc_aborting_entry()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onAborting(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * The error action in ERROR state
+   * former rtc_error_do()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onError(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * The reset action that is invoked resetting
+   * This is same but different the former rtc_init_entry()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onReset(RTC::UniqueId ec_id);
+  
+  /***
+   *
+   * The state update action that is invoked after onExecute() action
+   * no corresponding operation exists in OpenRTm-aist-0.2.0
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onStateUpdate(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * The action that is invoked when execution context's rate is changed
+   * no corresponding operation exists in OpenRTm-aist-0.2.0
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onRateChanged(RTC::UniqueId ec_id);
+
+
+ protected:
+  // <rtc-template block="protected_attribute">
+  
+  // </rtc-template>
+
+  // <rtc-template block="protected_operation">
+  
+  // </rtc-template>
+
+  // DataInPort declaration
+  // <rtc-template block="inport_declare">
+  
+  // </rtc-template>
+
+
+  // DataOutPort declaration
+  // <rtc-template block="outport_declare">
+  
+  // </rtc-template>
+
+  // CORBA Port declaration
+  // <rtc-template block="corbaport_declare">
+  /*!
+   */
+  RTC::CorbaPort m_sv_namePort;
+  
+  // </rtc-template>
+
+  // Service declaration
+  // <rtc-template block="service_declare">
+  /*!
+   */
+  MyServiceSVC_impl m_if_name;
+  
+  // </rtc-template>
+
+  // Consumer declaration
+  // <rtc-template block="consumer_declare">
+  
+  // </rtc-template>
+
+ private:
+  // <rtc-template block="private_attribute">
+  
+  // </rtc-template>
+
+  // <rtc-template block="private_operation">
+  
+  // </rtc-template>
+
+};
+
+
+extern "C"
+{
+  DLL_EXPORT void fooInit(RTC::Manager* manager);
+};
+
+#endif // FOO_H

Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArg/fooComp.cpp
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArg/fooComp.cpp	                        (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArg/fooComp.cpp	2011-09-25 06:14:33 UTC (rev 218)
@@ -0,0 +1,97 @@
+// -*- C++ -*-
+/*!
+ * @file fooComp.cpp
+ * @brief Standalone component
+ * @date $Date$
+ *
+ * $Id$
+ */
+
+#include <rtm/Manager.h>
+#include <iostream>
+#include <string>
+#include <stdlib.h>
+#include "foo.h"
+
+
+void MyModuleInit(RTC::Manager* manager)
+{
+  fooInit(manager);
+  RTC::RtcBase* comp;
+
+  // Create a component
+  comp = manager->createComponent("foo");
+
+  if (comp==NULL)
+  {
+    std::cerr << "Component create failed." << std::endl;
+    abort();
+  }
+
+  // Example
+  // The following procedure is examples how handle RT-Components.
+  // These should not be in this function.
+
+  // Get the component's object reference
+//  RTC::RTObject_var rtobj;
+//  rtobj = RTC::RTObject::_narrow(manager->getPOA()->servant_to_reference(comp));
+
+  // Get the port list of the component
+//  PortServiceList* portlist;
+//  portlist = rtobj->get_ports();
+
+  // getting port profiles
+//  std::cout << "Number of Ports: ";
+//  std::cout << portlist->length() << std::endl << std::endl; 
+//  for (CORBA::ULong i(0), n(portlist->length()); i < n; ++i)
+//  {
+//    PortService_ptr port;
+//    port = (*portlist)[i];
+//    std::cout << "Port" << i << " (name): ";
+//    std::cout << port->get_port_profile()->name << std::endl;
+//    
+//    RTC::PortInterfaceProfileList iflist;
+//    iflist = port->get_port_profile()->interfaces;
+//    std::cout << "---interfaces---" << std::endl;
+//    for (CORBA::ULong i(0), n(iflist.length()); i < n; ++i)
+//    {
+//      std::cout << "I/F name: ";
+//      std::cout << iflist[i].instance_name << std::endl;
+//      std::cout << "I/F type: ";
+//      std::cout << iflist[i].type_name << std::endl;
+//      const char* pol;
+//      pol = iflist[i].polarity == 0 ? "PROVIDED" : "REQUIRED";
+//      std::cout << "Polarity: " << pol << std::endl;
+//    }
+//    std::cout << "---properties---" << std::endl;
+//    NVUtil::dump(port->get_port_profile()->properties);
+//    std::cout << "----------------" << std::endl << std::endl;
+//  }
+
+  return;
+}
+
+int main (int argc, char** argv)
+{
+  RTC::Manager* manager;
+  manager = RTC::Manager::init(argc, argv);
+
+  // Initialize manager
+  manager->init(argc, argv);
+
+  // Set module initialization proceduer
+  // This procedure will be invoked in activateManager() function.
+  manager->setModuleInitProc(MyModuleInit);
+
+  // Activate manager and register to naming service
+  manager->activateManager();
+
+  // run the manager in blocking mode
+  // runManager(false) is the default.
+  manager->runManager();
+
+  // If you want to run the manager in non-blocking mode, do like this
+  // manager->runManager(true);
+
+  return 0;
+}

Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArgStruct/MyServiceModuleTypeDef.idl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArgStruct/MyServiceModuleTypeDef.idl	                        (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArgStruct/MyServiceModuleTypeDef.idl	2011-09-25 06:14:33 UTC (rev 218)
@@ -0,0 +1,10 @@
+struct Time
+{
+	unsigned long sec;    // sec
+	unsigned long nsec;   // nano sec
+};
+
+interface MyService
+{
+	Time echo(out Time msg, in string str);
+};

Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArgStruct/MyServiceModuleTypeDefSVC_impl.cpp
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArgStruct/MyServiceModuleTypeDefSVC_impl.cpp	                        (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArgStruct/MyServiceModuleTypeDefSVC_impl.cpp	2011-09-25 06:14:33 UTC (rev 218)
@@ -0,0 +1,43 @@
+// -*-C++-*-
+/*!
+ * @file  MyServiceModuleTypeDefSVC_impl.cpp
+ * @brief Service implementation code of MyServiceModuleTypeDef.idl
+ *
+ */
+
+#include "MyServiceModuleTypeDefSVC_impl.h"
+
+/*
+ * Example implementational code for IDL interface MyService
+ */
+MyServiceSVC_impl::MyServiceSVC_impl()
+{
+  // Please add extra constructor code here.
+}
+
+
+MyServiceSVC_impl::~MyServiceSVC_impl()
+{
+  // Please add extra destructor code here.
+}
+
+
+/*
+ * Methods corresponding to IDL attributes and operations
+ */
+Time MyServiceSVC_impl::echo(Time_out msg, const char* str)
+{
+	Time result;
+  // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+  #warning "Code missing in function <Time MyServiceSVC_impl::echo(Time_out msg, const char* str)>"
+#endif
+  return result;
+}
+
+
+
+// End of example implementational code
+
+
+

Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArgStruct/MyServiceModuleTypeDefSVC_impl.h
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArgStruct/MyServiceModuleTypeDefSVC_impl.h	                        (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArgStruct/MyServiceModuleTypeDefSVC_impl.h	2011-09-25 06:14:33 UTC (rev 218)
@@ -0,0 +1,45 @@
+// -*-C++-*-
+/*!
+ * @file  MyServiceModuleTypeDefSVC_impl.h
+ * @brief Service implementation header of MyServiceModuleTypeDef.idl
+ *
+ */
+
+#include "MyServiceModuleTypeDefSkel.h"
+
+#ifndef MYSERVICEMODULETYPEDEFSVC_IMPL_H
+#define MYSERVICEMODULETYPEDEFSVC_IMPL_H
+ 
+/*!
+ * @class MyServiceSVC_impl
+ * Example class implementing IDL interface MyService
+ */
+class MyServiceSVC_impl
+ : public virtual POA_MyService,
+   public virtual PortableServer::RefCountServantBase
+{
+ private:
+   // Make sure all instances are built on the heap by making the
+   // destructor non-public
+   //virtual ~MyServiceSVC_impl();
+
+ public:
+  /*!
+   * @brief standard constructor
+   */
+   MyServiceSVC_impl();
+  /*!
+   * @brief destructor
+   */
+   virtual ~MyServiceSVC_impl();
+
+   // attributes and operations
+   Time echo(Time_out msg, const char* str);
+
+};
+
+
+
+#endif // MYSERVICEMODULETYPEDEFSVC_IMPL_H
+
+

Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArgStruct/foo.cpp
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArgStruct/foo.cpp	                        (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArgStruct/foo.cpp	2011-09-25 06:14:33 UTC (rev 218)
@@ -0,0 +1,166 @@
+// -*- C++ -*-
+/*!
+ * @file  foo.cpp
+ * @brief ModuleDescription
+ * @date $Date$
+ *
+ * $Id$
+ */
+
+#include "foo.h"
+
+// Module specification
+// <rtc-template block="module_spec">
+static const char* foo_spec[] =
+  {
+    "implementation_id", "foo",
+    "type_name",         "foo",
+    "description",       "ModuleDescription",
+    "version",           "1.0.0",
+    "vendor",            "VenderName",
+    "category",          "Category",
+    "activity_type",     "EVENTDRIVEN",
+    "kind",              "DataFlowComponent",
+    "max_instance",      "0",
+    "language",          "C++",
+    "lang_type",         "compile",
+    ""
+  };
+// </rtc-template>
+
+/*!
+ * @brief constructor
+ * @param manager Maneger Object
+ */
+foo::foo(RTC::Manager* manager)
+    // <rtc-template block="initializer">
+  : RTC::DataFlowComponentBase(manager),
+    m_sv_namePort("sv_name")
+
+    // </rtc-template>
+{
+}
+
+/*!
+ * @brief destructor
+ */
+foo::~foo()
+{
+}
+
+
+
+RTC::ReturnCode_t foo::onInitialize()
+{
+  // Registration: InPort/OutPort/Service
+  // <rtc-template block="registration">
+  // Set InPort buffers
+  
+  // Set OutPort buffer
+  
+  // Set service provider to Ports
+  m_sv_namePort.registerProvider("if_name", "MyService", m_if_name);
+  
+  // Set service consumers to Ports
+  
+  // Set CORBA Service Ports
+  addPort(m_sv_namePort);
+  
+  // </rtc-template>
+
+  return RTC::RTC_OK;
+}
+
+/*
+RTC::ReturnCode_t foo::onFinalize()
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t foo::onStartup(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t foo::onShutdown(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t foo::onActivated(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t foo::onDeactivated(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t foo::onExecute(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t foo::onAborting(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t foo::onError(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t foo::onReset(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t foo::onStateUpdate(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t foo::onRateChanged(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+
+
+extern "C"
+{
+ 
+  void fooInit(RTC::Manager* manager)
+  {
+    coil::Properties profile(foo_spec);
+    manager->registerFactory(profile,
+                             RTC::Create<foo>,
+                             RTC::Delete<foo>);
+  }
+  
+};
+
+

Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArgStruct/foo.h
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArgStruct/foo.h	                        (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArgStruct/foo.h	2011-09-25 06:14:33 UTC (rev 218)
@@ -0,0 +1,274 @@
+// -*- C++ -*-
+/*!
+ * @file  foo.h
+ * @brief ModuleDescription
+ * @date  $Date$
+ *
+ * $Id$
+ */
+
+#ifndef FOO_H
+#define FOO_H
+
+#include <rtm/Manager.h>
+#include <rtm/DataFlowComponentBase.h>
+#include <rtm/CorbaPort.h>
+#include <rtm/DataInPort.h>
+#include <rtm/DataOutPort.h>
+#include <rtm/idl/BasicDataTypeSkel.h>
+#include <rtm/idl/ExtendedDataTypesSkel.h>
+#include <rtm/idl/InterfaceDataTypesSkel.h>
+
+// Service implementation headers
+// <rtc-template block="service_impl_h">
+#include "MyServiceModuleTypeDefSVC_impl.h"
+
+// </rtc-template>
+
+// Service Consumer stub headers
+// <rtc-template block="consumer_stub_h">
+
+// </rtc-template>
+
+using namespace RTC;
+
+/*!
+ * @class foo
+ * @brief ModuleDescription
+ *
+ */
+class foo
+  : public RTC::DataFlowComponentBase
+{
+ public:
+  /*!
+   * @brief constructor
+   * @param manager Maneger Object
+   */
+  foo(RTC::Manager* manager);
+
+  /*!
+   * @brief destructor
+   */
+  ~foo();
+
+  // <rtc-template block="public_attribute">
+  
+  // </rtc-template>
+
+  // <rtc-template block="public_operation">
+  
+  // </rtc-template>
+
+  /***
+   *
+   * The initialize action (on CREATED->ALIVE transition)
+   * formaer rtc_init_entry() 
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+   virtual RTC::ReturnCode_t onInitialize();
+
+  /***
+   *
+   * The finalize action (on ALIVE->END transition)
+   * formaer rtc_exiting_entry()
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onFinalize();
+
+  /***
+   *
+   * The startup action when ExecutionContext startup
+   * former rtc_starting_entry()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onStartup(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * The shutdown action when ExecutionContext stop
+   * former rtc_stopping_entry()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onShutdown(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * The activated action (Active state entry action)
+   * former rtc_active_entry()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * The deactivated action (Active state exit action)
+   * former rtc_active_exit()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * The execution action that is invoked periodically
+   * former rtc_active_do()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * The aborting action when main logic error occurred.
+   * former rtc_aborting_entry()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onAborting(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * The error action in ERROR state
+   * former rtc_error_do()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onError(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * The reset action that is invoked resetting
+   * This is same but different the former rtc_init_entry()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onReset(RTC::UniqueId ec_id);
+  
+  /***
+   *
+   * The state update action that is invoked after onExecute() action
+   * no corresponding operation exists in OpenRTm-aist-0.2.0
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onStateUpdate(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * The action that is invoked when execution context's rate is changed
+   * no corresponding operation exists in OpenRTm-aist-0.2.0
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onRateChanged(RTC::UniqueId ec_id);
+
+
+ protected:
+  // <rtc-template block="protected_attribute">
+  
+  // </rtc-template>
+
+  // <rtc-template block="protected_operation">
+  
+  // </rtc-template>
+
+  // DataInPort declaration
+  // <rtc-template block="inport_declare">
+  
+  // </rtc-template>
+
+
+  // DataOutPort declaration
+  // <rtc-template block="outport_declare">
+  
+  // </rtc-template>
+
+  // CORBA Port declaration
+  // <rtc-template block="corbaport_declare">
+  /*!
+   */
+  RTC::CorbaPort m_sv_namePort;
+  
+  // </rtc-template>
+
+  // Service declaration
+  // <rtc-template block="service_declare">
+  /*!
+   */
+  MyServiceSVC_impl m_if_name;
+  
+  // </rtc-template>
+
+  // Consumer declaration
+  // <rtc-template block="consumer_declare">
+  
+  // </rtc-template>
+
+ private:
+  // <rtc-template block="private_attribute">
+  
+  // </rtc-template>
+
+  // <rtc-template block="private_operation">
+  
+  // </rtc-template>
+
+};
+
+
+extern "C"
+{
+  DLL_EXPORT void fooInit(RTC::Manager* manager);
+};
+
+#endif // FOO_H

Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArgStruct/fooComp.cpp
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArgStruct/fooComp.cpp	                        (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idlmodule/serviceArgStruct/fooComp.cpp	2011-09-25 06:14:33 UTC (rev 218)
@@ -0,0 +1,97 @@
+// -*- C++ -*-
+/*!
+ * @file fooComp.cpp
+ * @brief Standalone component
+ * @date $Date$
+ *
+ * $Id$
+ */
+
+#include <rtm/Manager.h>
+#include <iostream>
+#include <string>
+#include <stdlib.h>
+#include "foo.h"
+
+
+void MyModuleInit(RTC::Manager* manager)
+{
+  fooInit(manager);
+  RTC::RtcBase* comp;
+
+  // Create a component
+  comp = manager->createComponent("foo");
+
+  if (comp==NULL)
+  {
+    std::cerr << "Component create failed." << std::endl;
+    abort();
+  }
+
+  // Example
+  // The following procedure is examples how handle RT-Components.
+  // These should not be in this function.
+
+  // Get the component's object reference
+//  RTC::RTObject_var rtobj;
+//  rtobj = RTC::RTObject::_narrow(manager->getPOA()->servant_to_reference(comp));
+
+  // Get the port list of the component
+//  PortServiceList* portlist;
+//  portlist = rtobj->get_ports();
+
+  // getting port profiles
+//  std::cout << "Number of Ports: ";
+//  std::cout << portlist->length() << std::endl << std::endl; 
+//  for (CORBA::ULong i(0), n(portlist->length()); i < n; ++i)
+//  {
+//    PortService_ptr port;
+//    port = (*portlist)[i];
+//    std::cout << "Port" << i << " (name): ";
+//    std::cout << port->get_port_profile()->name << std::endl;
+//    
+//    RTC::PortInterfaceProfileList iflist;
+//    iflist = port->get_port_profile()->interfaces;
+//    std::cout << "---interfaces---" << std::endl;
+//    for (CORBA::ULong i(0), n(iflist.length()); i < n; ++i)
+//    {
+//      std::cout << "I/F name: ";
+//      std::cout << iflist[i].instance_name << std::endl;
+//      std::cout << "I/F type: ";
+//      std::cout << iflist[i].type_name << std::endl;
+//      const char* pol;
+//      pol = iflist[i].polarity == 0 ? "PROVIDED" : "REQUIRED";
+//      std::cout << "Polarity: " << pol << std::endl;
+//    }
+//    std::cout << "---properties---" << std::endl;
+//    NVUtil::dump(port->get_port_profile()->properties);
+//    std::cout << "----------------" << std::endl << std::endl;
+//  }
+
+  return;
+}
+
+int main (int argc, char** argv)
+{
+  RTC::Manager* manager;
+  manager = RTC::Manager::init(argc, argv);
+
+  // Initialize manager
+  manager->init(argc, argv);
+
+  // Set module initialization proceduer
+  // This procedure will be invoked in activateManager() function.
+  manager->setModuleInitProc(MyModuleInit);
+
+  // Activate manager and register to naming service
+  manager->activateManager();
+
+  // run the manager in blocking mode
+  // runManager(false) is the default.
+  manager->runManager();
+
+  // If you want to run the manager in non-blocking mode, do like this
+  // manager->runManager(true);
+
+  return 0;
+}

Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idltype/IDLType1/TestIDLSVC_impl.cpp
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idltype/IDLType1/TestIDLSVC_impl.cpp	2011-09-25 05:59:19 UTC (rev 217)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idltype/IDLType1/TestIDLSVC_impl.cpp	2011-09-25 06:14:33 UTC (rev 218)
@@ -71,12 +71,12 @@
   return result;
 }
 
-Frame0 ComFkSVC_impl::set_tool0(const Frame0& frm, Frame0& frmo, Frame0& frmio)
+Frame0 ComFkSVC_impl::set_tool0(const Frame0& frm, Frame0_out frmo, Frame0& frmio)
 {
 	Frame0 result;
   // Please insert your code here and remove the following warning pragma
 #ifndef WIN32
-  #warning "Code missing in function <Frame0 ComFkSVC_impl::set_tool0(const Frame0& frm, Frame0& frmo, Frame0& frmio)>"
+  #warning "Code missing in function <Frame0 ComFkSVC_impl::set_tool0(const Frame0& frm, Frame0_out frmo, Frame0& frmio)>"
 #endif
   return result;
 }
@@ -99,12 +99,12 @@
   return 0;
 }
 
-Frame3 ComFkSVC_impl::set_tool3(const Frame3& frm, Frame3& frmo, Frame3& frmio)
+Frame3 ComFkSVC_impl::set_tool3(const Frame3& frm, Frame3_out frmo, Frame3& frmio)
 {
 	Frame3 result;
   // Please insert your code here and remove the following warning pragma
 #ifndef WIN32
-  #warning "Code missing in function <Frame3 ComFkSVC_impl::set_tool3(const Frame3& frm, Frame3& frmo, Frame3& frmio)>"
+  #warning "Code missing in function <Frame3 ComFkSVC_impl::set_tool3(const Frame3& frm, Frame3_out frmo, Frame3& frmio)>"
 #endif
   return result;
 }

Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idltype/IDLType1/TestIDLSVC_impl.h
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idltype/IDLType1/TestIDLSVC_impl.h	2011-09-25 05:59:19 UTC (rev 217)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/idltype/IDLType1/TestIDLSVC_impl.h	2011-09-25 06:14:33 UTC (rev 218)
@@ -39,10 +39,10 @@
    LongArray_slice* set_longArray(const LongArray frm, LongArray frmo, LongArray frmio);
    ValueListArray_slice* set_longArrayv(const ValueListArray frm, ValueListArray_out frmo, ValueListArray frmio);
    color set_color(color frm, color& frmo, color& frmio);
-   Frame0 set_tool0(const Frame0& frm, Frame0& frmo, Frame0& frmio);
+   Frame0 set_tool0(const Frame0& frm, Frame0_out frmo, Frame0& frmio);
    Frame1* set_tool1(const Frame1& frm, Frame1_out frmo, Frame1& frmio);
    Frame2* set_tool2(const Frame2& frm, Frame2_out frmo, Frame2& frmio);
-   Frame3 set_tool3(const Frame3& frm, Frame3& frmo, Frame3& frmio);
+   Frame3 set_tool3(const Frame3& frm, Frame3_out frmo, Frame3& frmio);
    Frame4* set_tool4(const Frame4& frm, Frame4_out frmo, Frame4& frmio);
    Frame5* set_tool5(const Frame5& frm, Frame5_out frmo, Frame5& frmio);
    Frame1List* set_toolSeq1(const Frame1List& frm, Frame1List_out frmo, Frame1List& frmio);

Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/manager/CXXConverter.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/manager/CXXConverter.java	2011-09-25 05:59:19 UTC (rev 217)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/manager/CXXConverter.java	2011-09-25 06:14:33 UTC (rev 218)
@@ -239,9 +239,14 @@
 				}
 				if(typeDef.getDirection().equals("in"))
 					result = "const " + result + "&";
+				else if(typeDef.getDirection().equals("out"))
+					result = result + "_out";
+				else if(typeDef.getDirection().equals("inout"))
+					result = result + "&";
+			} else {
+				if(typeDef.getDirection().equals("out") || typeDef.getDirection().equals("inout"))
+					result = result + "&";
 			}
-			if(typeDef.getDirection().equals("out") || typeDef.getDirection().equals("inout"))
-				result = result + "&";
 		}
 
 		return result;

Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/test/jp/go/aist/rtm/rtcbuilder/_test/_100/CXXIDLModuleTest.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/test/jp/go/aist/rtm/rtcbuilder/_test/_100/CXXIDLModuleTest.java	2011-09-25 05:59:19 UTC (rev 217)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/test/jp/go/aist/rtm/rtcbuilder/_test/_100/CXXIDLModuleTest.java	2011-09-25 06:14:33 UTC (rev 218)
@@ -131,4 +131,38 @@
 		checkCode(result, resourceDir, "MyServiceModuleTypeDefSVC_impl.h");
 		checkCode(result, resourceDir, "MyServiceModuleTypeDefSVC_impl.cpp");
 	}
+	
+	public void testArgStructModule() throws Exception {
+		rtcParam.setName("foo");
+		rtcParam.setDescription("ModuleDescription");
+		rtcParam.setVersion("1.0.0");
+		rtcParam.setVender("VenderName");
+		rtcParam.setCategory("Category");
+		rtcParam.setComponentType("UNIQUE");
+		rtcParam.setActivityType("EVENTDRIVEN");
+		rtcParam.setMaxInstance(0);
+		rtcParam.setComponentKind("DataFlowComponent");
+
+		ServicePortParam service1 = new ServicePortParam("sv_name", 0);
+		List<ServicePortInterfaceParam> srvinterts = new ArrayList<ServicePortInterfaceParam>(); 
+		ServicePortInterfaceParam int1 = new ServicePortInterfaceParam(service1, "if_name", "", "", 
+				rootPath + "/resource/100/CXX/idlmodule/serviceArgStruct/MyServiceModuleTypeDef.idl", "MyService", "", 0);
+		srvinterts.add(int1);
+		service1.getServicePortInterfaces().addAll(srvinterts);
+		List<ServicePortParam> srvports = new ArrayList<ServicePortParam>();
+		srvports.add(service1);
+		rtcParam.getServicePorts().addAll(srvports);
+
+		Generator generator = new Generator();
+		List<GeneratedResult> result = generator.generateTemplateCode(genParam);
+
+		String resourceDir = rootPath + "/resource/100/CXX/idlmodule/serviceArgStruct/";
+
+		assertEquals(14, result.size());
+		checkCode(result, resourceDir, "fooComp.cpp");
+		checkCode(result, resourceDir, "foo.h");
+		checkCode(result, resourceDir, "foo.cpp");
+		checkCode(result, resourceDir, "MyServiceModuleTypeDefSVC_impl.h");
+		checkCode(result, resourceDir, "MyServiceModuleTypeDefSVC_impl.cpp");
+	}
 }



openrtm-commit メーリングリストの案内