h3. ModuleName.java の変点
@@ -13,26 +13,27 @@
import jp.go.aist.rtm.RTC.RegisterModuleFunc;
import jp.go.aist.rtm.RTC.util.Properties;
-/*!
- * @class ModuleName
- * @brief ModuleDescription
+/**
+ * ModuleName
+ *
+ * ModuleDescription
*/
public class ModuleName implements RtcNewFunc, RtcDeleteFunc, RegisterModuleFunc {
// Module specification
//
public static String component_conf[] = {
- "implementation_id", "ModuleName",
- "type_name", "ModuleName",
- "description", "ModuleDescription",
- "version", "1.0.0",
- "vendor", "VenderName",
- "category", "Category",
- "activity_type", "STATIC",
- "max_instance", "1",
- "language", "Java",
- "lang_type", "compile",
- ""
+ "implementation_id", "ModuleName",
+ "type_name", "ModuleName",
+ "description", "ModuleDescription",
+ "version", "1.0.0",
+ "vendor", "VenderName",
+ "category", "Category",
+ "activity_type", "STATIC",
+ "max_instance", "1",
+ "language", "Java",
+ "lang_type", "compile",
+ ""
};
//
h3. ModuleNameComp.java の変点
@@ -12,9 +12,10 @@
import jp.go.aist.rtm.RTC.RTObject_impl;
import jp.go.aist.rtm.RTC.util.Properties;
-/*!
- * @class ModuleNameComp
- * @brief Standalone component Class
+/**
+ * ModuleNameComp
+ *
+ * Standalone component Class
*
*/
public class ModuleNameComp implements ModuleInitProc {
@@ -26,8 +27,8 @@
// Create a component
RTObject_impl comp = mgr.createComponent("ModuleName");
if( comp==null ) {
- System.err.println("Component create failed.");
- System.exit(0);
+ System.err.println("Component create failed.");
+ System.exit(0);
}
// Example
@@ -81,7 +82,7 @@
// Initialize manager
final Manager manager = Manager.init(args);
- // Set module initialization proceduer
+ // Set module initialization procedure
// This procedure will be invoked in activateManager() function.
ModuleNameComp init = new ModuleNameComp();
manager.setModuleInitProc(init);
h3. ModuleNameImpl.java の変点
@@ -25,18 +25,19 @@
import org.omg.PortableServer.POAPackage.WrongPolicy;
import RTC.ReturnCode_t;
-/*!
- * @class ModuleNameImpl
- * @brief ModuleDescription
+/**
+ * ModuleNameImpl
+ *
+ * ModuleDescription
*
*/
public class ModuleNameImpl extends DataFlowComponentBase {
- /*!
- * @brief constructor
- * @param manager Maneger Object
+ /**
+ * constructor
+ * @param manager Manager Object
*/
- public ModuleNameImpl(Manager manager) {
+ public ModuleNameImpl(Manager manager) {
super(manager);
//
m_sen_val = new TimedString();
@@ -53,8 +54,8 @@
/**
*
- * The initialize action (on CREATED->ALIVE transition)
- * formaer rtc_init_entry()
+ * The initialize action (on CREATED->ALIVE transition)
+ * former rtc_init_entry()
*
* @return RTC::ReturnCode_t
*
@@ -72,7 +73,7 @@
// Set service provider to Ports
try {
- m_sv_namePort.registerProvider("if_name", "MyService", m_if_name);
+ m_sv_namePort.registerProvider("if_name", "MyService", m_if_name);
} catch (ServantAlreadyActive e) {
e.printStackTrace();
} catch (WrongPolicy e) {
@@ -89,10 +90,10 @@
return super.onInitialize();
}
- /***
+ /**
*
- * The finalize action (on ALIVE->END transition)
- * formaer rtc_exiting_entry()
+ * The finalize action (on ALIVE->END transition)
+ * former rtc_exiting_entry()
*
* @return RTC::ReturnCode_t
*
@@ -103,7 +104,7 @@
// return super.onFinalize();
// }
- /***
+ /**
*
* The startup action when ExecutionContext startup
* former rtc_starting_entry()
@@ -119,7 +120,7 @@
// return super.onStartup(ec_id);
// }
- /***
+ /**
*
* The shutdown action when ExecutionContext stop
* former rtc_stopping_entry()
@@ -135,7 +136,7 @@
// return super.onShutdown(ec_id);
// }
- /***
+ /**
*
* The activated action (Active state entry action)
* former rtc_active_entry()
@@ -151,7 +152,7 @@
// return super.onActivated(ec_id);
// }
- /***
+ /**
*
* The deactivated action (Active state exit action)
* former rtc_active_exit()
@@ -167,7 +168,7 @@
// return super.onDeactivated(ec_id);
// }
- /***
+ /**
*
* The execution action that is invoked periodically
* former rtc_active_do()
@@ -183,7 +184,7 @@
// return super.onExecute(ec_id);
// }
- /***
+ /**
*
* The aborting action when main logic error occurred.
* former rtc_aborting_entry()
@@ -199,7 +200,7 @@
// return super.onAborting(ec_id);
// }
- /***
+ /**
*
* The error action in ERROR state
* former rtc_error_do()
@@ -215,7 +216,7 @@
// return super.onError(ec_id);
// }
- /***
+ /**
*
* The reset action that is invoked resetting
* This is same but different the former rtc_init_entry()
@@ -231,7 +232,7 @@
// return super.onReset(ec_id);
// }
- /***
+ /**
*
* The state update action that is invoked after onExecute() action
* no corresponding operation exists in OpenRTm-aist-0.2.0
@@ -247,7 +248,7 @@
// return super.onStateUpdate(ec_id);
// }
- /***
+ /**
*
* The action that is invoked when execution context's rate is changed
* no corresponding operation exists in OpenRTm-aist-0.2.0
@@ -262,7 +263,9 @@
// protected ReturnCode_t onRateChanged(int ec_id) {
// return super.onRateChanged(ec_id);
// }
-//
+
+ /**
+ */
// DataInPort declaration
//
protected TimedString m_sen_val;
@@ -307,55 +310,55 @@
//
- private void initializeParam(Object target) {
- Class> targetClass = target.getClass();
- ClassLoader loader = target.getClass().getClassLoader();
- //
- Field[] fields = targetClass.getFields();
- for(Field field : fields) {
- if(field.getType().isPrimitive()) continue;
-
- try {
- if(field.getType().isArray()) {
- Object arrayValue = null;
- Class> clazz = null;
- if(field.getType().getComponentType().isPrimitive()) {
- clazz = field.getType().getComponentType();
- } else {
- clazz = loader.loadClass(field.getType().getComponentType().getName());
- }
- arrayValue = Array.newInstance(clazz, 0);
- field.set(target, arrayValue);
-
- } else {
- Constructor>[] constList = field.getType().getConstructors();
- if(constList.length==0) {
- Method[] methodList = field.getType().getMethods();
- for(Method method : methodList) {
- if(method.getName().equals("from_int")==false) continue;
- Object objFld = method.invoke(target, new Object[]{ new Integer(0) });
- field.set(target, objFld);
- break;
- }
-
- } else {
- Class> classFld = Class.forName(field.getType().getName(), true, loader);
- Object objFld = classFld.newInstance();
- initializeParam(objFld);
- field.set(target, objFld);
- }
- }
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- } catch (InstantiationException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (IllegalArgumentException e) {
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- e.printStackTrace();
- }
- }
- }
+ private void initializeParam(Object target) {
+ Class> targetClass = target.getClass();
+ ClassLoader loader = target.getClass().getClassLoader();
+ //
+ Field[] fields = targetClass.getFields();
+ for(Field field : fields) {
+ if(field.getType().isPrimitive()) continue;
+
+ try {
+ if(field.getType().isArray()) {
+ Object arrayValue = null;
+ Class> clazz = null;
+ if(field.getType().getComponentType().isPrimitive()) {
+ clazz = field.getType().getComponentType();
+ } else {
+ clazz = loader.loadClass(field.getType().getComponentType().getName());
+ }
+ arrayValue = Array.newInstance(clazz, 0);
+ field.set(target, arrayValue);
+
+ } else {
+ Constructor>[] constList = field.getType().getConstructors();
+ if(constList.length==0) {
+ Method[] methodList = field.getType().getMethods();
+ for(Method method : methodList) {
+ if(method.getName().equals("from_int")==false) continue;
+ Object objFld = method.invoke(target, new Object[]{ new Integer(0) });
+ field.set(target, objFld);
+ break;
+ }
+
+ } else {
+ Class> classFld = Class.forName(field.getType().getName(), true, loader);
+ Object objFld = classFld.newInstance();
+ initializeParam(objFld);
+ field.set(target, objFld);
+ }
+ }
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ } catch (InstantiationException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ }
+ }
}
h3. MyServiceSVC_impl の変点
@@ -4,8 +4,9 @@
* @brief Service implementation code of MyService.idl
*
*/
-/*!
- * @class MyServiceSVC_impl
+/**
+ * MyServiceSVC_impl
+ *
* Example class implementing IDL interface MyService
*/
public class MyServiceSVC_impl extends MyServicePOA{