[openrtm-commit:03126] r795 - in trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder: generator/param generator/param/idl manager template/cpp template/cpp/test

openrtm @ openrtm.org openrtm @ openrtm.org
2018年 1月 23日 (火) 22:50:28 JST


Author: ga
Date: 2018-01-23 22:50:28 +0900 (Tue, 23 Jan 2018)
New Revision: 795

Added:
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/test/
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/test/CXX_Test_Comp.cpp.vsl
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/test/CXX_Test_RTC.cpp.vsl
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/test/CXX_Test_RTC.h.vsl
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/test/CXX_Test_SVC.cpp.vsl
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/test/CXX_Test_SVC.h.vsl
Removed:
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/CXX_STAND_ALONE.vsl
Modified:
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/RtcParam.java
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/idl/IdlFileParam.java
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/manager/CXXGenerateManager.java
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/manager/GenerateManager.java
Log:
Added function to output test RTC. #4433

Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/RtcParam.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/RtcParam.java	2018-01-23 13:47:36 UTC (rev 794)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/RtcParam.java	2018-01-23 13:50:28 UTC (rev 795)
@@ -886,5 +886,4 @@
 		//
 		this.targetEnvs.resetUpdated();
 	}
-
 }

Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/idl/IdlFileParam.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/idl/IdlFileParam.java	2018-01-23 13:47:36 UTC (rev 794)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/idl/IdlFileParam.java	2018-01-23 13:50:28 UTC (rev 795)
@@ -5,7 +5,6 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import jp.go.aist.rtm.rtcbuilder.IRtcBuilderConstants;
 import jp.go.aist.rtm.rtcbuilder.generator.param.RtcParam;
 
 /**
@@ -16,6 +15,7 @@
 	
 	private String idlPath;
 	private List<ServiceClassParam> serviceClass = new ArrayList<ServiceClassParam>();
+	private List<ServiceClassParam> testServiceClass = new ArrayList<ServiceClassParam>();
 	private RtcParam parent;
 	private List<String> idlSearchPathes = new ArrayList<String>();
 	private List<String> includeIdlPathes = new ArrayList<String>();
@@ -50,6 +50,14 @@
 		this.serviceClass = serviceClassParamList;
 	}
 
+	public List<ServiceClassParam> getTestServiceClassParams() {
+		return testServiceClass;
+	}
+
+	public void addTestServiceClassParams(	ServiceClassParam serviceClassParam) {
+		this.testServiceClass.add(serviceClassParam);
+	}
+	
 	public String getIdlFile() {
 		File file = new File( idlPath);
 		return file.getName();

Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/manager/CXXGenerateManager.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/manager/CXXGenerateManager.java	2018-01-23 13:47:36 UTC (rev 794)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/manager/CXXGenerateManager.java	2018-01-23 13:50:28 UTC (rev 795)
@@ -8,11 +8,11 @@
 
 import jp.go.aist.rtm.rtcbuilder.IRTCBMessageConstants;
 import jp.go.aist.rtm.rtcbuilder.generator.GeneratedResult;
+import jp.go.aist.rtm.rtcbuilder.generator.param.DataPortParam;
 import jp.go.aist.rtm.rtcbuilder.generator.param.RtcParam;
 import jp.go.aist.rtm.rtcbuilder.generator.param.idl.IdlFileParam;
 import jp.go.aist.rtm.rtcbuilder.template.TemplateHelper;
 import jp.go.aist.rtm.rtcbuilder.template.TemplateUtil;
-
 import static jp.go.aist.rtm.rtcbuilder.IRtcBuilderConstants.*;
 import static jp.go.aist.rtm.rtcbuilder.util.RTCUtil.*;
 
@@ -85,6 +85,22 @@
 			gr = generateSVCSource(contextMap);
 			result.add(gr);
 		}
+		//
+		if(rtcParam.isChoreonoid()==false) {
+			gr = generateTestCompSource(contextMap);
+			result.add(gr);
+			gr = generateTestHeader(contextMap);
+			result.add(gr);
+			gr = generateTestSource(contextMap);
+			result.add(gr);
+			for (IdlFileParam idl : rtcParam.getConsumerIdlPathes()) {
+				contextMap.put("idlFileParam", idl);
+				gr = generateTestSVCHeader(contextMap);
+				result.add(gr);
+				gr = generateTestSVCSource(contextMap);
+				result.add(gr);
+			}
+		}
 
 		return result;
 	}
@@ -151,7 +167,51 @@
 		String infile = "cpp/travis.vsl";
 		return generate(infile, outfile, contextMap);
 	}
+	/////
+	public GeneratedResult generateTestCompSource(Map<String, Object> contextMap) {
+		RtcParam rtcParam = (RtcParam) contextMap.get("rtcParam");
+		String outfile = null;
+		outfile = "test/src/" + rtcParam.getName() + "TestComp.cpp";
+		String infile = "cpp/test/CXX_Test_Comp.cpp.vsl";
+		return generate(infile, outfile, contextMap);
+	}
 	
+	public GeneratedResult generateTestHeader(Map<String, Object> contextMap) {
+		RtcParam rtcParam = (RtcParam) contextMap.get("rtcParam");
+		String outfile = null;
+		outfile = "test/include/" + rtcParam.getName() + "Test/" + rtcParam.getName() + "Test.h";
+		String infile = "cpp/test/CXX_Test_RTC.h.vsl";
+		return generate(infile, outfile, contextMap);
+	}
+	
+	public GeneratedResult generateTestSource(Map<String, Object> contextMap) {
+		RtcParam rtcParam = (RtcParam) contextMap.get("rtcParam");
+		String outfile = null;
+		outfile = "test/src/" + rtcParam.getName() + "Test.cpp";
+		String infile = "cpp/test/CXX_Test_RTC.cpp.vsl";
+		return generate(infile, outfile, contextMap);
+	}
+	
+	public GeneratedResult generateTestSVCHeader(Map<String, Object> contextMap) {
+		RtcParam rtcParam = (RtcParam) contextMap.get("rtcParam");
+		IdlFileParam idlParam = (IdlFileParam) contextMap.get("idlFileParam");
+		String outfile = null;
+		outfile = "test/include/" + rtcParam.getName() + "Test/" 
+				+ TemplateHelper.getBasename(idlParam.getIdlFileNoExt())
+				+ TemplateHelper.getServiceImplSuffix() + ".h";
+		String infile = "cpp/test/CXX_Test_SVC.h.vsl";
+		return generate(infile, outfile, contextMap);
+	}
+	
+	public GeneratedResult generateTestSVCSource(Map<String, Object> contextMap) {
+		IdlFileParam idlParam = (IdlFileParam) contextMap.get("idlFileParam");
+		String outfile = null;
+		outfile = "test/src/" + TemplateHelper.getBasename(idlParam.getIdlFileNoExt())
+					+ TemplateHelper.getServiceImplSuffix() + ".cpp";
+		String infile = "cpp/test/CXX_Test_SVC.cpp.vsl";
+		return generate(infile, outfile, contextMap);
+	}
+	/////
 	public GeneratedResult generate(String infile, String outfile,
 			Map<String, Object> contextMap) {
 		try {

Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/manager/GenerateManager.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/manager/GenerateManager.java	2018-01-23 13:47:36 UTC (rev 794)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/manager/GenerateManager.java	2018-01-23 13:50:28 UTC (rev 795)
@@ -54,6 +54,15 @@
 				}
 			}
 		}
+		for (IdlFileParam idl : rtcParam.getConsumerIdlPathes()) {
+			for (ServiceClassParam svc : rtcParam.getServiceClassParams()) {
+				if (idl.getIdlPath().equals(svc.getIdlPath())) {
+					if (!idl.getTestServiceClassParams().contains(svc)) {
+						idl.addTestServiceClassParams(svc);
+					}
+				}
+			}
+		}
 	}
 
 }

Deleted: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/CXX_STAND_ALONE.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/CXX_STAND_ALONE.vsl	2018-01-23 13:47:36 UTC (rev 794)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/CXX_STAND_ALONE.vsl	2018-01-23 13:50:28 UTC (rev 795)
@@ -1,42 +0,0 @@
-// -*- C++ -*-
-/*!
- * @file standalone.cpp
- * @brief Standalone component
- * @date ${dol}Date${dol}
-#parse("${template}/cpp/_doc.vsl")
- * ${dol}Id${dol}
- */
-
-${sharp}include "${rtcParam.name}/rtc.h"
-
-${sharp}include <rtm/Manager.h>
-${sharp}include <iostream>
-${sharp}include <string>
-${sharp}include <stdlib.h>
-
-void ModuleInit(RTC::Manager* manager)
-{
-    rtc_init(manager);
-    RTC::RtcBase* comp;
-    comp = manager->createComponent("${rtcParam.name}");
-
-    if (comp == NULL)
-    {
-        std::cerr << "${rtcParam.name} component creation failed." << std::endl;
-        abort();
-    }
-}
-
-
-int main(int argc, char** argv)
-{
-    RTC::Manager *manager;
-    manager = RTC::Manager::init(argc, argv);
-    manager->init(argc, argv);
-    manager->setModuleInitProc(ModuleInit);
-    manager->activateManager();
-    manager->runManager();
-
-    return 0;
-}
-

Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/test/CXX_Test_Comp.cpp.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/test/CXX_Test_Comp.cpp.vsl	                        (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/test/CXX_Test_Comp.cpp.vsl	2018-01-23 13:50:28 UTC (rev 795)
@@ -0,0 +1,97 @@
+// -*- C++ -*-
+/*!
+ * @file ${rtcParam.name}TestComp.cpp
+ * @brief Standalone component
+ * @date ${dol}Date${dol}
+#parse("${template}/cpp/_doc.vsl")
+ * ${dol}Id${dol}
+ */
+
+${sharp}include <rtm/Manager.h>
+${sharp}include <iostream>
+${sharp}include <string>
+${sharp}include <stdlib.h>
+${sharp}include "${rtcParam.name}Test.h"
+
+
+void MyModuleInit(RTC::Manager* manager)
+{
+  ${rtcParam.name}TestInit(manager);
+  RTC::RtcBase* comp;
+
+  // Create a component
+  comp = manager->createComponent("${rtcParam.name}Test");
+
+  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/src/jp/go/aist/rtm/rtcbuilder/template/cpp/test/CXX_Test_RTC.cpp.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/test/CXX_Test_RTC.cpp.vsl	                        (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/test/CXX_Test_RTC.cpp.vsl	2018-01-23 13:50:28 UTC (rev 795)
@@ -0,0 +1,341 @@
+// -*- C++ -*-
+/*!
+ * @file  ${rtcParam.name}Test.cpp
+ * @brief ${rtcParam.description}
+ * @date ${dol}Date${dol}
+#parse("${template}/cpp/_doc.vsl")
+ * ${dol}Id${dol}
+ */
+
+${sharp}include "${rtcParam.name}Test.h"
+
+// Module specification
+// <rtc-template block="module_spec">
+static const char* ${rtcParam.name.toLowerCase()}_spec[] =
+  {
+    "implementation_id", "${rtcParam.name}Test",
+    "type_name",         "${rtcParam.name}Test",
+    "description",       "${rtcParam.description}",
+    "version",           "${rtcParam.version}",
+    "vendor",            "${rtcParam.vender}",
+    "category",          "${rtcParam.category}",
+    "activity_type",     "${rtcParam.activityType}",
+    "kind",              "${rtcParam.componentKind}",
+    "max_instance",      "${rtcParam.maxInstance}",
+    "language",          "C++",
+    "lang_type",         "compile",
+#if( ${rtcParam.configParams.size()} > 0 )
+    // Configuration variables
+#foreach($configParam in ${rtcParam.configParams})  
+    "conf.default.${configParam.name}", "${configParam.defaultVal}",
+#end
+
+    // Widget
+#foreach($configParam in ${rtcParam.configParams})
+#if( ${configParam.widget.length()} > 0 )
+    "conf.__widget__.${configParam.name}", "${configParam.widget}#if( ${configParam.step.length()} > 0 ).${configParam.step}#end",
+#end
+#end
+    // Constraints
+#foreach($configParam in ${rtcParam.configParams})
+#if( ${configParam.constraint.length()} > 0 )
+    "conf.__constraints__.${configParam.name}", "${configParam.constraint}",
+#end
+#end
+
+#foreach($configParam in ${rtcParam.configParams})
+    "conf.__type__.${configParam.name}", "${configParam.type}",
+#end
+
+#end
+#if( ${rtcParam.configParameterParams.size()} > 0 )
+    // System Configuration
+#foreach($parameterParam in ${rtcParam.configParameterParams})  
+#if( ${parameterParam.isNonPeriodic()} )
+    "${parameterParam.configName}", "${parameterParam.defaultVal}",
+#end
+#end
+#end
+    ""
+  };
+// </rtc-template>
+
+/*!
+ * @brief constructor
+ * @param manager Maneger Object
+ */
+${rtcParam.name}Test::${rtcParam.name}Test(RTC::Manager* manager)
+    // <rtc-template block="initializer">
+  : RTC::${rtcParam.componentKind}Base(manager)#foreach($port in ${rtcParam.inports})#if(${port.type}!=""),
+    ${rtcParam.commonPrefix}${rtcParam.dataPortPrefix}${port.tmplVarName}In${rtcParam.dataPortSuffix}${rtcParam.commonSuffix}("${port.name}", ${rtcParam.commonPrefix}${rtcParam.dataPortPrefix}${port.tmplVarName}${rtcParam.dataPortSuffix}${rtcParam.commonSuffix})#end#end#foreach($port in ${rtcParam.outports})#if(${port.type}!=""),
+    ${rtcParam.commonPrefix}${rtcParam.dataPortPrefix}${port.tmplVarName}Out${rtcParam.dataPortSuffix}${rtcParam.commonSuffix}("${port.name}", ${rtcParam.commonPrefix}${rtcParam.dataPortPrefix}${port.tmplVarName}${rtcParam.dataPortSuffix}${rtcParam.commonSuffix})#end#end
+#if(${rtcParam.servicePorts.size()}>0)
+#foreach($servicePort in ${rtcParam.servicePorts})
+#if(${servicePort.servicePortInterfaces.size()}>0)
+,
+    ${rtcParam.commonPrefix}${rtcParam.servicePortPrefix}${servicePort.name}Port${rtcParam.servicePortSuffix}${rtcParam.commonSuffix}("${servicePort.name}")#end#end#end
+
+
+    // </rtc-template>
+{
+}
+
+/*!
+ * @brief destructor
+ */
+${rtcParam.name}Test::~${rtcParam.name}Test()
+{
+}
+
+
+#if(${rtcParam.getDocActionOverView(0).length()}>0)/*!
+ * ${tmpltHelper.convertDoc(${rtcParam.getDocActionOverView(0)})}
+ */#end
+#if(${rtcParam.configParams.size()}==0 && ${rtcParam.IsNotImplemented(0)} && ${rtcParam.inports.size()}==0 && ${rtcParam.outports.size()}==0 && ${rtcParam.servicePorts.size()}==0)/*#end
+
+RTC::ReturnCode_t ${rtcParam.name}Test::onInitialize()
+{
+  // Registration: InPort/OutPort/Service
+  // <rtc-template block="registration">
+  // Set InPort buffers
+#foreach($port in ${rtcParam.outports})
+#if(${port.type}!="")  addInPort("${port.name}", ${rtcParam.commonPrefix}${rtcParam.dataPortPrefix}${port.tmplVarName}In${rtcParam.dataPortSuffix}${rtcParam.commonSuffix});
+#end
+#end
+  
+  // Set OutPort buffer
+#foreach($port in ${rtcParam.inports})
+#if(${port.type}!="")  addOutPort("${port.name}", ${rtcParam.commonPrefix}${rtcParam.dataPortPrefix}${port.tmplVarName}Out${rtcParam.dataPortSuffix}${rtcParam.commonSuffix});
+#end
+#end
+  
+  // Set service provider to Ports
+#if(${rtcParam.servicePorts.size()}>0)
+#foreach($servicePort in ${rtcParam.servicePorts})
+#if(${servicePort.servicePortInterfaces.size()}>0)
+#foreach($serviceInterface in ${servicePort.servicePortInterfaces})
+#if(${serviceInterface.index}==1)
+  ${rtcParam.commonPrefix}${rtcParam.servicePortPrefix}${servicePort.name}Port${rtcParam.servicePortSuffix}${rtcParam.commonSuffix}.registerProvider("${serviceInterface.name}", "${serviceInterface.interfaceType}", ${rtcParam.commonPrefix}${rtcParam.serviceIFPrefix}${serviceInterface.tmplVarName}${rtcParam.serviceIFSuffix}${rtcParam.commonSuffix});
+#end#end#end#end#end
+  
+  // Set service consumers to Ports
+#if(${rtcParam.servicePorts.size()}>0)
+#foreach($servicePort in ${rtcParam.servicePorts})
+#if(${servicePort.servicePortInterfaces.size()}>0)
+#foreach($serviceInterface in ${servicePort.servicePortInterfaces})
+#if(${serviceInterface.index}==0)
+  ${rtcParam.commonPrefix}${rtcParam.servicePortPrefix}${servicePort.name}Port${rtcParam.servicePortSuffix}${rtcParam.commonSuffix}.registerConsumer("${serviceInterface.name}", "${serviceInterface.interfaceType}", ${rtcParam.commonPrefix}${rtcParam.serviceIFPrefix}${serviceInterface.tmplVarName}${rtcParam.serviceIFSuffix}${rtcParam.commonSuffix});
+#end#end#end#end#end
+  
+  // Set CORBA Service Ports
+#if(${rtcParam.servicePorts.size()}>0)
+#foreach($servicePort in ${rtcParam.servicePorts})
+#if(${servicePort.servicePortInterfaces.size()}>0)
+  addPort(${rtcParam.commonPrefix}${rtcParam.servicePortPrefix}${servicePort.name}Port${rtcParam.servicePortSuffix}${rtcParam.commonSuffix});
+#end#end#end
+  
+  // </rtc-template>
+
+  // <rtc-template block="bind_config">
+#if(${rtcParam.configParams.size()}>0)
+  // Bind variables and configuration variable
+#foreach($configParam in ${rtcParam.configParams})  
+  bindParameter("${configParam.name}", ${rtcParam.commonPrefix}${rtcParam.configurationPrefix}${configParam.tmplVarName}${rtcParam.configurationSuffix}${rtcParam.commonSuffix}, "${configParam.defaultVal}");
+#end
+#end
+  // </rtc-template>
+#if(${tmpltHelper.checkDetailContent(0,${rtcParam})})${rtcParam.getDetailContent(0)}
+#end
+  
+  return RTC::RTC_OK;
+}
+#if(${rtcParam.configParams.size()}==0 && ${rtcParam.IsNotImplemented(0)} && ${rtcParam.inports.size()}==0 && ${rtcParam.outports.size()}==0 && ${rtcParam.servicePorts.size()}==0)*/
+#end
+
+#if(${rtcParam.getDocActionOverView(1).length()}>0)/*!
+ * ${tmpltHelper.convertDoc(${rtcParam.getDocActionOverView(1)})}
+ */
+#end
+#if(${rtcParam.IsNotImplemented(1)})/*#end
+
+RTC::ReturnCode_t ${rtcParam.name}Test::onFinalize()
+{
+#if(${tmpltHelper.checkDetailContent(1,${rtcParam})})${rtcParam.getDetailContent(1)}
+#end
+  return RTC::RTC_OK;
+}
+#if(${rtcParam.IsNotImplemented(1)})*/
+#end
+
+#if(${rtcParam.getDocActionOverView(2).length()}>0)/*!
+ * ${tmpltHelper.convertDoc(${rtcParam.getDocActionOverView(2)})}
+ */
+#end
+#if(${rtcParam.IsNotImplemented(2)})/*#end
+
+RTC::ReturnCode_t ${rtcParam.name}Test::onStartup(RTC::UniqueId ec_id)
+{
+#if(${tmpltHelper.checkDetailContent(2,${rtcParam})})${rtcParam.getDetailContent(2)}
+#end
+  return RTC::RTC_OK;
+}
+#if(${rtcParam.IsNotImplemented(2)})*/
+#end
+
+#if(${rtcParam.getDocActionOverView(3).length()}>0)/*!
+ * ${tmpltHelper.convertDoc(${rtcParam.getDocActionOverView(3)})}
+ */
+#end
+#if(${rtcParam.IsNotImplemented(3)})/*#end
+
+RTC::ReturnCode_t ${rtcParam.name}Test::onShutdown(RTC::UniqueId ec_id)
+{
+#if(${tmpltHelper.checkDetailContent(3,${rtcParam})})${rtcParam.getDetailContent(3)}
+#end
+  return RTC::RTC_OK;
+}
+#if(${rtcParam.IsNotImplemented(3)})*/
+#end
+
+#if(${rtcParam.getDocActionOverView(4).length()}>0)/*!
+ * ${tmpltHelper.convertDoc(${rtcParam.getDocActionOverView(4)})}
+ */
+#end
+#if(${rtcParam.IsNotImplemented(4)})/*#end
+
+RTC::ReturnCode_t ${rtcParam.name}Test::onActivated(RTC::UniqueId ec_id)
+{
+#if(${tmpltHelper.checkDetailContent(4,${rtcParam})})${rtcParam.getDetailContent(4)}
+#end
+  return RTC::RTC_OK;
+}
+#if(${rtcParam.IsNotImplemented(4)})*/
+#end
+
+#if(${rtcParam.getDocActionOverView(5).length()}>0)/*!
+ * ${tmpltHelper.convertDoc(${rtcParam.getDocActionOverView(5)})}
+ */
+#end
+#if(${rtcParam.IsNotImplemented(5)})/*#end
+
+RTC::ReturnCode_t ${rtcParam.name}Test::onDeactivated(RTC::UniqueId ec_id)
+{
+#if(${tmpltHelper.checkDetailContent(5,${rtcParam})})${rtcParam.getDetailContent(5)}
+#end
+  return RTC::RTC_OK;
+}
+#if(${rtcParam.IsNotImplemented(5)})*/
+#end
+
+#if(${rtcParam.getDocActionOverView(9).length()}>0)/*!
+ * ${tmpltHelper.convertDoc(${rtcParam.getDocActionOverView(9)})}
+ */
+#end
+#if(${rtcParam.IsNotImplemented(9)})/*#end
+
+RTC::ReturnCode_t ${rtcParam.name}Test::onExecute(RTC::UniqueId ec_id)
+{
+#if(${tmpltHelper.checkDetailContent(9,${rtcParam})})${rtcParam.getDetailContent(9)}
+#end
+  return RTC::RTC_OK;
+}
+#if(${rtcParam.IsNotImplemented(9)})*/
+#end
+
+#if(${rtcParam.getDocActionOverView(6).length()}>0)/*!
+ * ${tmpltHelper.convertDoc(${rtcParam.getDocActionOverView(6)})}
+ */
+#end
+#if(${rtcParam.IsNotImplemented(6)})/*#end
+
+RTC::ReturnCode_t ${rtcParam.name}Test::onAborting(RTC::UniqueId ec_id)
+{
+#if(${tmpltHelper.checkDetailContent(6,${rtcParam})})${rtcParam.getDetailContent(6)}
+#end
+  return RTC::RTC_OK;
+}
+#if(${rtcParam.IsNotImplemented(6)})*/
+#end
+
+#if(${rtcParam.getDocActionOverView(7).length()}>0)/*!
+ * ${tmpltHelper.convertDoc(${rtcParam.getDocActionOverView(7)})}
+ */
+#end
+#if(${rtcParam.IsNotImplemented(7)})/*#end
+
+RTC::ReturnCode_t ${rtcParam.name}Test::onError(RTC::UniqueId ec_id)
+{
+#if(${tmpltHelper.checkDetailContent(7,${rtcParam})})${rtcParam.getDetailContent(7)}
+#end
+  return RTC::RTC_OK;
+}
+#if(${rtcParam.IsNotImplemented(7)})*/
+#end
+
+#if(${rtcParam.getDocActionOverView(8).length()}>0)/*!
+ * ${tmpltHelper.convertDoc(${rtcParam.getDocActionOverView(8)})}
+ */
+#end
+#if(${rtcParam.IsNotImplemented(8)})/*#end
+
+RTC::ReturnCode_t ${rtcParam.name}Test::onReset(RTC::UniqueId ec_id)
+{
+#if(${tmpltHelper.checkDetailContent(8,${rtcParam})})${rtcParam.getDetailContent(8)}
+#end
+  return RTC::RTC_OK;
+}
+#if(${rtcParam.IsNotImplemented(8)})*/
+#end
+
+#if(${rtcParam.getDocActionOverView(10).length()}>0)/*!
+ * ${tmpltHelper.convertDoc(${rtcParam.getDocActionOverView(10)})}
+ */
+#end
+#if(${rtcParam.IsNotImplemented(10)})/*#end
+
+RTC::ReturnCode_t ${rtcParam.name}Test::onStateUpdate(RTC::UniqueId ec_id)
+{
+#if(${tmpltHelper.checkDetailContent(10,${rtcParam})})${rtcParam.getDetailContent(10)}
+#end
+  return RTC::RTC_OK;
+}
+#if(${rtcParam.IsNotImplemented(10)})*/
+#end
+
+#if(${rtcParam.getDocActionOverView(11).length()}>0)/*!
+ * ${tmpltHelper.convertDoc(${rtcParam.getDocActionOverView(11)})}
+ */
+#end
+#if(${rtcParam.IsNotImplemented(11)})/*#end
+
+RTC::ReturnCode_t ${rtcParam.name}Test::onRateChanged(RTC::UniqueId ec_id)
+{
+#if(${tmpltHelper.checkDetailContent(11,${rtcParam})})${rtcParam.getDetailContent(11)}
+#end
+  return RTC::RTC_OK;
+}
+#if(${rtcParam.IsNotImplemented(11)})*/
+#end
+
+#if(${tmpltHelper.checkContents(${rtcParam.publicOpeSource})})${rtcParam.publicOpeSource}
+#end
+#if(${tmpltHelper.checkContents(${rtcParam.protectedOpeSource})})${rtcParam.protectedOpeSource}
+#end
+#if(${tmpltHelper.checkContents(${rtcParam.privateOpeSource})})${rtcParam.privateOpeSource}
+#end
+
+
+extern "C"
+{
+ 
+  void ${rtcParam.name}TestInit(RTC::Manager* manager)
+  {
+    coil::Properties profile(${rtcParam.name.toLowerCase()}_spec);
+    manager->registerFactory(profile,
+                             RTC::Create<${rtcParam.name}Test>,
+                             RTC::Delete<${rtcParam.name}Test>);
+  }
+  
+};
+
+

Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/test/CXX_Test_RTC.h.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/test/CXX_Test_RTC.h.vsl	                        (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/test/CXX_Test_RTC.h.vsl	2018-01-23 13:50:28 UTC (rev 795)
@@ -0,0 +1,503 @@
+// -*- C++ -*-
+/*!
+ * @file  ${rtcParam.name}Test.h
+ * @brief ${rtcParam.description}
+ * @date  ${dol}Date${dol}
+#parse("${template}/cpp/_doc.vsl")
+ * ${dol}Id${dol}
+ */
+
+${sharp}ifndef ${rtcParam.name.toUpperCase()}_TEST__H
+${sharp}define ${rtcParam.name.toUpperCase()}_TEST_H
+
+${sharp}include <rtm/idl/BasicDataTypeSkel.h>
+${sharp}include <rtm/idl/ExtendedDataTypesSkel.h>
+${sharp}include <rtm/idl/InterfaceDataTypesSkel.h>
+
+// Service implementation headers
+// <rtc-template block="service_impl_h">
+#foreach($consumerIdlFile in ${rtcParam.consumerIdlPathes})
+${sharp}include "${tmpltHelper.getFilenameNoExt(${consumerIdlFile.idlFile})}${tmpltHelper.serviceImplSuffix}.h"
+#end
+
+// </rtc-template>
+
+// Service Consumer stub headers
+// <rtc-template block="consumer_stub_h">
+#foreach($providerIdlFile in ${rtcParam.providerIdlPathes})
+${sharp}include "${tmpltHelper.getFilenameNoExt(${providerIdlFile.idlFile})}${tmpltHelper.serviceStubSuffix}.h"
+#end
+
+// </rtc-template>
+
+// Service Consumer stub headers
+// <rtc-template block="port_stub_h">
+#foreach($type in ${cXXConv.getPortModules(${rtcParam})})
+${cXXConv.getDataportUsingNamespace(${type})}
+#end
+// </rtc-template>
+
+${sharp}include <rtm/Manager.h>
+${sharp}include <rtm/${rtcParam.componentKind}Base.h>
+${sharp}include <rtm/CorbaPort.h>
+${sharp}include <rtm/DataInPort.h>
+${sharp}include <rtm/DataOutPort.h>
+
+using namespace RTC;
+
+/*!
+ * @class ${rtcParam.name}Test
+ * @brief ${rtcParam.description}
+#if( ${rtcParam.docDescription.length()} > 0 )
+ *
+ * ${tmpltHelper.convertDoc(${rtcParam.docDescription})}
+#end
+#if( ${rtcParam.docInOut.length()} > 0 )
+ *
+ * ${tmpltHelper.convertDoc(${rtcParam.docInOut})}
+#end
+#if( ${rtcParam.docAlgorithm.length()} > 0 )
+ *
+ * ${tmpltHelper.convertDoc(${rtcParam.docAlgorithm})}
+#end
+#if( ${rtcParam.docReference.length()} > 0 )
+ *
+ * ${tmpltHelper.convertDoc(${rtcParam.docReference})}
+#end
+ *
+ */
+class ${rtcParam.name}Test
+  : public RTC::${rtcParam.componentKind}Base
+{
+ public:
+  /*!
+   * @brief constructor
+   * @param manager Maneger Object
+   */
+  ${rtcParam.name}Test(RTC::Manager* manager);
+
+  /*!
+   * @brief destructor
+   */
+  ~${rtcParam.name}Test();
+
+  // <rtc-template block="public_attribute">
+#foreach($publicAttribute in ${rtcParam.publicAttributes})
+  ${publicAttribute}
+#end
+  
+  // </rtc-template>
+
+  // <rtc-template block="public_operation">
+#foreach($publicOperation in ${rtcParam.publicOperations})
+  ${publicOperation}
+#end
+  
+  // </rtc-template>
+
+  /***
+#if(${rtcParam.getDocActionOverView(0).length()}>0)   * ${tmpltHelper.convertDescDoc(${rtcParam.getDocActionOverView(0)})}
+#end
+   *
+   * The initialize action (on CREATED->ALIVE transition)
+   * formaer rtc_init_entry() 
+   *
+   * @return RTC::ReturnCode_t
+   * 
+#if(${rtcParam.getDocActionPreCondition(0).length()}>0)   * @pre ${tmpltHelper.convertPreDoc(${rtcParam.getDocActionPreCondition(0)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(0).length()}>0)   * @post ${tmpltHelper.convertPostDoc(${rtcParam.getDocActionPostCondition(0)})}
+#end
+   * 
+   */
+  #if(${rtcParam.configParams.size()}==0 && ${rtcParam.IsNotImplemented(0)} && ${rtcParam.inports.size()}==0 && ${rtcParam.outports.size()}==0 && ${rtcParam.servicePorts.size()}==0)//#end virtual RTC::ReturnCode_t onInitialize();
+
+  /***
+#if(${rtcParam.getDocActionOverView(0).length()}>0)   * ${tmpltHelper.convertDescDoc(${rtcParam.getDocActionOverView(1)})}
+#end
+   *
+   * The finalize action (on ALIVE->END transition)
+   * formaer rtc_exiting_entry()
+   *
+   * @return RTC::ReturnCode_t
+   * 
+#if(${rtcParam.getDocActionPreCondition(1).length()}>0)   * @pre ${tmpltHelper.convertPreDoc(${rtcParam.getDocActionPreCondition(1)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(1).length()}>0)   * @post ${tmpltHelper.convertPostDoc(${rtcParam.getDocActionPostCondition(1)})}
+#end
+   * 
+   */
+  #if(${rtcParam.IsNotImplemented(1)})//#end virtual RTC::ReturnCode_t onFinalize();
+
+  /***
+#if(${rtcParam.getDocActionOverView(2).length()}>0)   * ${tmpltHelper.convertDescDoc(${rtcParam.getDocActionOverView(2)})}
+#end
+   *
+   * The startup action when ExecutionContext startup
+   * former rtc_starting_entry()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+#if(${rtcParam.getDocActionPreCondition(2).length()}>0)   * @pre ${tmpltHelper.convertPreDoc(${rtcParam.getDocActionPreCondition(2)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(2).length()}>0)   * @post ${tmpltHelper.convertPostDoc(${rtcParam.getDocActionPostCondition(2)})}
+#end
+   * 
+   */
+  #if(${rtcParam.IsNotImplemented(2)})//#end virtual RTC::ReturnCode_t onStartup(RTC::UniqueId ec_id);
+
+  /***
+#if(${rtcParam.getDocActionOverView(3).length()}>0)   * ${tmpltHelper.convertDescDoc(${rtcParam.getDocActionOverView(3)})}
+#end
+   *
+   * The shutdown action when ExecutionContext stop
+   * former rtc_stopping_entry()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+#if(${rtcParam.getDocActionPreCondition(3).length()}>0)   * @pre ${tmpltHelper.convertPreDoc(${rtcParam.getDocActionPreCondition(3)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(3).length()}>0)   * @post ${tmpltHelper.convertPostDoc(${rtcParam.getDocActionPostCondition(3)})}
+#end
+   * 
+   */
+  #if(${rtcParam.IsNotImplemented(3)})//#end virtual RTC::ReturnCode_t onShutdown(RTC::UniqueId ec_id);
+
+  /***
+#if(${rtcParam.getDocActionOverView(4).length()}>0)   * ${tmpltHelper.convertDescDoc(${rtcParam.getDocActionOverView(4)})}
+#end
+   *
+   * The activated action (Active state entry action)
+   * former rtc_active_entry()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+#if(${rtcParam.getDocActionPreCondition(4).length()}>0)   * @pre ${tmpltHelper.convertPreDoc(${rtcParam.getDocActionPreCondition(4)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(4).length()}>0)   * @post ${tmpltHelper.convertPostDoc(${rtcParam.getDocActionPostCondition(4)})}
+#end
+   * 
+   */
+  #if(${rtcParam.IsNotImplemented(4)})//#end virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id);
+
+  /***
+#if(${rtcParam.getDocActionOverView(5).length()}>0)   * ${tmpltHelper.convertDescDoc(${rtcParam.getDocActionOverView(5)})}
+#end
+   *
+   * The deactivated action (Active state exit action)
+   * former rtc_active_exit()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+#if(${rtcParam.getDocActionPreCondition(5).length()}>0)   * @pre ${tmpltHelper.convertPreDoc(${rtcParam.getDocActionPreCondition(5)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(5).length()}>0)   * @post ${tmpltHelper.convertPostDoc(${rtcParam.getDocActionPostCondition(5)})}
+#end
+   * 
+   */
+  #if(${rtcParam.IsNotImplemented(5)})//#end virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id);
+
+  /***
+#if(${rtcParam.getDocActionOverView(9).length()}>0)   * ${tmpltHelper.convertDescDoc(${rtcParam.getDocActionOverView(9)})}
+#end
+   *
+   * The execution action that is invoked periodically
+   * former rtc_active_do()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+#if(${rtcParam.getDocActionPreCondition(9).length()}>0)   * @pre ${tmpltHelper.convertPreDoc(${rtcParam.getDocActionPreCondition(9)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(9).length()}>0)   * @post ${tmpltHelper.convertPostDoc(${rtcParam.getDocActionPostCondition(9)})}
+#end
+   * 
+   */
+  #if(${rtcParam.IsNotImplemented(9)})//#end virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id);
+
+  /***
+#if(${rtcParam.getDocActionOverView(6).length()}>0)   * ${tmpltHelper.convertDescDoc(${rtcParam.getDocActionOverView(6)})}
+#end
+   *
+   * The aborting action when main logic error occurred.
+   * former rtc_aborting_entry()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+#if(${rtcParam.getDocActionPreCondition(6).length()}>0)   * @pre ${tmpltHelper.convertPreDoc(${rtcParam.getDocActionPreCondition(6)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(6).length()}>0)   * @post ${tmpltHelper.convertPostDoc(${rtcParam.getDocActionPostCondition(6)})}
+#end
+   * 
+   */
+  #if(${rtcParam.IsNotImplemented(6)})//#end virtual RTC::ReturnCode_t onAborting(RTC::UniqueId ec_id);
+
+  /***
+#if(${rtcParam.getDocActionOverView(7).length()}>0)   * ${tmpltHelper.convertDescDoc(${rtcParam.getDocActionOverView(7)})}
+#end
+   *
+   * The error action in ERROR state
+   * former rtc_error_do()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+#if(${rtcParam.getDocActionPreCondition(7).length()}>0)   * @pre ${tmpltHelper.convertPreDoc(${rtcParam.getDocActionPreCondition(7)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(7).length()}>0)   * @post ${tmpltHelper.convertPostDoc(${rtcParam.getDocActionPostCondition(7)})}
+#end
+   * 
+   */
+  #if(${rtcParam.IsNotImplemented(7)})//#end virtual RTC::ReturnCode_t onError(RTC::UniqueId ec_id);
+
+  /***
+#if(${rtcParam.getDocActionOverView(8).length()}>0)   * ${tmpltHelper.convertDescDoc(${rtcParam.getDocActionOverView(8)})}
+#end
+   *
+   * 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
+   * 
+#if(${rtcParam.getDocActionPreCondition(8).length()}>0)   * @pre ${tmpltHelper.convertPreDoc(${rtcParam.getDocActionPreCondition(8)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(8).length()}>0)   * @post ${tmpltHelper.convertPostDoc(${rtcParam.getDocActionPostCondition(8)})}
+#end
+   * 
+   */
+  #if(${rtcParam.IsNotImplemented(8)})//#end virtual RTC::ReturnCode_t onReset(RTC::UniqueId ec_id);
+  
+  /***
+#if(${rtcParam.getDocActionOverView(10).length()}>0)   * ${tmpltHelper.convertDescDoc(${rtcParam.getDocActionOverView(10)})}
+#end
+   *
+   * 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
+   * 
+#if(${rtcParam.getDocActionPreCondition(10).length()}>0)   * @pre ${tmpltHelper.convertPreDoc(${rtcParam.getDocActionPreCondition(10)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(10).length()}>0)   * @post ${tmpltHelper.convertPostDoc(${rtcParam.getDocActionPostCondition(10)})}
+#end
+   * 
+   */
+  #if(${rtcParam.IsNotImplemented(10)})//#end virtual RTC::ReturnCode_t onStateUpdate(RTC::UniqueId ec_id);
+
+  /***
+#if(${rtcParam.getDocActionOverView(11).length()}>0)   * ${tmpltHelper.convertDescDoc(${rtcParam.getDocActionOverView(11)})}
+#end
+   *
+   * 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
+   * 
+#if(${rtcParam.getDocActionPreCondition(11).length()}>0)   * @pre ${tmpltHelper.convertPreDoc(${rtcParam.getDocActionPreCondition(11)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(11).length()}>0)   * @post ${tmpltHelper.convertPostDoc(${rtcParam.getDocActionPostCondition(11)})}
+#end
+   * 
+   */
+  #if(${rtcParam.IsNotImplemented(11)})//#end virtual RTC::ReturnCode_t onRateChanged(RTC::UniqueId ec_id);
+
+
+ protected:
+  // <rtc-template block="protected_attribute">
+#foreach($protectedAttribute in ${rtcParam.protectedAttributes})
+  ${protectedAttribute}
+#end
+  
+  // </rtc-template>
+
+  // <rtc-template block="protected_operation">
+#foreach($protectedOperation in ${rtcParam.protectedOperations})
+  ${protectedOperation}
+#end
+  
+  // </rtc-template>
+
+  // Configuration variable declaration
+  // <rtc-template block="config_declare">
+#if( ${rtcParam.configParams.size()} > 0 )
+#foreach($configParam in ${rtcParam.configParams})
+  /*!
+   * ${tmpltHelper.convertDescDoc(${configParam.docDescription})}
+   * - Name: ${configParam.docDataName} ${configParam.tmplVarName}
+   * - DefaultValue: ${configParam.defaultVal}
+#if(${configParam.docUnit.length()}>0)   * - Unit: ${tmpltHelper.convertUnitDoc(${configParam.docUnit})}
+#end
+#if(${configParam.docRange.length()}>0)   * - Range: ${tmpltHelper.convertRangeDoc(${configParam.docRange})}
+#end
+#if(${configParam.docConstraint.length()}>0)   * - Constraint: ${tmpltHelper.convertConstraintDoc(${configParam.docConstraint})}
+#end
+   */
+  ${cXXConv.convConfigSetType(${configParam.type})} ${rtcParam.commonPrefix}${rtcParam.configurationPrefix}${configParam.tmplVarName}${rtcParam.configurationSuffix}${rtcParam.commonSuffix};
+#end
+#end
+
+  // </rtc-template>
+
+  // DataInPort declaration
+  // <rtc-template block="inport_declare">
+#foreach($port in ${rtcParam.outports})
+#if(${port.type}!="")  ${port.type} ${rtcParam.commonPrefix}${rtcParam.dataPortPrefix}${port.tmplVarName}${rtcParam.dataPortSuffix}${rtcParam.commonSuffix};
+  /*!
+#if(${port.docDescription.length()}>0)   * ${tmpltHelper.convertDescDoc(${port.docDescription})}
+#end
+#if(${port.docType.length()}>0)   * - Type: ${tmpltHelper.convertTypeDoc(${port.docType})}
+#end
+#if(${port.docNum.length()}>0)   * - Number: ${tmpltHelper.convertNumberDoc(${port.docNum})}
+#end
+#if(${port.docSemantics.length()}>0)   * - Semantics: ${tmpltHelper.convertSemanticsDoc(${port.docSemantics})}
+#end
+#if(${port.docUnit.length()}>0)   * - Unit: ${tmpltHelper.convertUnitDoc(${port.docUnit})}
+#end
+#if(${port.docOccurrence.length()}>0)   * - Frequency: ${tmpltHelper.convertFrequencyDoc(${port.docOccurrence})}
+#end
+#if(${port.docOperation.length()}>0)   * - Operation Cycle: ${tmpltHelper.convertCycleDoc(${port.docOperation})}
+#end
+   */
+  InPort<${port.type}> ${rtcParam.commonPrefix}${rtcParam.dataPortPrefix}${port.tmplVarName}In${rtcParam.dataPortSuffix}${rtcParam.commonSuffix};
+#end
+#end
+  
+  // </rtc-template>
+
+
+  // DataOutPort declaration
+  // <rtc-template block="outport_declare">
+#foreach($port in ${rtcParam.inports})
+#if(${port.type}!="")  ${port.type} ${rtcParam.commonPrefix}${rtcParam.dataPortPrefix}${port.tmplVarName}${rtcParam.dataPortSuffix}${rtcParam.commonSuffix};
+  /*!
+#if(${port.docDescription.length()}>0)   * ${tmpltHelper.convertDescDoc(${port.docDescription})}
+#end
+#if(${port.docType.length()}>0)   * - Type: ${tmpltHelper.convertTypeDoc(${port.docType})}
+#end
+#if(${port.docNum.length()}>0)   * - Number: ${tmpltHelper.convertNumberDoc(${port.docNum})}
+#end
+#if(${port.docSemantics.length()}>0)   * - Semantics: ${tmpltHelper.convertSemanticsDoc(${port.docSemantics})}
+#end
+#if(${port.docUnit.length()}>0)   * - Unit: ${tmpltHelper.convertUnitDoc(${port.docUnit})}
+#end
+#if(${port.docOccurrence.length()}>0)   * - Frequency: ${tmpltHelper.convertFrequencyDoc(${port.docOccurrence})}
+#end
+#if(${port.docOperation.length()}>0)   * - Operation Cycle: ${tmpltHelper.convertCycleDoc(${port.docOperation})}
+#end
+   */
+  OutPort<${port.type}> ${rtcParam.commonPrefix}${rtcParam.dataPortPrefix}${port.tmplVarName}Out${rtcParam.dataPortSuffix}${rtcParam.commonSuffix};
+#end
+#end
+  
+  // </rtc-template>
+
+  // CORBA Port declaration
+  // <rtc-template block="corbaport_declare">
+#if(${rtcParam.servicePorts.size()}>0)
+#foreach($servicePort in ${rtcParam.servicePorts})
+#if(${servicePort.servicePortInterfaces.size()}>0)
+  /*!
+#if(${servicePort.docDescription.length()}>0)   * ${tmpltHelper.convertDescDoc(${servicePort.docDescription})}
+#end
+#if(${servicePort.docIfDescription.length()}>0)   * Interface: ${tmpltHelper.convertInterfaceDoc(${servicePort.docIfDescription})}
+#end
+   */
+  RTC::CorbaPort ${rtcParam.commonPrefix}${rtcParam.servicePortPrefix}${servicePort.name}Port${rtcParam.servicePortSuffix}${rtcParam.commonSuffix};
+#end#end#end
+  
+  // </rtc-template>
+
+  // Service declaration
+  // <rtc-template block="service_declare">
+#if(${rtcParam.servicePorts.size()}>0)
+#foreach($servicePort in ${rtcParam.servicePorts})
+#if(${servicePort.servicePortInterfaces.size()}>0)
+#foreach($serviceInterface in ${servicePort.servicePortInterfaces})
+#if(${serviceInterface.index}==1)
+  /*!
+#if(${serviceInterface.docDescription.length()}>0)   * ${tmpltHelper.convertDescDoc(${serviceInterface.docDescription})}
+#end
+#if(${serviceInterface.docArgument.length()}>0)   * - Argument:      ${tmpltHelper.convertInterfaceDetailDoc(${serviceInterface.docArgument})}
+#end
+#if(${serviceInterface.docReturn.length()}>0)   * - Return Value:  ${tmpltHelper.convertInterfaceDetailDoc(${serviceInterface.docReturn})}
+#end
+#if(${serviceInterface.docException.length()}>0)   * - Exception:     ${tmpltHelper.convertInterfaceDetailDoc(${serviceInterface.docException})}
+#end
+#if(${serviceInterface.docPreCondition.length()}>0)   * - PreCondition:  ${tmpltHelper.convertInterfaceDetailDoc(${serviceInterface.docPreCondition})}
+#end
+#if(${serviceInterface.docPostCondition.length()}>0)   * - PostCondition: ${tmpltHelper.convertInterfaceDetailDoc(${serviceInterface.docPostCondition})}
+#end
+   */
+  ${serviceInterface.interfaceRawType}${tmpltHelper.serviceImplSuffix} ${rtcParam.commonPrefix}${rtcParam.serviceIFPrefix}${serviceInterface.tmplVarName}${rtcParam.serviceIFSuffix}${rtcParam.commonSuffix};
+#end#end#end#end#end
+  
+  // </rtc-template>
+
+  // Consumer declaration
+  // <rtc-template block="consumer_declare">
+#if(${rtcParam.servicePorts.size()}>0)
+#foreach($servicePort in ${rtcParam.servicePorts})
+#if(${servicePort.servicePortInterfaces.size()}>0)
+#foreach($serviceInterface in ${servicePort.servicePortInterfaces})
+#if(${serviceInterface.index}==0)
+  /*!
+#if(${serviceInterface.docDescription.length()}>0)   * ${tmpltHelper.convertDescDoc(${serviceInterface.docDescription})}
+#end
+#if(${serviceInterface.docArgument.length()}>0)   * - Argument:      ${tmpltHelper.convertInterfaceDetailDoc(${serviceInterface.docArgument})}
+#end
+#if(${serviceInterface.docReturn.length()}>0)   * - Return Value:  ${tmpltHelper.convertInterfaceDetailDoc(${serviceInterface.docReturn})}
+#end
+#if(${serviceInterface.docException.length()}>0)   * - Exception:     ${tmpltHelper.convertInterfaceDetailDoc(${serviceInterface.docException})}
+#end
+#if(${serviceInterface.docPreCondition.length()}>0)   * - PreCondition:  ${tmpltHelper.convertInterfaceDetailDoc(${serviceInterface.docPreCondition})}
+#end
+#if(${serviceInterface.docPostCondition.length()}>0)   * - PostCondition: ${tmpltHelper.convertInterfaceDetailDoc(${serviceInterface.docPostCondition})}
+#end
+   */
+  RTC::CorbaConsumer<${serviceInterface.interfaceType}> ${rtcParam.commonPrefix}${rtcParam.serviceIFPrefix}${serviceInterface.tmplVarName}${rtcParam.serviceIFSuffix}${rtcParam.commonSuffix};
+#end#end#end#end#end
+  
+  // </rtc-template>
+
+ private:
+  // <rtc-template block="private_attribute">
+#foreach($privateAttribute in ${rtcParam.privateAttributes})
+  ${privateAttribute}
+#end
+  
+  // </rtc-template>
+
+  // <rtc-template block="private_operation">
+#foreach($privateOperation in ${rtcParam.privateOperations})
+  ${privateOperation}
+#end
+  
+  // </rtc-template>
+
+};
+
+
+extern "C"
+{
+  DLL_EXPORT void ${rtcParam.name}TestInit(RTC::Manager* manager);
+};
+
+#endif // ${rtcParam.name.toUpperCase()}_TEST_H

Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/test/CXX_Test_SVC.cpp.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/test/CXX_Test_SVC.cpp.vsl	                        (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/test/CXX_Test_SVC.cpp.vsl	2018-01-23 13:50:28 UTC (rev 795)
@@ -0,0 +1,50 @@
+// -*-C++-*-
+/*!
+ * @file  ${idlFileParam.idlFileNoExt}${tmpltHelper.serviceImplSuffix}.cpp
+ * @brief Service implementation code of ${idlFileParam.idlFile}
+#parse("${template}/cpp/_doc.vsl")
+ */
+
+${sharp}include "${idlFileParam.idlFileNoExt}${tmpltHelper.serviceImplSuffix}.h"
+
+#foreach($serviceClassParam in ${idlFileParam.testServiceClassParams})
+/*
+ * Example implementational code for IDL interface ${cXXConv.convertDelimiter(${serviceClassParam.name})}
+ */
+${tmpltHelper.getBasename2(${serviceClassParam.name})}${tmpltHelper.serviceImplSuffix}::${tmpltHelper.getBasename2(${serviceClassParam.name})}${tmpltHelper.serviceImplSuffix}()
+{
+  // Please add extra constructor code here.
+}
+
+
+${tmpltHelper.getBasename2(${serviceClassParam.name})}${tmpltHelper.serviceImplSuffix}::~${tmpltHelper.getBasename2(${serviceClassParam.name})}${tmpltHelper.serviceImplSuffix}()
+{
+  // Please add extra destructor code here.
+}
+
+
+/*
+ * Methods corresponding to IDL attributes and operations
+ */
+#foreach($serviceMethodParam in ${serviceClassParam.methods})
+${cXXConv.convCpp2CORBA(${serviceMethodParam})} ${tmpltHelper.getBasename2(${serviceClassParam.name})}${tmpltHelper.serviceImplSuffix}::${serviceMethodParam.name}(#foreach($serviceArgumentParam in ${serviceMethodParam.arguments})#if($velocityCount > 1), #end${cXXConv.convCpp2CORBAforArg(${serviceArgumentParam})} ${serviceArgumentParam.name}#end)
+{
+#if(${serviceMethodParam.isResult})	${cXXConv.convCpp2CORBA(${serviceMethodParam})} result;
+#end
+  // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+  #warning "Code missing in function <${cXXConv.convCpp2CORBA(${serviceMethodParam})} ${tmpltHelper.getBasename2(${serviceClassParam.name})}${tmpltHelper.serviceImplSuffix}::${serviceMethodParam.name}(#foreach($serviceArgumentParam in ${serviceMethodParam.arguments})#if($velocityCount > 1), #end${cXXConv.convCpp2CORBAforArg(${serviceArgumentParam})} ${serviceArgumentParam.name}#end)>"
+#endif
+#if(${serviceMethodParam.isResult})  return result;
+#elseif(!${serviceMethodParam.isVoid})  return 0;
+#end
+}
+
+#end
+
+
+// End of example implementational code
+
+#end
+
+

Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/test/CXX_Test_SVC.h.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/test/CXX_Test_SVC.h.vsl	                        (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/test/CXX_Test_SVC.h.vsl	2018-01-23 13:50:28 UTC (rev 795)
@@ -0,0 +1,55 @@
+// -*-C++-*-
+/*!
+ * @file  ${tmpltHelper.getBasename2(${idlFileParam.idlFileNoExt})}${tmpltHelper.serviceImplSuffix}.h
+ * @brief Service implementation header of ${idlFileParam.idlFile}
+#parse("${template}/cpp/_doc.vsl")
+ */
+
+#if (${idlFileParam.includeIdlParams.size()} > 0)
+#foreach ($idl in ${idlFileParam.includeIdlParams})
+${sharp}include "${idl.idlFileNoExt}${tmpltHelper.serviceSkelSuffix}.h"
+#end
+
+#end
+${sharp}include "${idlFileParam.idlFileNoExt}${tmpltHelper.serviceSkelSuffix}.h"
+
+#ifndef ${idlFileParam.idlFileNoExt.toUpperCase()}${tmpltHelper.serviceImplSuffix.toUpperCase()}_H
+${sharp}define ${idlFileParam.idlFileNoExt.toUpperCase()}${tmpltHelper.serviceImplSuffix.toUpperCase()}_H
+ 
+#foreach($serviceClassParam in ${idlFileParam.testServiceClassParams})
+/*!
+ * @class ${tmpltHelper.getBasename2(${serviceClassParam.name})}${tmpltHelper.serviceImplSuffix}
+ * Example class implementing IDL interface ${cXXConv.convertDelimiter(${serviceClassParam.name})}
+ */
+class ${tmpltHelper.getBasename2(${serviceClassParam.name})}${tmpltHelper.serviceImplSuffix}
+ : public virtual POA_${cXXConv.convertDelimiter(${serviceClassParam.name})},
+   public virtual PortableServer::RefCountServantBase
+{
+ private:
+   // Make sure all instances are built on the heap by making the
+   // destructor non-public
+   //virtual ~${tmpltHelper.getBasename2(${serviceClassParam.name})}${tmpltHelper.serviceImplSuffix}();
+
+ public:
+  /*!
+   * @brief standard constructor
+   */
+   ${tmpltHelper.getBasename2(${serviceClassParam.name})}${tmpltHelper.serviceImplSuffix}();
+  /*!
+   * @brief destructor
+   */
+   virtual ~${tmpltHelper.getBasename2(${serviceClassParam.name})}${tmpltHelper.serviceImplSuffix}();
+
+   // attributes and operations
+#foreach($serviceMethodParam in ${serviceClassParam.methods})
+   ${cXXConv.convCpp2CORBA(${serviceMethodParam})} ${serviceMethodParam.name}(#foreach($serviceArgumentParam in ${serviceMethodParam.arguments})#if($velocityCount > 1), #end${cXXConv.convCpp2CORBAforArg(${serviceArgumentParam})} ${serviceArgumentParam.name}#end);
+#end
+
+};
+
+#end
+
+
+#endif // ${idlFileParam.idlFileNoExt.toUpperCase()}${tmpltHelper.serviceImplSuffix.toUpperCase()}_H
+
+



More information about the openrtm-commit mailing list