Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsgar Radermacher2015-10-16 09:00:12 +0000
committerAnsgar Radermacher2015-10-16 09:05:45 +0000
commit525e52e727a78b4781b648952a867dace7a876d3 (patch)
tree97a2e4c74a24839ca84ba39f0e62280e05669e62 /extraplugins/codegen/org.eclipse.papyrus.cpp.codegen
parent8fe0bbe45cb9816289ae930c88c8d474db2cd2cf (diff)
downloadorg.eclipse.papyrus-525e52e727a78b4781b648952a867dace7a876d3.tar.gz
org.eclipse.papyrus-525e52e727a78b4781b648952a867dace7a876d3.tar.xz
org.eclipse.papyrus-525e52e727a78b4781b648952a867dace7a876d3.zip
479927 - [C++ codegen] The code generator does not support the types Real and Unlimited Natural
Diffstat (limited to 'extraplugins/codegen/org.eclipse.papyrus.cpp.codegen')
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.java15
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassInheritedDeclarations.xtend4
2 files changed, 15 insertions, 4 deletions
diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.java
index 7679a73abfe..36043a363ad 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.java
+++ b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.java
@@ -95,11 +95,20 @@ public class CppGenUtils {
if (name.equals("Boolean")) { //$NON-NLS-1$
td = "bool"; //$NON-NLS-1$
- } else if (name.equals("Integer")) { //$NON-NLS-1$
+ }
+ else if (name.equals("Integer")) { //$NON-NLS-1$
td = "int"; //$NON-NLS-1$
- } else if (name.equals("String")) { //$NON-NLS-1$
+ }
+ else if (name.equals("Unlimited Natural")) { //$NON-NLS-1$
+ td = "unsigned long"; //$NON-NLS-1$
+ }
+ else if (name.equals("Real")) { //$NON-NLS-1$
+ td = "float"; //$NON-NLS-1$
+ }
+ else if (name.equals("String")) { //$NON-NLS-1$
td = "const char *"; //$NON-NLS-1$
- } else if (name.equals("Unlimited Natural")) { //$NON-NLS-1$
+ }
+ else if (name.equals("Unlimited Natural")) { //$NON-NLS-1$
td = "unsigned long"; //$NON-NLS-1$
}
if (td != null) {
diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassInheritedDeclarations.xtend b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassInheritedDeclarations.xtend
index d4f3a2fa4f6..b6b81c0c5a9 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassInheritedDeclarations.xtend
+++ b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassInheritedDeclarations.xtend
@@ -36,7 +36,9 @@ class CppClassInheritedDeclarations {
//and the target does not point to a classifier that has the no-code-gen Stereotype
//TODO: not sure if it makes sense NOT to declare an inheritance, since we do not generate code.
static def filteredRelationships(Classifier clazz) {
- clazz.sourceDirectedRelationships.filter[((it instanceof Generalization) || (it instanceof InterfaceRealization)) && (!GenUtils.hasStereotype(it.targets.get(0), NoCodeGen))]
+ clazz.sourceDirectedRelationships.filter[((it instanceof Generalization) || (it instanceof InterfaceRealization)) &&
+ (it.targets.size > 0) && (!GenUtils.hasStereotype(it.targets.get(0), NoCodeGen))
+ ]
}
static def getCppVisibility(Relationship relationship) {

Back to the top