Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Haug2015-07-14 15:51:25 +0000
committerJuergen Haug2015-07-15 09:18:46 +0000
commitae0407d0703e6c4cd69e0f674cc5b8b15e85acf6 (patch)
tree7cd7880529fbf99358451bb694a4c99627e6c581 /plugins/org.eclipse.etrice.generator.cpp/src
parent6efdfd0f82ed35ad37a655fa991300d1f1a179d5 (diff)
downloadorg.eclipse.etrice-ae0407d0703e6c4cd69e0f674cc5b8b15e85acf6.tar.gz
org.eclipse.etrice-ae0407d0703e6c4cd69e0f674cc5b8b15e85acf6.tar.xz
org.eclipse.etrice-ae0407d0703e6c4cd69e0f674cc5b8b15e85acf6.zip
Bug 456617 added operation inheritance + new ctor/dtor model element
Diffstat (limited to 'plugins/org.eclipse.etrice.generator.cpp/src')
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ActorClassGen.xtend28
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/DataClassGen.xtend24
2 files changed, 26 insertions, 26 deletions
diff --git a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ActorClassGen.xtend b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ActorClassGen.xtend
index 4dfddabd4..6927bb434 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ActorClassGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ActorClassGen.xtend
@@ -118,7 +118,7 @@ class ActorClassGen extends GenericActorClassGenerator {
«ac.attributes.attributes»
- «ac.operationsImplementation»
+ «operationsImplementation(ac.operations, ac.name)»
public:
//--------------------- construction
@@ -193,8 +193,8 @@ class ActorClassGen extends GenericActorClassGenerator {
def private generateSourceFile(Root root, ExpandedActorClass xpac, ActorClass ac) {
- val ctor = ac.operations.filter(op|op.constructor).head
- val dtor = ac.operations.filter(op|op.destructor).head
+// val ctor = ac.operations.filter(op|op.constructor).head
+// val dtor = ac.operations.filter(op|op.destructor).head
val async = xpac.actorClass.commType==ComponentCommunicationType::ASYNCHRONOUS
'''
@@ -228,10 +228,10 @@ class ActorClassGen extends GenericActorClassGenerator {
«IF async»
getMsgsvc()->addAsyncActor(*this);
«ENDIF»
- «IF ctor!=null»
- // user defined constructor body
- «AbstractGenerator::getInstance().getTranslatedCode(ctor.detailCode)»
- «ENDIF»
+««« «IF ctor!=null»
+««« // user defined constructor body
+««« «AbstractGenerator::getInstance().getTranslatedCode(ctor.detailCode)»
+««« «ENDIF»
}
void «ac.name»::init(){
@@ -248,13 +248,13 @@ class ActorClassGen extends GenericActorClassGenerator {
}
«ENDIF»
- void «ac.name»::destroy(){
- «IF dtor!=null»
-
- // user defined destructor body
- «AbstractGenerator::getInstance().getTranslatedCode(dtor.detailCode)»
- «ENDIF»
- }
+««« void «ac.name»::destroy(){
+««« «IF dtor!=null»
+«««
+««« // user defined destructor body
+««« «AbstractGenerator::getInstance().getTranslatedCode(dtor.detailCode)»
+««« «ENDIF»
+««« }
«IF ac.hasNonEmptyStateMachine»
«xpac.genStateMachine(false)»
diff --git a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/DataClassGen.xtend b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/DataClassGen.xtend
index 0398aba3c..b29dca461 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/DataClassGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/DataClassGen.xtend
@@ -64,8 +64,8 @@ class DataClassGen {
}
def generateHeaderFile(Root root, DataClass dc) {
- val ctor = dc.operations.filter(op|op.constructor).head
- val dtor = dc.operations.filter(op|op.destructor).head
+// val ctor = dc.operations.filter(op|op.constructor).head
+// val dtor = dc.operations.filter(op|op.destructor).head
//TODO: getReferencedDataClasses does not contain a base class of the own package
'''
«generateIncludeGuardBegin(dc.path + dc.name)»
@@ -118,8 +118,8 @@ class DataClassGen {
}
def generateSourceFile(Root root, DataClass dc) {
- val ctor = dc.operations.filter(op|op.constructor).head
- val dtor = dc.operations.filter(op|op.destructor).head
+// val ctor = dc.operations.filter(op|op.constructor).head
+// val dtor = dc.operations.filter(op|op.destructor).head
'''
/**
@@ -145,14 +145,14 @@ class DataClassGen {
«ENDIF»
{
«dc.attributes.attributeInitialization(false)»
- «IF ctor!=null»
- {
- // user defined constructor body
- «FOR l : ctor.detailCode.lines»
- «l»
- «ENDFOR»
- }
- «ENDIF»
+««« «IF ctor!=null»
+««« {
+««« // user defined constructor body
+««« «FOR l : ctor.detailCode.lines»
+««« «l»
+««« «ENDFOR»
+««« }
+««« «ENDIF»
}
// copy constructor

Back to the top