diff options
author | Juergen Haug | 2015-07-14 15:51:25 +0000 |
---|---|---|
committer | Juergen Haug | 2015-07-15 09:18:46 +0000 |
commit | ae0407d0703e6c4cd69e0f674cc5b8b15e85acf6 (patch) | |
tree | 7cd7880529fbf99358451bb694a4c99627e6c581 /plugins/org.eclipse.etrice.generator.cpp/src | |
parent | 6efdfd0f82ed35ad37a655fa991300d1f1a179d5 (diff) | |
download | org.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
Change-Id: I99ec4385acc15011f266510094298628774904ac
Diffstat (limited to 'plugins/org.eclipse.etrice.generator.cpp/src')
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 |