[openrtm-commit:01561] r535 - in trunk/rtmtools: jp.go.aist.rtm.nameserviceview/META-INF jp.go.aist.rtm.nameserviceview.nl1/META-INF jp.go.aist.rtm.repositoryView/META-INF jp.go.aist.rtm.repositoryView.nl1/META-INF jp.go.aist.rtm.rtcbuilder/META-INF jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/corba/idl/parser jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/idl jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/manager jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp jp.go.aist.rtm.rtcbuilder.java/META-INF jp.go.aist.rtm.rtcbuilder.java/src/jp/go/aist/rtm/rtcbuilder/java/manager jp.go.aist.rtm.rtcbuilder.nl1/META-INF jp.go.aist.rtm.rtcbuilder.python/META-INF jp.go.aist.rtm.rtcbuilder.python/src/jp/go/aist/rtm/rtcbuilder/python/manager jp.go.aist.rtm.systemeditor/META-INF jp.go.aist.rtm.systemeditor.nl1/META-INF jp.go.aist.rtm.toolscommon/META-INF jp.go.aist.rtm.toolscommon.nl1/META-INF jp.go.aist.rtm.toolscommon.profiles/META-INF jp.go.aist.rtm.toolscommon.profiles.nl1/META-INF
openrtm @ openrtm.org
openrtm @ openrtm.org
2015年 6月 17日 (水) 12:16:20 JST
Author: hara
Date: 2015-06-17 12:16:20 +0900 (Wed, 17 Jun 2015)
New Revision: 535
Modified:
trunk/rtmtools/jp.go.aist.rtm.nameserviceview.nl1/META-INF/MANIFEST.MF
trunk/rtmtools/jp.go.aist.rtm.nameserviceview/META-INF/MANIFEST.MF
trunk/rtmtools/jp.go.aist.rtm.repositoryView.nl1/META-INF/MANIFEST.MF
trunk/rtmtools/jp.go.aist.rtm.repositoryView/META-INF/MANIFEST.MF
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.java/META-INF/MANIFEST.MF
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.java/src/jp/go/aist/rtm/rtcbuilder/java/manager/JavaConverter.java
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.nl1/META-INF/MANIFEST.MF
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/META-INF/MANIFEST.MF
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/src/jp/go/aist/rtm/rtcbuilder/python/manager/PythonGenerateManager.java
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/META-INF/MANIFEST.MF
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/Generator.java
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/corba/idl/parser/IDLParser.java
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/IDLParamConverter.java
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/idl/ServiceArgumentParam.java
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/idl/ServiceMethodParam.java
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/idl/TypeDefParam.java
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/template/TemplateHelper.java
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/CXX_SVC.cpp.vsl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/CXX_SVC.h.vsl
trunk/rtmtools/jp.go.aist.rtm.systemeditor.nl1/META-INF/MANIFEST.MF
trunk/rtmtools/jp.go.aist.rtm.systemeditor/META-INF/MANIFEST.MF
trunk/rtmtools/jp.go.aist.rtm.toolscommon.nl1/META-INF/MANIFEST.MF
trunk/rtmtools/jp.go.aist.rtm.toolscommon.profiles.nl1/META-INF/MANIFEST.MF
trunk/rtmtools/jp.go.aist.rtm.toolscommon.profiles/META-INF/MANIFEST.MF
trunk/rtmtools/jp.go.aist.rtm.toolscommon/META-INF/MANIFEST.MF
Log:
Modified IDLParamConverter and the SVC_impl Generators(for C++, Python, Java)
Modified: trunk/rtmtools/jp.go.aist.rtm.nameserviceview/META-INF/MANIFEST.MF
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.nameserviceview/META-INF/MANIFEST.MF 2015-06-14 01:21:51 UTC (rev 534)
+++ trunk/rtmtools/jp.go.aist.rtm.nameserviceview/META-INF/MANIFEST.MF 2015-06-17 03:16:20 UTC (rev 535)
@@ -24,6 +24,6 @@
Bundle-ActivationPolicy: lazy
Bundle-Activator: jp.go.aist.rtm.nameserviceview.NameServiceViewPlugin
Eclipse-BuddyPolicy: registered
-Built-By: n-ando
-Built-Date: 2013/01/25 00:47:24
+Built-By: isao-hara
+Built-Date: 2015/06/17 08:34:01
Modified: trunk/rtmtools/jp.go.aist.rtm.nameserviceview.nl1/META-INF/MANIFEST.MF
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.nameserviceview.nl1/META-INF/MANIFEST.MF 2015-06-14 01:21:51 UTC (rev 534)
+++ trunk/rtmtools/jp.go.aist.rtm.nameserviceview.nl1/META-INF/MANIFEST.MF 2015-06-17 03:16:20 UTC (rev 535)
@@ -6,6 +6,6 @@
Bundle-SymbolicName: jp.go.aist.rtm.nameserviceview.nl1
Bundle-Version: 1.1.0.rc4v20130124
Fragment-Host: jp.go.aist.rtm.nameserviceview;bundle-version="1.1.0"
-Built-By: n-ando
-Built-Date: 2013/01/25 00:47:27
+Built-By: isao-hara
+Built-Date: 2015/06/17 08:34:34
Modified: trunk/rtmtools/jp.go.aist.rtm.repositoryView/META-INF/MANIFEST.MF
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.repositoryView/META-INF/MANIFEST.MF 2015-06-14 01:21:51 UTC (rev 534)
+++ trunk/rtmtools/jp.go.aist.rtm.repositoryView/META-INF/MANIFEST.MF 2015-06-17 03:16:20 UTC (rev 535)
@@ -17,6 +17,6 @@
Bundle-ClassPath: lib/rtrepository_local-1.0.jar,.
Bundle-Vendor: %providerName
Eclipse-BuddyPolicy: registered
-Built-By: n-ando
-Built-Date: 2013/01/25 00:47:21
+Built-By: isao-hara
+Built-Date: 2015/06/17 08:33:28
Modified: trunk/rtmtools/jp.go.aist.rtm.repositoryView.nl1/META-INF/MANIFEST.MF
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.repositoryView.nl1/META-INF/MANIFEST.MF 2015-06-14 01:21:51 UTC (rev 534)
+++ trunk/rtmtools/jp.go.aist.rtm.repositoryView.nl1/META-INF/MANIFEST.MF 2015-06-17 03:16:20 UTC (rev 535)
@@ -7,6 +7,6 @@
Bundle-Version: 1.1.0.rc4v20130124
Fragment-Host: jp.go.aist.rtm.repositoryView;bundle-version="1.1.0"
Bundle-Vendor: AIST
-Built-By: n-ando
-Built-Date: 2013/01/25 00:47:24
+Built-By: isao-hara
+Built-Date: 2015/06/17 08:33:56
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/META-INF/MANIFEST.MF
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/META-INF/MANIFEST.MF 2015-06-14 01:21:51 UTC (rev 534)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/META-INF/MANIFEST.MF 2015-06-17 03:16:20 UTC (rev 535)
@@ -29,6 +29,6 @@
Bundle-ActivationPolicy: lazy
Bundle-Activator: jp.go.aist.rtm.rtcbuilder.RtcBuilderPlugin
Eclipse-BuddyPolicy: registered
-Built-By: n-ando
-Built-Date: 2013/01/25 00:47:05
+Built-By: isao-hara
+Built-Date: 2015/06/17 08:31:26
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/Generator.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/Generator.java 2015-06-14 01:21:51 UTC (rev 534)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/Generator.java 2015-06-17 03:16:20 UTC (rev 535)
@@ -368,11 +368,37 @@
private List<ServiceClassParam> convertType(List<ServiceClassParam> source, List<TypeDefParam> types) {
for(int idxParent=0;idxParent<types.size();idxParent++) {
+ TypeDefParam cur = types.get(idxParent);
String target = types.get(idxParent).getOriginalDef();
- checkTypeAtt(target, types.get(idxParent), types);
- for(int idxChild=0; idxChild<types.get(idxParent).getChildType().size(); idxChild++) {
- checkTypeAtt(types.get(idxParent).getChildType().get(idxChild), types.get(idxParent), types);
+ //// for struct...
+ if (cur.isStruct()){
+ for(String chld : cur.getChildType()){
+ TypeDefParam tdp2 = findTypeDefParam(chld, types);
+ if(tdp2 != null){
+
+ if(!cur.isSequence()){ cur.setSequence(tdp2.isSequence()); }
+ if(!cur.isUnbounded()) {
+ cur.setUnbounded( isUnboundedTypeDef(chld, types));
+
+ }
+ }
+ }
}
+ /// for typedef
+ if (cur.isAlias()){
+ TypeDefParam tdp = findTypeDefParam(target , types) ;
+ if(tdp != null){
+ //// Copy Attributs
+ if(!cur.isSequence()){ cur.setSequence(tdp.isSequence()); }
+ if(!cur.isUnbounded()) {
+ cur.setUnbounded( isUnboundedTypeDef(cur.getTargetDef(), types));
+ }
+ cur.setStruct(tdp.isStruct());
+ cur.setInterface(tdp.isInterface());
+ cur.setOriginalDef(tdp.getTargetDef());
+ }
+
+ }
}
for( ServiceClassParam target : source) {
@@ -386,15 +412,38 @@
return source;
}
- private void checkTypeAtt(String target, TypeDefParam source, List<TypeDefParam> types) {
+ private TypeDefParam findTypeDefParam(String name, List<TypeDefParam> types) {
for(int index=0;index<types.size();index++) {
- if( target.equals(types.get(index).getTargetDef()) ) {
- source.setSequence(types.get(index).isSequence());
- source.setString(types.get(index).isString());
- break;
+ TypeDefParam tdp = types.get(index);
+ if( name.equals(tdp.getTargetDef()) ) {
+ return tdp;
}
}
+ return null;
}
+
+ private boolean isUnboundedTypeDef(String name, List<TypeDefParam> types) {
+ TypeDefParam cur = findTypeDefParam(name, types);
+
+ if(cur != null){
+ if(cur.isUnbounded() || cur.isSequence()) {
+ return true;
+
+ }else{
+ if (cur.isAlias()){
+ return isUnboundedTypeDef(cur.getOriginalDef(), types);
+
+ }
+ if (cur.isStruct()){
+ for(String chld : cur.getChildType()){
+ if( isUnboundedTypeDef(chld, types) ){ return true; }
+ }
+ }
+ }
+ }
+ return false;
+ }
+
private void checkMethodType(ServiceMethodParam target, List<TypeDefParam> types) {
String targetFull = target.getModule() + target.getType();
//
@@ -405,13 +454,15 @@
} else {
defFull = tdparam.getTargetDef();
}
-// if(target.getType().equals(tdparam.getTargetDef())) {
if(targetFull.equals(defFull)) {
target.setSequence(tdparam.isSequence());
- target.setString(tdparam.isString());
- target.setChildString(tdparam.isChildString());
target.setArray(tdparam.isArray());
- target.setStruct(tdparam.isStruct() || tdparam.isEnum());
+ target.setArrayDim(tdparam.getArrayDim());
+ target.setStruct(tdparam.isStruct());
+ target.setOriginalType(tdparam.getOriginalDef());
+ target.setUnbounded(tdparam.isUnbounded());
+ target.setAlias(tdparam.isAlias());
+ target.setInterface(tdparam.isInterface());
break;
}
}
@@ -427,13 +478,14 @@
defFull = tdparam.getTargetDef();
}
if(targetFull.equals(defFull)) {
- target.setOriginalType(target.getType());
- target.setUnbounded(tdparam.isSequence() || tdparam.isString());
+ target.setOriginalType(tdparam.getOriginalDef());
+ target.setUnbounded(tdparam.isSequence() || tdparam.isUnbounded());
target.setArray(tdparam.isArray());
- target.setInnerArray(tdparam.isInnerArray());
+ target.setArrayDim(tdparam.getArrayDim());
target.setStruct(tdparam.isStruct());
- target.setEnum(tdparam.isEnum());
- target.setChildDouble(tdparam.isChildDouble());
+ target.setInterface(tdparam.isInterface());
+ target.setAlias(tdparam.isAlias());
+ target.setSequence(tdparam.isSequence());
target.setType(checkType(target.getType(), types));
return;
}
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/corba/idl/parser/IDLParser.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/corba/idl/parser/IDLParser.java 2015-06-14 01:21:51 UTC (rev 534)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/corba/idl/parser/IDLParser.java 2015-06-17 03:16:20 UTC (rev 535)
@@ -2865,6 +2865,7 @@
private int[] jj_lasttokens = new int[100];
private int jj_endpos;
+ @SuppressWarnings("unchecked")
private void jj_add_error_token(int kind, int pos) {
if (pos >= 100) return;
if (pos == jj_endpos + 1) {
@@ -2893,6 +2894,7 @@
}
}
+ @SuppressWarnings("unchecked")
public ParseException generateParseException() {
jj_expentries.removeAllElements();
boolean[] la1tokens = new boolean[78];
@@ -2986,6 +2988,7 @@
}
class JTBToolkit {
+ @SuppressWarnings("unchecked")
static NodeToken makeNodeToken(Token t) {
NodeToken node = new NodeToken(t.image.intern(), t.kind, t.beginLine, t.beginColumn, t.endLine, t.endColumn);
@@ -3000,7 +3003,7 @@
temp.addElement(new NodeToken(t.image.intern(), t.kind, t.beginLine, t.beginColumn, t.endLine, t.endColumn));
}
- // Reverse the special token list
+ // Reverse the special token list
for ( int i = temp.size() - 1; i >= 0; --i )
node.addSpecial((NodeToken)temp.elementAt(i));
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/IDLParamConverter.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/IDLParamConverter.java 2015-06-14 01:21:51 UTC (rev 534)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/IDLParamConverter.java 2015-06-17 03:16:20 UTC (rev 535)
@@ -145,7 +145,7 @@
moduleName = new ArrayList<String>();
spec.accept(new GJVoidDepthFirst<String>() {
-
+
@Override
public void visit(module n, String argu) {
moduleName.add(node2String(n.identifier.nodeToken));
@@ -163,48 +163,22 @@
@Override
public void visit(interface_dcl n, String argu) {
final String ifname = n.interface_header.identifier.nodeToken.tokenImage;
+ final TypeDefParam tdparam = new TypeDefParam();
+ tdparam.setModuleName(getModuleNames());
+ tdparam.setInterface(true);
+ tdparam.setTargetDef(ifname);
+ result.add(tdparam);
+
n.interface_body.accept(new GJVoidDepthFirst<String>() {
@Override
public void visit(type_declarator n, String argu) {
final TypeDefParam tdparam = new TypeDefParam();
tdparam.setModuleName(getModuleNames());
- n.declarators.accept(new DepthFirstVisitor(){
- @Override
- public void visit(identifier n) {
- tdparam.setScopedName(ifname);
- tdparam.setTargetDef(node2String(n));
- }
- @Override
- public void visit(array_declarator n) {
- tdparam.setArray(true);
- }
- });
- n.type_spec.accept(new DepthFirstVisitor(){
- @Override
- public void visit(simple_type_spec n) {
- n.nodeChoice.accept(new DepthFirstVisitor(){
- @Override
- public void visit(simple_type_spec n) {
- tdparam.setOriginalDef(node2String(n));
- tdparam.setSequence(true);
- }
- @Override
- public void visit(base_type_spec n) {
- tdparam.setOriginalDef(node2String(n));
-
- }
- @Override
- public void visit(scoped_name n) {
- tdparam.setOriginalDef(node2String(n));
- }
- @Override
- public void visit(array_declarator n) {
- tdparam.setArray(true);
- }
- });
-
- }
- });
+ tdparam.setAlias(true);
+
+ n.declarators.accept(new DepthFirstDeclaratorsVisitor(tdparam, ifname));
+ n.type_spec.accept(new DepthFirstTypeSpecVisitor(tdparam));
+
result.add(tdparam);
}
}, null);
@@ -220,21 +194,8 @@
tdparam.setTargetDef(node2String(n));
}
});
- n.member_list.accept(new DepthFirstVisitor(){
- @Override
- public void visit(simple_type_spec n) {
- tdparam.getChildType().add(node2String(n));
- if(node2String(n).toLowerCase().equals("string") ) {
- tdparam.setChildString(true);
- } else if(node2String(n).toLowerCase().equals("double") ) {
- tdparam.setChildDouble(true);
- }
- }
- @Override
- public void visit(array_declarator n) {
- tdparam.setInnerArray(true);
- }
- });
+ n.member_list.accept(new DepthFirstStructMemberVisitor(tdparam));
+
result.add(tdparam);
}
@Override
@@ -254,58 +215,10 @@
public void visit(type_declarator n, String argu) {
final TypeDefParam tdparam = new TypeDefParam();
tdparam.setModuleName(getModuleNames());
- n.declarators.accept(new DepthFirstVisitor(){
- @Override
- public void visit(identifier n) {
- tdparam.setTargetDef(node2String(n));
- }
- @Override
- public void visit(array_declarator n) {
- tdparam.setArray(true);
- n.identifier.accept(new DepthFirstVisitor(){
- @Override
- public void visit(identifier n) {
- tdparam.setTargetDef(node2String(n));
- }
- });
- }
- });
- n.type_spec.accept(new DepthFirstVisitor(){
- @Override
- public void visit(simple_type_spec n) {
- n.nodeChoice.accept(new DepthFirstVisitor(){
- @Override
- public void visit(simple_type_spec n) {
- tdparam.setOriginalDef(node2String(n));
- tdparam.setSequence(true);
- }
- @Override
- public void visit(base_type_spec n) {
- tdparam.setOriginalDef(node2String(n));
- }
- @Override
- public void visit(scoped_name n) {
- tdparam.setOriginalDef(node2String(n));
- }
- @Override
- public void visit(string_type n) {
- n.nodeChoice.accept(new DepthFirstVisitor(){
- @Override
- public void visit(NodeToken n) {
- if(node2String(n).toLowerCase().equals("string") ) {
- tdparam.setOriginalDef("string");
- tdparam.setString(true);
- } else if(node2String(n).toLowerCase().equals("wstring") ) {
- tdparam.setOriginalDef("wstring");
- tdparam.setString(true);
- }
- }
- });
- }
- });
-
- }
- });
+
+ n.declarators.accept(new DepthFirstDeclaratorsVisitor(tdparam));
+ n.type_spec.accept(new DepthFirstTypeSpecVisitor(tdparam));
+
result.add(tdparam);
}
}, null);
@@ -377,6 +290,7 @@
this.results = results;
}
+ @SuppressWarnings("unchecked")
@Override
public void visit(definition n, Object argu) {
n.accept(new GJVoidDepthFirst() {
@@ -445,4 +359,199 @@
public List<String> superInterfaceList = new ArrayList<String>();
}
+
+ /*
+ * Custom Visitor
+ */
+ /*
+ * Visitor for 'declarators()'
+ * declarators() -> declarator() ( ',' declarator() )*
+ * declarator() -> complex_declarator(), simple_declarator()
+ * complex_declarator() -> array_declarator()
+ * array_declarator() -> identifier() ( fixed_array_size() )+
+ * simple_declarator() -> identifier()
+ *
+ */
+ public static class DepthFirstDeclaratorsVisitor extends DepthFirstVisitor{
+ TypeDefParam tdparam;
+ String ifname = null;
+
+ public DepthFirstDeclaratorsVisitor() {
+ }
+
+ public DepthFirstDeclaratorsVisitor(TypeDefParam tdparam) {
+ this.tdparam = tdparam;
+ }
+
+ public DepthFirstDeclaratorsVisitor(TypeDefParam tdparam, String ifname) {
+ this.tdparam = tdparam;
+ this.ifname = ifname;
+ }
+
+ public void visit(identifier n) {
+ if(ifname != null){ tdparam.setScopedName(ifname); }
+ tdparam.setTargetDef(node2String(n));
+ }
+
+ public void visit(array_declarator n) {
+ tdparam.setArray(true);
+ if(ifname != null){ tdparam.setScopedName(ifname); }
+ tdparam.setTargetDef(n.identifier.nodeToken.toString());
+ tdparam.setArrayDim(n.nodeList.size());
+ }
+ }
+ /**
+ * Visitor for 'type_spec()'
+ *
+ * 'typedef' type_declarator()
+ * type_declarator() -> type_spec() declarators()
+ *
+ * type_spec() -> simple_type_spec(), constr_type_spec()
+ * constr_type_spec() -> struct_type(), union_type(), enum_type()
+ *
+ */
+ public static class DepthFirstTypeSpecVisitor extends DepthFirstVisitor{
+ TypeDefParam tdparam;
+ boolean replaceStringFlag;
+
+ public DepthFirstTypeSpecVisitor() {
+ replaceStringFlag = false;
+ }
+ public DepthFirstTypeSpecVisitor(TypeDefParam tdparam) {
+ this.tdparam = tdparam;
+ }
+ public DepthFirstTypeSpecVisitor(TypeDefParam tdparam, boolean flag) {
+ this.tdparam = tdparam;
+ this.replaceStringFlag = flag;
+ }
+
+ ////////
+ //
+ public void visit(simple_type_spec n) {
+ n.nodeChoice.accept(new DepthFirstSimpleTypeSpecVisitor(this.tdparam, this.replaceStringFlag));
+ }
+
+ /////////////////
+ public void visit(struct_type n) {
+ tdparam.setModuleName(getModuleNames());
+ tdparam.setStruct(true);
+ n.member_list.accept(new DepthFirstStructMemberVisitor(tdparam));
+ super.visit(n);
+ }
+
+ public void visit(enum_type n) {
+ System.out.println("Call enum: "+ node2String(n.identifier));
+ super.visit(n);
+ }
+ //////////////////
+ }
+
+ /*
+ * type_spec()
+ * -> simple_type_spec()
+ * -> base_type_spec(),
+ * template_type_spec(),
+ * scoped_name()
+ *
+ * base_type_spec() -> floating_pt_type(),
+ * integer_type(),
+ * char_type(),
+ * boolean_type(),
+ * octet_type(),
+ * any_type()
+ *
+ * template_type_spec() -> sequence_type(),
+ * string_type()
+ *
+ * scoped_name()
+ */
+ public static class DepthFirstSimpleTypeSpecVisitor extends DepthFirstVisitor{
+ TypeDefParam tdparam;
+ boolean replaceStringFlag;
+
+ public DepthFirstSimpleTypeSpecVisitor() {
+ replaceStringFlag = false;
+ }
+
+ public DepthFirstSimpleTypeSpecVisitor(TypeDefParam tdparam) {
+ this.tdparam = tdparam;
+ }
+
+ public DepthFirstSimpleTypeSpecVisitor(TypeDefParam tdparam, boolean flag) {
+ this.tdparam = tdparam;
+ this.replaceStringFlag = flag;
+ }
+
+ ///////
+ /*
+ * sequence_type() -> 'sequence' '<' simple_type_spec() [ ',' positive_int_const() ] '>'
+ */
+ @Override
+ public void visit(simple_type_spec n) {
+ tdparam.setOriginalDef(node2String(n));
+ super.visit(n);
+ }
+
+ @Override
+ public void visit(sequence_type n) {
+ tdparam.setSequence(true);
+ tdparam.setUnbounded(true);
+ super.visit(n);
+ }
+
+ @Override
+ public void visit(base_type_spec n) {
+ String type = node2String(n);
+
+ tdparam.setOriginalDef(type);
+ super.visit(n);
+ }
+
+ @Override
+ public void visit(scoped_name n) {
+ String type = node2String(n);
+
+ tdparam.setOriginalDef(type);
+ tdparam.setAlias(true);
+ super.visit(n);
+ }
+
+ @Override
+ public void visit(string_type n) {
+ String type = node2String(n);
+
+ tdparam.setOriginalDef(type);
+ super.visit(n);
+ }
+ }
+/*
+ *
+ */
+ public static class DepthFirstStructMemberVisitor extends DepthFirstVisitor{
+ TypeDefParam tdparam;
+
+ public DepthFirstStructMemberVisitor() {
+ }
+
+ public DepthFirstStructMemberVisitor(TypeDefParam tdparam) {
+ this.tdparam = tdparam;
+ }
+ @Override
+ public void visit(simple_type_spec n) {
+ tdparam.getChildType().add(node2String(n));
+ super.visit(n);
+ }
+
+ @Override
+ public void visit(sequence_type n) {
+ tdparam.setUnbounded(true);
+ super.visit(n);
+ }
+
+ @Override
+ public void visit(string_type n) {
+ tdparam.setUnbounded(true);
+ super.visit(n);
+ }
+ }
}
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/idl/ServiceArgumentParam.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/idl/ServiceArgumentParam.java 2015-06-14 01:21:51 UTC (rev 534)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/idl/ServiceArgumentParam.java 2015-06-17 03:16:20 UTC (rev 535)
@@ -19,6 +19,10 @@
private boolean isStruct;
private boolean isEnum;
private boolean isChildDouble;
+ private boolean isInterface;
+ private boolean isSequence;
+ private boolean isAlias;
+ private int arrayDim;
public String getName() {
return name;
@@ -96,4 +100,40 @@
public void setEnum(boolean isEnum) {
this.isEnum = isEnum;
}
+/**
+ * Append by Hara
+ */
+ public boolean isString() {
+ if(type.equals("string")){
+ return true;
+ }
+ if(this.isAlias && this.originalType.equals("string")){
+ return true;
+ }
+ return false;
+ }
+ public boolean isSequence() {
+ return isSequence;
+ }
+ public void setSequence(boolean isSequence) {
+ this.isSequence = isSequence;
+ }
+ public boolean isInterface() {
+ return isInterface;
+ }
+ public void setInterface(boolean isInterface) {
+ this.isInterface = isInterface;
+ }
+ public boolean isAlias() {
+ return isAlias;
+ }
+ public void setAlias(boolean isAlias) {
+ this.isAlias = isAlias;
+ }
+ public int getArrayDim() {
+ return arrayDim;
+ }
+ public void setArrayDim(int dim) {
+ this.arrayDim = dim;
+ }
}
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/idl/ServiceMethodParam.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/idl/ServiceMethodParam.java 2015-06-14 01:21:51 UTC (rev 534)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/idl/ServiceMethodParam.java 2015-06-17 03:16:20 UTC (rev 535)
@@ -13,12 +13,20 @@
private String type;
private String name;
private String module;
+
+ private String originalType;
+
private boolean isSequence;
private boolean isArray;
private boolean isStruct;
private boolean isString;
private boolean isChildString;
+ private boolean isUnbounded;
+ private boolean isInterface;
+ private boolean isAlias;
+ private int arrayDim;
+
private List<ServiceArgumentParam> arguments = new ArrayList<ServiceArgumentParam>();
public boolean getIsVoid() {
@@ -91,4 +99,40 @@
public void setChildString(boolean isChildString) {
this.isChildString = isChildString;
}
+/**
+ * Append by Hara 2015/06
+ */
+
+ public boolean isUnbounded() {
+ return this.isUnbounded;
+ }
+ public void setUnbounded(boolean b) {
+ this.isUnbounded = b;
+ }
+ public boolean isInterface() {
+ return this.isInterface;
+ }
+ public void setInterface(boolean b) {
+ this.isInterface = b;
+ }
+ public boolean isAlias() {
+ return this.isAlias;
+ }
+ public void setAlias(boolean b) {
+ this.isAlias = b;
+ }
+
+ public String getOriginalType() {
+ return this.originalType;
+ }
+ public void setOriginalType(String typ) {
+ this.originalType = typ;
+ }
+
+ public int getArrayDim() {
+ return this.arrayDim;
+ }
+ public void setArrayDim(int dim) {
+ this.arrayDim = dim;
+ }
}
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/idl/TypeDefParam.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/idl/TypeDefParam.java 2015-06-14 01:21:51 UTC (rev 534)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/idl/TypeDefParam.java 2015-06-17 03:16:20 UTC (rev 535)
@@ -22,6 +22,13 @@
private boolean isEnum;
private boolean isChildString;
private boolean isChildDouble;
+
+ private boolean isUnbounded;
+ private boolean isInterface;
+ private boolean isAlias;
+
+ private int arrayDim;
+
private List<String> childType;
public TypeDefParam() {
@@ -37,6 +44,12 @@
isEnum = false;
isChildString = false;
isChildDouble = false;
+
+ isUnbounded = false;
+ isInterface = false;
+ isAlias = false;
+ arrayDim = 0;
+
childType = new ArrayList<String>();
}
@@ -127,4 +140,32 @@
public List<String> getChildType() {
return childType;
}
+
+ /*
+ * Append by I.Hara 2015/06
+ */
+ public boolean isUnbounded() {
+ return isUnbounded;
+ }
+ public void setUnbounded(boolean isUnbounded) {
+ this.isUnbounded = isUnbounded;
+ }
+ public boolean isInterface() {
+ return isInterface;
+ }
+ public void setInterface(boolean isInterface) {
+ this.isInterface = isInterface;
+ }
+ public boolean isAlias() {
+ return isAlias;
+ }
+ public void setAlias(boolean isAlias) {
+ this.isAlias = isAlias;
+ }
+ public int getArrayDim() {
+ return arrayDim;
+ }
+ public void setArrayDim(int dim) {
+ this.arrayDim = dim;
+ }
}
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 2015-06-14 01:21:51 UTC (rev 534)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/manager/CXXConverter.java 2015-06-17 03:16:20 UTC (rev 535)
@@ -38,22 +38,22 @@
private final String idlAny = "any";
private final String idlVoid= "void";
- private final String cppShort = "CORBA::Short";
- private final String cppLong = "CORBA::Long";
- private final String cppLongLong = "CORBA::LongLong";
- private final String cppUnsignedShort = "CORBA::UShort";
- private final String cppUnsignedLong = "CORBA::ULong";
- private final String cppUnsignedLongLong = "CORBA::ULongLong";
- private final String cppFloat = "CORBA::Float";
- private final String cppDouble = "CORBA::Double";
- private final String cppLongDouble = "CORBA::LongDouble";
- private final String cppBoolean = "CORBA::Boolean";
- private final String cppChar = "CORBA::Char";
- private final String cppWchar = "CORBA::WChar";
- private final String cppOctet = "CORBA::Octet";
+ private final String cppShort = "::CORBA::Short";
+ private final String cppLong = "::CORBA::Long";
+ private final String cppLongLong = "::CORBA::LongLong";
+ private final String cppUnsignedShort = "::CORBA::UShort";
+ private final String cppUnsignedLong = "::CORBA::ULong";
+ private final String cppUnsignedLongLong = "::CORBA::ULongLong";
+ private final String cppFloat = "::CORBA::Float";
+ private final String cppDouble = "::CORBA::Double";
+ private final String cppLongDouble = "::CORBA::LongDouble";
+ private final String cppBoolean = "::CORBA::Boolean";
+ private final String cppChar = "::CORBA::Char";
+ private final String cppWchar = "::CORBA::WChar";
+ private final String cppOctet = "::CORBA::Octet";
private final String cppString = "char*";
- private final String cppWstring = "CORBA::WChar*";
- private final String cppAny = "CORBA::Any*";
+ private final String cppWstring = "::CORBA::WChar*";
+ private final String cppAny = "::CORBA::Any*";
private final String cppVoid= "void";
public CXXConverter() {
@@ -147,15 +147,32 @@
String result = mapType.get(typeDef.getType());
if( result == null ) {
result = typeDef.getType();
- if( !typeDef.getType().contains("::") ) {
-// if(typeDef.isArray() && !typeDef.isStruct()) {
- if(typeDef.isArray()) {
- result = result + "_slice*";
- } else if(typeDef.isSequence() || typeDef.isString() || typeDef.isChildString()) {
- result = result + "*";
+
+ if(typeDef.isArray()) {
+ result = result + "_slice*";
+
+ }else if(typeDef.isSequence() ){
+ result = result + "*";
+
+ } else if(typeDef.isStruct()) {
+ if(typeDef.isUnbounded()) {
+ result = result + "*";
+ }
+
+ } else if(typeDef.isInterface()) {
+ if(typeDef.isAlias()) {
+ result = typeDef.getOriginalType() + "_ptr";
+ }else{
+ result = result + "_ptr";
}
- } else {
- if(typeDef.isStruct()) {
+
+ } else if(typeDef.isAlias()) {
+ if (typeDef.getOriginalType().equals("string")){
+ result = "char*";
+
+ }else if (typeDef.getOriginalType().equals("wstring")){
+ result = "::CORBA::WChar*";
+ }else if (typeDef.getOriginalType().equals("any")){
result = result + "*";
}
}
@@ -193,7 +210,7 @@
if(typeDef.isUnbounded()) {
result = typeDef.getOriginalType() + "_out";
} else {
- result = "CORBA::String_out";
+ result = "::CORBA::String_out";
}
}
else if(typeDef.getDirection().equals("inout"))
@@ -201,63 +218,129 @@
} else if(typeDef.getType().equals("wstring")) {
if(typeDef.getDirection().equals("in"))
- result = "const CORBA::WChar*";
+ result = "const ::CORBA::WChar*";
else if(typeDef.getDirection().equals("out")) {
if(typeDef.isUnbounded()) {
result = typeDef.getOriginalType() + "_out";
} else {
- result = "CORBA::WString_out";
+ result = "::CORBA::WString_out";
}
}
else if(typeDef.getDirection().equals("inout"))
- result = "CORBA::WChar*&";
+ result = "::CORBA::WChar*&";
} else if(typeDef.getType().equals("any")) {
if(typeDef.getDirection().equals("in"))
- result = "const CORBA::Any&";
+ result = "const ::CORBA::Any&";
else if(typeDef.getDirection().equals("out"))
- result = "CORBA::Any_OUT_arg";
+ result = "::CORBA::Any_OUT_arg";
else if(typeDef.getDirection().equals("inout"))
- result = "CORBA::Any&";
-
- } else if(typeDef.isUnbounded() && typeDef.isArray()) {
+ result = "::CORBA::Any&";
+
+ } else if(typeDef.isArray()) {
+ if( typeDef.getModule() != "" ){
+ result = typeDef.getModule()+result;
+ }
+ if(typeDef.isUnbounded() || typeDef.isInterface()
+ || typeDef.getOriginalType().equals("string")
+ || typeDef.getOriginalType().equals("wstring")
+ || typeDef.getOriginalType().equals("any")
+ ){
+ if(typeDef.getDirection().equals("in"))
+ result = "const " + result;
+ else if(typeDef.getDirection().equals("out"))
+ result = result + "_out";
+ }else{
+ if(typeDef.getDirection().equals("in"))
+ result = "const " + result;
+ }
+
+ } else if(typeDef.isStruct() ) {
+ if( typeDef.getModule() != "" ){
+ result = typeDef.getModule()+result;
+ }
+ if(typeDef.getDirection().equals("in")){
+ result = "const " + result + "&";
+ }else if(typeDef.getDirection().equals("out")){
+ if( typeDef.isUnbounded() ){
+ result = result + "_out";
+ }else{
+ result = result + "&";
+ }
+ }else if(typeDef.getDirection().equals("inout")){
+ result = result + "&";
+ }
+
+ } else if(typeDef.isSequence() ) {
+ if( typeDef.getModule() != "" ){
+ result = typeDef.getModule()+result;
+ }
if(typeDef.getDirection().equals("in"))
- result = "const " + result;
- else if(typeDef.getDirection().equals("out"))
- result = result + "_out";
-
- } else if(typeDef.isUnbounded()) {
- 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.isArray()) {
- if(typeDef.getDirection().equals("in"))
- result = "const " + result;
-
- } else {
- if(typeDef.isStruct()) {
- if(typeDef.getModule()!=null && typeDef.getModule().length()>0) {
- result = typeDef.getModule() + result;
- }
- if(typeDef.getDirection().equals("in"))
- result = "const " + result + "&";
- else if(typeDef.getDirection().equals("out")) {
- if(typeDef.isInnerArray()==false && typeDef.isChildDouble()) {
- result = result + "&";
- } else {
- result = result + "_out";
- }
- }
+
+ } else if(typeDef.isInterface()) {
+ if(typeDef.getDirection().equals("in") || typeDef.getDirection().equals("inout") ){
+ if(typeDef.isAlias()) result = typeDef.getOriginalType();
+ }
+
+ if(typeDef.getDirection().equals("in") ){
+ result = result + "_ptr";
+ }else if(typeDef.getDirection().equals("out"))
+ result = result + "_out";
+ else if(typeDef.getDirection().equals("inout")){
+ result = result + "_ptr&";
+ }
+
+ }else if(typeDef.isAlias()) {
+ if (typeDef.getOriginalType().equals("string")){
+ if(typeDef.getDirection().equals("in") )
+ result = "const char*";
+ else if(typeDef.getDirection().equals("out") )
+ result = result + "_out";
else if(typeDef.getDirection().equals("inout"))
+ result = "char*&";
+
+ }else if (typeDef.getOriginalType().equals("wstring")){
+ if(typeDef.getDirection().equals("in") )
+ result = "const ::CORBA::WChar*";
+ else if(typeDef.getDirection().equals("out") )
+ result = result + "_out";
+ else if(typeDef.getDirection().equals("inout"))
+ result = "::CORBA::WChar*&";
+
+ }else if (typeDef.getOriginalType().equals("any")){
+ if(typeDef.getDirection().equals("in") )
+ result = "const "+result+"&";
+ else if(typeDef.getDirection().equals("out") )
+ result = "::CORBA::Any_OUT_arg";
+ else if(typeDef.getDirection().equals("inout"))
result = result + "&";
} else {
- if(typeDef.getDirection().equals("out") || typeDef.getDirection().equals("inout"))
+ if( typeDef.getModule() != "" ){
+ if( result.indexOf("::") < 0 ){
+ result = typeDef.getModule()+result;
+ }
+ }
+
+ if(typeDef.getDirection().equals("out") || typeDef.getDirection().equals("inout")){
result = result + "&";
+ }
}
+
+ } else {
+ if( typeDef.getModule() != "" ){
+ if( result.indexOf("::") < 0 ){
+ result = typeDef.getModule()+result;
+ }
+ }
+
+ if(typeDef.getDirection().equals("out") || typeDef.getDirection().equals("inout")) {
+ result = result + "&";
+ }
}
return result;
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/TemplateHelper.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/TemplateHelper.java 2015-06-14 01:21:51 UTC (rev 534)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/TemplateHelper.java 2015-06-17 03:16:20 UTC (rev 535)
@@ -26,6 +26,12 @@
return split[split.length - 1];
}
+ /*
+ * Appebd By I.Hara 2015/06
+ **/
+ public static String getBasename2(String fullName) {
+ return fullName.replaceAll("::", "_");
+ }
/**
* ファイル名を取得する
*
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/CXX_SVC.cpp.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/CXX_SVC.cpp.vsl 2015-06-14 01:21:51 UTC (rev 534)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/CXX_SVC.cpp.vsl 2015-06-17 03:16:20 UTC (rev 535)
@@ -11,13 +11,13 @@
/*
* Example implementational code for IDL interface ${cXXConv.convertDelimiter(${serviceClassParam.name})}
*/
-${tmpltHelper.getBasename(${serviceClassParam.name})}${tmpltHelper.serviceImplSuffix}::${tmpltHelper.getBasename(${serviceClassParam.name})}${tmpltHelper.serviceImplSuffix}()
+${tmpltHelper.getBasename2(${serviceClassParam.name})}${tmpltHelper.serviceImplSuffix}::${tmpltHelper.getBasename2(${serviceClassParam.name})}${tmpltHelper.serviceImplSuffix}()
{
// Please add extra constructor code here.
}
-${tmpltHelper.getBasename(${serviceClassParam.name})}${tmpltHelper.serviceImplSuffix}::~${tmpltHelper.getBasename(${serviceClassParam.name})}${tmpltHelper.serviceImplSuffix}()
+${tmpltHelper.getBasename2(${serviceClassParam.name})}${tmpltHelper.serviceImplSuffix}::~${tmpltHelper.getBasename2(${serviceClassParam.name})}${tmpltHelper.serviceImplSuffix}()
{
// Please add extra destructor code here.
}
@@ -27,13 +27,13 @@
* Methods corresponding to IDL attributes and operations
*/
#foreach($serviceMethodParam in ${serviceClassParam.methods})
-${cXXConv.convCpp2CORBA(${serviceMethodParam})} ${tmpltHelper.getBasename(${serviceClassParam.name})}${tmpltHelper.serviceImplSuffix}::${serviceMethodParam.name}(#foreach($serviceArgumentParam in ${serviceMethodParam.arguments})#if($velocityCount > 1), #end${cXXConv.convCpp2CORBAforArg(${serviceArgumentParam})} ${serviceArgumentParam.name}#end)
+${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.getBasename(${serviceClassParam.name})}${tmpltHelper.serviceImplSuffix}::${serviceMethodParam.name}(#foreach($serviceArgumentParam in ${serviceMethodParam.arguments})#if($velocityCount > 1), #end${cXXConv.convCpp2CORBAforArg(${serviceArgumentParam})} ${serviceArgumentParam.name}#end)>"
+ #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;
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/CXX_SVC.h.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/CXX_SVC.h.vsl 2015-06-14 01:21:51 UTC (rev 534)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/CXX_SVC.h.vsl 2015-06-17 03:16:20 UTC (rev 535)
@@ -21,7 +21,7 @@
* @class ${tmpltHelper.getBasename(${serviceClassParam.name})}${tmpltHelper.serviceImplSuffix}
* Example class implementing IDL interface ${cXXConv.convertDelimiter(${serviceClassParam.name})}
*/
-class ${tmpltHelper.getBasename(${serviceClassParam.name})}${tmpltHelper.serviceImplSuffix}
+class ${tmpltHelper.getBasename2(${serviceClassParam.name})}${tmpltHelper.serviceImplSuffix}
: public virtual POA_${cXXConv.convertDelimiter(${serviceClassParam.name})},
public virtual PortableServer::RefCountServantBase
{
@@ -38,7 +38,7 @@
/*!
* @brief destructor
*/
- virtual ~${tmpltHelper.getBasename(${serviceClassParam.name})}${tmpltHelper.serviceImplSuffix}();
+ virtual ~${tmpltHelper.getBasename2(${serviceClassParam.name})}${tmpltHelper.serviceImplSuffix}();
// attributes and operations
#foreach($serviceMethodParam in ${serviceClassParam.methods})
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.java/META-INF/MANIFEST.MF
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.java/META-INF/MANIFEST.MF 2015-06-14 01:21:51 UTC (rev 534)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.java/META-INF/MANIFEST.MF 2015-06-17 03:16:20 UTC (rev 535)
@@ -17,6 +17,6 @@
template.java_04,jp.go.aist.rtm.rtcbuilder.java.ui.Perspective
Eclipse-BuddyPolicy: registered
Eclipse-RegisterBuddy: jp.go.aist.rtm.rtcbuilder
-Built-By: n-ando
-Built-Date: 2013/01/25 00:47:16
+Built-By: isao-hara
+Built-Date: 2015/06/17 08:49:36
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.java/src/jp/go/aist/rtm/rtcbuilder/java/manager/JavaConverter.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.java/src/jp/go/aist/rtm/rtcbuilder/java/manager/JavaConverter.java 2015-06-14 01:21:51 UTC (rev 534)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.java/src/jp/go/aist/rtm/rtcbuilder/java/manager/JavaConverter.java 2015-06-17 03:16:20 UTC (rev 535)
@@ -185,11 +185,12 @@
* @return Java型
*/
public String convCORBA2Java(ServiceMethodParam typeDef, ServiceClassParam scp) {
+ boolean isBasicType = false;
String strType = getTypeDefs(typeDef.getType(), scp);
if( strType==null ) {
strType = typeDef.getType();
} else {
- strType.replaceAll("::", ".");
+ strType = strType.replaceAll("::", ".");
}
String rawType = strType.replaceAll("\\[\\]", "");
@@ -197,21 +198,38 @@
String result;
if( convType == null ) {
- if(typeDef.isSequence() && !typeDef.isStruct()) {
+ if(typeDef.isSequence() ) {
result = strType;
} else {
- result = typeDef.getType();
+ if(typeDef.isAlias()){
+ result = typeDef.getOriginalType();
+ }else{
+ result = typeDef.getType();
+ }
+ result = result.replaceAll(scp.getName()+"::", "");
+
+ if(typeDef.isArray()){
+ result = result+"[]";
+ }
}
} else {
+ isBasicType = true;
result = strType.replaceAll(rawType, convType);
}
+ result=result.replaceAll("::", ".");
+ String mdl = typeDef.getModule();
+ if(!isBasicType && mdl.length() > 0){
+ result = mdl.replaceAll("::", ".") + result;
+ }
+
return result;
}
private String getTypeDefs(String target, ServiceClassParam scp) {
String result = null;
+ target = target.replaceAll(scp.getName()+"::", "");
TypeDefParam source = scp.getTypeDef().get(target);
if( source==null || source.getOriginalDef()==null || source.getOriginalDef().length()==0 ) {
@@ -219,7 +237,13 @@
} else {
result = getTypeDefs(source.getOriginalDef(), scp);
if( source!=null ) {
- if( source.isSequence() || source.isArray() ) result += "[]";
+ if( source.isSequence() ){
+ result += "[]";
+ }else if( source.isArray() ){
+ for(int i=0; i< source.getArrayDim() ; i++){
+ result += "[]";
+ }
+ }
}
}
return result;
@@ -245,15 +269,46 @@
*/
public String convCORBA2JavaforArg(ServiceArgumentParam typeDef, String strDirection, ServiceClassParam scp) {
String result = "";
+ boolean isBasicType = false;
String strType = getTypeDefs(typeDef.getType(), scp);
- if( typeDef.getType().equals(strType) ) {
+
+
+ if( mapType.get(strType) != null){
+ isBasicType = true;
if( strDirection.equals(dirIn) ) {
+ result = mapType.get(strType);
+ } else {
+ result = mapTypeHolder.get(strType);
+ }
+
+ }else if( typeDef.getType().equals(strType) ) {
+ if( strDirection.equals(dirIn) ) {
result = mapType.get(typeDef.getType());
if( result == null ) result = typeDef.getType();
} else {
result = mapTypeHolder.get(typeDef.getType());
if( result == null ) result = typeDef.getType() + "Holder";
}
+ }else if( typeDef.isArray() || typeDef.isSequence() ) {
+ if( !strDirection.equals(dirIn) ) {
+ result = typeDef.getType() + "Holder";
+ }else{
+ String rawType = strType.replaceAll("\\[\\]", "");
+ String convType = mapType.get(rawType);
+ if( convType != null ) {
+ isBasicType = true;
+ result = strType.replaceAll(rawType, convType);
+ }else{
+ result = strType;
+ }
+ }
+
+ }else if( typeDef.isStruct() ) {
+ result = strType;
+ if( !strDirection.equals(dirIn) ){
+ result = result + "Holder";
+ }
+
} else {
strType.replaceAll("::", ".");
String rawType = strType.replaceAll("\\[\\]", "");
@@ -266,6 +321,7 @@
}
if( !strDirection.equals(dirIn) ) result = result + "Holder";
} else {
+ isBasicType = true;
result = strType.replaceAll(rawType, convType);
}
@@ -275,6 +331,12 @@
}
}
}
+ result = result.replaceAll("::", "Package.");
+ String mdl = typeDef.getModule();
+ if(!isBasicType && mdl.length() > 0){
+ result = mdl.replaceAll("::", ".") + result;
+ }
+
return result;
}
/**
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.nl1/META-INF/MANIFEST.MF
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.nl1/META-INF/MANIFEST.MF 2015-06-14 01:21:51 UTC (rev 534)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.nl1/META-INF/MANIFEST.MF 2015-06-17 03:16:20 UTC (rev 535)
@@ -8,6 +8,6 @@
Fragment-Host: jp.go.aist.rtm.rtcbuilder;bundle-version="1.1.0"
Bundle-Localization: plugin
Bundle-Vendor: AIST
-Built-By: n-ando
-Built-Date: 2013/01/25 00:47:15
+Built-By: isao-hara
+Built-Date: 2015/06/17 08:32:27
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/META-INF/MANIFEST.MF
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/META-INF/MANIFEST.MF 2015-06-14 01:21:51 UTC (rev 534)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/META-INF/MANIFEST.MF 2015-06-17 03:16:20 UTC (rev 535)
@@ -17,6 +17,6 @@
p.go.aist.rtm.rtcbuilder.python.template.python,jp.go.aist.rtm.rtcbui
lder.python.template.python_04
Eclipse-BuddyPolicy: registered
-Built-By: n-ando
-Built-Date: 2013/01/25 00:47:18
+Built-By: isao-hara
+Built-Date: 2015/06/17 08:32:57
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/src/jp/go/aist/rtm/rtcbuilder/python/manager/PythonGenerateManager.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/src/jp/go/aist/rtm/rtcbuilder/python/manager/PythonGenerateManager.java 2015-06-14 01:21:51 UTC (rev 534)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/src/jp/go/aist/rtm/rtcbuilder/python/manager/PythonGenerateManager.java 2015-06-17 03:16:20 UTC (rev 535)
@@ -76,8 +76,11 @@
// IDLファイル内に記述されているServiceClassParamを設定する
for (IdlFileParam idlFileParam : allIdlFileParams) {
for (ServiceClassParam serviceClassParam : rtcParam.getServiceClassParams()) {
- if (idlFileParam.getIdlPath().equals(serviceClassParam.getIdlPath()))
- idlFileParam.addServiceClassParams(serviceClassParam);
+ if (idlFileParam.getIdlPath().equals(serviceClassParam.getIdlPath())){
+ if (!idlFileParam.getServiceClassParams().contains(serviceClassParam)){
+ idlFileParam.addServiceClassParams(serviceClassParam);
+ }
+ }
}
}
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/META-INF/MANIFEST.MF
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/META-INF/MANIFEST.MF 2015-06-14 01:21:51 UTC (rev 534)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/META-INF/MANIFEST.MF 2015-06-17 03:16:20 UTC (rev 535)
@@ -28,6 +28,6 @@
r.ui.workbenchadapter,jp.go.aist.rtm.systemeditor.extension
Bundle-Vendor: %providerName
Eclipse-BuddyPolicy: registered
-Built-By: n-ando
-Built-Date: 2013/01/25 00:47:28
+Built-By: isao-hara
+Built-Date: 2015/06/17 08:34:38
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor.nl1/META-INF/MANIFEST.MF
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor.nl1/META-INF/MANIFEST.MF 2015-06-14 01:21:51 UTC (rev 534)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor.nl1/META-INF/MANIFEST.MF 2015-06-17 03:16:20 UTC (rev 535)
@@ -7,6 +7,6 @@
Bundle-Version: 1.1.0.rc4v20130124
Fragment-Host: jp.go.aist.rtm.systemeditor;bundle-version="1.1.0"
Bundle-Vendor: AIST
-Built-By: n-ando
-Built-Date: 2013/01/25 00:47:32
+Built-By: isao-hara
+Built-Date: 2015/06/17 08:35:46
Modified: trunk/rtmtools/jp.go.aist.rtm.toolscommon/META-INF/MANIFEST.MF
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.toolscommon/META-INF/MANIFEST.MF 2015-06-14 01:21:51 UTC (rev 534)
+++ trunk/rtmtools/jp.go.aist.rtm.toolscommon/META-INF/MANIFEST.MF 2015-06-17 03:16:20 UTC (rev 535)
@@ -36,6 +36,6 @@
Bundle-ActivationPolicy: lazy
Eclipse-BuddyPolicy: registered
Bundle-Activator: jp.go.aist.rtm.toolscommon.ToolsCommonPlugin
-Built-By: n-ando
-Built-Date: 2013/01/25 00:46:59
+Built-By: isao-hara
+Built-Date: 2015/06/17 08:18:55
Modified: trunk/rtmtools/jp.go.aist.rtm.toolscommon.nl1/META-INF/MANIFEST.MF
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.toolscommon.nl1/META-INF/MANIFEST.MF 2015-06-14 01:21:51 UTC (rev 534)
+++ trunk/rtmtools/jp.go.aist.rtm.toolscommon.nl1/META-INF/MANIFEST.MF 2015-06-17 03:16:20 UTC (rev 535)
@@ -6,6 +6,6 @@
Bundle-SymbolicName: jp.go.aist.rtm.toolscommon.nl1
Bundle-Version: 1.1.0.rc4v20130124
Fragment-Host: jp.go.aist.rtm.toolscommon;bundle-version="1.1.0"
-Built-By: n-ando
-Built-Date: 2013/01/25 00:47:04
+Built-By: isao-hara
+Built-Date: 2015/06/17 08:31:22
Modified: trunk/rtmtools/jp.go.aist.rtm.toolscommon.profiles/META-INF/MANIFEST.MF
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.toolscommon.profiles/META-INF/MANIFEST.MF 2015-06-14 01:21:51 UTC (rev 534)
+++ trunk/rtmtools/jp.go.aist.rtm.toolscommon.profiles/META-INF/MANIFEST.MF 2015-06-17 03:16:20 UTC (rev 535)
@@ -36,6 +36,6 @@
s.rts.version02;uses:="javax.xml.bind,javax.xml.datatype"
Bundle-ActivationPolicy: lazy
Eclipse-BuddyPolicy: registered
-Built-By: n-ando
-Built-Date: 2013/01/25 00:46:56
+Built-By: isao-hara
+Built-Date: 2015/06/17 08:18:03
Modified: trunk/rtmtools/jp.go.aist.rtm.toolscommon.profiles.nl1/META-INF/MANIFEST.MF
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.toolscommon.profiles.nl1/META-INF/MANIFEST.MF 2015-06-14 01:21:51 UTC (rev 534)
+++ trunk/rtmtools/jp.go.aist.rtm.toolscommon.profiles.nl1/META-INF/MANIFEST.MF 2015-06-17 03:16:20 UTC (rev 535)
@@ -7,6 +7,6 @@
Bundle-Version: 1.1.0.rc4v20130124
Fragment-Host: jp.go.aist.rtm.toolscommon.profiles;bundle-version="1.1
.0"
-Built-By: n-ando
-Built-Date: 2013/01/25 00:46:59
+Built-By: isao-hara
+Built-Date: 2015/06/17 08:18:50
More information about the openrtm-commit
mailing list