Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Haug2015-12-23 06:35:03 -0500
committerJuergen Haug2016-02-28 12:01:11 -0500
commit81750c5e633ad14e7ab25b016564af20fec0a1cc (patch)
tree951ca972625f09ffee924496591e97d927a74f0d
parentdc98de4bb145d8d3789909e32c11765596165fbb (diff)
downloadorg.eclipse.etrice-81750c5e633ad14e7ab25b016564af20fec0a1cc.tar.gz
org.eclipse.etrice-81750c5e633ad14e7ab25b016564af20fec0a1cc.tar.xz
org.eclipse.etrice-81750c5e633ad14e7ab25b016564af20fec0a1cc.zip
[generators] added cpp generator draft
-rw-r--r--examples/org.eclipse.etrice.examples.c/.cproject2
-rw-r--r--examples/org.eclipse.etrice.template.c/.cproject2
-rw-r--r--examples/org.eclipse.etrice.template.cpp/.cproject378
-rw-r--r--examples/org.eclipse.etrice.template.cpp/.gitignore8
-rw-r--r--examples/org.eclipse.etrice.template.cpp/.project36
-rw-r--r--examples/org.eclipse.etrice.template.cpp/.settings/org.eclipse.cdt.core.prefs37
-rw-r--r--examples/org.eclipse.etrice.template.cpp/.settings/org.eclipse.cdt.managedbuilder.core.prefs13
-rw-r--r--examples/org.eclipse.etrice.template.cpp/generate_Template.launch18
-rw-r--r--examples/org.eclipse.etrice.template.cpp/log/readme.txt1
-rw-r--r--examples/org.eclipse.etrice.template.cpp/model/Mapping.etmap17
-rw-r--r--examples/org.eclipse.etrice.template.cpp/model/Physical.etphys43
-rw-r--r--examples/org.eclipse.etrice.template.cpp/model/TemplateModel.room76
-rw-r--r--examples/org.eclipse.etrice.template.cpp/model/diagrams/TemplateModel.Receiver.structure37
-rw-r--r--examples/org.eclipse.etrice.template.cpp/model/diagrams/TemplateModel.Sender.structure37
-rw-r--r--examples/org.eclipse.etrice.template.cpp/run_Template_Linux_.launch34
-rw-r--r--examples/org.eclipse.etrice.template.cpp/run_Template_Windows_.launch34
-rw-r--r--examples/org.eclipse.etrice.template.cpp/src-gen-info/readme.txt4
-rw-r--r--examples/org.eclipse.etrice.template.cpp/src-gen/readme.txt4
-rw-r--r--examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/HelloWorld.room4
-rw-r--r--examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/Mapping.etmap8
-rw-r--r--examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/Physical.etphys43
-rw-r--r--examples/org.eclipse.etrice.tutorials.c/model/PingPong/Mapping.etmap8
-rw-r--r--examples/org.eclipse.etrice.tutorials.c/model/PingPong/Physical.etphys43
-rw-r--r--examples/org.eclipse.etrice.tutorials.c/model/PingPong/PingPong.room6
-rw-r--r--examples/org.eclipse.etrice.tutorials.c/model/PingPong/diagrams/PingPongModel.SubSysClass.structure4
-rw-r--r--examples/org.eclipse.etrice.tutorials.cpp/.cproject292
-rw-r--r--examples/org.eclipse.etrice.tutorials.cpp/.gitignore8
-rw-r--r--examples/org.eclipse.etrice.tutorials.cpp/.project36
-rw-r--r--examples/org.eclipse.etrice.tutorials.cpp/.settings/org.eclipse.cdt.managedbuilder.core.prefs13
-rw-r--r--examples/org.eclipse.etrice.tutorials.cpp/log/readme.txt1
-rw-r--r--examples/org.eclipse.etrice.tutorials.cpp/model/HelloWorld/HelloWorld.room42
-rw-r--r--examples/org.eclipse.etrice.tutorials.cpp/model/HelloWorld/Mapping.etmap17
-rw-r--r--examples/org.eclipse.etrice.tutorials.cpp/model/HelloWorld/Physical.etphys43
-rw-r--r--examples/org.eclipse.etrice.tutorials.cpp/model/HelloWorld/generate_HelloWorldCpp.launch16
-rw-r--r--examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/Mapping.etmap17
-rw-r--r--examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/Physical.etphys43
-rw-r--r--examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/PingPong.room109
-rw-r--r--examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/diagrams/PingPongModel.Receiver.behavior183
-rw-r--r--examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/diagrams/PingPongModel.Receiver.structure37
-rw-r--r--examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/diagrams/PingPongModel.Sender.behavior135
-rw-r--r--examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/diagrams/PingPongModel.Sender.structure37
-rw-r--r--examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/diagrams/PingPongModel.SubSysClass.structure291
-rw-r--r--examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/diagrams/PingPongModel.TopActor.structure299
-rw-r--r--examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/generate_PingPongCpp.launch16
-rw-r--r--examples/org.eclipse.etrice.tutorials.cpp/run_Readme4
-rw-r--r--examples/org.eclipse.etrice.tutorials.cpp/run_Template_Linux_.launch34
-rw-r--r--examples/org.eclipse.etrice.tutorials.cpp/run_Template_Windows_.launch34
-rw-r--r--examples/org.eclipse.etrice.tutorials.cpp/src-gen-info/readme.txt4
-rw-r--r--examples/org.eclipse.etrice.tutorials.cpp/src-gen/readme.txt4
-rw-r--r--plugins/org.eclipse.etrice.doc/featuremodel/etrice.codegenerators.featurizer65
-rw-r--r--plugins/org.eclipse.etrice.doc/online-doc/static/css/custom.css4
-rw-r--r--plugins/org.eclipse.etrice.generator.c/META-INF/MANIFEST.MF13
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ActorClassGen.xtend153
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/CExtensions.xtend92
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeGen.xtend275
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/StateMachineGen.xtend31
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/setup/GeneratorModule.java12
-rw-r--r--plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ActorClassGen.java135
-rw-r--r--plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/CExtensions.java39
-rw-r--r--plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/NodeGen.java129
-rw-r--r--plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/StateMachineGen.java5
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/META-INF/MANIFEST.MF32
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/Main.java77
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ActorClassGen.xtend339
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/CppExtensions.xtend155
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/CppTranslationProvider.java22
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/DataClassGen.xtend227
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/GeneratorSettings.java32
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/Initialization.xtend18
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/MainGen.xtend4
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/NodeGen.xtend250
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/NodeRunnerGen.xtend112
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ProtocolClassGen.xtend558
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/StateMachineGen.xtend115
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/SubSystemClassGen.xtend302
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/SubSystemRunnerGen.xtend93
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/setup/GeneratorModule.java16
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/ActorClassGen.java1265
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/CppExtensions.java197
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/DataClassGen.java634
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/MainGen.java8
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/NodeGen.java680
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/NodeRunnerGen.java255
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/ProtocolClassGen.java1627
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/StateMachineGen.java256
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/SubSystemClassGen.java939
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/SubSystemRunnerGen.java209
-rw-r--r--plugins/org.eclipse.etrice.generator.fsm/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--plugins/org.eclipse.etrice.generator.fsm/src/org/eclipse/etrice/generator/fsm/generic/AbstractStateMachineGenerator.xtend482
-rw-r--r--plugins/org.eclipse.etrice.generator.fsm/src/org/eclipse/etrice/generator/fsm/generic/ILanguageExtensionBase.java122
-rw-r--r--plugins/org.eclipse.etrice.generator.fsm/xtend-gen/org/eclipse/etrice/generator/fsm/generic/AbstractStateMachineGenerator.java25
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ActorClassGen.xtend159
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/DataClassGen.xtend70
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/JavaExtensions.xtend76
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/NodeGen.xtend77
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.xtend84
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/StateMachineGen.xtend23
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/setup/GeneratorModule.java15
-rw-r--r--plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ActorClassGen.java377
-rw-r--r--plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/DataClassGen.java444
-rw-r--r--plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/JavaExtensions.java20
-rw-r--r--plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/NodeGen.java26
-rw-r--r--plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.java41
-rw-r--r--plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/StateMachineGen.java8
-rw-r--r--plugins/org.eclipse.etrice.generator.launch.cpp/src/org/eclipse/etrice/generator/launch/cpp/CppGeneratorConfigTab.java40
-rw-r--r--plugins/org.eclipse.etrice.generator.launch.cpp/src/org/eclipse/etrice/generator/launch/cpp/CppGeneratorLaunchConfigurationDelegate.java11
-rw-r--r--plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/DefaultTranslationProvider.java20
-rw-r--r--plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/generic/GenericStateMachineGenerator.xtend183
-rw-r--r--plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/generic/ProcedureHelpers.xtend235
-rw-r--r--plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/generic/RoomExtensions.xtend64
-rw-r--r--plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/GenericStateMachineGenerator.java311
-rw-r--r--plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/ProcedureHelpers.java532
-rw-r--r--plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/RoomExtensions.java2
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.examples.c.zipbin103380 -> 103431 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.c.zipbin213488 -> 25286 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.cpp.zipbin0 -> 14443 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.java.zipbin43916 -> 26277 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.c.zipbin176697 -> 177245 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.cpp.zipbin0 -> 61114 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.java.zipbin69445 -> 69933 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.template.c.zipbin10957 -> 11006 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.template.cpp.zipbin0 -> 12418 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.c.zipbin19405 -> 20169 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.cpp.zipbin0 -> 21449 bytes
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/create_contents.xml19
-rw-r--r--plugins/org.eclipse.etrice.ui.runtime/plugin.xml227
-rw-r--r--releng/org.eclipse.etrice.releng/buckminster.cspec13
-rw-r--r--releng/org.eclipse.etrice.releng/buckminster.script7
-rw-r--r--runtime/org.eclipse.etrice.modellib.c/.cproject9
-rw-r--r--runtime/org.eclipse.etrice.modellib.cpp/.cproject257
-rw-r--r--runtime/org.eclipse.etrice.modellib.cpp/.gitignore16
-rw-r--r--runtime/org.eclipse.etrice.modellib.cpp/.project1
-rw-r--r--runtime/org.eclipse.etrice.modellib.cpp/.settings/org.eclipse.cdt.core.prefs12
-rw-r--r--runtime/org.eclipse.etrice.modellib.cpp/Makefile20
-rw-r--r--runtime/org.eclipse.etrice.modellib.cpp/buildTools/modellib.mk17
-rw-r--r--runtime/org.eclipse.etrice.modellib.cpp/gen_modellib.launch9
-rw-r--r--runtime/org.eclipse.etrice.modellib.cpp/model/GenericPhysical.etphys43
-rw-r--r--runtime/org.eclipse.etrice.modellib.cpp/model/Tests.room16
-rw-r--r--runtime/org.eclipse.etrice.modellib.cpp/model/TimingService.room349
-rw-r--r--runtime/org.eclipse.etrice.modellib.cpp/model/Types.room4
-rw-r--r--runtime/org.eclipse.etrice.modellib.cpp/model/diagrams/room.basic.service.timing.ATimingService.behavior4
-rw-r--r--runtime/org.eclipse.etrice.modellib.cpp/model/diagrams/room.basic.service.timing.ATimingService.structure7
-rw-r--r--runtime/org.eclipse.etrice.modellib.cpp/src-gen-info/readme.txt4
-rw-r--r--runtime/org.eclipse.etrice.modellib.cpp/src-gen/room/basic/service/timing/ATimingService.cpp263
-rw-r--r--runtime/org.eclipse.etrice.modellib.cpp/src-gen/room/basic/service/timing/ATimingService.h262
-rw-r--r--runtime/org.eclipse.etrice.modellib.cpp/src-gen/room/basic/service/timing/PTimer.cpp242
-rw-r--r--runtime/org.eclipse.etrice.modellib.cpp/src-gen/room/basic/service/timing/PTimer.h139
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/.cproject22
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/.gitignore2
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/buildTools/Makefile5
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/buildTools/Makefile.mk10
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/buildTools/defaults.mk2
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etLogger.h7
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/etStdDatatypes.h13
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.h6
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/osal/etMutex.h7
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/osal/etSema.h7
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/osal/etTcpSockets.h7
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/osal/etThread.h8
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/osal/etTime.h8
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/osal/etTimer.h8
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/runtime/etRuntime.h8
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW/etDatatypes.h8
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/.cproject249
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/.gitignore4
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/.project1
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/.settings/org.eclipse.cdt.core.prefs9
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/Makefile18
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/buildTools/Makefile32
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/buildTools/runtime.mk30
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/gen_runtime.launch17
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/model/SystemServices.room9
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src-gen/common/modelbase/RTSystemServicesProtocol.cpp161
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src-gen/common/modelbase/RTSystemServicesProtocol.h127
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src-gen/readme.txt4
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/DebuggingService.cpp98
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/DebuggingService.h59
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/MSCFilter.cpp11
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/MSCFilter.h18
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/MSCLogger.cpp153
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/MSCLogger.h46
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/AbstractMessageReceiver.h30
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/AbstractMessageService.cpp59
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/AbstractMessageService.h66
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/Address.cpp66
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/Address.h44
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/IMessageReceiver.h10
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/IMessageService.h51
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/IRTObject.cpp8
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/IRTObject.h17
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/Message.cpp100
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/Message.h138
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageDispatcher.cpp115
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageDispatcher.h33
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageSeQueue.cpp15
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageSeQueue.h57
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageService.cpp215
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageService.h96
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageServiceController.cpp146
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageServiceController.h59
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/RTObject.cpp142
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/RTObject.h52
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/RTServices.cpp44
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/RTServices.h45
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/RTSystemServicesProtocol.cpp219
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/RTSystemServicesProtocol.h148
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/ActorClassBase.cpp78
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/ActorClassBase.h74
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/DataPort.cpp34
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/DataPort.h69
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/EventReceiver.cpp21
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/EventReceiver.h22
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/IEventReceiver.h10
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/IInterfaceItem.h27
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/IInterfaceItemOwner.h30
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/IReplicatedInterfaceItem.h30
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/InterfaceItemBase.cpp148
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/InterfaceItemBase.h68
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/PortBase.cpp32
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/PortBase.h27
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/RTSystem.h37
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/RTSystemProtocol.cpp45
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/RTSystemProtocol.h62
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/ReplicatedInterfaceItemBase.cpp93
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/ReplicatedInterfaceItemBase.h75
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/ReplicatedPortBase.h38
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/SubSystemClassBase.cpp125
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/SubSystemClassBase.h78
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/SubSystemRunnerBase.cpp132
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/SubSystemRunnerBase.h18
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/SystemPortOwner.h54
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/TestSemaphore.cpp38
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/TestSemaphore.h45
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/platform/etTimer.h46
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/platforms/generic/etDatatypes.h77
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/gen_runtime.launch18
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/MessageService.java66
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/RTObject.java51
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/InterfaceItemBase.java57
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/RTSystemProtocol.java30
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/common.xml47
-rw-r--r--tests/org.eclipse.etrice.generator.cpp.tests/.gitignore12
-rw-r--r--tests/org.eclipse.etrice.generator.cpp.tests/Makefile16
-rw-r--r--tests/org.eclipse.etrice.generator.cpp.tests/SubSystem_CPTest_Async.seq27
-rw-r--r--tests/org.eclipse.etrice.generator.cpp.tests/SubSystem_CPTest_Sync.seq1
-rw-r--r--tests/org.eclipse.etrice.generator.cpp.tests/SubSystem_HandlerTest_Async.seq48
-rw-r--r--tests/org.eclipse.etrice.generator.cpp.tests/SubSystem_HandlerTest_Sync.seq1
-rw-r--r--tests/org.eclipse.etrice.generator.cpp.tests/buckminster.cspec1
-rw-r--r--tests/org.eclipse.etrice.generator.cpp.tests/make.xml441
-rw-r--r--tests/org.eclipse.etrice.generator.cpp.tests/org.eclipse.etrice.generator.cpp.tests make.xml.launch15
-rw-r--r--tests/org.eclipse.etrice.generator.cpp.tests/targetModels/empty.txt0
-rw-r--r--tests/org.eclipse.etrice.runtime.cpp.tests/.cproject374
-rw-r--r--tests/org.eclipse.etrice.runtime.cpp.tests/.gitignore6
-rw-r--r--tests/org.eclipse.etrice.runtime.cpp.tests/.project29
-rw-r--r--tests/org.eclipse.etrice.runtime.cpp.tests/.settings/org.eclipse.cdt.core.prefs12
-rw-r--r--tests/org.eclipse.etrice.runtime.cpp.tests/.settings/org.eclipse.cdt.managedbuilder.core.prefs13
-rw-r--r--tests/org.eclipse.etrice.runtime.cpp.tests/Makefile14
-rw-r--r--tests/org.eclipse.etrice.runtime.cpp.tests/buckminster.cspec10
-rw-r--r--tests/org.eclipse.etrice.runtime.cpp.tests/make.xml68
-rw-r--r--tests/org.eclipse.etrice.runtime.cpp.tests/org.eclipse.etrice.runtime.cpp.tests make.xml.launch17
-rw-r--r--tests/org.eclipse.etrice.runtime.cpp.tests/src/RunAllTestCases.cpp (renamed from runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/IMessageReceiver.cpp)21
-rw-r--r--tests/org.eclipse.etrice.runtime.cpp.tests/src/messaging/AddressTest.cpp33
-rw-r--r--tests/org.eclipse.etrice.runtime.cpp.tests/src/messaging/AddressTest.h33
-rw-r--r--tests/org.eclipse.etrice.runtime.cpp.tests/src/util/etAssert.h (renamed from runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/IEventReceiver.cpp)21
-rw-r--r--tests/org.eclipse.etrice.runtime.cpp.tests/src/util/etTestSuite.cpp33
-rw-r--r--tests/org.eclipse.etrice.runtime.cpp.tests/src/util/etTestSuite.h49
266 files changed, 13478 insertions, 10244 deletions
diff --git a/examples/org.eclipse.etrice.examples.c/.cproject b/examples/org.eclipse.etrice.examples.c/.cproject
index 5feed9a76..35ea66756 100644
--- a/examples/org.eclipse.etrice.examples.c/.cproject
+++ b/examples/org.eclipse.etrice.examples.c/.cproject
@@ -47,6 +47,7 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/util}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src-gen}&quot;"/>
</option>
+ <option id="gnu.c.compiler.option.dialect.std.580541371" superClass="gnu.c.compiler.option.dialect.std" value="gnu.c.compiler.dialect.c99" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.556343319" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug.385830627" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug">
@@ -140,6 +141,7 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/util}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src-gen}&quot;"/>
</option>
+ <option id="gnu.c.compiler.option.dialect.std.1592888080" superClass="gnu.c.compiler.option.dialect.std" value="gnu.c.compiler.dialect.c99" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1429441529" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug.981845646" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug">
diff --git a/examples/org.eclipse.etrice.template.c/.cproject b/examples/org.eclipse.etrice.template.c/.cproject
index f0fd808e9..9bc2ec820 100644
--- a/examples/org.eclipse.etrice.template.c/.cproject
+++ b/examples/org.eclipse.etrice.template.c/.cproject
@@ -48,6 +48,7 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/util}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src-gen}&quot;"/>
</option>
+ <option id="gnu.c.compiler.option.dialect.std.1920747048" superClass="gnu.c.compiler.option.dialect.std" value="gnu.c.compiler.dialect.default" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1011975041" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug.1647711876" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug">
@@ -142,6 +143,7 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/util}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src-gen}&quot;"/>
</option>
+ <option id="gnu.c.compiler.option.dialect.std.985330533" superClass="gnu.c.compiler.option.dialect.std" value="gnu.c.compiler.dialect.default" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1539026479" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug.524816999" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug">
diff --git a/examples/org.eclipse.etrice.template.cpp/.cproject b/examples/org.eclipse.etrice.template.cpp/.cproject
new file mode 100644
index 000000000..6b918b783
--- /dev/null
+++ b/examples/org.eclipse.etrice.template.cpp/.cproject
@@ -0,0 +1,378 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+ <storageModule moduleId="org.eclipse.cdt.core.settings">
+ <cconfiguration id="cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372" moduleId="org.eclipse.cdt.core.settings" name="WindowsMinGW">
+ <externalSettings/>
+ <extensions>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372" name="WindowsMinGW" parent="cdt.managedbuild.config.gnu.mingw.exe.debug">
+ <folderInfo id="cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372." name="/" resourcePath="">
+ <toolChain id="cdt.managedbuild.toolchain.gnu.mingw.exe.debug.418522507" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.exe.debug">
+ <targetPlatform binaryParser="org.eclipse.cdt.core.PE;org.eclipse.cdt.core.ELF" id="cdt.managedbuild.target.gnu.platform.mingw.exe.debug.1394894600" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.exe.debug"/>
+ <builder buildPath="${workspace_loc:/org.eclipse.etrice.template.cpp}/WindowsMinGW" id="cdt.managedbuild.tool.gnu.builder.mingw.base.966111836" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="cdt.managedbuild.tool.gnu.builder.mingw.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.assembler.mingw.exe.debug.1106927259" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.exe.debug">
+ <option id="gnu.both.asm.option.include.paths.1947689275" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.modellib.cpp}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.modellib.cpp/src-gen}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src/}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/common}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src-gen}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/config}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/util}&quot;"/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1024603493" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.1499945448" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug.724131833" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug">
+ <option id="gnu.cpp.compiler.mingw.exe.debug.option.optimization.level.1780976094" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.exe.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.mingw.exe.debug.option.debugging.level.1664887698" name="Debug Level" superClass="gnu.cpp.compiler.mingw.exe.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.include.paths.836599006" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.modellib.cpp}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.modellib.cpp/src-gen}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src/}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/common}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src-gen}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/config}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/util}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src-gen}&quot;"/>
+ </option>
+ <option id="gnu.cpp.compiler.option.dialect.std.930835239" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" value="gnu.cpp.compiler.dialect.default" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.warnings.pedantic.1931311750" name="Pedantic (-pedantic)" superClass="gnu.cpp.compiler.option.warnings.pedantic" value="false" valueType="boolean"/>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.46783824" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.1071304858" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug">
+ <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.mingw.exe.debug.option.optimization.level.1653609723" name="Optimization Level" superClass="gnu.c.compiler.mingw.exe.debug.option.optimization.level" valueType="enumerated"/>
+ <option id="gnu.c.compiler.mingw.exe.debug.option.debugging.level.2060996838" name="Debug Level" superClass="gnu.c.compiler.mingw.exe.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.include.paths.792248644" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths"/>
+ <option id="gnu.c.compiler.option.dialect.std.1702962683" name="Language standard" superClass="gnu.c.compiler.option.dialect.std" value="gnu.c.compiler.dialect.c90" valueType="enumerated"/>
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1116416627" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug.1616927644" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug"/>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug.716010295" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug">
+ <option id="gnu.cpp.link.option.paths.11130594" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.modellib.cpp/WindowsMinGW}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/WindowsMinGW}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/WindowsMinGW}&quot;"/>
+ </option>
+ <option id="gnu.cpp.link.option.libs.491428449" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
+ <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="org.eclipse.etrice.modellib.cpp"/>
+ <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="org.eclipse.etrice.runtime.cpp"/>
+ <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="org.eclipse.etrice.runtime.c"/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1779793303" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+ <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+ <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+ </inputType>
+ </tool>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry excluding="src-gen-info" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings">
+ <externalSettings containerId="org.eclipse.etrice.runtime.c;cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier">
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/org.eclipse.etrice.runtime.c"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/common"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/config"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/util"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.runtime.c/WindowsMinGW"/>
+ <entry flags="RESOLVED" kind="libraryFile" name="org.eclipse.etrice.runtime.c" srcPrefixMapping="" srcRootPath=""/>
+ </externalSetting>
+ </externalSettings>
+ <externalSettings containerId="org.eclipse.etrice.runtime.cpp;cdt.managedbuild.config.gnu.mingw.lib.debug.878140176" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier">
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/org.eclipse.etrice.runtime.cpp"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.cpp/src/"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/common"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.cpp/src-gen"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.cpp/src"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.runtime.cpp/WindowsMinGW"/>
+ <entry flags="RESOLVED" kind="libraryFile" name="org.eclipse.etrice.runtime.cpp" srcPrefixMapping="" srcRootPath=""/>
+ </externalSetting>
+ </externalSettings>
+ <externalSettings containerId="org.eclipse.etrice.modellib.cpp;cdt.managedbuild.config.gnu.mingw.lib.debug.44153035" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier">
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/org.eclipse.etrice.modellib.cpp"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.modellib.cpp/src-gen"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.modellib.cpp/WindowsMinGW"/>
+ <entry flags="RESOLVED" kind="libraryFile" name="org.eclipse.etrice.modellib.cpp" srcPrefixMapping="" srcRootPath=""/>
+ </externalSetting>
+ </externalSettings>
+ </storageModule>
+ </cconfiguration>
+ <cconfiguration id="cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309" moduleId="org.eclipse.cdt.core.settings" name="ExternalMakefile">
+ <externalSettings/>
+ <extensions>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309" name="ExternalMakefile" parent="cdt.managedbuild.config.gnu.mingw.exe.debug">
+ <folderInfo id="cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309." name="/" resourcePath="">
+ <toolChain id="cdt.managedbuild.toolchain.gnu.mingw.exe.debug.88658143" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.exe.debug">
+ <targetPlatform binaryParser="org.eclipse.cdt.core.PE;org.eclipse.cdt.core.ELF" id="cdt.managedbuild.target.gnu.platform.mingw.exe.debug.2103573969" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.exe.debug"/>
+ <builder arguments="-f ${workspace_loc:org.eclipse.etrice.runtime.cpp}/buildTools/Makefile" cleanBuildTarget="clean_build" command="make" id="cdt.managedbuild.target.gnu.builder.base.1427935129" incrementalBuildTarget="build" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="false" superClass="cdt.managedbuild.target.gnu.builder.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.assembler.mingw.exe.debug.279658872" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.exe.debug">
+ <option id="gnu.both.asm.option.include.paths.866765549" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.modellib.cpp}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/common}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src-gen}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src}&quot;"/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.assembler.input.760997608" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.1436020519" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug.1486478189" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug">
+ <option id="gnu.cpp.compiler.mingw.exe.debug.option.optimization.level.1723240029" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.exe.debug.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.mingw.exe.debug.option.debugging.level.271123914" name="Debug Level" superClass="gnu.cpp.compiler.mingw.exe.debug.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.include.paths.1967618567" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.modellib.cpp}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/common}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src-gen}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src-gen}&quot;"/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1241078740" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.1849062664" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug">
+ <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.mingw.exe.debug.option.optimization.level.225989001" name="Optimization Level" superClass="gnu.c.compiler.mingw.exe.debug.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/>
+ <option id="gnu.c.compiler.mingw.exe.debug.option.debugging.level.1428552349" name="Debug Level" superClass="gnu.c.compiler.mingw.exe.debug.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.include.paths.3716756" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.modellib.cpp}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/common}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src-gen}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src}&quot;"/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.311967814" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug.1987098668" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug"/>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug.1554422721" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug">
+ <option id="gnu.cpp.link.option.paths.113953250" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.modellib.cpp/ExternalMakefile}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.modellib.cpp}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/ExternalMakefile}&quot;"/>
+ </option>
+ <option id="gnu.cpp.link.option.libs.1547842592" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
+ <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="org.eclipse.etrice.modellib.cpp"/>
+ <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="org.eclipse.etrice.runtime.cpp"/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1170077261" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+ <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+ <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+ </inputType>
+ </tool>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry excluding="src-gen-info" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings">
+ <externalSettings containerId="org.eclipse.etrice.runtime.cpp;cdt.managedbuild.config.gnu.mingw.lib.debug.878140176.1748792605" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier">
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/org.eclipse.etrice.runtime.cpp"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/common"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.cpp/src-gen"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.cpp/src"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.runtime.cpp/ExternalMakefile"/>
+ <entry flags="RESOLVED" kind="libraryFile" name="org.eclipse.etrice.runtime.cpp" srcPrefixMapping="" srcRootPath=""/>
+ </externalSetting>
+ </externalSettings>
+ <externalSettings containerId="org.eclipse.etrice.modellib.cpp;cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.90416093" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier">
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/org.eclipse.etrice.modellib.cpp"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.modellib.cpp/ExternalMakefile"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.modellib.cpp"/>
+ <entry flags="RESOLVED" kind="libraryFile" name="org.eclipse.etrice.modellib.cpp" srcPrefixMapping="" srcRootPath=""/>
+ </externalSetting>
+ </externalSettings>
+ </storageModule>
+ </cconfiguration>
+ <cconfiguration id="cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675" moduleId="org.eclipse.cdt.core.settings" name="LinuxPosix">
+ <externalSettings/>
+ <extensions>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675" name="LinuxPosix" parent="cdt.managedbuild.config.gnu.mingw.exe.debug">
+ <folderInfo id="cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675." name="/" resourcePath="">
+ <toolChain id="cdt.managedbuild.toolchain.gnu.base.1209374409" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.base">
+ <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.PE;org.eclipse.cdt.core.ELF" id="cdt.managedbuild.target.gnu.platform.base.1949788205" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/>
+ <builder buildPath="${workspace_loc:/org.eclipse.etrice.template.cpp}/LinuxPosix" id="cdt.managedbuild.target.gnu.builder.base.890389796" keepEnvironmentInBuildfile="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="cdt.managedbuild.target.gnu.builder.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.archiver.base.1946903351" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.924367323" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base">
+ <option id="gnu.cpp.compiler.option.include.paths.1022838042" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.modellib.cpp/src-gen}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src-gen}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/platforms/MT_POSIX_GENERIC_GCC}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/common}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src-gen}&quot;"/>
+ </option>
+ <option id="gnu.cpp.compiler.option.optimization.level.90770693" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.debugging.level.1040355827" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.235973880" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.compiler.base.1331416696" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.base">
+ <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.487847866" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.debugging.level.164525895" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.include.paths.770176081" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths"/>
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.2003313590" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.linker.base.1678871535" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.linker.base.222066514" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base">
+ <option id="gnu.cpp.link.option.libs.1882186128" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
+ <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="org.eclipse.etrice.modellib.cpp"/>
+ <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="org.eclipse.etrice.runtime.cpp"/>
+ <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="org.eclipse.etrice.runtime.c"/>
+ <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="pthread"/>
+ <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="rt"/>
+ </option>
+ <option id="gnu.cpp.link.option.paths.1451265412" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.modellib.cpp/LinuxPosix}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/LinuxPosix}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/LinuxPosix}&quot;"/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.616137082" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+ <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+ <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+ </inputType>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.assembler.base.1684552365" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.base">
+ <option id="gnu.both.asm.option.include.paths.1113457472" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.modellib.cpp}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.modellib.cpp/src-gen}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src-gen}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/platforms/MT_POSIX_GENERIC_GCC}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/common}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/config}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/util}&quot;"/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.assembler.input.723404626" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+ </tool>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry excluding="src-gen-info" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings">
+ <externalSettings containerId="org.eclipse.etrice.runtime.c;cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919.294295052" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier">
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/org.eclipse.etrice.runtime.c"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/common"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/config"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/platforms/MT_POSIX_GENERIC_GCC"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/util"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.runtime.c/LinuxPosix"/>
+ <entry flags="RESOLVED" kind="libraryFile" name="org.eclipse.etrice.runtime.c" srcPrefixMapping="" srcRootPath=""/>
+ </externalSetting>
+ </externalSettings>
+ <externalSettings containerId="org.eclipse.etrice.runtime.cpp;cdt.managedbuild.config.gnu.mingw.lib.debug.878140176.190433079" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier">
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/org.eclipse.etrice.runtime.cpp"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.cpp/src-gen"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.cpp/src"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/platforms/MT_POSIX_GENERIC_GCC"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/common"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.runtime.cpp/LinuxPosix"/>
+ <entry flags="RESOLVED" kind="libraryFile" name="org.eclipse.etrice.runtime.cpp" srcPrefixMapping="" srcRootPath=""/>
+ </externalSetting>
+ </externalSettings>
+ <externalSettings containerId="org.eclipse.etrice.modellib.cpp;cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.551809464" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier">
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/org.eclipse.etrice.modellib.cpp"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.modellib.cpp/src-gen"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.modellib.cpp/LinuxPosix"/>
+ <entry flags="RESOLVED" kind="libraryFile" name="org.eclipse.etrice.modellib.cpp" srcPrefixMapping="" srcRootPath=""/>
+ </externalSetting>
+ </externalSettings>
+ </storageModule>
+ </cconfiguration>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <project id="org.eclipse.etrice.template.cpp.cdt.managedbuild.target.gnu.mingw.exe.1864681474" name="Executable" projectType="cdt.managedbuild.target.gnu.mingw.exe"/>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
+ <storageModule moduleId="refreshScope" versionNumber="2">
+ <configuration configurationName="ExternalMakefile">
+ <resource resourceType="PROJECT" workspacePath="/org.eclipse.etrice.template.cpp"/>
+ </configuration>
+ <configuration configurationName="WindowsMinGW">
+ <resource resourceType="PROJECT" workspacePath="/org.eclipse.etrice.template.cpp"/>
+ </configuration>
+ <configuration configurationName="LinuxPosix">
+ <resource resourceType="PROJECT" workspacePath="/org.eclipse.etrice.template.cpp"/>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="scannerConfiguration">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675;cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675.;cdt.managedbuild.tool.gnu.c.compiler.base.1331416696;cdt.managedbuild.tool.gnu.c.compiler.input.2003313590">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372;cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug.724131833;cdt.managedbuild.tool.gnu.cpp.compiler.input.46783824">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372;cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.;cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.1071304858;cdt.managedbuild.tool.gnu.c.compiler.input.1116416627">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675;cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675.;cdt.managedbuild.tool.gnu.cpp.compiler.base.924367323;cdt.managedbuild.tool.gnu.cpp.compiler.input.235973880">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309;cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309.;cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.1849062664;cdt.managedbuild.tool.gnu.c.compiler.input.311967814">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309;cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug.1486478189;cdt.managedbuild.tool.gnu.cpp.compiler.input.1241078740">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </scannerConfigBuildInfo>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cproject>
diff --git a/examples/org.eclipse.etrice.template.cpp/.gitignore b/examples/org.eclipse.etrice.template.cpp/.gitignore
new file mode 100644
index 000000000..d2a6ec005
--- /dev/null
+++ b/examples/org.eclipse.etrice.template.cpp/.gitignore
@@ -0,0 +1,8 @@
+WindowsMinGW
+LinuxPosix
+src-gen/*
+!src-gen/readme.txt
+src-gen-info/*
+!src-gen-info/readme.txt
+log/*
+!log/readme.txt
diff --git a/examples/org.eclipse.etrice.template.cpp/.project b/examples/org.eclipse.etrice.template.cpp/.project
new file mode 100644
index 000000000..e984d5a42
--- /dev/null
+++ b/examples/org.eclipse.etrice.template.cpp/.project
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.etrice.template.cpp</name>
+ <comment></comment>
+ <projects>
+ <project>org.eclipse.etrice.runtime.cpp</project>
+ <project>org.eclipse.etrice.modellib.cpp</project>
+ <project>org.eclipse.etrice.runtime.c</project>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+ <triggers>clean,full,incremental,</triggers>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+ <triggers>full,incremental,</triggers>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.core.ccnature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+ <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+ </natures>
+</projectDescription>
diff --git a/examples/org.eclipse.etrice.template.cpp/.settings/org.eclipse.cdt.core.prefs b/examples/org.eclipse.etrice.template.cpp/.settings/org.eclipse.cdt.core.prefs
new file mode 100644
index 000000000..ba50e9cec
--- /dev/null
+++ b/examples/org.eclipse.etrice.template.cpp/.settings/org.eclipse.cdt.core.prefs
@@ -0,0 +1,37 @@
+eclipse.preferences.version=1
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675/CPP_MODELLIB_ROOTDIR/delimiter=;
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675/CPP_MODELLIB_ROOTDIR/operation=append
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675/CPP_MODELLIB_ROOTDIR/value=${workspace_loc\:org.eclipse.etrice.modellib.cpp}
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675/CPP_RUNTIME_ROOTDIR/delimiter=;
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675/CPP_RUNTIME_ROOTDIR/operation=append
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675/CPP_RUNTIME_ROOTDIR/value=${workspace_loc\:org.eclipse.etrice.runtime.cpp}
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675/RUNTIME_ROOTDIR/delimiter=;
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675/RUNTIME_ROOTDIR/operation=append
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675/RUNTIME_ROOTDIR/value=${workspace_loc\:org.eclipse.etrice.runtime.c}
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675/append=true
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675/appendContributed=true
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309/CPP_MODELLIB_ROOTDIR/delimiter=;
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309/CPP_MODELLIB_ROOTDIR/operation=append
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309/CPP_MODELLIB_ROOTDIR/value=${workspace_loc\:org.eclipse.etrice.modellib.cpp}
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309/CPP_RUNTIME_ROOTDIR/delimiter=;
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309/CPP_RUNTIME_ROOTDIR/operation=append
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309/CPP_RUNTIME_ROOTDIR/value=${workspace_loc\:org.eclipse.etrice.runtime.cpp}
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309/ECLIPSE_MODE/delimiter=;
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309/ECLIPSE_MODE/operation=append
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309/ECLIPSE_MODE/value=true
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309/RUNTIME_ROOTDIR/delimiter=;
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309/RUNTIME_ROOTDIR/operation=append
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309/RUNTIME_ROOTDIR/value=${workspace_loc\:org.eclipse.etrice.runtime.c}
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309/append=true
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309/appendContributed=true
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/CPP_MODELLIB_ROOTDIR/delimiter=;
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/CPP_MODELLIB_ROOTDIR/operation=append
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/CPP_MODELLIB_ROOTDIR/value=${workspace_loc\:org.eclipse.etrice.modellib.cpp}
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/CPP_RUNTIME_ROOTDIR/delimiter=;
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/CPP_RUNTIME_ROOTDIR/operation=append
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/CPP_RUNTIME_ROOTDIR/value=${workspace_loc\:org.eclipse.etrice.runtime.cpp}
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/RUNTIME_ROOTDIR/delimiter=;
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/RUNTIME_ROOTDIR/operation=append
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/RUNTIME_ROOTDIR/value=${workspace_loc\:org.eclipse.etrice.runtime.c}
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/append=true
+environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/appendContributed=true
diff --git a/examples/org.eclipse.etrice.template.cpp/.settings/org.eclipse.cdt.managedbuilder.core.prefs b/examples/org.eclipse.etrice.template.cpp/.settings/org.eclipse.cdt.managedbuilder.core.prefs
new file mode 100644
index 000000000..99e96a40b
--- /dev/null
+++ b/examples/org.eclipse.etrice.template.cpp/.settings/org.eclipse.cdt.managedbuilder.core.prefs
@@ -0,0 +1,13 @@
+eclipse.preferences.version=1
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/CPATH/delimiter=;
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/CPATH/operation=remove
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/CPLUS_INCLUDE_PATH/delimiter=;
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/CPLUS_INCLUDE_PATH/operation=remove
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/C_INCLUDE_PATH/delimiter=;
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/C_INCLUDE_PATH/operation=remove
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/append=true
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/appendContributed=true
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/LIBRARY_PATH/delimiter=;
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/LIBRARY_PATH/operation=remove
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/append=true
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/appendContributed=true
diff --git a/examples/org.eclipse.etrice.template.cpp/generate_Template.launch b/examples/org.eclipse.etrice.template.cpp/generate_Template.launch
new file mode 100644
index 000000000..970394f6a
--- /dev/null
+++ b/examples/org.eclipse.etrice.template.cpp/generate_Template.launch
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.etrice.generator.launch.cpp.launchConfigurationType">
+<booleanAttribute key="Debug" value="false"/>
+<booleanAttribute key="GenDocumentation" value="false"/>
+<booleanAttribute key="GenInstanceDiagram" value="false"/>
+<stringAttribute key="GenModelPath" value=""/>
+<booleanAttribute key="Lib" value="false"/>
+<booleanAttribute key="MSC" value="true"/>
+<booleanAttribute key="DataLogging" value="true"/>
+<listAttribute key="ModelFiles">
+<listEntry value="${workspace_loc:/org.eclipse.etrice.template.cpp/model/Mapping.etmap}"/>
+</listAttribute>
+<booleanAttribute key="OverrideDirectories" value="false"/>
+<booleanAttribute key="SaveGenModel" value="false"/>
+<booleanAttribute key="UseTranslation" value="true"/>
+<booleanAttribute key="Verbose" value="false"/>
+<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${workspace}"/>
+</launchConfiguration>
diff --git a/examples/org.eclipse.etrice.template.cpp/log/readme.txt b/examples/org.eclipse.etrice.template.cpp/log/readme.txt
new file mode 100644
index 000000000..dadbdcfe8
--- /dev/null
+++ b/examples/org.eclipse.etrice.template.cpp/log/readme.txt
@@ -0,0 +1 @@
+This directory is an eTrice directory used for logging e.g. MSC. \ No newline at end of file
diff --git a/examples/org.eclipse.etrice.template.cpp/model/Mapping.etmap b/examples/org.eclipse.etrice.template.cpp/model/Mapping.etmap
new file mode 100644
index 000000000..a4c5d8fb0
--- /dev/null
+++ b/examples/org.eclipse.etrice.template.cpp/model/Mapping.etmap
@@ -0,0 +1,17 @@
+/*
+ * This model defines a mapping between a logical ROOM model and a physical model (nodes and threads).
+ *
+ * <p>Hint: Press F3 to open declaration of selected element or import</p>
+ */
+MappingModel TemplateMapping {
+
+ import TemplatePhysical.* from "Physical.etphys"
+ import TemplateModel.* from "TemplateModel.room"
+
+ Mapping LogSys -> TemplatePhysicalSystem {
+ SubSystemMapping subSystemRef -> node {
+ ThreadMapping defaultThread -> DefaultPhysicalThread
+ }
+ }
+
+} \ No newline at end of file
diff --git a/examples/org.eclipse.etrice.template.cpp/model/Physical.etphys b/examples/org.eclipse.etrice.template.cpp/model/Physical.etphys
new file mode 100644
index 000000000..2bf93c456
--- /dev/null
+++ b/examples/org.eclipse.etrice.template.cpp/model/Physical.etphys
@@ -0,0 +1,43 @@
+PhysicalModel TemplatePhysical {
+
+ PhysicalSystem TemplatePhysicalSystem {
+ NodeRef node : DefaultNodeClass
+ }
+
+ NodeClass DefaultNodeClass {
+ runtime = DefaultRuntimeClass
+ priomin = -10
+ priomax = 10
+
+ DefaultThread DefaultPhysicalThread {
+ execmode = mixed
+ interval = 100ms
+ prio = 0
+ stacksize = 1024
+ msgblocksize = 64
+ msgpoolsize = 100
+ }
+
+ Thread BlockedThread {
+ execmode = blocked
+ prio = 0
+ stacksize = 1024
+ msgblocksize = 64
+ msgpoolsize = 100
+ }
+
+ Thread PolledThread {
+ execmode = polled
+ interval = 100ms
+ prio = 0
+ stacksize = 1024
+ msgblocksize = 64
+ msgpoolsize = 100
+ }
+ }
+
+ RuntimeClass DefaultRuntimeClass {
+ model = multiThreaded
+ }
+
+} \ No newline at end of file
diff --git a/examples/org.eclipse.etrice.template.cpp/model/TemplateModel.room b/examples/org.eclipse.etrice.template.cpp/model/TemplateModel.room
new file mode 100644
index 000000000..289121e99
--- /dev/null
+++ b/examples/org.eclipse.etrice.template.cpp/model/TemplateModel.room
@@ -0,0 +1,76 @@
+/*
+ * Shortkeys:
+ * Ctrl+Space - content assist
+ * F3 - open declaration of selected element
+ * Alt+S - open structure diagram
+ * Alt+B - open behavior diagram
+ * Alt+M - open textual editor (in diagrams)
+ */
+RoomModel TemplateModel {
+
+ import room.basic.types.* from "../../org.eclipse.etrice.modellib.cpp/model/Types.room"
+ import room.basic.service.timing.* from "../../org.eclipse.etrice.modellib.cpp/model/TimingService.room"
+
+ LogicalSystem LogSys {
+ SubSystemRef subSystemRef: SubSysClass
+ }
+
+ SubSystemClass SubSysClass {
+ ActorRef topActor: TopActor
+ ActorRef timingService: ATimingService
+ LayerConnection ref topActor satisfied_by timingService.timer
+ LogicalThread defaultThread
+ }
+
+ // - build your application from here
+ ActorClass TopActor {
+ Structure {
+
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> helloState
+ State helloState {
+ entry {
+ "printf(\"### Hello World! ###\\n\");"
+ }
+ }
+ }
+ }
+ }
+
+ // - PingPong building kit
+
+ ProtocolClass PingPongProtocol {
+ incoming {
+ Message ping()
+ }
+ outgoing {
+ Message pong()
+ }
+ }
+
+ ActorClass Sender {
+ Interface {
+ conjugated Port sendPort: PingPongProtocol
+ }
+ Structure {
+ external Port sendPort
+ }
+ Behavior {
+ }
+ }
+
+ ActorClass Receiver {
+ Interface {
+ Port recvPort: PingPongProtocol
+ }
+ Structure {
+ external Port recvPort
+ SAP timingService: PTimer
+ }
+ Behavior {
+ }
+ }
+
+} \ No newline at end of file
diff --git a/examples/org.eclipse.etrice.template.cpp/model/diagrams/TemplateModel.Receiver.structure b/examples/org.eclipse.etrice.template.cpp/model/diagrams/TemplateModel.Receiver.structure
new file mode 100644
index 000000000..29a5d648c
--- /dev/null
+++ b/examples/org.eclipse.etrice.template.cpp/model/diagrams/TemplateModel.Receiver.structure
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="ASCII"?>
+<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" gridUnit="10" diagramTypeId="room.structure" name="Structure of Receiver" pictogramLinks="//@link //@children.0/@link //@children.0/@children.0/@link" verticalGridUnit="10" version="0.11.0">
+ <graphicsAlgorithm xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.0" lineWidth="1" transparency="0.0" width="1000" height="1000"/>
+ <link>
+ <businessObjects href="../TemplateModel.room#ActorClass:Receiver"/>
+ </link>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="cls"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="880" height="580" x="40" y="40">
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.2" lineWidth="1" lineVisible="false" transparency="0.5" width="800" height="500" x="40" y="40"/>
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" foreground="//@colors.2" lineWidth="4" filled="false" transparency="0.0" width="800" height="500" x="40" y="40"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../TemplateModel.room#ActorClass:Receiver"/>
+ </link>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="port"/>
+ <properties key="inherited" value="false"/>
+ <properties key="item-kind" value=""/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="80" height="80" x="400">
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.2" foreground="//@colors.2" lineWidth="2" transparency="0.0" width="40" height="40" x="20" y="20"/>
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.1" foreground="//@colors.1" lineWidth="2" transparency="0.0" width="20" height="20" x="30" y="30"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../TemplateModel.room#Port:Receiver$recvPort"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" referencedGraphicsAlgorithm="//@children.0/@children.0/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="80" height="20" font="//@fonts.0" value="recvPort"/>
+ </children>
+ </children>
+ </children>
+ <colors red="227" green="238" blue="249"/>
+ <colors red="255" green="255" blue="255"/>
+ <colors/>
+ <fonts name="Arial" size="8"/>
+</pi:Diagram>
diff --git a/examples/org.eclipse.etrice.template.cpp/model/diagrams/TemplateModel.Sender.structure b/examples/org.eclipse.etrice.template.cpp/model/diagrams/TemplateModel.Sender.structure
new file mode 100644
index 000000000..d952f1e7e
--- /dev/null
+++ b/examples/org.eclipse.etrice.template.cpp/model/diagrams/TemplateModel.Sender.structure
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="ASCII"?>
+<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" gridUnit="10" diagramTypeId="room.structure" name="Structure of Sender" pictogramLinks="//@link //@children.0/@link //@children.0/@children.0/@link" verticalGridUnit="10" version="0.11.0">
+ <graphicsAlgorithm xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.0" lineWidth="1" transparency="0.0" width="1000" height="1000"/>
+ <link>
+ <businessObjects href="../TemplateModel.room#ActorClass:Sender"/>
+ </link>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="cls"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="880" height="580" x="40" y="40">
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.2" lineWidth="1" lineVisible="false" transparency="0.5" width="800" height="500" x="40" y="40"/>
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" foreground="//@colors.2" lineWidth="4" filled="false" transparency="0.0" width="800" height="500" x="40" y="40"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../TemplateModel.room#ActorClass:Sender"/>
+ </link>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="port"/>
+ <properties key="inherited" value="false"/>
+ <properties key="item-kind" value="C"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="80" height="80" x="396" y="500">
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.2" lineWidth="2" transparency="0.0" width="40" height="40" x="20" y="20"/>
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.2" foreground="//@colors.2" lineWidth="2" transparency="0.0" width="20" height="20" x="30" y="30"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../TemplateModel.room#Port:Sender$sendPort"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" referencedGraphicsAlgorithm="//@children.0/@children.0/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="80" height="20" y="60" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="sendPort"/>
+ </children>
+ </children>
+ </children>
+ <colors red="227" green="238" blue="249"/>
+ <colors red="255" green="255" blue="255"/>
+ <colors/>
+ <fonts name="Arial" size="8"/>
+</pi:Diagram>
diff --git a/examples/org.eclipse.etrice.template.cpp/run_Template_Linux_.launch b/examples/org.eclipse.etrice.template.cpp/run_Template_Linux_.launch
new file mode 100644
index 000000000..1e3baa52b
--- /dev/null
+++ b/examples/org.eclipse.etrice.template.cpp/run_Template_Linux_.launch
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.cdt.launch.applicationLaunchType">
+<booleanAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB" value="true"/>
+<listAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB_LIST"/>
+<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="gdb"/>
+<booleanAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_ON_FORK" value="false"/>
+<stringAttribute key="org.eclipse.cdt.dsf.gdb.GDB_INIT" value=".gdbinit"/>
+<booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="false"/>
+<booleanAttribute key="org.eclipse.cdt.dsf.gdb.REVERSE" value="false"/>
+<listAttribute key="org.eclipse.cdt.dsf.gdb.SOLIB_PATH"/>
+<stringAttribute key="org.eclipse.cdt.dsf.gdb.TRACEPOINT_MODE" value="TP_NORMAL_ONLY"/>
+<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
+<booleanAttribute key="org.eclipse.cdt.dsf.gdb.internal.ui.launching.LocalApplicationCDebuggerTab.DEFAULTS_SET" value="true"/>
+<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
+<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
+<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_ID" value="gdb"/>
+<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/>
+<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="run"/>
+<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>
+<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
+<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="LinuxPosix/org.eclipse.etrice.template.cpp.exe"/>
+<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="org.eclipse.etrice.template.cpp"/>
+<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675"/>
+<booleanAttribute key="org.eclipse.cdt.launch.use_terminal" value="true"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.etrice.template.cpp"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="4"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;memoryBlockExpressionList context=&quot;reserved-for-future-use&quot;/&gt;&#13;&#10;"/>
+<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
+</launchConfiguration>
diff --git a/examples/org.eclipse.etrice.template.cpp/run_Template_Windows_.launch b/examples/org.eclipse.etrice.template.cpp/run_Template_Windows_.launch
new file mode 100644
index 000000000..bd84dcf3a
--- /dev/null
+++ b/examples/org.eclipse.etrice.template.cpp/run_Template_Windows_.launch
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.cdt.launch.applicationLaunchType">
+<booleanAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB" value="true"/>
+<listAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB_LIST"/>
+<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="gdb"/>
+<booleanAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_ON_FORK" value="false"/>
+<stringAttribute key="org.eclipse.cdt.dsf.gdb.GDB_INIT" value=".gdbinit"/>
+<booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="false"/>
+<booleanAttribute key="org.eclipse.cdt.dsf.gdb.REVERSE" value="false"/>
+<listAttribute key="org.eclipse.cdt.dsf.gdb.SOLIB_PATH"/>
+<stringAttribute key="org.eclipse.cdt.dsf.gdb.TRACEPOINT_MODE" value="TP_NORMAL_ONLY"/>
+<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
+<booleanAttribute key="org.eclipse.cdt.dsf.gdb.internal.ui.launching.LocalApplicationCDebuggerTab.DEFAULTS_SET" value="true"/>
+<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
+<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
+<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_ID" value="gdb"/>
+<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/>
+<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="run"/>
+<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>
+<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
+<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="WindowsMinGW\org.eclipse.etrice.template.cpp.exe"/>
+<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="org.eclipse.etrice.template.cpp"/>
+<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372"/>
+<booleanAttribute key="org.eclipse.cdt.launch.use_terminal" value="true"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.etrice.template.cpp"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="4"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;memoryBlockExpressionList context=&quot;reserved-for-future-use&quot;/&gt;&#13;&#10;"/>
+<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
+</launchConfiguration>
diff --git a/examples/org.eclipse.etrice.template.cpp/src-gen-info/readme.txt b/examples/org.eclipse.etrice.template.cpp/src-gen-info/readme.txt
new file mode 100644
index 000000000..1dc2b35ab
--- /dev/null
+++ b/examples/org.eclipse.etrice.template.cpp/src-gen-info/readme.txt
@@ -0,0 +1,4 @@
+This directory is an eTrice code generation target.
+It will be erased every time the generator is executed.
+
+DO NOT PLACE OTHER FILES HERE!
diff --git a/examples/org.eclipse.etrice.template.cpp/src-gen/readme.txt b/examples/org.eclipse.etrice.template.cpp/src-gen/readme.txt
new file mode 100644
index 000000000..1dc2b35ab
--- /dev/null
+++ b/examples/org.eclipse.etrice.template.cpp/src-gen/readme.txt
@@ -0,0 +1,4 @@
+This directory is an eTrice code generation target.
+It will be erased every time the generator is executed.
+
+DO NOT PLACE OTHER FILES HERE!
diff --git a/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/HelloWorld.room b/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/HelloWorld.room
index cad07ec56..174187b08 100644
--- a/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/HelloWorld.room
+++ b/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/HelloWorld.room
@@ -1,4 +1,4 @@
-/*
+/*
* Shortkeys:
* Ctrl+Space - content assist
* F3 - open declaration of selected element
@@ -25,7 +25,7 @@ RoomModel HelloWorldModel {
// - build your application from here
ActorClass TopActor {
Structure {
-
+
}
Behavior {
StateMachine {
diff --git a/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/Mapping.etmap b/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/Mapping.etmap
index d474a7983..2c9c9bdc5 100644
--- a/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/Mapping.etmap
+++ b/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/Mapping.etmap
@@ -1,14 +1,14 @@
/*
* This model defines a mapping between a logical ROOM model and a physical model (nodes and threads).
- *
+ *
* <p>Hint: Press F3 to open declaration of selected element or import</p>
*/
MappingModel TemplateMapping {
-
- import room.generic.physical.* from "../../../org.eclipse.etrice.modellib.c/model/GenericPhysical.etphys"
+
+ import TemplatePhysical.* from "Physical.etphys"
import HelloWorldModel.* from "HelloWorld.room"
- Mapping LogSys -> GenericPhysicalSystem {
+ Mapping LogSys -> TemplatePhysicalSystem {
SubSystemMapping subSystemRef -> node {
ThreadMapping defaultThread -> DefaultPhysicalThread
}
diff --git a/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/Physical.etphys b/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/Physical.etphys
new file mode 100644
index 000000000..2bf93c456
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/Physical.etphys
@@ -0,0 +1,43 @@
+PhysicalModel TemplatePhysical {
+
+ PhysicalSystem TemplatePhysicalSystem {
+ NodeRef node : DefaultNodeClass
+ }
+
+ NodeClass DefaultNodeClass {
+ runtime = DefaultRuntimeClass
+ priomin = -10
+ priomax = 10
+
+ DefaultThread DefaultPhysicalThread {
+ execmode = mixed
+ interval = 100ms
+ prio = 0
+ stacksize = 1024
+ msgblocksize = 64
+ msgpoolsize = 100
+ }
+
+ Thread BlockedThread {
+ execmode = blocked
+ prio = 0
+ stacksize = 1024
+ msgblocksize = 64
+ msgpoolsize = 100
+ }
+
+ Thread PolledThread {
+ execmode = polled
+ interval = 100ms
+ prio = 0
+ stacksize = 1024
+ msgblocksize = 64
+ msgpoolsize = 100
+ }
+ }
+
+ RuntimeClass DefaultRuntimeClass {
+ model = multiThreaded
+ }
+
+} \ No newline at end of file
diff --git a/examples/org.eclipse.etrice.tutorials.c/model/PingPong/Mapping.etmap b/examples/org.eclipse.etrice.tutorials.c/model/PingPong/Mapping.etmap
index 2ff1cc88e..f49796b29 100644
--- a/examples/org.eclipse.etrice.tutorials.c/model/PingPong/Mapping.etmap
+++ b/examples/org.eclipse.etrice.tutorials.c/model/PingPong/Mapping.etmap
@@ -1,14 +1,14 @@
/*
* This model defines a mapping between a logical ROOM model and a physical model (nodes and threads).
- *
+ *
* <p>Hint: Press F3 to open declaration of selected element or import</p>
*/
MappingModel TemplateMapping {
-
- import room.generic.physical.* from "../../../org.eclipse.etrice.modellib.c/model/GenericPhysical.etphys"
+
+ import TemplatePhysical.* from "Physical.etphys"
import PingPongModel.* from "PingPong.room"
- Mapping LogSys -> GenericPhysicalSystem {
+ Mapping LogSys -> TemplatePhysicalSystem {
SubSystemMapping subSystemRef -> node {
ThreadMapping defaultThread -> DefaultPhysicalThread
}
diff --git a/examples/org.eclipse.etrice.tutorials.c/model/PingPong/Physical.etphys b/examples/org.eclipse.etrice.tutorials.c/model/PingPong/Physical.etphys
new file mode 100644
index 000000000..2bf93c456
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.c/model/PingPong/Physical.etphys
@@ -0,0 +1,43 @@
+PhysicalModel TemplatePhysical {
+
+ PhysicalSystem TemplatePhysicalSystem {
+ NodeRef node : DefaultNodeClass
+ }
+
+ NodeClass DefaultNodeClass {
+ runtime = DefaultRuntimeClass
+ priomin = -10
+ priomax = 10
+
+ DefaultThread DefaultPhysicalThread {
+ execmode = mixed
+ interval = 100ms
+ prio = 0
+ stacksize = 1024
+ msgblocksize = 64
+ msgpoolsize = 100
+ }
+
+ Thread BlockedThread {
+ execmode = blocked
+ prio = 0
+ stacksize = 1024
+ msgblocksize = 64
+ msgpoolsize = 100
+ }
+
+ Thread PolledThread {
+ execmode = polled
+ interval = 100ms
+ prio = 0
+ stacksize = 1024
+ msgblocksize = 64
+ msgpoolsize = 100
+ }
+ }
+
+ RuntimeClass DefaultRuntimeClass {
+ model = multiThreaded
+ }
+
+} \ No newline at end of file
diff --git a/examples/org.eclipse.etrice.tutorials.c/model/PingPong/PingPong.room b/examples/org.eclipse.etrice.tutorials.c/model/PingPong/PingPong.room
index 3e298afd5..77e36f75f 100644
--- a/examples/org.eclipse.etrice.tutorials.c/model/PingPong/PingPong.room
+++ b/examples/org.eclipse.etrice.tutorials.c/model/PingPong/PingPong.room
@@ -1,4 +1,4 @@
-/*
+/*
* Shortkeys:
* Ctrl+Space - content assist
* F3 - open declaration of selected element
@@ -30,10 +30,10 @@ RoomModel PingPongModel {
Binding sender.sendPort and receiver.recvPort
}
Behavior {
-
+
}
}
-
+
// - PingPong building kit
ActorClass Sender {
diff --git a/examples/org.eclipse.etrice.tutorials.c/model/PingPong/diagrams/PingPongModel.SubSysClass.structure b/examples/org.eclipse.etrice.tutorials.c/model/PingPong/diagrams/PingPongModel.SubSysClass.structure
index 7a0edd751..c96cab3df 100644
--- a/examples/org.eclipse.etrice.tutorials.c/model/PingPong/diagrams/PingPongModel.SubSysClass.structure
+++ b/examples/org.eclipse.etrice.tutorials.c/model/PingPong/diagrams/PingPongModel.SubSysClass.structure
@@ -16,7 +16,7 @@
<children xsi:type="pi:ContainerShape" visible="true" active="true">
<properties key="obj-type" value="ref"/>
<properties key="actorref_version" value="2"/>
- <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="240" height="140" x="240" y="40">
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="240" height="140" x="210" y="40">
<graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="180" height="80" x="33" y="27">
<properties key="actorref_graphic_element" value="replborder"/>
</graphicsAlgorithmChildren>
@@ -136,7 +136,7 @@
<children xsi:type="pi:ContainerShape" visible="true" active="true">
<properties key="obj-type" value="ref"/>
<properties key="actorref_version" value="2"/>
- <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="240" height="140" x="254" y="281">
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="240" height="140" x="276" y="282">
<graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="180" height="80" x="33" y="27">
<properties key="actorref_graphic_element" value="replborder"/>
</graphicsAlgorithmChildren>
diff --git a/examples/org.eclipse.etrice.tutorials.cpp/.cproject b/examples/org.eclipse.etrice.tutorials.cpp/.cproject
new file mode 100644
index 000000000..a2bcff2ba
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.cpp/.cproject
@@ -0,0 +1,292 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+ <storageModule moduleId="org.eclipse.cdt.core.settings">
+ <cconfiguration id="cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733" moduleId="org.eclipse.cdt.core.settings" name="WindowsMinGW">
+ <externalSettings/>
+ <extensions>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733" name="WindowsMinGW" parent="cdt.managedbuild.config.gnu.mingw.exe.debug">
+ <folderInfo id="cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733." name="/" resourcePath="">
+ <toolChain id="cdt.managedbuild.toolchain.gnu.mingw.exe.debug.69420596" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.exe.debug">
+ <targetPlatform binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.PE" id="cdt.managedbuild.target.gnu.platform.mingw.exe.debug.976387164" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.exe.debug"/>
+ <builder buildPath="${workspace_loc:/org.eclipse.etrice.tutorials.cpp}/Debug" id="cdt.managedbuild.tool.gnu.builder.mingw.base.731154742" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="cdt.managedbuild.tool.gnu.builder.mingw.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.assembler.mingw.exe.debug.909731650" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.exe.debug">
+ <option id="gnu.both.asm.option.include.paths.901817972" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.modellib.cpp}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.modellib.cpp/src-gen}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src/}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/common}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src-gen}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/config}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/util}&quot;"/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.assembler.input.643291852" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.1632615240" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug.2100048552" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug">
+ <option id="gnu.cpp.compiler.mingw.exe.debug.option.optimization.level.655209945" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.exe.debug.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.mingw.exe.debug.option.debugging.level.1460798176" name="Debug Level" superClass="gnu.cpp.compiler.mingw.exe.debug.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.dialect.std.1317258943" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.cpp.compiler.dialect.c++98" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.warnings.pedantic.226070795" name="Pedantic (-pedantic)" superClass="gnu.cpp.compiler.option.warnings.pedantic" useByScannerDiscovery="false" value="true" valueType="boolean"/>
+ <option id="gnu.cpp.compiler.option.include.paths.942109534" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.modellib.cpp}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.modellib.cpp/src-gen}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src/}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/common}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src-gen}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/config}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/util}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src-gen}&quot;"/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1294463514" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.1373358885" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug">
+ <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.mingw.exe.debug.option.optimization.level.1465707096" name="Optimization Level" superClass="gnu.c.compiler.mingw.exe.debug.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/>
+ <option id="gnu.c.compiler.mingw.exe.debug.option.debugging.level.1494540699" name="Debug Level" superClass="gnu.c.compiler.mingw.exe.debug.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.include.paths.1559751690" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.modellib.cpp}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.modellib.cpp/src-gen}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src/}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/common}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src-gen}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/config}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/util}&quot;"/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1734922408" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug.144770136" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug"/>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug.1380030344" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug">
+ <option id="gnu.cpp.link.option.paths.119583934" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.modellib.cpp/WindowsMinGW}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/WindowsMinGW}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/WindowsMinGW}&quot;"/>
+ </option>
+ <option id="gnu.cpp.link.option.libs.746051639" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
+ <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="org.eclipse.etrice.modellib.cpp"/>
+ <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="org.eclipse.etrice.runtime.cpp"/>
+ <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="org.eclipse.etrice.runtime.c"/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1261226396" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+ <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+ <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+ </inputType>
+ </tool>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry excluding="src-gen-info" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings">
+ <externalSettings containerId="org.eclipse.etrice.runtime.c;cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier">
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/org.eclipse.etrice.runtime.c"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/common"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/config"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/util"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.runtime.c/WindowsMinGW"/>
+ <entry flags="RESOLVED" kind="libraryFile" name="org.eclipse.etrice.runtime.c" srcPrefixMapping="" srcRootPath=""/>
+ </externalSetting>
+ </externalSettings>
+ <externalSettings containerId="org.eclipse.etrice.runtime.cpp;cdt.managedbuild.config.gnu.mingw.lib.debug.878140176" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier">
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/org.eclipse.etrice.runtime.cpp"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.cpp/src/"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/common"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.cpp/src-gen"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.cpp/src"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.runtime.cpp/WindowsMinGW"/>
+ <entry flags="RESOLVED" kind="libraryFile" name="org.eclipse.etrice.runtime.cpp" srcPrefixMapping="" srcRootPath=""/>
+ </externalSetting>
+ </externalSettings>
+ <externalSettings containerId="org.eclipse.etrice.modellib.cpp;cdt.managedbuild.config.gnu.mingw.lib.debug.44153035" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier">
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/org.eclipse.etrice.modellib.cpp"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.modellib.cpp/src-gen"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.modellib.cpp/WindowsMinGW"/>
+ <entry flags="RESOLVED" kind="libraryFile" name="org.eclipse.etrice.modellib.cpp" srcPrefixMapping="" srcRootPath=""/>
+ </externalSetting>
+ </externalSettings>
+ </storageModule>
+ </cconfiguration>
+ <cconfiguration id="cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733.766587329">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733.766587329" moduleId="org.eclipse.cdt.core.settings" name="LinuxPosix">
+ <externalSettings/>
+ <extensions>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733.766587329" name="LinuxPosix" parent="cdt.managedbuild.config.gnu.mingw.exe.debug">
+ <folderInfo id="cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733.766587329." name="/" resourcePath="">
+ <toolChain id="cdt.managedbuild.toolchain.gnu.base.1362883699" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.base">
+ <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.PE" id="cdt.managedbuild.target.gnu.platform.base.735750578" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/>
+ <builder buildPath="${workspace_loc:/org.eclipse.etrice.tutorials.cpp}/LinuxPosix" id="cdt.managedbuild.target.gnu.builder.base.573969466" keepEnvironmentInBuildfile="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="cdt.managedbuild.target.gnu.builder.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.archiver.base.1482613308" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.2134443291" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base">
+ <option id="gnu.cpp.compiler.option.include.paths.1263573154" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.modellib.cpp/src-gen}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src-gen}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/platforms/MT_POSIX_GENERIC_GCC}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/common}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src-gen}&quot;"/>
+ </option>
+ <option id="gnu.cpp.compiler.option.optimization.level.401439173" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.debugging.level.1048371522" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1432324036" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.compiler.base.2117376630" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.base">
+ <option id="gnu.c.compiler.option.include.paths.567943289" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath"/>
+ <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.920319210" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.debugging.level.2118090648" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/>
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1453951142" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.linker.base.1690819981" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.linker.base.945150042" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base">
+ <option id="gnu.cpp.link.option.libs.756838940" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
+ <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="org.eclipse.etrice.modellib.cpp"/>
+ <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="org.eclipse.etrice.runtime.cpp"/>
+ <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="org.eclipse.etrice.runtime.c"/>
+ <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="pthread"/>
+ <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="rt"/>
+ </option>
+ <option id="gnu.cpp.link.option.paths.1991551719" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.modellib.cpp/LinuxPosix}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/LinuxPosix}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/LinuxPosix}&quot;"/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1724866444" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+ <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+ <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+ </inputType>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.assembler.base.1297836620" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.base">
+ <option id="gnu.both.asm.option.include.paths.1731441660" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.modellib.cpp}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.modellib.cpp/src-gen}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src-gen}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/platforms/MT_POSIX_GENERIC_GCC}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/common}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/config}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/util}&quot;"/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1042810554" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+ </tool>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry excluding="src-gen-info" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings">
+ <externalSettings containerId="org.eclipse.etrice.runtime.c;cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919.294295052" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier">
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/org.eclipse.etrice.runtime.c"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/common"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/config"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/platforms/MT_POSIX_GENERIC_GCC"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/util"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.runtime.c/LinuxPosix"/>
+ <entry flags="RESOLVED" kind="libraryFile" name="org.eclipse.etrice.runtime.c" srcPrefixMapping="" srcRootPath=""/>
+ </externalSetting>
+ </externalSettings>
+ <externalSettings containerId="org.eclipse.etrice.runtime.cpp;cdt.managedbuild.config.gnu.mingw.lib.debug.878140176.190433079" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier">
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/org.eclipse.etrice.runtime.cpp"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.cpp/src-gen"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.cpp/src"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/platforms/MT_POSIX_GENERIC_GCC"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/common"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.runtime.cpp/LinuxPosix"/>
+ <entry flags="RESOLVED" kind="libraryFile" name="org.eclipse.etrice.runtime.cpp" srcPrefixMapping="" srcRootPath=""/>
+ </externalSetting>
+ </externalSettings>
+ <externalSettings containerId="org.eclipse.etrice.modellib.cpp;cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.551809464" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier">
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/org.eclipse.etrice.modellib.cpp"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.modellib.cpp/src-gen"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.modellib.cpp/LinuxPosix"/>
+ <entry flags="RESOLVED" kind="libraryFile" name="org.eclipse.etrice.modellib.cpp" srcPrefixMapping="" srcRootPath=""/>
+ </externalSetting>
+ </externalSettings>
+ </storageModule>
+ </cconfiguration>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <project id="org.eclipse.etrice.tutorials.cpp.cdt.managedbuild.target.gnu.mingw.exe.998447895" name="Executable" projectType="cdt.managedbuild.target.gnu.mingw.exe"/>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
+ <storageModule moduleId="refreshScope" versionNumber="2">
+ <configuration configurationName="Release">
+ <resource resourceType="PROJECT" workspacePath="/org.eclipse.etrice.tutorials.cpp"/>
+ </configuration>
+ <configuration configurationName="WindowsMinGW">
+ <resource resourceType="PROJECT" workspacePath="/org.eclipse.etrice.tutorials.cpp"/>
+ </configuration>
+ <configuration configurationName="Debug">
+ <resource resourceType="PROJECT" workspacePath="/org.eclipse.etrice.tutorials.cpp"/>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+ <storageModule moduleId="scannerConfiguration">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733.766587329;cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733.766587329.;cdt.managedbuild.tool.gnu.c.compiler.base.2117376630;cdt.managedbuild.tool.gnu.c.compiler.input.1453951142">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733.766587329;cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733.766587329.;cdt.managedbuild.tool.gnu.cpp.compiler.base.2134443291;cdt.managedbuild.tool.gnu.cpp.compiler.input.1432324036">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.release.1661058126;cdt.managedbuild.config.gnu.mingw.exe.release.1661058126.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.release.1813252183;cdt.managedbuild.tool.gnu.cpp.compiler.input.1940053336">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.release.1661058126;cdt.managedbuild.config.gnu.mingw.exe.release.1661058126.;cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.release.1248435059;cdt.managedbuild.tool.gnu.c.compiler.input.1097403450">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733.766587329;cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733.766587329.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug.516972569;cdt.managedbuild.tool.gnu.cpp.compiler.input.2038569775">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733;cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733.;cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.1373358885;cdt.managedbuild.tool.gnu.c.compiler.input.1734922408">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733.766587329;cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733.766587329.;cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.2011759281;cdt.managedbuild.tool.gnu.c.compiler.input.1382639861">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733;cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug.2100048552;cdt.managedbuild.tool.gnu.cpp.compiler.input.1294463514">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </scannerConfigBuildInfo>
+ </storageModule>
+</cproject>
diff --git a/examples/org.eclipse.etrice.tutorials.cpp/.gitignore b/examples/org.eclipse.etrice.tutorials.cpp/.gitignore
new file mode 100644
index 000000000..d2a6ec005
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.cpp/.gitignore
@@ -0,0 +1,8 @@
+WindowsMinGW
+LinuxPosix
+src-gen/*
+!src-gen/readme.txt
+src-gen-info/*
+!src-gen-info/readme.txt
+log/*
+!log/readme.txt
diff --git a/examples/org.eclipse.etrice.tutorials.cpp/.project b/examples/org.eclipse.etrice.tutorials.cpp/.project
new file mode 100644
index 000000000..ce9f5da7d
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.cpp/.project
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.etrice.tutorials.cpp</name>
+ <comment></comment>
+ <projects>
+ <project>org.eclipse.etrice.runtime.cpp</project>
+ <project>org.eclipse.etrice.runtime.c</project>
+ <project>org.eclipse.etrice.modellib.cpp</project>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+ <triggers>clean,full,incremental,</triggers>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+ <triggers>full,incremental,</triggers>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.core.ccnature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+ <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+ </natures>
+</projectDescription>
diff --git a/examples/org.eclipse.etrice.tutorials.cpp/.settings/org.eclipse.cdt.managedbuilder.core.prefs b/examples/org.eclipse.etrice.tutorials.cpp/.settings/org.eclipse.cdt.managedbuilder.core.prefs
new file mode 100644
index 000000000..88f0f6f8c
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.cpp/.settings/org.eclipse.cdt.managedbuilder.core.prefs
@@ -0,0 +1,13 @@
+eclipse.preferences.version=1
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733/CPATH/delimiter=;
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733/CPATH/operation=remove
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733/CPLUS_INCLUDE_PATH/delimiter=;
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733/CPLUS_INCLUDE_PATH/operation=remove
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733/C_INCLUDE_PATH/delimiter=;
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733/C_INCLUDE_PATH/operation=remove
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733/append=true
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733/appendContributed=true
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733/LIBRARY_PATH/delimiter=;
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733/LIBRARY_PATH/operation=remove
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733/append=true
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733/appendContributed=true
diff --git a/examples/org.eclipse.etrice.tutorials.cpp/log/readme.txt b/examples/org.eclipse.etrice.tutorials.cpp/log/readme.txt
new file mode 100644
index 000000000..dadbdcfe8
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.cpp/log/readme.txt
@@ -0,0 +1 @@
+This directory is an eTrice directory used for logging e.g. MSC. \ No newline at end of file
diff --git a/examples/org.eclipse.etrice.tutorials.cpp/model/HelloWorld/HelloWorld.room b/examples/org.eclipse.etrice.tutorials.cpp/model/HelloWorld/HelloWorld.room
new file mode 100644
index 000000000..c76ce1334
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.cpp/model/HelloWorld/HelloWorld.room
@@ -0,0 +1,42 @@
+/*
+ * Shortkeys:
+ * Ctrl+Space - content assist
+ * F3 - open declaration of selected element
+ * Alt+S - open structure diagram
+ * Alt+B - open behavior diagram
+ * Alt+M - open textual editor (in diagrams)
+ */
+RoomModel HelloWorldModel {
+
+ import room.basic.types.* from "../../../org.eclipse.etrice.modellib.cpp/model/Types.room"
+ import room.basic.service.timing.* from "../../../org.eclipse.etrice.modellib.cpp/model/TimingService.room"
+
+ LogicalSystem LogSys {
+ SubSystemRef subSystemRef: SubSysClass
+ }
+
+ SubSystemClass SubSysClass {
+ ActorRef topActor: TopActor
+ ActorRef timingService: ATimingService
+ LayerConnection ref topActor satisfied_by timingService.timer
+ LogicalThread defaultThread
+ }
+
+ // - build your application from here
+ ActorClass TopActor {
+ Structure {
+
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> helloState
+ State helloState {
+ entry {
+ "printf(\"### Hello World! ###\\n\");"
+ }
+ }
+ }
+ }
+ }
+
+} \ No newline at end of file
diff --git a/examples/org.eclipse.etrice.tutorials.cpp/model/HelloWorld/Mapping.etmap b/examples/org.eclipse.etrice.tutorials.cpp/model/HelloWorld/Mapping.etmap
new file mode 100644
index 000000000..2c9c9bdc5
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.cpp/model/HelloWorld/Mapping.etmap
@@ -0,0 +1,17 @@
+/*
+ * This model defines a mapping between a logical ROOM model and a physical model (nodes and threads).
+ *
+ * <p>Hint: Press F3 to open declaration of selected element or import</p>
+ */
+MappingModel TemplateMapping {
+
+ import TemplatePhysical.* from "Physical.etphys"
+ import HelloWorldModel.* from "HelloWorld.room"
+
+ Mapping LogSys -> TemplatePhysicalSystem {
+ SubSystemMapping subSystemRef -> node {
+ ThreadMapping defaultThread -> DefaultPhysicalThread
+ }
+ }
+
+} \ No newline at end of file
diff --git a/examples/org.eclipse.etrice.tutorials.cpp/model/HelloWorld/Physical.etphys b/examples/org.eclipse.etrice.tutorials.cpp/model/HelloWorld/Physical.etphys
new file mode 100644
index 000000000..2bf93c456
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.cpp/model/HelloWorld/Physical.etphys
@@ -0,0 +1,43 @@
+PhysicalModel TemplatePhysical {
+
+ PhysicalSystem TemplatePhysicalSystem {
+ NodeRef node : DefaultNodeClass
+ }
+
+ NodeClass DefaultNodeClass {
+ runtime = DefaultRuntimeClass
+ priomin = -10
+ priomax = 10
+
+ DefaultThread DefaultPhysicalThread {
+ execmode = mixed
+ interval = 100ms
+ prio = 0
+ stacksize = 1024
+ msgblocksize = 64
+ msgpoolsize = 100
+ }
+
+ Thread BlockedThread {
+ execmode = blocked
+ prio = 0
+ stacksize = 1024
+ msgblocksize = 64
+ msgpoolsize = 100
+ }
+
+ Thread PolledThread {
+ execmode = polled
+ interval = 100ms
+ prio = 0
+ stacksize = 1024
+ msgblocksize = 64
+ msgpoolsize = 100
+ }
+ }
+
+ RuntimeClass DefaultRuntimeClass {
+ model = multiThreaded
+ }
+
+} \ No newline at end of file
diff --git a/examples/org.eclipse.etrice.tutorials.cpp/model/HelloWorld/generate_HelloWorldCpp.launch b/examples/org.eclipse.etrice.tutorials.cpp/model/HelloWorld/generate_HelloWorldCpp.launch
new file mode 100644
index 000000000..fbb1ccdb4
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.cpp/model/HelloWorld/generate_HelloWorldCpp.launch
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.etrice.generator.launch.cpp.launchConfigurationType">
+<booleanAttribute key="Debug" value="false"/>
+<booleanAttribute key="GenDocumentation" value="false"/>
+<booleanAttribute key="GenInstanceDiagram" value="false"/>
+<stringAttribute key="GenModelPath" value=""/>
+<booleanAttribute key="Lib" value="false"/>
+<booleanAttribute key="MSC" value="true"/>
+<booleanAttribute key="DataLogging" value="true"/>
+<listAttribute key="ModelFiles">
+<listEntry value="${workspace_loc:/org.eclipse.etrice.tutorials.cpp/model/HelloWorld/Mapping.etmap}"/>
+</listAttribute>
+<booleanAttribute key="SaveGenModel" value="false"/>
+<booleanAttribute key="Verbose" value="false"/>
+<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${workspace}"/>
+</launchConfiguration>
diff --git a/examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/Mapping.etmap b/examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/Mapping.etmap
new file mode 100644
index 000000000..f49796b29
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/Mapping.etmap
@@ -0,0 +1,17 @@
+/*
+ * This model defines a mapping between a logical ROOM model and a physical model (nodes and threads).
+ *
+ * <p>Hint: Press F3 to open declaration of selected element or import</p>
+ */
+MappingModel TemplateMapping {
+
+ import TemplatePhysical.* from "Physical.etphys"
+ import PingPongModel.* from "PingPong.room"
+
+ Mapping LogSys -> TemplatePhysicalSystem {
+ SubSystemMapping subSystemRef -> node {
+ ThreadMapping defaultThread -> DefaultPhysicalThread
+ }
+ }
+
+} \ No newline at end of file
diff --git a/examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/Physical.etphys b/examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/Physical.etphys
new file mode 100644
index 000000000..2bf93c456
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/Physical.etphys
@@ -0,0 +1,43 @@
+PhysicalModel TemplatePhysical {
+
+ PhysicalSystem TemplatePhysicalSystem {
+ NodeRef node : DefaultNodeClass
+ }
+
+ NodeClass DefaultNodeClass {
+ runtime = DefaultRuntimeClass
+ priomin = -10
+ priomax = 10
+
+ DefaultThread DefaultPhysicalThread {
+ execmode = mixed
+ interval = 100ms
+ prio = 0
+ stacksize = 1024
+ msgblocksize = 64
+ msgpoolsize = 100
+ }
+
+ Thread BlockedThread {
+ execmode = blocked
+ prio = 0
+ stacksize = 1024
+ msgblocksize = 64
+ msgpoolsize = 100
+ }
+
+ Thread PolledThread {
+ execmode = polled
+ interval = 100ms
+ prio = 0
+ stacksize = 1024
+ msgblocksize = 64
+ msgpoolsize = 100
+ }
+ }
+
+ RuntimeClass DefaultRuntimeClass {
+ model = multiThreaded
+ }
+
+} \ No newline at end of file
diff --git a/examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/PingPong.room b/examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/PingPong.room
new file mode 100644
index 000000000..08c941d8f
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/PingPong.room
@@ -0,0 +1,109 @@
+/*
+ * Shortkeys:
+ * Ctrl+Space - content assist
+ * F3 - open declaration of selected element
+ * Alt+S - open structure diagram
+ * Alt+B - open behavior diagram
+ * Alt+M - open textual editor (in diagrams)
+ */
+RoomModel PingPongModel {
+
+ import room.basic.types.* from "../../../org.eclipse.etrice.modellib.cpp/model/Types.room"
+ import room.basic.service.timing.* from "../../../org.eclipse.etrice.modellib.cpp/model/TimingService.room"
+
+ LogicalSystem LogSys {
+ SubSystemRef subSystemRef: SubSysClass
+ }
+
+ SubSystemClass SubSysClass {
+ ActorRef topActor: TopActor
+ ActorRef timingService: ATimingService
+ LayerConnection ref topActor satisfied_by timingService.timer
+ LogicalThread defaultThread
+ }
+
+ // - build your application from here
+ ActorClass TopActor {
+ Structure {
+ ActorRef sender : Sender
+ ActorRef receiver : Receiver
+ Binding sender.sendPort and receiver.recvPort
+ }
+ Behavior {
+
+ }
+ }
+
+ // - PingPong building kit
+
+ ActorClass Sender {
+ Interface {
+ conjugated Port sendPort: PingPongProtocol
+ }
+ Structure {
+ external Port sendPort
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> sendingPing
+ Transition tr0: sendingPing -> receivedPong {
+ triggers {
+ <pong: sendPort>
+ }
+ }
+ State sendingPing {
+ entry {
+ "sendPort.ping();"
+ }
+ }
+ State receivedPong
+ }
+ }
+ }
+
+ ActorClass Receiver {
+ Interface {
+ Port recvPort: PingPongProtocol
+ }
+ Structure {
+ external Port recvPort
+ SAP timingService: PTimer
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> waitingForPing
+ Transition tr0: waitingForPing -> receivedPing {
+ triggers {
+ <ping: recvPort>
+ }
+ }
+ Transition tr1: receivedPing -> sentPong {
+ triggers {
+ <timeout: timingService>
+ }
+ }
+ State waitingForPing
+ State receivedPing {
+ entry {
+ "timingService.startTimeout(500);"
+ }
+ }
+ State sentPong {
+ entry {
+ "recvPort.pong();"
+ }
+ }
+ }
+ }
+ }
+
+ ProtocolClass PingPongProtocol {
+ incoming {
+ Message ping()
+ }
+ outgoing {
+ Message pong()
+ }
+ }
+
+} \ No newline at end of file
diff --git a/examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/diagrams/PingPongModel.Receiver.behavior b/examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/diagrams/PingPongModel.Receiver.behavior
new file mode 100644
index 000000000..ae2938c64
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/diagrams/PingPongModel.Receiver.behavior
@@ -0,0 +1,183 @@
+<?xml version="1.0" encoding="ASCII"?>
+<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" gridUnit="10" diagramTypeId="room.behavior" name="Behavior of Receiver" pictogramLinks="//@link //@children.0/@link //@children.0/@children.1/@link //@children.0/@children.2/@link //@children.0/@children.3/@link //@children.0/@children.4/@link //@connections.0/@link //@connections.1/@link //@connections.2/@link" verticalGridUnit="10" version="0.11.0">
+ <graphicsAlgorithm xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.0" lineWidth="1" transparency="0.0" width="1000" height="1000"/>
+ <link>
+ <businessObjects href="../PingPong.room#ActorClass:Receiver"/>
+ </link>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="sg"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="880" height="580" x="40" y="40">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.1" foreground="//@colors.2" lineWidth="4" transparency="0.5" width="800" height="500" x="40" y="40" cornerHeight="20" cornerWidth="20"/>
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.2" lineWidth="4" filled="false" transparency="0.0" width="800" height="500" x="40" y="40" cornerHeight="20" cornerWidth="20"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#StateGraph:Receiver$sg"/>
+ </link>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="800" height="80" y="40" font="//@fonts.1" horizontalAlignment="ALIGNMENT_RIGHT" verticalAlignment="ALIGNMENT_TOP" value="/"/>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="trp"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="40" height="40" x="100" y="100">
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.1" foreground="//@colors.2" lineWidth="2" transparency="0.0" width="20" height="20" x="10" y="10"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#StateGraph:Receiver$sg"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.0" referencedGraphicsAlgorithm="//@children.0/@children.1/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="40" height="20" y="10" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="I"/>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="state"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="141" height="90" x="206" y="134">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="81" height="30" x="30" y="30" cornerHeight="20" cornerWidth="20">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="15" height="8" x="56" y="3" cornerHeight="5" cornerWidth="5"/>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="40" y="24">
+ <points x="-3" y="-3"/>
+ <points x="-3" y="3"/>
+ <points x="-11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="40" y="24">
+ <points x="3" y="-3"/>
+ <points x="3" y="3"/>
+ <points x="11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="40" y="24">
+ <points x="-2" y="-3"/>
+ <points x="-2" y="3"/>
+ <points x="2" y="3"/>
+ <points x="2" y="-3"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#SimpleState:Receiver$waitingForPing"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.1" incomingConnections="//@connections.0" referencedGraphicsAlgorithm="//@children.0/@children.2/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="81" height="30" x="30" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="waitingForPing"/>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="state"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="132" height="90" x="512" y="134">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="72" height="30" x="30" y="30" cornerHeight="20" cornerWidth="20">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="15" height="8" x="47" y="3" cornerHeight="5" cornerWidth="5"/>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="true" transparency="0.0" x="36" y="24">
+ <points x="-3" y="-3"/>
+ <points x="-3" y="3"/>
+ <points x="-11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="36" y="24">
+ <points x="3" y="-3"/>
+ <points x="3" y="3"/>
+ <points x="11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="36" y="24">
+ <points x="-2" y="-3"/>
+ <points x="-2" y="3"/>
+ <points x="2" y="3"/>
+ <points x="2" y="-3"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#SimpleState:Receiver$receivedPing"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.2" incomingConnections="//@connections.1" referencedGraphicsAlgorithm="//@children.0/@children.3/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="72" height="30" x="30" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="receivedPing"/>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="state"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="120" height="90" x="518" y="277">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="60" height="30" x="30" y="30" cornerHeight="20" cornerWidth="20">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="15" height="8" x="35" y="3" cornerHeight="5" cornerWidth="5"/>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="true" transparency="0.0" x="30" y="24">
+ <points x="-3" y="-3"/>
+ <points x="-3" y="3"/>
+ <points x="-11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="3" y="-3"/>
+ <points x="3" y="3"/>
+ <points x="11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="-2" y="-3"/>
+ <points x="-2" y="3"/>
+ <points x="2" y="3"/>
+ <points x="2" y="-3"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#SimpleState:Receiver$sentPong"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" incomingConnections="//@connections.2" referencedGraphicsAlgorithm="//@children.0/@children.4/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="60" height="30" x="30" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="sentPong"/>
+ </children>
+ </children>
+ </children>
+ <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.1/@anchors.0" end="//@children.0/@children.2/@anchors.0">
+ <properties key="obj-type" value="trans"/>
+ <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+ <link>
+ <businessObjects href="../PingPong.room#InitialTransition:Receiver$initial"/>
+ </link>
+ <connectionDecorators visible="true" locationRelative="true" location="1.0">
+ <graphicsAlgorithm xsi:type="al:Polygon" background="//@colors.1" foreground="//@colors.2" lineWidth="1" filled="true" transparency="0.0">
+ <points x="-15" y="5"/>
+ <points/>
+ <points x="-15" y="-5"/>
+ </graphicsAlgorithm>
+ </connectionDecorators>
+ <connectionDecorators visible="true" active="true" locationRelative="true" location="0.5">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" x="10" font="//@fonts.0" value="init"/>
+ </connectionDecorators>
+ </connections>
+ <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.2/@anchors.0" end="//@children.0/@children.3/@anchors.0">
+ <properties key="obj-type" value="trans"/>
+ <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+ <link>
+ <businessObjects href="../PingPong.room#TriggeredTransition:Receiver$tr0"/>
+ </link>
+ <connectionDecorators visible="true" locationRelative="true" location="1.0">
+ <graphicsAlgorithm xsi:type="al:Polygon" background="//@colors.1" foreground="//@colors.2" lineWidth="1" filled="true" transparency="0.0">
+ <points x="-15" y="5"/>
+ <points/>
+ <points x="-15" y="-5"/>
+ </graphicsAlgorithm>
+ </connectionDecorators>
+ <connectionDecorators visible="true" active="true" locationRelative="true" location="0.5">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" x="-45" y="1" font="//@fonts.0" value="tr0: &lt;ping:recvPort>"/>
+ </connectionDecorators>
+ </connections>
+ <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.3/@anchors.0" end="//@children.0/@children.4/@anchors.0">
+ <properties key="obj-type" value="trans"/>
+ <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+ <link>
+ <businessObjects href="../PingPong.room#TriggeredTransition:Receiver$tr1"/>
+ </link>
+ <connectionDecorators visible="true" locationRelative="true" location="1.0">
+ <graphicsAlgorithm xsi:type="al:Polygon" background="//@colors.1" foreground="//@colors.2" lineWidth="1" filled="true" transparency="0.0">
+ <points x="-15" y="5"/>
+ <points/>
+ <points x="-15" y="-5"/>
+ </graphicsAlgorithm>
+ </connectionDecorators>
+ <connectionDecorators visible="true" active="true" locationRelative="true" location="0.5">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" x="10" font="//@fonts.0" value="tr1: &lt;timeout:timing..."/>
+ </connectionDecorators>
+ </connections>
+ <colors red="227" green="238" blue="249"/>
+ <colors red="255" green="255" blue="255"/>
+ <colors/>
+ <colors red="200" green="200" blue="200"/>
+ <fonts name="Arial" size="8"/>
+ <fonts name="Arial" size="9" bold="true"/>
+</pi:Diagram>
diff --git a/examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/diagrams/PingPongModel.Receiver.structure b/examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/diagrams/PingPongModel.Receiver.structure
new file mode 100644
index 000000000..c65ba4f1b
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/diagrams/PingPongModel.Receiver.structure
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="ASCII"?>
+<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" gridUnit="10" diagramTypeId="room.structure" name="Structure of Receiver" pictogramLinks="//@link //@children.0/@link //@children.0/@children.0/@link" verticalGridUnit="10" version="0.11.0">
+ <graphicsAlgorithm xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.0" lineWidth="1" transparency="0.0" width="1000" height="1000"/>
+ <link>
+ <businessObjects href="../PingPong.room#ActorClass:Receiver"/>
+ </link>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="cls"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="880" height="580" x="40" y="40">
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.2" lineWidth="1" lineVisible="false" transparency="0.5" width="800" height="500" x="40" y="40"/>
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" foreground="//@colors.2" lineWidth="4" filled="false" transparency="0.0" width="800" height="500" x="40" y="40"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#ActorClass:Receiver"/>
+ </link>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="port"/>
+ <properties key="inherited" value="false"/>
+ <properties key="item-kind" value=""/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="80" height="80" x="400">
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.2" foreground="//@colors.2" lineWidth="2" transparency="0.0" width="40" height="40" x="20" y="20"/>
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.1" foreground="//@colors.1" lineWidth="2" transparency="0.0" width="20" height="20" x="30" y="30"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#Port:Receiver$recvPort"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" referencedGraphicsAlgorithm="//@children.0/@children.0/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="80" height="20" font="//@fonts.0" value="recvPort"/>
+ </children>
+ </children>
+ </children>
+ <colors red="227" green="238" blue="249"/>
+ <colors red="255" green="255" blue="255"/>
+ <colors/>
+ <fonts name="Arial" size="8"/>
+</pi:Diagram>
diff --git a/examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/diagrams/PingPongModel.Sender.behavior b/examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/diagrams/PingPongModel.Sender.behavior
new file mode 100644
index 000000000..10884d9d0
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/diagrams/PingPongModel.Sender.behavior
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="ASCII"?>
+<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" gridUnit="10" diagramTypeId="room.behavior" name="Behavior of Sender" pictogramLinks="//@link //@children.0/@link //@children.0/@children.1/@link //@children.0/@children.2/@link //@children.0/@children.3/@link //@connections.0/@link //@connections.1/@link" verticalGridUnit="10" version="0.11.0">
+ <graphicsAlgorithm xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.0" lineWidth="1" transparency="0.0" width="1000" height="1000"/>
+ <link>
+ <businessObjects href="../PingPong.room#ActorClass:Sender"/>
+ </link>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="sg"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="880" height="580" x="40" y="40">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.1" foreground="//@colors.2" lineWidth="4" transparency="0.5" width="800" height="500" x="40" y="40" cornerHeight="20" cornerWidth="20"/>
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.2" lineWidth="4" filled="false" transparency="0.0" width="800" height="500" x="40" y="40" cornerHeight="20" cornerWidth="20"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#StateGraph:Sender$sg"/>
+ </link>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="800" height="80" y="40" font="//@fonts.1" horizontalAlignment="ALIGNMENT_RIGHT" verticalAlignment="ALIGNMENT_TOP" value="/"/>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="trp"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="40" height="40" x="100" y="100">
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.1" foreground="//@colors.2" lineWidth="2" transparency="0.0" width="20" height="20" x="10" y="10"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#StateGraph:Sender$sg"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.0" referencedGraphicsAlgorithm="//@children.0/@children.1/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="40" height="20" y="10" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="I"/>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="state"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="128" height="90" x="202" y="120">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="68" height="30" x="30" y="30" cornerHeight="20" cornerWidth="20">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="15" height="8" x="43" y="3" cornerHeight="5" cornerWidth="5"/>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="true" transparency="0.0" x="34" y="24">
+ <points x="-3" y="-3"/>
+ <points x="-3" y="3"/>
+ <points x="-11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="34" y="24">
+ <points x="3" y="-3"/>
+ <points x="3" y="3"/>
+ <points x="11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="34" y="24">
+ <points x="-2" y="-3"/>
+ <points x="-2" y="3"/>
+ <points x="2" y="3"/>
+ <points x="2" y="-3"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#SimpleState:Sender$sendingPing"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.1" incomingConnections="//@connections.0" referencedGraphicsAlgorithm="//@children.0/@children.2/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="68" height="30" x="30" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="sendingPing"/>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="state"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="136" height="90" x="464" y="120">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="76" height="30" x="30" y="30" cornerHeight="20" cornerWidth="20">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="15" height="8" x="51" y="3" cornerHeight="5" cornerWidth="5"/>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="38" y="24">
+ <points x="-3" y="-3"/>
+ <points x="-3" y="3"/>
+ <points x="-11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="38" y="24">
+ <points x="3" y="-3"/>
+ <points x="3" y="3"/>
+ <points x="11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="38" y="24">
+ <points x="-2" y="-3"/>
+ <points x="-2" y="3"/>
+ <points x="2" y="3"/>
+ <points x="2" y="-3"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#SimpleState:Sender$receivedPong"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" incomingConnections="//@connections.1" referencedGraphicsAlgorithm="//@children.0/@children.3/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="76" height="30" x="30" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="receivedPong"/>
+ </children>
+ </children>
+ </children>
+ <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.1/@anchors.0" end="//@children.0/@children.2/@anchors.0">
+ <properties key="obj-type" value="trans"/>
+ <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+ <link>
+ <businessObjects href="../PingPong.room#InitialTransition:Sender$initial"/>
+ </link>
+ <connectionDecorators visible="true" locationRelative="true" location="1.0">
+ <graphicsAlgorithm xsi:type="al:Polygon" background="//@colors.1" foreground="//@colors.2" lineWidth="1" filled="true" transparency="0.0">
+ <points x="-15" y="5"/>
+ <points/>
+ <points x="-15" y="-5"/>
+ </graphicsAlgorithm>
+ </connectionDecorators>
+ <connectionDecorators visible="true" active="true" locationRelative="true" location="0.5">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" x="10" font="//@fonts.0" value="init"/>
+ </connectionDecorators>
+ </connections>
+ <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.2/@anchors.0" end="//@children.0/@children.3/@anchors.0">
+ <properties key="obj-type" value="trans"/>
+ <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+ <link>
+ <businessObjects href="../PingPong.room#TriggeredTransition:Sender$tr0"/>
+ </link>
+ <connectionDecorators visible="true" locationRelative="true" location="1.0">
+ <graphicsAlgorithm xsi:type="al:Polygon" background="//@colors.1" foreground="//@colors.2" lineWidth="1" filled="true" transparency="0.0">
+ <points x="-15" y="5"/>
+ <points/>
+ <points x="-15" y="-5"/>
+ </graphicsAlgorithm>
+ </connectionDecorators>
+ <connectionDecorators visible="true" active="true" locationRelative="true" location="0.5">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" x="-48" y="1" font="//@fonts.0" value="tr0: &lt;pong:sendPort>"/>
+ </connectionDecorators>
+ </connections>
+ <colors red="227" green="238" blue="249"/>
+ <colors red="255" green="255" blue="255"/>
+ <colors/>
+ <colors red="200" green="200" blue="200"/>
+ <fonts name="Arial" size="8"/>
+ <fonts name="Arial" size="9" bold="true"/>
+</pi:Diagram>
diff --git a/examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/diagrams/PingPongModel.Sender.structure b/examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/diagrams/PingPongModel.Sender.structure
new file mode 100644
index 000000000..7e4fdfcd4
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/diagrams/PingPongModel.Sender.structure
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="ASCII"?>
+<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" gridUnit="10" diagramTypeId="room.structure" name="Structure of Sender" pictogramLinks="//@link //@children.0/@link //@children.0/@children.0/@link" verticalGridUnit="10" version="0.11.0">
+ <graphicsAlgorithm xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.0" lineWidth="1" transparency="0.0" width="1000" height="1000"/>
+ <link>
+ <businessObjects href="../PingPong.room#ActorClass:Sender"/>
+ </link>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="cls"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="880" height="580" x="40" y="40">
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.2" lineWidth="1" lineVisible="false" transparency="0.5" width="800" height="500" x="40" y="40"/>
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" foreground="//@colors.2" lineWidth="4" filled="false" transparency="0.0" width="800" height="500" x="40" y="40"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#ActorClass:Sender"/>
+ </link>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="port"/>
+ <properties key="inherited" value="false"/>
+ <properties key="item-kind" value="C"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="80" height="80" x="403" y="500">
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.2" lineWidth="2" transparency="0.0" width="40" height="40" x="20" y="20"/>
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.2" foreground="//@colors.2" lineWidth="2" transparency="0.0" width="20" height="20" x="30" y="30"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#Port:Sender$sendPort"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" referencedGraphicsAlgorithm="//@children.0/@children.0/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="80" height="20" y="60" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="sendPort"/>
+ </children>
+ </children>
+ </children>
+ <colors red="227" green="238" blue="249"/>
+ <colors red="255" green="255" blue="255"/>
+ <colors/>
+ <fonts name="Arial" size="8"/>
+</pi:Diagram>
diff --git a/examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/diagrams/PingPongModel.SubSysClass.structure b/examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/diagrams/PingPongModel.SubSysClass.structure
new file mode 100644
index 000000000..c6fda1207
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/diagrams/PingPongModel.SubSysClass.structure
@@ -0,0 +1,291 @@
+<?xml version="1.0" encoding="ASCII"?>
+<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" gridUnit="10" diagramTypeId="room.structure" name="Structure of SubSysClass" pictogramLinks="//@link //@children.0/@link //@children.0/@children.0/@link //@children.0/@children.1/@link //@children.0/@children.1/@children.2/@link //@connections.0/@link" verticalGridUnit="10" version="0.11.0">
+ <graphicsAlgorithm xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.0" lineWidth="1" transparency="0.0" width="1000" height="1000"/>
+ <link>
+ <businessObjects href="../PingPong.room#SubSystemClass:SubSysClass"/>
+ </link>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="cls"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="880" height="580" x="40" y="40">
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.2" lineWidth="1" lineVisible="false" transparency="0.5" width="800" height="500" x="40" y="40"/>
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" foreground="//@colors.2" lineWidth="4" filled="false" transparency="0.0" width="800" height="500" x="40" y="40"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#SubSystemClass:SubSysClass"/>
+ </link>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="ref"/>
+ <properties key="actorref_version" value="2"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="240" height="140" x="240" y="40">
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="180" height="80" x="33" y="27">
+ <properties key="actorref_graphic_element" value="replborder"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="180" height="80" x="30" y="30">
+ <properties key="actorref_graphic_element" value="mainborder"/>
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="true" transparency="0.0" width="20" height="10" x="150" y="50">
+ <properties key="actorref_graphic_element" value="substructure"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="true" transparency="0.0" width="20" height="10" x="145" y="65">
+ <properties key="actorref_graphic_element" value="substructure"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points y="15"/>
+ <points x="15"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points y="30"/>
+ <points x="30"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points y="45"/>
+ <points x="45"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points y="60"/>
+ <points x="60"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points y="75"/>
+ <points x="75"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="10" y="80"/>
+ <points x="90"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="25" y="80"/>
+ <points x="105"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="40" y="80"/>
+ <points x="120"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="55" y="80"/>
+ <points x="135"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="70" y="80"/>
+ <points x="150"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="85" y="80"/>
+ <points x="165"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="100" y="80"/>
+ <points x="180"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="115" y="80"/>
+ <points x="180" y="15"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="130" y="80"/>
+ <points x="180" y="30"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="145" y="80"/>
+ <points x="180" y="45"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="160" y="80"/>
+ <points x="180" y="60"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="175" y="80"/>
+ <points x="180" y="75"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="25" height="25" x="185" y="30">
+ <properties key="actorref_graphic_element" value="sizeframe"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#ActorRef:SubSysClass$topActor"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.0" referencedGraphicsAlgorithm="//@children.0/@children.0/@graphicsAlgorithm/@graphicsAlgorithmChildren.1">
+ <properties key="actorref_graphic_element" value="layerconn_anchor"/>
+ </anchors>
+ <children visible="true">
+ <properties key="actorref_graphic_element" value="name_shape"/>
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.3" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="180" height="80" x="30" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="topActor&#xA;(TopActor)"/>
+ </children>
+ <children>
+ <properties key="actorref_graphic_element" value="size_shape"/>
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.3" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="25" height="25" x="185" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="1"/>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="ref"/>
+ <properties key="actorref_version" value="2"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="240" height="140" x="254" y="281">
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="180" height="80" x="33" y="27">
+ <properties key="actorref_graphic_element" value="replborder"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="180" height="80" x="30" y="30">
+ <properties key="actorref_graphic_element" value="mainborder"/>
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="20" height="10" x="150" y="50">
+ <properties key="actorref_graphic_element" value="substructure"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="20" height="10" x="145" y="65">
+ <properties key="actorref_graphic_element" value="substructure"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points y="15"/>
+ <points x="15"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points y="30"/>
+ <points x="30"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points y="45"/>
+ <points x="45"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points y="60"/>
+ <points x="60"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points y="75"/>
+ <points x="75"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="10" y="80"/>
+ <points x="90"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="25" y="80"/>
+ <points x="105"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="40" y="80"/>
+ <points x="120"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="55" y="80"/>
+ <points x="135"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="70" y="80"/>
+ <points x="150"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="85" y="80"/>
+ <points x="165"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="100" y="80"/>
+ <points x="180"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="115" y="80"/>
+ <points x="180" y="15"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="130" y="80"/>
+ <points x="180" y="30"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="145" y="80"/>
+ <points x="180" y="45"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="160" y="80"/>
+ <points x="180" y="60"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="175" y="80"/>
+ <points x="180" y="75"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="25" height="25" x="185" y="30">
+ <properties key="actorref_graphic_element" value="sizeframe"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#ActorRef:SubSysClass$timingService"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" referencedGraphicsAlgorithm="//@children.0/@children.1/@graphicsAlgorithm/@graphicsAlgorithmChildren.1">
+ <properties key="actorref_graphic_element" value="layerconn_anchor"/>
+ </anchors>
+ <children visible="true">
+ <properties key="actorref_graphic_element" value="name_shape"/>
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.3" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="180" height="80" x="30" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="timingService&#xA;(ATimingService)"/>
+ </children>
+ <children>
+ <properties key="actorref_graphic_element" value="size_shape"/>
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.3" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="25" height="25" x="185" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="1"/>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="port"/>
+ <properties key="inherited" value="false"/>
+ <properties key="item-kind" value=""/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="60" height="60" x="89">
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.2" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="18" height="18" x="21" y="21"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../../../../org.eclipse.etrice.modellib.cpp/model/TimingService.room#SPP:ATimingService$timer"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" incomingConnections="//@connections.0" referencedGraphicsAlgorithm="//@children.0/@children.1/@children.2/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="60" height="15" y="6" font="//@fonts.0" value="timer"/>
+ </children>
+ </children>
+ </children>
+ </children>
+ <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.0/@anchors.0" end="//@children.0/@children.1/@children.2/@anchors.0">
+ <properties key="obj-type" value="conn"/>
+ <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="2" filled="false" transparency="0.0"/>
+ <link>
+ <businessObjects href="../PingPong.room#LayerConnection:SubSysClass$topActor-timingService!timer"/>
+ </link>
+ <connectionDecorators visible="true" locationRelative="true" location="1.0">
+ <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="2" filled="false" transparency="0.0">
+ <points x="-15" y="10"/>
+ <points/>
+ <points x="-15" y="-10"/>
+ </graphicsAlgorithm>
+ </connectionDecorators>
+ </connections>
+ <colors red="227" green="238" blue="249"/>
+ <colors red="255" green="255" blue="255"/>
+ <colors/>
+ <colors red="200" green="200" blue="200"/>
+ <fonts name="Arial" size="8"/>
+</pi:Diagram>
diff --git a/examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/diagrams/PingPongModel.TopActor.structure b/examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/diagrams/PingPongModel.TopActor.structure
new file mode 100644
index 000000000..75c499a78
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/diagrams/PingPongModel.TopActor.structure
@@ -0,0 +1,299 @@
+<?xml version="1.0" encoding="ASCII"?>
+<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" gridUnit="10" diagramTypeId="room.structure" name="Structure of TopActor" pictogramLinks="//@link //@children.0/@link //@children.0/@children.0/@link //@children.0/@children.1/@link //@children.0/@children.0/@children.2/@link //@children.0/@children.1/@children.2/@link //@connections.0/@link" verticalGridUnit="10" version="0.11.0">
+ <graphicsAlgorithm xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.0" lineWidth="1" transparency="0.0" width="1000" height="1000"/>
+ <link>
+ <businessObjects href="../PingPong.room#ActorClass:TopActor"/>
+ </link>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="cls"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="880" height="580" x="40" y="40">
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.2" lineWidth="1" lineVisible="false" transparency="0.5" width="800" height="500" x="40" y="40"/>
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" foreground="//@colors.2" lineWidth="4" filled="false" transparency="0.0" width="800" height="500" x="40" y="40"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#ActorClass:TopActor"/>
+ </link>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="ref"/>
+ <properties key="actorref_version" value="2"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="240" height="140" x="174" y="90">
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="180" height="80" x="33" y="27">
+ <properties key="actorref_graphic_element" value="replborder"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="180" height="80" x="30" y="30">
+ <properties key="actorref_graphic_element" value="mainborder"/>
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="20" height="10" x="150" y="50">
+ <properties key="actorref_graphic_element" value="substructure"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="20" height="10" x="145" y="65">
+ <properties key="actorref_graphic_element" value="substructure"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points y="15"/>
+ <points x="15"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points y="30"/>
+ <points x="30"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points y="45"/>
+ <points x="45"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points y="60"/>
+ <points x="60"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points y="75"/>
+ <points x="75"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="10" y="80"/>
+ <points x="90"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="25" y="80"/>
+ <points x="105"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="40" y="80"/>
+ <points x="120"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="55" y="80"/>
+ <points x="135"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="70" y="80"/>
+ <points x="150"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="85" y="80"/>
+ <points x="165"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="100" y="80"/>
+ <points x="180"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="115" y="80"/>
+ <points x="180" y="15"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="130" y="80"/>
+ <points x="180" y="30"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="145" y="80"/>
+ <points x="180" y="45"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="160" y="80"/>
+ <points x="180" y="60"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="175" y="80"/>
+ <points x="180" y="75"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="25" height="25" x="185" y="30">
+ <properties key="actorref_graphic_element" value="sizeframe"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#ActorRef:TopActor$sender"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" referencedGraphicsAlgorithm="//@children.0/@children.0/@graphicsAlgorithm/@graphicsAlgorithmChildren.1">
+ <properties key="actorref_graphic_element" value="layerconn_anchor"/>
+ </anchors>
+ <children visible="true">
+ <properties key="actorref_graphic_element" value="name_shape"/>
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.3" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="180" height="80" x="30" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="sender&#xA;(Sender)"/>
+ </children>
+ <children>
+ <properties key="actorref_graphic_element" value="size_shape"/>
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.3" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="25" height="25" x="185" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="1"/>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="port"/>
+ <properties key="inherited" value="false"/>
+ <properties key="item-kind" value="C"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="60" height="60" x="88" y="80">
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="18" height="18" x="21" y="21"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#Port:Sender$sendPort"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.0" referencedGraphicsAlgorithm="//@children.0/@children.0/@children.2/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="60" height="15" y="39" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="sendPort"/>
+ </children>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="ref"/>
+ <properties key="actorref_version" value="2"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="240" height="140" x="309" y="308">
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="180" height="80" x="33" y="27">
+ <properties key="actorref_graphic_element" value="replborder"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="180" height="80" x="30" y="30">
+ <properties key="actorref_graphic_element" value="mainborder"/>
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="20" height="10" x="150" y="50">
+ <properties key="actorref_graphic_element" value="substructure"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="20" height="10" x="145" y="65">
+ <properties key="actorref_graphic_element" value="substructure"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points y="15"/>
+ <points x="15"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points y="30"/>
+ <points x="30"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points y="45"/>
+ <points x="45"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points y="60"/>
+ <points x="60"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points y="75"/>
+ <points x="75"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="10" y="80"/>
+ <points x="90"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="25" y="80"/>
+ <points x="105"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="40" y="80"/>
+ <points x="120"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="55" y="80"/>
+ <points x="135"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="70" y="80"/>
+ <points x="150"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="85" y="80"/>
+ <points x="165"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="100" y="80"/>
+ <points x="180"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="115" y="80"/>
+ <points x="180" y="15"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="130" y="80"/>
+ <points x="180" y="30"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="145" y="80"/>
+ <points x="180" y="45"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="160" y="80"/>
+ <points x="180" y="60"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineStyle="UNSPECIFIED" lineVisible="false" transparency="0.4">
+ <properties key="actorref_graphic_element" value="hatched_line"/>
+ <points x="175" y="80"/>
+ <points x="180" y="75"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="25" height="25" x="185" y="30">
+ <properties key="actorref_graphic_element" value="sizeframe"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#ActorRef:TopActor$receiver"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" referencedGraphicsAlgorithm="//@children.0/@children.1/@graphicsAlgorithm/@graphicsAlgorithmChildren.1">
+ <properties key="actorref_graphic_element" value="layerconn_anchor"/>
+ </anchors>
+ <children visible="true">
+ <properties key="actorref_graphic_element" value="name_shape"/>
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.3" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="180" height="80" x="30" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="receiver&#xA;(Receiver)"/>
+ </children>
+ <children>
+ <properties key="actorref_graphic_element" value="size_shape"/>
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.3" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="25" height="25" x="185" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="1"/>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="port"/>
+ <properties key="inherited" value="false"/>
+ <properties key="item-kind" value=""/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="60" height="60" x="89">
+ <graphicsAlgorithmChildren xsi:type="al:Rectangle" background="//@colors.2" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="18" height="18" x="21" y="21"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../PingPong.room#Port:Receiver$recvPort"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" incomingConnections="//@connections.0" referencedGraphicsAlgorithm="//@children.0/@children.1/@children.2/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="60" height="15" y="6" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="recvPort"/>
+ </children>
+ </children>
+ </children>
+ </children>
+ <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.0/@children.2/@anchors.0" end="//@children.0/@children.1/@children.2/@anchors.0">
+ <properties key="obj-type" value="bind"/>
+ <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+ <link>
+ <businessObjects href="../PingPong.room#Binding:TopActor$sendPort!sender-recvPort!receiver"/>
+ </link>
+ </connections>
+ <colors red="227" green="238" blue="249"/>
+ <colors red="255" green="255" blue="255"/>
+ <colors/>
+ <colors red="200" green="200" blue="200"/>
+ <fonts name="Arial" size="8"/>
+</pi:Diagram>
diff --git a/examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/generate_PingPongCpp.launch b/examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/generate_PingPongCpp.launch
new file mode 100644
index 000000000..702765a93
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.cpp/model/PingPong/generate_PingPongCpp.launch
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.etrice.generator.launch.cpp.launchConfigurationType">
+<booleanAttribute key="Debug" value="false"/>
+<booleanAttribute key="GenDocumentation" value="false"/>
+<booleanAttribute key="GenInstanceDiagram" value="false"/>
+<stringAttribute key="GenModelPath" value=""/>
+<booleanAttribute key="Lib" value="false"/>
+<booleanAttribute key="MSC" value="true"/>
+<booleanAttribute key="DataLogging" value="true"/>
+<listAttribute key="ModelFiles">
+<listEntry value="${workspace_loc:/org.eclipse.etrice.tutorials.cpp/model/PingPong/Mapping.etmap}"/>
+</listAttribute>
+<booleanAttribute key="SaveGenModel" value="false"/>
+<booleanAttribute key="Verbose" value="false"/>
+<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${workspace}"/>
+</launchConfiguration>
diff --git a/examples/org.eclipse.etrice.tutorials.cpp/run_Readme b/examples/org.eclipse.etrice.tutorials.cpp/run_Readme
new file mode 100644
index 000000000..7a19fc356
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.cpp/run_Readme
@@ -0,0 +1,4 @@
+Perform a clean of the project whenever you run another generated model. (Menu: Project -> Clean)
+
+Switching from HelloWorld to PingPong application requires a complete clean before run.
+Otherwise there might be more than one main function in the binary folder. \ No newline at end of file
diff --git a/examples/org.eclipse.etrice.tutorials.cpp/run_Template_Linux_.launch b/examples/org.eclipse.etrice.tutorials.cpp/run_Template_Linux_.launch
new file mode 100644
index 000000000..e91ee2ebc
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.cpp/run_Template_Linux_.launch
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.cdt.launch.applicationLaunchType">
+<booleanAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB" value="true"/>
+<listAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB_LIST"/>
+<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="gdb"/>
+<booleanAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_ON_FORK" value="false"/>
+<stringAttribute key="org.eclipse.cdt.dsf.gdb.GDB_INIT" value=".gdbinit"/>
+<booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="false"/>
+<booleanAttribute key="org.eclipse.cdt.dsf.gdb.REVERSE" value="false"/>
+<listAttribute key="org.eclipse.cdt.dsf.gdb.SOLIB_PATH"/>
+<stringAttribute key="org.eclipse.cdt.dsf.gdb.TRACEPOINT_MODE" value="TP_NORMAL_ONLY"/>
+<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
+<booleanAttribute key="org.eclipse.cdt.dsf.gdb.internal.ui.launching.LocalApplicationCDebuggerTab.DEFAULTS_SET" value="true"/>
+<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
+<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
+<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_ID" value="gdb"/>
+<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/>
+<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="run"/>
+<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>
+<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
+<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="LinuxPosix/org.eclipse.etrice.tutorials.cpp.exe"/>
+<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="org.eclipse.etrice.tutorials.cpp"/>
+<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733.766587329"/>
+<booleanAttribute key="org.eclipse.cdt.launch.use_terminal" value="true"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.etrice.tutorials.cpp"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="4"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;memoryBlockExpressionList context=&quot;reserved-for-future-use&quot;/&gt;&#13;&#10;"/>
+<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
+</launchConfiguration>
diff --git a/examples/org.eclipse.etrice.tutorials.cpp/run_Template_Windows_.launch b/examples/org.eclipse.etrice.tutorials.cpp/run_Template_Windows_.launch
new file mode 100644
index 000000000..1f9d56d7a
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.cpp/run_Template_Windows_.launch
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.cdt.launch.applicationLaunchType">
+<booleanAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB" value="true"/>
+<listAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB_LIST"/>
+<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="gdb"/>
+<booleanAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_ON_FORK" value="false"/>
+<stringAttribute key="org.eclipse.cdt.dsf.gdb.GDB_INIT" value=".gdbinit"/>
+<booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="false"/>
+<booleanAttribute key="org.eclipse.cdt.dsf.gdb.REVERSE" value="false"/>
+<listAttribute key="org.eclipse.cdt.dsf.gdb.SOLIB_PATH"/>
+<stringAttribute key="org.eclipse.cdt.dsf.gdb.TRACEPOINT_MODE" value="TP_NORMAL_ONLY"/>
+<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
+<booleanAttribute key="org.eclipse.cdt.dsf.gdb.internal.ui.launching.LocalApplicationCDebuggerTab.DEFAULTS_SET" value="true"/>
+<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
+<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
+<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_ID" value="gdb"/>
+<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/>
+<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="run"/>
+<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>
+<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
+<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="WindowsMinGW\org.eclipse.etrice.tutorials.cpp.exe"/>
+<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="org.eclipse.etrice.tutorials.cpp"/>
+<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="cdt.managedbuild.config.gnu.mingw.exe.debug.1129952733"/>
+<booleanAttribute key="org.eclipse.cdt.launch.use_terminal" value="true"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.etrice.tutorials.cpp"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="4"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;memoryBlockExpressionList context=&quot;reserved-for-future-use&quot;/&gt;&#13;&#10;"/>
+<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
+</launchConfiguration>
diff --git a/examples/org.eclipse.etrice.tutorials.cpp/src-gen-info/readme.txt b/examples/org.eclipse.etrice.tutorials.cpp/src-gen-info/readme.txt
new file mode 100644
index 000000000..1dc2b35ab
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.cpp/src-gen-info/readme.txt
@@ -0,0 +1,4 @@
+This directory is an eTrice code generation target.
+It will be erased every time the generator is executed.
+
+DO NOT PLACE OTHER FILES HERE!
diff --git a/examples/org.eclipse.etrice.tutorials.cpp/src-gen/readme.txt b/examples/org.eclipse.etrice.tutorials.cpp/src-gen/readme.txt
new file mode 100644
index 000000000..1dc2b35ab
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.cpp/src-gen/readme.txt
@@ -0,0 +1,4 @@
+This directory is an eTrice code generation target.
+It will be erased every time the generator is executed.
+
+DO NOT PLACE OTHER FILES HERE!
diff --git a/plugins/org.eclipse.etrice.doc/featuremodel/etrice.codegenerators.featurizer b/plugins/org.eclipse.etrice.doc/featuremodel/etrice.codegenerators.featurizer
index a23df9bec..20aff0226 100644
--- a/plugins/org.eclipse.etrice.doc/featuremodel/etrice.codegenerators.featurizer
+++ b/plugins/org.eclipse.etrice.doc/featuremodel/etrice.codegenerators.featurizer
@@ -6,30 +6,51 @@ Package CodeGenerators
description ''''''
contains CCodeGenerator
contains JavaCodeGenerator
+ contains CPPCodeGenerator
;
Feature CCodeGenerator
shortName '''C Code Generator'''
description ''''''
-
+
contains GenerationOptions
contains MSCLogging
contains DataLogging
-
+
stable
;
Feature JavaCodeGenerator
shortName '''Java Code Generator'''
description ''''''
-
+
contains GenerationOptions
contains MSCLogging
-
+
stable
;
Feature CPPCodeGenerator
shortName '''C++ Code Generator'''
- description ''''''
+ description '''
+ Missing Features:
+
+ - memory management of messages (pool + free memory)
+
+ - Inheritance
+ - Enums, non-primtive datatypes e.g. string, DataClass ...
+ - Wait on 'quit' in cmd (atm wait 30sec)
+ - getter/setter attributes
+
+ TODO:
+ - fix free memory on exit (delete of instance tree in runner)
+ - remove streams
+ - find compiler flags for deactivating exceptions, streams ...
+ - includes to generated files
+
+ Optimization:
+ - for C11 use unordered map
+ - reduce use of dynamic_cast and rtti
+
+ '''
prototype
;
@@ -38,7 +59,7 @@ Feature GenerationOptions
text '''
Options for generation are configured in the launch configuration or in case of standalone generation via command line.
A list of available options:
-
+
- generate as library
- generate documentation
- generate instrumentation for MSC generation
@@ -53,10 +74,10 @@ Feature MSCLogging
description '''Runtime logger for event-driven Messages, represented as a Message Sequence Chart.'''
text '''
The MSCLogging is activated by default, but can be set manually in the [GenerationOptions][]. The output file is created upon regular termination of the application. The resulting file can be found in the logging directory and has the name *msc.seq*, which can be open with the free open source tool [Trace2UML](http://trace2uml.stage.tigris.org/).
-
+
![MSCLogging](images/300-MSCLogging.png)
'''
-
+
uses GenerationOptions
stable
;
@@ -68,25 +89,25 @@ Feature DataLogging
```room
@DataLogging(pathlist = "/portInstancePath,/portInstancePath,..")
- ```
-
+ ```
+
Where `pathlist` is a string specifying a list of port instances which should be instrumented for data logging:
-
+
- the path of a port instance starts with the name of the [LogicalSystem][] and thus consists of at least 4 following segments
- `/portInstancePath` = `/LogicalSystem/SubSystemRef/ActorRef/Port`
+ `/portInstancePath` = `/LogicalSystem/SubSystemRef/ActorRef/Port`
- multiple paths are separated through comma (`,`), but avoid any whitespace
- the [Port][] must be conjugated and it´s [ProtocolClass][] has to be data-driven
- only the first Message having primitive or enum typed data is considered
-
+
The logging status can be verified in the generation console. It will output an overview of all accepted ports. In the [GenerationOptions][] is possible to (de)activate the data logging and thus ignoring the presence of the annotation.
-
- At runtime the data values will then be logged
-
+
+ At runtime the data values will then be logged
+
- into a file *log/SubSystemRef.data.csv*
- it contains one column for each port instance
- and a new row for every polling cycle, containing all readout data values
- the first column is used to number the cycles
-
+
Multi-Threading is not supported, the system must have not more than one polled/async physical thread.
@@ -102,11 +123,11 @@ Feature DataLogging
example '''
```room
import room.basic.annotations.* from "../../org.eclipse.etrice.modellib.c/model/Annotations.room"
-
+
LogicalSystem Logging {
SubSystemRef main: MainSubSystem
}
-
+
SubSystemClass MainSubSystem {
@DataLogging(pathlist = "/Logging/main/actorRef1/port1")
@Gnuplot(format="pngcairo", outputfile="main.data.png", width=1800, height=600, fontsize=10)
@@ -127,11 +148,11 @@ Feature DataLogging
5, 0.389418 ,0.500000
[...]
```
-
- Resulting graph created from generated gnuplot script:
+
+ Resulting graph created from generated gnuplot script:
![Gnuplot example](images/300-Gnuplot.png)
'''
-
+
uses Annotation
prototype
;
diff --git a/plugins/org.eclipse.etrice.doc/online-doc/static/css/custom.css b/plugins/org.eclipse.etrice.doc/online-doc/static/css/custom.css
index bd6ab8e4a..3e32f8661 100644
--- a/plugins/org.eclipse.etrice.doc/online-doc/static/css/custom.css
+++ b/plugins/org.eclipse.etrice.doc/online-doc/static/css/custom.css
@@ -2,10 +2,6 @@
color: #888;
}
-.pull-right {
- float: right;
-}
-
/* bootstrap nestd list fix */
ol ol, ol ul, ul ol, ul ul {
margin-bottom: 10px;
diff --git a/plugins/org.eclipse.etrice.generator.c/META-INF/MANIFEST.MF b/plugins/org.eclipse.etrice.generator.c/META-INF/MANIFEST.MF
index 0f8f12b24..d72474055 100644
--- a/plugins/org.eclipse.etrice.generator.c/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.etrice.generator.c/META-INF/MANIFEST.MF
@@ -5,15 +5,14 @@ Bundle-Vendor: Eclipse eTrice (Incubation)
Bundle-Version: 0.5.0.qualifier
Bundle-SymbolicName: org.eclipse.etrice.generator.c;singleton:=true
Bundle-ActivationPolicy: lazy
-Require-Bundle: org.eclipse.etrice.core.room.ui;bundle-version="0.5.0",
- org.eclipse.etrice.core.genmodel;bundle-version="0.5.0",
+Require-Bundle: org.eclipse.etrice.core.genmodel;bundle-version="0.5.0",
+ org.eclipse.etrice.core.etphys;bundle-version="0.5.0",
+ org.eclipse.etrice.core.etmap;bundle-version="0.5.0",
org.eclipse.etrice.generator.fsm;bundle-version="0.5.0",
org.eclipse.etrice.generator;bundle-version="0.5.0",
- org.eclipse.etrice.generator.doc;bundle-version="0.5.0",
org.eclipse.etrice.generator.config;bundle-version="0.5.0",
+ org.eclipse.etrice.generator.doc;bundle-version="0.5.0",
org.eclipse.etrice.generator.gnuplot;bundle-version="0.5.0",
- org.eclipse.etrice.core.etmap;bundle-version="0.5.0",
- org.eclipse.etrice.core.etphys;bundle-version="0.5.0",
org.eclipse.core.resources;bundle-version="3.6.0",
org.eclipse.core.runtime;bundle-version="3.6.0",
org.eclipse.ui;bundle-version="3.7.0",
@@ -23,4 +22,6 @@ Require-Bundle: org.eclipse.etrice.core.room.ui;bundle-version="0.5.0",
org.eclipse.xtext.util;bundle-version="2.6.0"
Import-Package: org.apache.log4j
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Export-Package: org.eclipse.etrice.generator.c
+Export-Package: org.eclipse.etrice.generator.c,
+ org.eclipse.etrice.generator.c.gen,
+ org.eclipse.etrice.generator.c.setup
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ActorClassGen.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ActorClassGen.xtend
index 03c557429..c4d14fa5e 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ActorClassGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ActorClassGen.xtend
@@ -4,11 +4,11 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* CONTRIBUTORS:
* Henrik Rentz-Reichert (initial contribution)
* Thomas Schuetz (changed for C code generator)
- *
+ *
*******************************************************************************/
package org.eclipse.etrice.generator.c.gen
@@ -19,7 +19,6 @@ import org.eclipse.etrice.core.fsm.fSM.ComponentCommunicationType
import org.eclipse.etrice.core.genmodel.etricegen.ExpandedActorClass
import org.eclipse.etrice.core.genmodel.etricegen.Root
import org.eclipse.etrice.core.genmodel.fsm.base.ILogger
-import org.eclipse.etrice.core.room.ActorClass
import org.eclipse.etrice.core.room.CommunicationType
import org.eclipse.etrice.core.room.Operation
import org.eclipse.etrice.core.room.ProtocolClass
@@ -33,7 +32,7 @@ import org.eclipse.etrice.generator.generic.RoomExtensions
@Singleton
class ActorClassGen extends GenericActorClassGenerator {
-
+
@Inject protected extension RoomExtensions
@Inject extension CExtensions
@Inject extension ProcedureHelpers
@@ -42,16 +41,16 @@ class ActorClassGen extends GenericActorClassGenerator {
@Inject protected ILanguageExtension langExt
@Inject IGeneratorFileIo fileIO
@Inject ILogger logger
-
+
def doGenerate(Root root) {
for (xpac: root.xpActorClasses) {
val path = xpac.actorClass.generationTargetPath+xpac.actorClass.getPath
val infopath = xpac.actorClass.generationInfoPath+xpac.actorClass.getPath
var file = xpac.actorClass.getCHeaderFileName
-
+
// header file
fileIO.generateFile("generating ActorClass header", path, infopath, file, root.generateHeaderFile(xpac))
-
+
// utils file
file = xpac.actorClass.getCUtilsFileName
fileIO.generateFile("generating ActorClass utils", path, infopath, file, root.generateUtilsFile(xpac))
@@ -66,7 +65,7 @@ class ActorClassGen extends GenericActorClassGenerator {
}
}
}
-
+
def private generateHeaderFile(Root root, ExpandedActorClass xpac) {
val ac = xpac.actorClass
val eventPorts = ac.allEndPorts.filter(p|(p.protocol as ProtocolClass).commType==CommunicationType::EVENT_DRIVEN)
@@ -77,20 +76,20 @@ class ActorClassGen extends GenericActorClassGenerator {
val hasConstData = !(eventPorts.empty && recvPorts.empty && ac.allSAPs.empty && ac.allServiceImplementations.empty)
|| Main::settings.generateMSCInstrumentation
val hasVarData = !(sendPorts.empty && ac.allAttributes.empty && xpac.stateMachine.empty && !hasConstData)
-
+
'''
/**
* @author generated by eTrice
*
* Header File of ActorClass «ac.name»
- *
+ *
*/
-
+
«generateIncludeGuardBegin(ac)»
-
+
#include "etDatatypes.h"
#include "messaging/etMessage.h"
-
+
«FOR dataClass : root.getReferencedDataClasses(ac)»
#include «dataClass.includePath»
«ENDFOR»
@@ -100,17 +99,17 @@ class ActorClassGen extends GenericActorClassGenerator {
«FOR pc : root.getReferencedProtocolClasses(ac)»
#include «pc.includePath»
«ENDFOR»
-
+
«ac.userCode(1, true)»
-
+
typedef struct «ac.name» «ac.name»;
-
+
/* const part of ActorClass (ROM) */
«IF hasConstData»
typedef struct «ac.name»_const {
«IF Main::settings.generateMSCInstrumentation»
const char* instName;
-
+
«ENDIF»
/* simple ports */
«FOR ep : eventPorts»
@@ -118,7 +117,7 @@ class ActorClassGen extends GenericActorClassGenerator {
const «ep.getPortClassName()» «ep.name»;
«ENDIF»
«ENDFOR»
-
+
/* data receive ports */
«FOR ep : recvPorts»
«IF ep.multiplicity==1»
@@ -130,14 +129,14 @@ class ActorClassGen extends GenericActorClassGenerator {
«FOR sap: ac.allSAPs»
const «sap.getPortClassName()» «sap.name»;
«ENDFOR»
-
+
/* replicated ports */
«FOR ep : ac.allEndPorts»
«IF ep.multiplicity!=1»
const etReplPort «ep.name»;
«ENDIF»
«ENDFOR»
-
+
/* services */
«FOR svc : ac.allServiceImplementations»
const etReplPort «svc.spp.name»;
@@ -146,18 +145,18 @@ class ActorClassGen extends GenericActorClassGenerator {
«ELSE»
/* this actor class has no ports and thus no constant data */
«ENDIF»
-
+
«IF !xpac.stateMachine.empty»
-
+
«xpac.genHeaderConstants»
«ENDIF»
-
+
/* variable part of ActorClass (RAM) */
«IF hasVarData»
struct «ac.name» {
«IF hasConstData»
const «ac.name»_const* const constData;
-
+
«ENDIF»
/* data send ports */
«FOR ep : sendPorts»
@@ -165,11 +164,11 @@ class ActorClassGen extends GenericActorClassGenerator {
«ep.getPortClassName()» «ep.name»;
«ENDIF»
«ENDFOR»
-
+
«ac.allAttributes.attributes»
-
+
«IF !xpac.stateMachine.empty»
-
+
«xpac.genDataMembers»
«ENDIF»
};
@@ -186,23 +185,22 @@ class ActorClassGen extends GenericActorClassGenerator {
void «ac.name»_init(«ac.name»* self);
void «ac.name»_receiveMessage(void* self, const void* ifitem, const etMessage* msg);
-
+
«IF dataDriven || async»
void «ac.name»_execute(«ac.name»* self);
«ENDIF»
-
- «IF ac.allStructors.exists[isConstructor]»«getConstructorSignature(ac.name)»;«ENDIF»
- «IF ac.allStructors.exists[!isConstructor]»«getDestructorSignature(ac.name)»;«ENDIF»
-
+
+ «ac.userStructorsDeclaration»
+
«ac.latestOperations.operationsDeclaration(ac.name)»
-
+
«ac.userCode(2, true)»
-
+
«generateIncludeGuardEnd(ac)»
-
+
'''
}
-
+
def private generateUtilsFile(Root root, ExpandedActorClass xpac) {
val ac = xpac.actorClass
val eventPorts = ac.allEndPorts.filter(p|(p.protocol as ProtocolClass).commType==CommunicationType::EVENT_DRIVEN)
@@ -211,23 +209,23 @@ class ActorClassGen extends GenericActorClassGenerator {
val recvPorts = ac.allEndPorts.filter(p|(p.protocol as ProtocolClass).commType==CommunicationType::DATA_DRIVEN && !p.conjugated && p.multiplicity==1)
val portsWithOperations = ac.allInterfaceItems.filter(p|p.portClass!=null && p.portClass.operations.size>0)
val filename = (ac.eContainer as RoomModel).name.replaceAll("\\.","_")+"_"+ac.name+"_Utils"
-
+
'''
/**
* @author generated by eTrice
*
* Utils File of ActorClass «ac.name»
- *
+ *
*/
-
+
«generateIncludeGuardBegin(filename)»
-
+
#include «ac.includePath»
-
+
/*
* access macros for ports, operations and attributes
*/
-
+
/* simple event ports */
«FOR ep : eventPorts.filter[multiplicity==1]»
«FOR msg : ep.outgoing»
@@ -236,14 +234,14 @@ class ActorClassGen extends GenericActorClassGenerator {
#define «ep.name»_«msg.name»(«data1») «ep.portClassName»_«msg.name»(&self->constData->«ep.name»«data2»)
«ENDFOR»
«ENDFOR»
-
+
/* data receive ports */
«FOR ep : recvPorts»
«FOR msg : ep.incoming»
#define «ep.name»_«msg.name» «ep.portClassName»_«msg.name»_get(&self->constData->«ep.name»)
«ENDFOR»
«ENDFOR»
-
+
/* data send ports */
«FOR ep : sendPorts»
«FOR msg : ep.outgoing»
@@ -261,7 +259,7 @@ class ActorClassGen extends GenericActorClassGenerator {
#define «sap.name»_«msg.name»(«data1») «sap.portClassName»_«msg.name»(&self->constData->«sap.name»«data2»)
«ENDFOR»
«ENDFOR»
-
+
/* replicated event ports */
«IF !replEventPorts.empty»
#define ifitem_index (((etReplSubPort*)ifitem)->index)
@@ -274,7 +272,7 @@ class ActorClassGen extends GenericActorClassGenerator {
#define «ep.name»_«msg.name»(idx«data2») «ep.portClassName»_«msg.name»(&self->constData->«ep.name», idx«data2»)
«ENDFOR»
«ENDFOR»
-
+
/* services */
«FOR svc : ac.allServiceImplementations»
«FOR msg : svc.spp.outgoing»
@@ -284,18 +282,18 @@ class ActorClassGen extends GenericActorClassGenerator {
#define «svc.spp.name»_«msg.name»(idx«data2») «svc.spp.portClassName»_«msg.name»(&self->constData->«svc.spp.name», idx«data2»)
«ENDFOR»
«ENDFOR»
-
+
/* operations */
«FOR op : ac.latestOperations»
«val args = op.argList»
#define «op.name»(«args») «ac.name»_«op.name»(self«IF !op.arguments.empty», «args»«ENDIF»)
«ENDFOR»
-
+
/* attributes */
«FOR a : ac.allAttributes»
#define «a.name» (self->«a.name»)
«ENDFOR»
-
+
/* port operations */
«FOR p : portsWithOperations»
«FOR op : p.portClass.operations»
@@ -303,33 +301,33 @@ class ActorClassGen extends GenericActorClassGenerator {
#define «p.name»_«op.name»(«args») «p.portClassName»_«op.name»((«p.portClassName»*)&self->constData->«p.name»«IF !op.arguments.empty», «args»«ENDIF»)
«ENDFOR»
«ENDFOR»
-
+
«generateIncludeGuardEnd(filename)»
-
+
'''
}
-
+
private def argList(Operation op) {
'''«FOR a : op.arguments SEPARATOR ", "»«a.name»«ENDFOR»'''
}
-
+
def private generateSourceFile(Root root, ExpandedActorClass xpac) {
val ac = xpac.actorClass
val async = ac.commType==ComponentCommunicationType::ASYNCHRONOUS
val eventDriven = ac.commType==ComponentCommunicationType::EVENT_DRIVEN
val dataDriven = ac.commType==ComponentCommunicationType::DATA_DRIVEN
val handleEvents = async || eventDriven
-
+
'''
/**
* @author generated by eTrice
*
* Source File of ActorClass «ac.name»
- *
+ *
*/
#include "«ac.getCHeaderFileName»"
-
+
#include "modelbase/etActor.h"
#include "debugging/etLogger.h"
#include "debugging/etMSCLogger.h"
@@ -339,9 +337,9 @@ class ActorClassGen extends GenericActorClassGenerator {
«FOR pc : root.getReferencedProtocolClasses(ac)»
#include «pc.includePath»
«ENDFOR»
-
+
#include "«ac.getCUtilsFileName»"
-
+
«ac.userCode(3, true)»
/* interface item IDs */
@@ -350,7 +348,7 @@ class ActorClassGen extends GenericActorClassGenerator {
«IF !xpac.stateMachine.empty»
«xpac.genStateMachine()»
«ENDIF»
-
+
void «ac.name»_init(«ac.name»* self){
ET_MSC_LOGGER_SYNC_ENTRY("«ac.name»", "init")
«IF !xpac.stateMachine.empty»
@@ -358,8 +356,8 @@ class ActorClassGen extends GenericActorClassGenerator {
«ENDIF»
ET_MSC_LOGGER_SYNC_EXIT
}
-
-
+
+
void «ac.name»_receiveMessage(void* self, const void* ifitem, const etMessage* msg){
ET_MSC_LOGGER_SYNC_ENTRY("«ac.name»", "_receiveMessage")
«IF !xpac.stateMachine.empty»
@@ -369,47 +367,30 @@ class ActorClassGen extends GenericActorClassGenerator {
«langExt.operationScope(ac.name, false)»receiveEventInternal(self);
«ENDIF»
«ENDIF»
-
+
ET_MSC_LOGGER_SYNC_EXIT
}
-
+
«IF dataDriven || async»
void «ac.name»_execute(«ac.name»* self) {
ET_MSC_LOGGER_SYNC_ENTRY("«ac.name»", "_execute")
«IF !xpac.stateMachine.empty»
-
+
«IF handleEvents»
«langExt.operationScope(ac.name, false)»receiveEvent(self, NULL, 0, NULL);
«ELSE»
«langExt.operationScope(ac.name, false)»receiveEventInternal(self);
«ENDIF»
«ENDIF»
-
+
ET_MSC_LOGGER_SYNC_EXIT
}
«ENDIF»
-
- «classStructors(ac)»
-
+
+ «ac.userStructorsImplementation»
+
«operationsImplementation(ac.latestOperations, ac.name)»
-
- '''
- }
-
- def protected classStructors(ActorClass ac){
- val ctors = ac.allStructors.filter[isConstructor]
- val dtors = ac.allStructors.filter[!isConstructor]
- '''
- «IF !ctors.isEmpty»
- «getConstructorSignature(ac.name)»{
- «ctors.map[translator.getTranslatedCode(detailCode).asBlock].join»
- }
- «ENDIF»
- «IF !dtors.isEmpty»
- «getDestructorSignature(ac.name)»{
- «dtors.map[translator.getTranslatedCode(detailCode).asBlock].join»
- }
- «ENDIF»
+
'''
}
}
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/CExtensions.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/CExtensions.xtend
index fcb2d9da7..6ecaca306 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/CExtensions.xtend
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/CExtensions.xtend
@@ -4,11 +4,11 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* CONTRIBUTORS:
* Thomas Schuetz and Henrik Rentz-Reichert (initial contribution)
* Thomas Schuetz (changed for C code generator)
- *
+ *
*******************************************************************************/
/*
@@ -61,7 +61,7 @@ class CExtensions implements ILanguageExtension {
override String accessLevelPrivate(){"static "}
override String accessLevelProtected(){"static "}
override String accessLevelPublic(){""}
-
+
override String memberAccess(){"self->"}
override String selfPointer(String classname, boolean hasArgs){
classname+
@@ -70,7 +70,7 @@ class CExtensions implements ILanguageExtension {
else
"* self"
}
-
+
override String selfPointer(boolean hasArgs) { if (hasArgs) "self, " else "self" }
override String operationScope(String classname, boolean isDeclaration){classname+"_"}
@@ -78,14 +78,14 @@ class CExtensions implements ILanguageExtension {
override String memberInDeclaration(String namespace, String member) {
return namespace+"_"+member
}
-
+
override String memberInUse(String namespace, String member) {
return namespace+"_"+member
}
//**** C-Specific
- /* TODO: move specific code elsewhere */
+ /* TODO: move specific code elsewhere */
// used
def String getCHeaderFileName(RoomClass rc) {
return rc.name+".h";
@@ -108,7 +108,7 @@ class CExtensions implements ILanguageExtension {
def String getDispSourceFileName(RoomClass rc) {
return rc.name+"_Disp.h";
}
-
+
// used
def String getCHeaderFileName(NodeRef nr, SubSystemInstance ssi) {
return nr.name+"_"+ssi.name+".h";
@@ -152,19 +152,19 @@ class CExtensions implements ILanguageExtension {
#endif /* «filename.getIncludeGuardString» */
'''
}
-
+
override boolean usesInheritance() {
return false
}
-
+
override boolean usesPointers() {
return true
}
-
+
override String genEnumeration(String name, List<Pair<String, String>> entries) {
if (entries.empty)
return "/* empty enum not generated */"
-
+
'''
enum «name» {
«FOR entry: entries SEPARATOR ","»
@@ -177,32 +177,16 @@ class CExtensions implements ILanguageExtension {
override String booleanConstant(boolean b) {
if (b) "ET_TRUE" else "ET_FALSE"
}
-
+
override String pointerLiteral() { "*" }
override String nullPointer() { "NULL" }
override String voidPointer() { "void*" }
-
- override String arrayDeclaration(String type, int size, String name, boolean isRef) {
- if (isRef){
- type+"* "+name+"["+size+"]";
- }else {
- type+" "+name+"["+size+"]";
- }
- }
-
- override String constructorName(String cls) {
- "ctor"
- }
- override String destructorName(String cls) {
- "dtor"
- }
- override String constructorReturnType() {
- "void"
- }
- override String destructorReturnType() {
- "void"
- }
-
+ override String typeArrayModifier() { pointerLiteral }
+
+ override String arrayDeclaration(String type, int size, String name, boolean isRef)'''
+ «type»«IF isRef»*«ENDIF» «name»[«size»]
+ '''
+
override String superCall(String baseClassName, String method, String args) {
""
}
@@ -220,10 +204,10 @@ class CExtensions implements ILanguageExtension {
case "boolean":
if (value.equals("true")) "ET_TRUE" else "ET_FALSE"
default:
- value
+ value
}
}
-
+
override toEnumLiteral(EnumerationType type, String value) {
if(value.contains(',') || value.contains('{')){
var singleValues = value.replace('{', '').replace('}', '').trim.split(',')
@@ -231,7 +215,7 @@ class CExtensions implements ILanguageExtension {
} else
convertStringEnumLiteral(type, value)
}
-
+
def private convertStringEnumLiteral(EnumerationType type, String value){
var v = value
if (v.startsWith(type.name))
@@ -253,7 +237,7 @@ class CExtensions implements ILanguageExtension {
diagnostician.error("external type "+dt.name + "has no default initialization", dt.eContainer, dt.eContainingFeature)
""
}
- DataClass:
+ DataClass:
'''
{
«FOR att : dt.allAttributes SEPARATOR ","»
@@ -263,14 +247,14 @@ class CExtensions implements ILanguageExtension {
'''
}
}
-
+
def String getDefaultValue(EnumerationType type) {
if (type.getLiterals().isEmpty())
""
else
getCastedValue(type.getLiterals().get(0))
}
-
+
override initializationWithDefaultValues(DataType dt, int size) {
val dv = dt.defaultValue
dv.initializer(size)
@@ -291,7 +275,7 @@ class CExtensions implements ILanguageExtension {
else
dv
}
-
+
def initializationWithDefaultValues(Attribute att) {
val dv = att.defaultValueLiteral
if (dv!=null) {
@@ -306,15 +290,15 @@ class CExtensions implements ILanguageExtension {
else
att.type.type.initializationWithDefaultValues(att.size)
}
-
+
override generateArglistAndTypedData(EObject d) {
if (d==null || !(d instanceof VarDecl))
return newArrayList("", "", "")
-
+
val data = d as VarDecl
if (data==null)
return newArrayList("", "", "")
-
+
var typeName = if (data.getRefType().getType() instanceof PrimitiveType)
(data.getRefType().getType() as PrimitiveType).targetName
else if (data.getRefType().getType() instanceof EnumerationType)
@@ -323,7 +307,7 @@ class CExtensions implements ILanguageExtension {
(data.getRefType().getType() as ExternalType).targetName
else
data.getRefType().getType().getName()
-
+
var castTypeName = if (data.getRefType().getType() instanceof PrimitiveType) {
val ct = (data.getRefType().getType() as PrimitiveType).getCastName()
if (ct!=null && !ct.isEmpty())
@@ -338,7 +322,7 @@ class CExtensions implements ILanguageExtension {
typeName
castTypeName = castTypeName+"*"
var deRef = "*"
-
+
val isRef = data.getRefType().isRef()
val isPrim = (data.getRefType().getType() instanceof PrimitiveType || data.getRefType().getType() instanceof EnumerationType)
if (isRef) {
@@ -351,41 +335,41 @@ class CExtensions implements ILanguageExtension {
deRef = ""
}
}
-
+
val typedData = typeName+" "+data.getName() + " = "+deRef+"(("+castTypeName+") generic_data__et);\n"
val dataArg = ", "+data.getName()
val typedArgList = ", "+typeName+" "+data.getName()
-
+
return newArrayList(dataArg, typedData, typedArgList);
}
-
+
def getIncludePath(RoomClass rc) {
"\""+(rc.eContainer as RoomModel).name.replaceAll("\\.","/")+"/"+rc.getCHeaderFileName+"\""
}
-
+
override getTargetType(EnumerationType type) {
if (type.getPrimitiveType()!=null)
type.getPrimitiveType().getTargetName()
else
type.getName()
}
-
+
override getCastedValue(EnumLiteral literal) {
val type = literal.eContainer() as EnumerationType
val cast = type.targetType
-
+
if (type.primitiveType==null)
Long.toString(literal.getLiteralValue())
else
"(("+cast+")"+Long.toString(literal.getLiteralValue())+")"
}
-
+
override getCastType(EnumerationType type) {
if (type.getPrimitiveType()!=null)
type.getPrimitiveType().getCastName()
else
type.getName()
}
-
+
}
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeGen.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeGen.xtend
index 34c27b984..1e849d8c2 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeGen.xtend
@@ -4,11 +4,11 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* CONTRIBUTORS:
* Henrik Rentz-Reichert (initial contribution)
* Thomas Schuetz (changed for C code generator)
- *
+ *
*******************************************************************************/
package org.eclipse.etrice.generator.c.gen
@@ -50,19 +50,19 @@ import org.eclipse.etrice.generator.generic.TypeHelpers
@Singleton
class NodeGen {
-
+
@Inject extension RoomHelpers
@Inject extension CExtensions
@Inject extension RoomExtensions
@Inject extension TypeHelpers
@Inject extension ProcedureHelpers helpers
-
+
@Inject IGeneratorFileIo fileIO
@Inject Initialization attrInitGenAddon
@Inject ILanguageExtension languageExt
@Inject IDiagnostician diagnostician
@Inject ILogger logger;
-
+
def doGenerate(Root root) {
for (nr : ETMapUtil::getNodeRefs()) {
for (instpath : ETMapUtil::getSubSystemInstancePaths(nr)) {
@@ -71,19 +71,19 @@ class NodeGen {
val filepath = ssi.subSystemClass.generationTargetPath+ssi.subSystemClass.getPath
val infopath = ssi.subSystemClass.generationInfoPath+ssi.subSystemClass.getPath
var file = nr.getCHeaderFileName(ssi)
-
+
checkDataPorts(ssi)
-
+
val usedThreads = ETMapUtil::getUsedThreads(nr, ssi)
-
+
fileIO.generateFile("generating Node declaration", filepath, infopath, file, root.generateHeaderFile(ssi))
-
+
file = nr.getCSourceFileName(ssi)
fileIO.generateFile("generating Node implementation", filepath, infopath, file, root.generateSourceFile(ssi, usedThreads))
-
+
file = nr.getInstSourceFileName(ssi)
fileIO.generateFile("generating Node instance file", filepath, infopath, file, root.generateInstanceFile(ssi, usedThreads))
-
+
file = nr.getDispSourceFileName(ssi)
fileIO.generateFile("generating Node dispatcher file", filepath, infopath, file, root.generateDispatcherFile(ssi, usedThreads))
}
@@ -100,40 +100,40 @@ class NodeGen {
* @author generated by eTrice
*
* Header File of Node «nr.name» with SubSystem «ssi.name»
- *
+ *
*/
-
+
«generateIncludeGuardBegin(clsname)»
-
+
#include "etDatatypes.h"
««« TODOCGENPHYS: user code?
«helpers.userCode(ssc.userCode1)»
-
-
+
+
/* lifecycle functions
* init -> start -> run (loop) -> stop -> destroy
*/
-
+
void «clsname»_init(void); /* lifecycle init */
void «clsname»_start(void); /* lifecycle start */
-
+
void «clsname»_run(etBool runAsTest); /* lifecycle run */
-
+
void «clsname»_stop(void); /* lifecycle stop */
void «clsname»_destroy(void); /* lifecycle destroy */
-
+
void «clsname»_shutdown(void); /* shutdown the dispatcher loop */
-
+
««« TODOCGENPHYS: user code?
«helpers.userCode(ssc.userCode2)»
-
+
«generateIncludeGuardEnd(clsname)»
-
-
+
+
'''
}
-
+
def private generateSourceFile(Root root, SubSystemInstance ssi, Collection<PhysicalThread> usedThreads) {
val nr = ETMapUtil::getNodeRef(ssi)
val ssc = ssi.subSystemClass
@@ -145,13 +145,13 @@ class NodeGen {
* @author generated by eTrice
*
* Source File of Node «nr.name» with SubSystem «ssi.name»
- *
+ *
*/
-
+
#include <stdio.h>
#include <string.h>
-
-
+
+
#include "«nr.getCHeaderFileName(ssi)»"
#include "debugging/etLogger.h"
@@ -165,18 +165,18 @@ class NodeGen {
««« TODOCGENPHYS: user code?
«helpers.userCode(ssc.userCode3)»
-
+
/* data for Node «nr.name» with SubSystem «ssi.name» */
typedef struct «clsname» {
char *name;
volatile int shutdownRequest;
} «clsname»;
-
+
static «clsname» «clsname»Inst = {"«clsname»", 0};
-
+
static void «clsname»_initActorInstances(void);
static void «clsname»_constructActorInstances(void);
-
+
/* include instances for all classes */
#include "«nr.getInstSourceFileName(ssi)»"
#include "«nr.getDispSourceFileName(ssi)»"
@@ -185,7 +185,7 @@ class NodeGen {
ET_MSC_LOGGER_SYNC_ENTRY("«clsname»", "initMessageServices")
{
etTime interval;
-
+
/* initialization of all message services */
«FOR thread: threads»
«IF thread.execmode==ExecMode::POLLED || thread.execmode==ExecMode::MIXED»
@@ -202,56 +202,56 @@ class NodeGen {
interval,
MsgDispatcher_«thread.name»_receiveMessage,
EXECMODE_«thread.execmode.toString.toUpperCase»);
-
+
«ENDFOR»
}
-
+
ET_MSC_LOGGER_SYNC_EXIT
}
static void «clsname»_startMessageServices(void) {
ET_MSC_LOGGER_SYNC_ENTRY("«clsname»", "startMessageServices")
-
+
«FOR thread: threads.sortBy[getPrio].reverse»
etMessageService_start(&msgService_«thread.name»);
«ENDFOR»
-
+
ET_MSC_LOGGER_SYNC_EXIT
}
static void «clsname»_stopMessageServices(void) {
ET_MSC_LOGGER_SYNC_ENTRY("«clsname»", "stopMessageServices")
-
+
«FOR thread: threads»
etMessageService_stop(&msgService_«thread.name»);
«ENDFOR»
-
+
ET_MSC_LOGGER_SYNC_EXIT
}
static void «clsname»_destroyMessageServices(void) {
ET_MSC_LOGGER_SYNC_ENTRY("«clsname»", "destroyMessageServices")
-
+
«FOR thread: threads»
etMessageService_destroy(&msgService_«thread.name»);
«ENDFOR»
-
+
ET_MSC_LOGGER_SYNC_EXIT
}
-
+
void «clsname»_init(void) {
ET_MSC_LOGGER_SYNC_ENTRY("«clsname»", "init")
etLogger_logInfoF("%s_init", «clsname»Inst.name);
-
+
/* construct all actors */
«clsname»_constructActorInstances();
-
+
/* initialization of all message services */
«clsname»_initMessageServices();
-
+
/* init all actors */
«clsname»_initActorInstances();
-
+
«IF logData»
«FOR thread: threads»
MsgDispatcher_«thread.name»_logDataHeaders();
@@ -260,21 +260,21 @@ class NodeGen {
MsgDispatcher_«thread.name»_logData();
«ENDFOR»
«ENDIF»
-
+
ET_MSC_LOGGER_SYNC_EXIT
}
-
+
void «clsname»_start(void) {
ET_MSC_LOGGER_SYNC_ENTRY("«clsname»", "start")
etLogger_logInfoF("%s_start", «clsname»Inst.name);
«clsname»_startMessageServices();
ET_MSC_LOGGER_SYNC_EXIT
}
-
+
void «clsname»_run(etBool runAsTest) {
- #ifdef ET_RUNNER_ACTIVATE
+ #ifdef ET_RUNNER_ACTIVATE
ET_MSC_LOGGER_SYNC_ENTRY("«clsname»", "run")
-
+
if (runAsTest) {
etSema_waitForWakeup(etRuntime_getTerminateSemaphore());
}
@@ -283,70 +283,67 @@ class NodeGen {
fflush(stdout);
while (ET_TRUE) {
char line[64];
-
+
if (fgets(line, 64, stdin) != NULL) {
if (strncmp(line, "quit", 4)==0)
break;
}
}
}
-
+
ET_MSC_LOGGER_SYNC_EXIT
- #endif
+ #endif
}
-
+
void «clsname»_stop(void){
ET_MSC_LOGGER_SYNC_ENTRY("«clsname»", "stop")
etLogger_logInfoF("%s_stop", «clsname»Inst.name);
-
+
«clsname»_stopMessageServices();
-
+
ET_MSC_LOGGER_SYNC_EXIT
}
-
+
void «clsname»_destroy(void){
ET_MSC_LOGGER_SYNC_ENTRY("«clsname»", "destroy")
etLogger_logInfoF("%s_destroy", «clsname»Inst.name);
- «FOR ai : ssi.allContainedInstances.reverseView»
- «IF ai.actorClass.allStructors.exists[!isConstructor]»
- «languageExt.memberInUse(ai.actorClass.name, languageExt.destructorName(ai.actorClass.name))»(&«ai.path.getPathName()»);
- «ENDIF»
+
+ «FOR ai : ssi.allContainedInstances»
+ «invokeUserStructor(ai.actorClass, '&'+ai.path.getPathName(), false)»
«ENDFOR»
-
+
«clsname»_destroyMessageServices();
-
+
ET_MSC_LOGGER_SYNC_EXIT
}
void «clsname»_shutdown(void){
ET_MSC_LOGGER_SYNC_ENTRY("«clsname»", "shutdown")
etLogger_logInfoF("%s_shutdown", «clsname»Inst.name);
-
+
«clsname»Inst.shutdownRequest = 1;
-
+
ET_MSC_LOGGER_SYNC_EXIT
}
static void «clsname»_constructActorInstances(void){
ET_MSC_LOGGER_SYNC_ENTRY("«clsname»", "constructActorInstances")
-
+
«FOR ai : ssi.allContainedInstances»
- «IF ai.actorClass.allStructors.exists[isConstructor]»
- «languageExt.memberInUse(ai.actorClass.name, languageExt.constructorName(ai.actorClass.name))»(&«ai.path.getPathName()»);
- «ENDIF»
+ «invokeUserStructor(ai.actorClass, '&'+ai.path.getPathName(), true)»
«ENDFOR»
-
+
ET_MSC_LOGGER_SYNC_EXIT
}
static void «clsname»_initActorInstances(void){
ET_MSC_LOGGER_SYNC_ENTRY("«clsname»", "initActorInstances")
-
+
«FOR ai : ssi.allContainedInstances»
«ai.actorClass.name»_init(&«ai.path.getPathName()»);
«ENDFOR»
-
+
ET_MSC_LOGGER_SYNC_EXIT
}
'''
@@ -374,23 +371,23 @@ class NodeGen {
«FOR protocolClass : root.getReferencedProtocolClasses(ssi.subSystemClass)»
#include «protocolClass.includePath»
«ENDFOR»
-
+
/* instantiation of message services and message buffers */
«FOR thread: nr.type.threads.filter(t|usedThreads.contains(t))»
/* «thread.name» */
#define «thread.name.toUpperCase»_POOL_SIZE «thread.msgpoolsize»
#define «thread.name.toUpperCase»_BLOCK_SIZE «thread.msgblocksize»
- static uint8 msgBuffer_«thread.name»[«thread.name.toUpperCase»_POOL_SIZE * «thread.name.toUpperCase»_BLOCK_SIZE];
+ static uint8 msgBuffer_«thread.name»[«thread.name.toUpperCase»_POOL_SIZE * «thread.name.toUpperCase»_BLOCK_SIZE];
static etMessageService msgService_«thread.name»;
«ENDFOR»
-
+
/* declarations of all ActorClass instances (const and variable structs) */
/* forward declaration of variable actor structs */
«FOR ai : ssi.allContainedInstances»
static «ai.actorClass.name» «ai.path.getPathName()»;
«ENDFOR»
-
+
/* forward declaration of variable port structs */
«FOR ai: ssi.allContainedInstances»
«IF ai.orderedIfItemInstances.empty»
@@ -402,13 +399,13 @@ class NodeGen {
«FOR Integer i:1.. if(pi.peers.size==0)1 else pi.peers.size SEPARATOR ', '»
«attrInitGenAddon.generateAttributeInit(pi, pi.interfaceItem.portClass.attributes)»
«ENDFOR»};
- «ENDIF»
+ «ENDIF»
«ENDFOR»
- «ENDIF»
+ «ENDIF»
«ENDFOR»
-
+
«FOR ai : ssi.allContainedInstances»
-
+
/* instance «ai.path.getPathName()» */
«IF !Main::settings.generateMSCInstrumentation && ai.orderedIfItemInstances.empty»
/* no ports/saps/services - nothing to initialize statically */
@@ -416,47 +413,47 @@ class NodeGen {
«genActorInstanceInitializer(root, ai)»
«ENDIF»
«ENDFOR»
-
+
'''
}
-
+
def private genActorInstanceInitializer(Root root, ActorInstance ai) {
val instName = ai.path.pathName
-
+
// list of replicated interface items (all are event driven ports)
val replEventItems = new ArrayList<InterfaceItemInstance>()
replEventItems.addAll(ai.orderedIfItemInstances.filter(e|e.replicated))
val haveReplSubItems = replEventItems.findFirst(e|!e.peers.empty)!=null
val replEventPorts = replEventItems.filter(i|i.interfaceItem instanceof Port)
val replEventSPPs = replEventItems.filter(i|i.interfaceItem instanceof SPP)
-
+
val simplePorts = ai.orderedIfItemInstances.filter(e|e.simple)
-
+
// list of simple event interface items
val simpleEventItems = new ArrayList<InterfaceItemInstance>()
simpleEventItems.addAll(simplePorts.filter(p|p.protocol.commType==CommunicationType::EVENT_DRIVEN))
-
+
// lists of event driven ports and saps
val simpleEventPorts = simpleEventItems.filter(i|i.interfaceItem instanceof Port)
val simpleEventSAPs = simpleEventItems.filter(i|i.interfaceItem instanceof SAP)
-
+
val dataPorts = simplePorts.filter(p|p.protocol.commType==CommunicationType::DATA_DRIVEN)
val recvPorts = dataPorts.filter(p|p instanceof PortInstance && !(p as PortInstance).port.conjugated)
val sendPorts = dataPorts.filter(p|p instanceof PortInstance && (p as PortInstance).port.conjugated)
-
- // compute replicated port offsets
+
+ // compute replicated port offsets
val offsets = new HashMap<InterfaceItemInstance, Integer>()
var offset = 0
for (p: replEventItems) {
offsets.put(p, offset)
offset = offset + p.peers.size
}
-
+
var replSubPortsArray = if (haveReplSubItems) instName+"_repl_sub_ports" else "NULL"
val haveConstData = !simpleEventItems.empty || !recvPorts.empty || !replEventItems.empty
|| Main::settings.generateMSCInstrumentation
val sep = new IntelligentSeparator(",");
-
+
val const = if (Main::settings.generateMSCInstrumentation) "/*const*/" else "const"
'''
«IF Main::settings.generateMSCInstrumentation»
@@ -474,29 +471,29 @@ class NodeGen {
static «const» «ai.actorClass.name»_const «instName»_const = {
«IF Main::settings.generateMSCInstrumentation»
«sep»"«ai.path»"
-
+
«ENDIF»
/* Ports: {varData, msgService, peerAddress, localId} */
/* simple ports */
«FOR pi : simpleEventPorts»
«sep»«genPortInitializer(root, ai, pi)»
«ENDFOR»
-
+
/* data receive ports */
«FOR pi : recvPorts»
«sep»«genRecvPortInitializer(root, ai, pi)»
«ENDFOR»
-
+
/* saps */
«FOR pi : simpleEventSAPs»
«sep»«genPortInitializer(root, ai, pi)»
«ENDFOR»
-
+
/* replicated ports */
«FOR pi : replEventPorts»
«sep»{«pi.peers.size», «replSubPortsArray»+«offsets.get(pi)»}
«ENDFOR»
-
+
/* services */
«FOR pi : replEventSPPs»
«sep»{«pi.peers.size», «replSubPortsArray»+«offsets.get(pi)»}
@@ -506,20 +503,20 @@ class NodeGen {
static «ai.actorClass.name» «instName» = {
«IF haveConstData»
&«instName»_const,
-
- «ENDIF»
+
+ «ENDIF»
/* data send ports */
«FOR pi : sendPorts»
«pi.genSendPortInitializer»,
«ENDFOR»
-
+
/* attributes */
«attrInitGenAddon.generateAttributeInit(ai, ai.actorClass.allAttributes)»
-
+
/* state and history are initialized in init function */
};
'''}
-
+
private def genPeerPortArrays(Root root, ActorInstance ai) {
val simplePorts = ai.orderedIfItemInstances.filter(e|e.simple && e instanceof PortInstance).map(inst|inst as PortInstance)
val sendPorts = simplePorts.filter(p|p.port.conjugated && p.protocol.commType==CommunicationType::DATA_DRIVEN)
@@ -539,7 +536,7 @@ class NodeGen {
«ENDIF»
'''
}
-
+
def private String genPortInitializer(Root root, ActorInstance ai, InterfaceItemInstance pi) {
val objId = if (pi.peers.empty) 0 else pi.peers.get(0).objId
val idx = if (pi.peers.empty) 0 else pi.peers.get(0).peers.indexOf(pi)
@@ -551,8 +548,8 @@ class NodeGen {
peerInst = if (!pi.peers.empty) "\""+(pi.peers.get(0).eContainer as ActorInstance).path+"\"\n#endif\n"
else "\n#endif\n"
}
-
- "{"+getInterfaceItemInstanceData(pi)+", "
+
+ "{"+getInterfaceItemInstanceData(pi)+", "
+msgSvc+", "
+(objId+idx)+"+BASE_ADDRESS, "
+(root.getExpandedActorClass(ai).getInterfaceItemLocalId(pi.interfaceItem)+1)
@@ -560,7 +557,7 @@ class NodeGen {
+peerInst
+"} /* Port "+pi.name+" */"
}
-
+
def private genSendPortInitializer(InterfaceItemInstance pi) {
val pc = (pi as PortInstance).port.protocol as ProtocolClass
var messages = pc.allIncomingMessages.filter(m|m.data!=null)
@@ -568,7 +565,7 @@ class NodeGen {
val boolMsgs = messages.filter(m|m.data.refType.type.isBoolean)
val usesMSC = Main::settings.generateMSCInstrumentation && !(enumMsgs.empty && boolMsgs.empty)
val instName = (pi.eContainer as ActorInstance).path
-
+
'''
{
«FOR m : pc.incomingMessages SEPARATOR ","»
@@ -583,7 +580,7 @@ class NodeGen {
} /* send port «pi.name» */
'''
}
-
+
def private getInterfaceItemInstanceData(InterfaceItemInstance pi){
if (pi.protocol.getPortClass(pi.conjugated)== null) return "NULL"
if (pi.protocol.getPortClass(pi.conjugated).attributes.empty){
@@ -592,8 +589,8 @@ class NodeGen {
return "&"+pi.path.pathName+"_var"
}
}
-
-
+
+
def private String genRecvPortInitializer(Root root, ActorInstance ai, InterfaceItemInstance pi) {
var sentMsgs = pi.interfaceItem.incoming.filter(m|m.data!=null)
val enumMsgs = sentMsgs.filter(m|m.data.refType.type.isEnumeration)
@@ -610,22 +607,22 @@ class NodeGen {
}
enumVal = "\n#ifdef ET_ASYNC_MSC_LOGGER_ACTIVATE"+enumVal+"\n#endif\n"
}
-
+
if (pi.peers.empty)
return "{NULL"+enumVal+"}"
var peer = pi.peers.get(0)
var peerInst = pi.peers.get(0).eContainer() as ActorInstance
var instName = peerInst.path.pathName
-
+
"{&"+instName+"."+peer.name+enumVal+"}"
}
-
+
def private String genReplSubPortInitializers(Root root, ActorInstance ai, InterfaceItemInstance pi) {
var result = ""
val myInst = if (Main::settings.generateMSCInstrumentation) "\n#ifdef ET_ASYNC_MSC_LOGGER_ACTIVATE\n,\""+(pi.eContainer as ActorInstance).path+"\"\n"
else ""
-
+
for (p: pi.peers) {
val idx = pi.peers.indexOf(p)
val comma = if (idx<pi.peers.size-1) "," else ""
@@ -635,7 +632,7 @@ class NodeGen {
else ""
iiiD = if (iiiD.equals("NULL")) iiiD+"," else iiiD+"["+idx+"],"
result = result +
- "{{"+iiiD
+ "{{"+iiiD
+"&msgService_"+thread+", "
+p.objId+"+BASE_ADDRESS, "
+(root.getExpandedActorClass(ai).getInterfaceItemLocalId(pi.interfaceItem)+1)
@@ -645,15 +642,15 @@ class NodeGen {
+idx
+"}"+comma+" /* Repl Sub Port "+pi.name+" idx +"+idx+"*/\n"
}
-
+
return result
}
-
+
def private generateDispatcherFile(Root root, SubSystemInstance ssi, Collection<PhysicalThread> usedThreads) {
val nr = ETMapUtil::getNodeRef(ssi)
val logData = Main::settings.generateDataInstrumentation && ssi.subSystemClass.annotations.isAnnotationPresent("DataLogging")
val loggedPorts = if(logData) ssi.loggedPorts else newArrayList
-
+
'''
/**
* @author generated by eTrice
@@ -661,16 +658,16 @@ class NodeGen {
* Dispatcher File of Node «nr.name» with SubSystem «ssi.name»
* contains a generated message dispatcher (receiveMessage) for each MessageService (Thread)
*/
-
+
#include "messaging/etMessageReceiver.h"
#include "debugging/etLogger.h"
#include "debugging/etMSCLogger.h"
-
+
«FOR thread: nr.type.threads.filter(t|usedThreads.contains(t)) SEPARATOR "\n"»
«val instancesOnThread = ssi.allContainedInstances.filter(ai|ETMapUtil::getMappedThread(ai).thread==thread)»
«val dispatchedInstances = instancesOnThread.filter(ai|ai.actorClass.commType == ComponentCommunicationType::EVENT_DRIVEN || ai.actorClass.commType == ComponentCommunicationType::ASYNCHRONOUS)»
«val executedInstances = instancesOnThread.filter(ai|ai.actorClass.commType == ComponentCommunicationType::DATA_DRIVEN || ai.actorClass.commType == ComponentCommunicationType::ASYNCHRONOUS)»
-
+
«IF executedInstances.size > 0»
/**
* generated execute function for all cyclic execute calls for the async or datadriven actor instances of thread "«thread.name»"
@@ -696,14 +693,14 @@ class NodeGen {
}
«ENDIF»
«ENDIF»
-
+
/**
* generated dispatch function for all messages for the thread "«thread.name»"
*/
static etBool MsgDispatcher_«thread.name»_receiveMessage(const etMessage* msg){
ET_MSC_LOGGER_SYNC_ENTRY("MsgDispatcher_«thread.name»", "receiveMessage")
switch(msg->address){
-
+
case MESSAGESERVICE_ADDRESS:
«IF !executedInstances.empty»
if (msg->evtID == etSystemProtocol_IN_poll) {
@@ -718,7 +715,7 @@ class NodeGen {
return ET_FALSE;
break;
«FOR ai : dispatchedInstances»
-
+
/* interface items of «ai.path» */
«FOR pi : ai. orderedIfItemInstances.filter(p|p.protocol.commType==CommunicationType::EVENT_DRIVEN)»
«IF pi.replicated»
@@ -733,7 +730,7 @@ class NodeGen {
«ENDFOR»
default: «ai.actorClass.name»_receiveMessage((void*)&«ai.path.pathName»,(etPort*)&«ai.path.pathName»_const.«pi.name».ports[«pi.peers.indexOf(peer)»], msg);
break;
- }
+ }
«ELSE»
«IF Main::settings.generateMSCInstrumentation»
ET_MSC_LOGGER_ASYNC_IN(
@@ -748,7 +745,7 @@ class NodeGen {
«ENDFOR»
«ELSE»
case «pi.objId»+BASE_ADDRESS:
- «IF (pi.protocol.handlesReceive(pi.isConjugated()))»
+ «IF (pi.protocol.handlesReceive(pi.isConjugated()))»
switch (msg->evtID){
«FOR h:getReceiveHandlers(pi.protocol,pi.isConjugated())»
case «pi.protocol.name»_«h.msg.codeName»:
@@ -772,7 +769,7 @@ class NodeGen {
«ENDIF»
«ENDFOR»
«ENDFOR»
-
+
default:
etLogger_logErrorF("MessageService_«thread.name»_receiveMessage: address %d does not exist ", msg->address);
break;
@@ -783,14 +780,14 @@ class NodeGen {
«ENDFOR»
'''
}
-
+
def private createLoggerCall(PortInstance pi) {
val msg = pi.protocol.incomingMessages.filter(m|m.data!=null && m.data.refType.type.enumerationOrPrimitive).get(0)
val ai = pi.eContainer as ActorInstance
val data = ai.path.pathName+"."+pi.name+"."+msg.name
val type = if (msg.data.refType.type instanceof EnumerationType) LiteralType.INT
else (msg.data.refType.type as PrimitiveType).type
-
+
switch (type) {
case LiteralType.BOOL: "ET_DATA_LOGGER_LOG_BOOL((int)"+data+")"
case LiteralType.CHAR: "ET_DATA_LOGGER_LOG_INT((int)"+data+")"
@@ -799,21 +796,21 @@ class NodeGen {
default: "internal error: unknown primitive type"
}
}
-
+
def private loggedPorts(SubSystemInstance ssi) {
val ArrayList<PortInstance> result = newArrayList
-
+
if (ssi.subSystemClass.annotations.isAnnotationPresent("DataLogging")) {
logger.logInfo("Data Logging is configured by annotation");
-
+
val filters = ssi.subSystemClass.annotations.getAttribute("DataLogging", "pathlist")
val filterList = filters.split(",")
for (filter: filterList) {
logger.logInfo(" filter: "+filter);
}
-
+
val ArrayList<String> notLogged = newArrayList
-
+
logger.logInfo(" logged ports:");
var iter = ssi.eAllContents
while (iter.hasNext) {
@@ -854,16 +851,16 @@ class NodeGen {
}
}
}
-
+
logger.logInfo(" NOT logged ports:");
for (nl: notLogged) {
logger.logInfo(nl);
}
}
-
+
return result
}
-
+
def private checkDataPorts(SubSystemInstance comp) {
val found = new HashSet<String>()
for (ai: comp.allContainedInstances) {
@@ -888,5 +885,5 @@ class NodeGen {
}
}
}
- }
+ }
}
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/StateMachineGen.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/StateMachineGen.xtend
index d2787cffd..4d1fcc834 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/StateMachineGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/StateMachineGen.xtend
@@ -4,10 +4,10 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* CONTRIBUTORS:
* Henrik Rentz-Reichert (initial contribution)
- *
+ *
*******************************************************************************/
package org.eclipse.etrice.generator.c.gen
@@ -22,9 +22,9 @@ import org.eclipse.etrice.core.genmodel.fsm.fsmgen.ExpandedModelComponent
@Singleton
class StateMachineGen extends GenericStateMachineGenerator {
-
+
@Inject extension RoomExtensions
-
+
def genHeaderConstants(ExpandedActorClass xpac) {
val ac = xpac.actorClass
/* TODO: can save one entry if NO_STATE=-1 but influences Java */
@@ -34,7 +34,7 @@ class StateMachineGen extends GenericStateMachineGenerator {
#define «ac.name.toUpperCase»_HISTORY_SIZE «historySize»
'''
}
-
+
def genDataMembers(ExpandedActorClass xpac) {
val ac = xpac.actorClass
'''
@@ -43,7 +43,7 @@ class StateMachineGen extends GenericStateMachineGenerator {
etInt16 history[«ac.name.toUpperCase»_HISTORY_SIZE];
'''
}
-
+
def genInitialization(ExpandedActorClass xpac) {
val ac = xpac.actorClass
'''
@@ -56,8 +56,11 @@ class StateMachineGen extends GenericStateMachineGenerator {
«langExt.operationScope(ac.name, false)»executeInitTransition(self);
'''
}
-
- override public genExtra(ExpandedModelComponent xpmc) {
+
+ /**
+ * @param generateImplementation NOT used
+ */
+ override public genExtra(ExpandedModelComponent xpmc, boolean generateImplementation) {
val mc = xpmc.modelComponent
val states = xpmc.stateMachine.baseStateList.getLeafStatesLast
'''
@@ -66,28 +69,28 @@ class StateMachineGen extends GenericStateMachineGenerator {
static char* stateStrings[] = {"<no state>","<top>",«FOR state : states SEPARATOR ","»"«state.genStatePathName»"
«ENDFOR»};
«ENDIF»
-
+
«langExt.accessLevelPrivate»void setState(«mc.componentName»* self, «stateType» new_state) {
self->state = new_state;
«IF Main::settings.generateMSCInstrumentation»
ET_MSC_LOGGER_CHANGE_STATE(self->constData->instName, stateStrings[new_state])
«ENDIF»
}
-
+
«langExt.accessLevelPrivate»«stateType» getState(«mc.componentName»* self) {
return self->state;
}
'''
}
-
+
override public stateType() {
"etInt16"
}
-
+
override boolType() {
"etBool"
}
-
+
override markVariableUsed(String varname) {
'''
((void)trigger__et); /* avoids unused warning */
@@ -96,5 +99,5 @@ class StateMachineGen extends GenericStateMachineGenerator {
override public unreachableReturn() {
"/* return NO_STATE; // required by CDT but detected as unreachable by JDT because of while (true) */"
}
-
+
}
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/setup/GeneratorModule.java b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/setup/GeneratorModule.java
index f6a9ec701..8bee75795 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/setup/GeneratorModule.java
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/setup/GeneratorModule.java
@@ -4,10 +4,10 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* CONTRIBUTORS:
* Henrik Rentz-Reichert (initial contribution)
- *
+ *
*******************************************************************************/
package org.eclipse.etrice.generator.c.setup;
@@ -17,9 +17,13 @@ import org.eclipse.etrice.generator.base.AbstractGeneratorBaseModule;
import org.eclipse.etrice.generator.base.IDataConfiguration;
import org.eclipse.etrice.generator.base.ITranslationProvider;
import org.eclipse.etrice.generator.c.Main;
+import org.eclipse.etrice.generator.c.gen.ActorClassGen;
import org.eclipse.etrice.generator.c.gen.CExtensions;
import org.eclipse.etrice.generator.c.gen.CTranslationProvider;
+import org.eclipse.etrice.generator.c.gen.ProtocolClassGen;
import org.eclipse.etrice.generator.config.DataConfiguration;
+import org.eclipse.etrice.generator.generic.GenericActorClassGenerator;
+import org.eclipse.etrice.generator.generic.GenericProtocolClassGenerator;
import org.eclipse.etrice.generator.generic.ILanguageExtension;
import com.google.inject.Binder;
@@ -29,8 +33,10 @@ public class GeneratorModule extends AbstractGeneratorBaseModule {
// @Override
public void configure(Binder binder) {
super.configure(binder);
-
+
binder.bind(AbstractGenerator.class).to(Main.class);
+ binder.bind(GenericProtocolClassGenerator.class).to(ProtocolClassGen.class);
+ binder.bind(GenericActorClassGenerator.class).to(ActorClassGen.class);
}
@Override
diff --git a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ActorClassGen.java b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ActorClassGen.java
index 8d9e857dc..b5cb0284e 100644
--- a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ActorClassGen.java
+++ b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ActorClassGen.java
@@ -18,14 +18,12 @@ import java.util.List;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.etrice.core.fsm.fSM.ComponentCommunicationType;
-import org.eclipse.etrice.core.fsm.fSM.DetailCode;
import org.eclipse.etrice.core.fsm.fSM.StateGraph;
import org.eclipse.etrice.core.genmodel.etricegen.ExpandedActorClass;
import org.eclipse.etrice.core.genmodel.etricegen.Root;
import org.eclipse.etrice.core.genmodel.fsm.base.ILogger;
import org.eclipse.etrice.core.room.ActorClass;
import org.eclipse.etrice.core.room.Attribute;
-import org.eclipse.etrice.core.room.ClassStructor;
import org.eclipse.etrice.core.room.CommunicationType;
import org.eclipse.etrice.core.room.DataClass;
import org.eclipse.etrice.core.room.EnumerationType;
@@ -252,7 +250,7 @@ public class ActorClassGen extends GenericActorClassGenerator {
_builder.append(_name, " ");
_builder.newLineIfNotEmpty();
_builder.append(" ");
- _builder.append("* ");
+ _builder.append("*");
_builder.newLine();
_builder.append(" ");
_builder.append("*/");
@@ -324,7 +322,6 @@ public class ActorClassGen extends GenericActorClassGenerator {
_builder.append("\t");
_builder.append("const char* instName;");
_builder.newLine();
- _builder.append("\t");
_builder.newLine();
}
}
@@ -350,7 +347,6 @@ public class ActorClassGen extends GenericActorClassGenerator {
}
}
}
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("/* data receive ports */");
@@ -392,7 +388,6 @@ public class ActorClassGen extends GenericActorClassGenerator {
_builder.newLineIfNotEmpty();
}
}
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("/* replicated ports */");
@@ -414,7 +409,6 @@ public class ActorClassGen extends GenericActorClassGenerator {
}
}
}
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("/* services */");
@@ -471,7 +465,6 @@ public class ActorClassGen extends GenericActorClassGenerator {
_builder.append(_name_11, "\t");
_builder.append("_const* const constData;");
_builder.newLineIfNotEmpty();
- _builder.append("\t");
_builder.newLine();
}
}
@@ -496,21 +489,18 @@ public class ActorClassGen extends GenericActorClassGenerator {
}
}
}
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
List<Attribute> _allAttributes_1 = this._roomHelpers.getAllAttributes(ac);
CharSequence _attributes = this._procedureHelpers.attributes(_allAttributes_1);
_builder.append(_attributes, "\t");
_builder.newLineIfNotEmpty();
- _builder.append("\t");
_builder.newLine();
{
StateGraph _stateMachine_2 = xpac.getStateMachine();
boolean _isEmpty_8 = this._roomHelpers.isEmpty(_stateMachine_2);
boolean _not_2 = (!_isEmpty_8);
if (_not_2) {
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
CharSequence _genDataMembers = this._stateMachineGen.genDataMembers(xpac);
@@ -580,43 +570,13 @@ public class ActorClassGen extends GenericActorClassGenerator {
}
}
_builder.newLine();
- {
- List<ClassStructor> _allStructors = this._roomHelpers.getAllStructors(ac);
- final Function1<ClassStructor, Boolean> _function_3 = new Function1<ClassStructor, Boolean>() {
- public Boolean apply(final ClassStructor it) {
- return Boolean.valueOf(it.isConstructor());
- }
- };
- boolean _exists = IterableExtensions.<ClassStructor>exists(_allStructors, _function_3);
- if (_exists) {
- String _name_19 = ac.getName();
- CharSequence _constructorSignature = this._procedureHelpers.getConstructorSignature(_name_19);
- _builder.append(_constructorSignature, "");
- _builder.append(";");
- }
- }
- _builder.newLineIfNotEmpty();
- {
- List<ClassStructor> _allStructors_1 = this._roomHelpers.getAllStructors(ac);
- final Function1<ClassStructor, Boolean> _function_4 = new Function1<ClassStructor, Boolean>() {
- public Boolean apply(final ClassStructor it) {
- boolean _isConstructor = it.isConstructor();
- return Boolean.valueOf((!_isConstructor));
- }
- };
- boolean _exists_1 = IterableExtensions.<ClassStructor>exists(_allStructors_1, _function_4);
- if (_exists_1) {
- String _name_20 = ac.getName();
- CharSequence _destructorSignature = this._procedureHelpers.getDestructorSignature(_name_20);
- _builder.append(_destructorSignature, "");
- _builder.append(";");
- }
- }
+ String _userStructorsDeclaration = this._procedureHelpers.userStructorsDeclaration(ac);
+ _builder.append(_userStructorsDeclaration, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
List<StandardOperation> _latestOperations = this._roomHelpers.getLatestOperations(ac);
- String _name_21 = ac.getName();
- CharSequence _operationsDeclaration = this._procedureHelpers.operationsDeclaration(_latestOperations, _name_21);
+ String _name_19 = ac.getName();
+ CharSequence _operationsDeclaration = this._procedureHelpers.operationsDeclaration(_latestOperations, _name_19);
_builder.append(_operationsDeclaration, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
@@ -745,7 +705,7 @@ public class ActorClassGen extends GenericActorClassGenerator {
_builder.append(_name_2, " ");
_builder.newLineIfNotEmpty();
_builder.append(" ");
- _builder.append("* ");
+ _builder.append("*");
_builder.newLine();
_builder.append(" ");
_builder.append("*/");
@@ -1277,7 +1237,7 @@ public class ActorClassGen extends GenericActorClassGenerator {
_builder.append(_name, " ");
_builder.newLineIfNotEmpty();
_builder.append(" ");
- _builder.append("* ");
+ _builder.append("*");
_builder.newLine();
_builder.append(" ");
_builder.append("*/");
@@ -1404,7 +1364,6 @@ public class ActorClassGen extends GenericActorClassGenerator {
}
}
}
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("ET_MSC_LOGGER_SYNC_EXIT");
@@ -1439,7 +1398,6 @@ public class ActorClassGen extends GenericActorClassGenerator {
boolean _isEmpty_3 = this._roomHelpers.isEmpty(_stateMachine_3);
boolean _not_3 = (!_isEmpty_3);
if (_not_3) {
- _builder.append("\t");
_builder.newLine();
{
if (handleEvents) {
@@ -1460,7 +1418,6 @@ public class ActorClassGen extends GenericActorClassGenerator {
}
}
}
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("ET_MSC_LOGGER_SYNC_EXIT");
@@ -1470,8 +1427,8 @@ public class ActorClassGen extends GenericActorClassGenerator {
}
}
_builder.newLine();
- CharSequence _classStructors = this.classStructors(ac);
- _builder.append(_classStructors, "");
+ String _userStructorsImplementation = this._procedureHelpers.userStructorsImplementation(ac);
+ _builder.append(_userStructorsImplementation, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
List<StandardOperation> _latestOperations = this._roomHelpers.getLatestOperations(ac);
@@ -1484,78 +1441,4 @@ public class ActorClassGen extends GenericActorClassGenerator {
}
return _xblockexpression;
}
-
- protected CharSequence classStructors(final ActorClass ac) {
- CharSequence _xblockexpression = null;
- {
- List<ClassStructor> _allStructors = this._roomHelpers.getAllStructors(ac);
- final Function1<ClassStructor, Boolean> _function = new Function1<ClassStructor, Boolean>() {
- public Boolean apply(final ClassStructor it) {
- return Boolean.valueOf(it.isConstructor());
- }
- };
- final Iterable<ClassStructor> ctors = IterableExtensions.<ClassStructor>filter(_allStructors, _function);
- List<ClassStructor> _allStructors_1 = this._roomHelpers.getAllStructors(ac);
- final Function1<ClassStructor, Boolean> _function_1 = new Function1<ClassStructor, Boolean>() {
- public Boolean apply(final ClassStructor it) {
- boolean _isConstructor = it.isConstructor();
- return Boolean.valueOf((!_isConstructor));
- }
- };
- final Iterable<ClassStructor> dtors = IterableExtensions.<ClassStructor>filter(_allStructors_1, _function_1);
- StringConcatenation _builder = new StringConcatenation();
- {
- boolean _isEmpty = IterableExtensions.isEmpty(ctors);
- boolean _not = (!_isEmpty);
- if (_not) {
- String _name = ac.getName();
- CharSequence _constructorSignature = this._procedureHelpers.getConstructorSignature(_name);
- _builder.append(_constructorSignature, "");
- _builder.append("{");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- final Function1<ClassStructor, CharSequence> _function_2 = new Function1<ClassStructor, CharSequence>() {
- public CharSequence apply(final ClassStructor it) {
- DetailCode _detailCode = it.getDetailCode();
- String _translatedCode = ActorClassGen.this._stateMachineGen.translator.getTranslatedCode(_detailCode);
- return ActorClassGen.this._procedureHelpers.asBlock(_translatedCode);
- }
- };
- Iterable<CharSequence> _map = IterableExtensions.<ClassStructor, CharSequence>map(ctors, _function_2);
- String _join = IterableExtensions.join(_map);
- _builder.append(_join, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- }
- }
- {
- boolean _isEmpty_1 = IterableExtensions.isEmpty(dtors);
- boolean _not_1 = (!_isEmpty_1);
- if (_not_1) {
- String _name_1 = ac.getName();
- CharSequence _destructorSignature = this._procedureHelpers.getDestructorSignature(_name_1);
- _builder.append(_destructorSignature, "");
- _builder.append("{");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- final Function1<ClassStructor, CharSequence> _function_3 = new Function1<ClassStructor, CharSequence>() {
- public CharSequence apply(final ClassStructor it) {
- DetailCode _detailCode = it.getDetailCode();
- String _translatedCode = ActorClassGen.this._stateMachineGen.translator.getTranslatedCode(_detailCode);
- return ActorClassGen.this._procedureHelpers.asBlock(_translatedCode);
- }
- };
- Iterable<CharSequence> _map_1 = IterableExtensions.<ClassStructor, CharSequence>map(dtors, _function_3);
- String _join_1 = IterableExtensions.join(_map_1);
- _builder.append(_join_1, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- }
- }
- _xblockexpression = _builder;
- }
- return _xblockexpression;
- }
}
diff --git a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/CExtensions.java b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/CExtensions.java
index 2c11ecbf9..f4f5b48f4 100644
--- a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/CExtensions.java
+++ b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/CExtensions.java
@@ -298,30 +298,25 @@ public class CExtensions implements ILanguageExtension {
return "void*";
}
- public String arrayDeclaration(final String type, final int size, final String name, final boolean isRef) {
- String _xifexpression = null;
- if (isRef) {
- _xifexpression = (((((type + "* ") + name) + "[") + Integer.valueOf(size)) + "]");
- } else {
- _xifexpression = (((((type + " ") + name) + "[") + Integer.valueOf(size)) + "]");
- }
- return _xifexpression;
- }
-
- public String constructorName(final String cls) {
- return "ctor";
- }
-
- public String destructorName(final String cls) {
- return "dtor";
- }
-
- public String constructorReturnType() {
- return "void";
+ public String typeArrayModifier() {
+ return this.pointerLiteral();
}
- public String destructorReturnType() {
- return "void";
+ public String arrayDeclaration(final String type, final int size, final String name, final boolean isRef) {
+ StringConcatenation _builder = new StringConcatenation();
+ _builder.append(type, "");
+ {
+ if (isRef) {
+ _builder.append("*");
+ }
+ }
+ _builder.append(" ");
+ _builder.append(name, "");
+ _builder.append("[");
+ _builder.append(size, "");
+ _builder.append("]");
+ _builder.newLineIfNotEmpty();
+ return _builder.toString();
}
public String superCall(final String baseClassName, final String method, final String args) {
diff --git a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/NodeGen.java b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/NodeGen.java
index 0ba79145c..d9975ff81 100644
--- a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/NodeGen.java
+++ b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/NodeGen.java
@@ -46,7 +46,6 @@ import org.eclipse.etrice.core.genmodel.fsm.base.ILogger;
import org.eclipse.etrice.core.genmodel.fsm.fsmgen.IDiagnostician;
import org.eclipse.etrice.core.room.ActorClass;
import org.eclipse.etrice.core.room.Attribute;
-import org.eclipse.etrice.core.room.ClassStructor;
import org.eclipse.etrice.core.room.CommunicationType;
import org.eclipse.etrice.core.room.DataType;
import org.eclipse.etrice.core.room.EnumerationType;
@@ -191,7 +190,7 @@ public class NodeGen {
_builder.append(_name_3, " ");
_builder.newLineIfNotEmpty();
_builder.append(" ");
- _builder.append("* ");
+ _builder.append("*");
_builder.newLine();
_builder.append(" ");
_builder.append("*/");
@@ -308,7 +307,7 @@ public class NodeGen {
_builder.append(_name_3, " ");
_builder.newLineIfNotEmpty();
_builder.append(" ");
- _builder.append("* ");
+ _builder.append("*");
_builder.newLine();
_builder.append(" ");
_builder.append("*/");
@@ -417,7 +416,6 @@ public class NodeGen {
_builder.append("\t\t");
_builder.append("etTime interval;");
_builder.newLine();
- _builder.append("\t\t");
_builder.newLine();
_builder.append("\t\t");
_builder.append("/* initialization of all message services */");
@@ -515,15 +513,12 @@ public class NodeGen {
_builder.append(_upperCase_2, "\t\t\t");
_builder.append(");");
_builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("\t");
_builder.newLine();
}
}
_builder.append("\t");
_builder.append("}");
_builder.newLine();
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("ET_MSC_LOGGER_SYNC_EXIT");
@@ -540,7 +535,6 @@ public class NodeGen {
_builder.append(clsname, "\t");
_builder.append("\", \"startMessageServices\")");
_builder.newLineIfNotEmpty();
- _builder.append("\t");
_builder.newLine();
{
final Function1<PhysicalThread, Integer> _function_1 = new Function1<PhysicalThread, Integer>() {
@@ -559,7 +553,6 @@ public class NodeGen {
_builder.newLineIfNotEmpty();
}
}
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("ET_MSC_LOGGER_SYNC_EXIT");
@@ -576,7 +569,6 @@ public class NodeGen {
_builder.append(clsname, "\t");
_builder.append("\", \"stopMessageServices\")");
_builder.newLineIfNotEmpty();
- _builder.append("\t");
_builder.newLine();
{
for(final PhysicalThread thread_2 : threads) {
@@ -588,7 +580,6 @@ public class NodeGen {
_builder.newLineIfNotEmpty();
}
}
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("ET_MSC_LOGGER_SYNC_EXIT");
@@ -605,7 +596,6 @@ public class NodeGen {
_builder.append(clsname, "\t");
_builder.append("\", \"destroyMessageServices\")");
_builder.newLineIfNotEmpty();
- _builder.append("\t");
_builder.newLine();
{
for(final PhysicalThread thread_3 : threads) {
@@ -617,7 +607,6 @@ public class NodeGen {
_builder.newLineIfNotEmpty();
}
}
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("ET_MSC_LOGGER_SYNC_EXIT");
@@ -639,7 +628,6 @@ public class NodeGen {
_builder.append(clsname, "\t");
_builder.append("Inst.name);");
_builder.newLineIfNotEmpty();
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("/* construct all actors */");
@@ -648,7 +636,6 @@ public class NodeGen {
_builder.append(clsname, "\t");
_builder.append("_constructActorInstances();");
_builder.newLineIfNotEmpty();
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("/* initialization of all message services */");
@@ -657,7 +644,6 @@ public class NodeGen {
_builder.append(clsname, "\t");
_builder.append("_initMessageServices();");
_builder.newLineIfNotEmpty();
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("/* init all actors */");
@@ -666,7 +652,6 @@ public class NodeGen {
_builder.append(clsname, "\t");
_builder.append("_initActorInstances();");
_builder.newLineIfNotEmpty();
- _builder.append("\t");
_builder.newLine();
{
if (logData) {
@@ -692,7 +677,6 @@ public class NodeGen {
}
}
}
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("ET_MSC_LOGGER_SYNC_EXIT");
@@ -728,14 +712,13 @@ public class NodeGen {
_builder.append(clsname, "");
_builder.append("_run(etBool runAsTest) {");
_builder.newLineIfNotEmpty();
- _builder.append("#ifdef ET_RUNNER_ACTIVATE ");
+ _builder.append("#ifdef ET_RUNNER_ACTIVATE");
_builder.newLine();
_builder.append("\t");
_builder.append("ET_MSC_LOGGER_SYNC_ENTRY(\"");
_builder.append(clsname, "\t");
_builder.append("\", \"run\")");
_builder.newLineIfNotEmpty();
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("if (runAsTest) {");
@@ -780,12 +763,11 @@ public class NodeGen {
_builder.append("\t");
_builder.append("}");
_builder.newLine();
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("ET_MSC_LOGGER_SYNC_EXIT");
_builder.newLine();
- _builder.append("#endif\t");
+ _builder.append("#endif");
_builder.newLine();
_builder.append("}");
_builder.newLine();
@@ -809,7 +791,6 @@ public class NodeGen {
_builder.append(clsname, "\t");
_builder.append("_stopMessageServices();");
_builder.newLineIfNotEmpty();
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("ET_MSC_LOGGER_SYNC_EXIT");
@@ -831,46 +812,25 @@ public class NodeGen {
_builder.append(clsname, "\t");
_builder.append("Inst.name);");
_builder.newLineIfNotEmpty();
+ _builder.newLine();
{
EList<ActorInstance> _allContainedInstances = ssi.getAllContainedInstances();
- List<ActorInstance> _reverseView = ListExtensions.<ActorInstance>reverseView(_allContainedInstances);
- for(final ActorInstance ai : _reverseView) {
- {
- ActorClass _actorClass = ai.getActorClass();
- List<ClassStructor> _allStructors = this._roomHelpers.getAllStructors(_actorClass);
- final Function1<ClassStructor, Boolean> _function_2 = new Function1<ClassStructor, Boolean>() {
- public Boolean apply(final ClassStructor it) {
- boolean _isConstructor = it.isConstructor();
- return Boolean.valueOf((!_isConstructor));
- }
- };
- boolean _exists = IterableExtensions.<ClassStructor>exists(_allStructors, _function_2);
- if (_exists) {
- _builder.append("\t");
- ActorClass _actorClass_1 = ai.getActorClass();
- String _name_16 = _actorClass_1.getName();
- ActorClass _actorClass_2 = ai.getActorClass();
- String _name_17 = _actorClass_2.getName();
- String _destructorName = this.languageExt.destructorName(_name_17);
- String _memberInUse = this.languageExt.memberInUse(_name_16, _destructorName);
- _builder.append(_memberInUse, "\t");
- _builder.append("(&");
- String _path = ai.getPath();
- String _pathName = this._roomExtensions.getPathName(_path);
- _builder.append(_pathName, "\t");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- }
- }
+ for(final ActorInstance ai : _allContainedInstances) {
+ _builder.append("\t");
+ ActorClass _actorClass = ai.getActorClass();
+ String _path = ai.getPath();
+ String _pathName = this._roomExtensions.getPathName(_path);
+ String _plus_1 = ("&" + _pathName);
+ String _invokeUserStructor = this.helpers.invokeUserStructor(_actorClass, _plus_1, false);
+ _builder.append(_invokeUserStructor, "\t");
+ _builder.newLineIfNotEmpty();
}
}
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append(clsname, "\t");
_builder.append("_destroyMessageServices();");
_builder.newLineIfNotEmpty();
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("ET_MSC_LOGGER_SYNC_EXIT");
@@ -892,13 +852,11 @@ public class NodeGen {
_builder.append(clsname, "\t");
_builder.append("Inst.name);");
_builder.newLineIfNotEmpty();
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append(clsname, "\t");
_builder.append("Inst.shutdownRequest = 1;");
_builder.newLineIfNotEmpty();
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("ET_MSC_LOGGER_SYNC_EXIT");
@@ -916,40 +874,20 @@ public class NodeGen {
_builder.append(clsname, "\t");
_builder.append("\", \"constructActorInstances\")");
_builder.newLineIfNotEmpty();
- _builder.append("\t");
_builder.newLine();
{
EList<ActorInstance> _allContainedInstances_1 = ssi.getAllContainedInstances();
for(final ActorInstance ai_1 : _allContainedInstances_1) {
- {
- ActorClass _actorClass_3 = ai_1.getActorClass();
- List<ClassStructor> _allStructors_1 = this._roomHelpers.getAllStructors(_actorClass_3);
- final Function1<ClassStructor, Boolean> _function_3 = new Function1<ClassStructor, Boolean>() {
- public Boolean apply(final ClassStructor it) {
- return Boolean.valueOf(it.isConstructor());
- }
- };
- boolean _exists_1 = IterableExtensions.<ClassStructor>exists(_allStructors_1, _function_3);
- if (_exists_1) {
- _builder.append("\t");
- ActorClass _actorClass_4 = ai_1.getActorClass();
- String _name_18 = _actorClass_4.getName();
- ActorClass _actorClass_5 = ai_1.getActorClass();
- String _name_19 = _actorClass_5.getName();
- String _constructorName = this.languageExt.constructorName(_name_19);
- String _memberInUse_1 = this.languageExt.memberInUse(_name_18, _constructorName);
- _builder.append(_memberInUse_1, "\t");
- _builder.append("(&");
- String _path_1 = ai_1.getPath();
- String _pathName_1 = this._roomExtensions.getPathName(_path_1);
- _builder.append(_pathName_1, "\t");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("\t");
+ ActorClass _actorClass_1 = ai_1.getActorClass();
+ String _path_1 = ai_1.getPath();
+ String _pathName_1 = this._roomExtensions.getPathName(_path_1);
+ String _plus_2 = ("&" + _pathName_1);
+ String _invokeUserStructor_1 = this.helpers.invokeUserStructor(_actorClass_1, _plus_2, true);
+ _builder.append(_invokeUserStructor_1, "\t");
+ _builder.newLineIfNotEmpty();
}
}
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("ET_MSC_LOGGER_SYNC_EXIT");
@@ -966,15 +904,14 @@ public class NodeGen {
_builder.append(clsname, "\t");
_builder.append("\", \"initActorInstances\")");
_builder.newLineIfNotEmpty();
- _builder.append("\t");
_builder.newLine();
{
EList<ActorInstance> _allContainedInstances_2 = ssi.getAllContainedInstances();
for(final ActorInstance ai_2 : _allContainedInstances_2) {
_builder.append("\t");
- ActorClass _actorClass_6 = ai_2.getActorClass();
- String _name_20 = _actorClass_6.getName();
- _builder.append(_name_20, "\t");
+ ActorClass _actorClass_2 = ai_2.getActorClass();
+ String _name_16 = _actorClass_2.getName();
+ _builder.append(_name_16, "\t");
_builder.append("_init(&");
String _path_2 = ai_2.getPath();
String _pathName_2 = this._roomExtensions.getPathName(_path_2);
@@ -983,7 +920,6 @@ public class NodeGen {
_builder.newLineIfNotEmpty();
}
}
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("ET_MSC_LOGGER_SYNC_EXIT");
@@ -1099,7 +1035,7 @@ public class NodeGen {
String _name_7 = thread.getName();
String _upperCase_3 = _name_7.toUpperCase();
_builder.append(_upperCase_3, "");
- _builder.append("_BLOCK_SIZE]; ");
+ _builder.append("_BLOCK_SIZE];");
_builder.newLineIfNotEmpty();
_builder.append("static etMessageService msgService_");
String _name_8 = thread.getName();
@@ -1490,7 +1426,6 @@ public class NodeGen {
_builder.append(_path_1, "\t");
_builder.append("\"");
_builder.newLineIfNotEmpty();
- _builder.append("\t");
_builder.newLine();
}
}
@@ -1509,7 +1444,6 @@ public class NodeGen {
_builder.newLineIfNotEmpty();
}
}
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("/* data receive ports */");
@@ -1523,7 +1457,6 @@ public class NodeGen {
_builder.newLineIfNotEmpty();
}
}
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("/* saps */");
@@ -1537,7 +1470,6 @@ public class NodeGen {
_builder.newLineIfNotEmpty();
}
}
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("/* replicated ports */");
@@ -1559,7 +1491,6 @@ public class NodeGen {
_builder.newLineIfNotEmpty();
}
}
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("/* services */");
@@ -1600,7 +1531,6 @@ public class NodeGen {
_builder.append(instName, "\t");
_builder.append("_const,");
_builder.newLineIfNotEmpty();
- _builder.append("\t");
_builder.newLine();
}
}
@@ -1616,7 +1546,6 @@ public class NodeGen {
_builder.newLineIfNotEmpty();
}
}
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("/* attributes */");
@@ -1627,7 +1556,6 @@ public class NodeGen {
CharSequence _generateAttributeInit = this.attrInitGenAddon.generateAttributeInit(ai, _allAttributes);
_builder.append(_generateAttributeInit, "\t");
_builder.newLineIfNotEmpty();
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("/* state and history are initialized in init function */");
@@ -2380,7 +2308,6 @@ public class NodeGen {
_builder.append("\t");
_builder.append("switch(msg->address){");
_builder.newLine();
- _builder.append("\t");
_builder.newLine();
_builder.append("\t\t");
_builder.append("case MESSAGESERVICE_ADDRESS:");
@@ -2429,7 +2356,6 @@ public class NodeGen {
_builder.newLine();
{
for(final ActorInstance ai_1 : dispatchedInstances) {
- _builder.append("\t\t");
_builder.newLine();
_builder.append("\t\t");
_builder.append("/* interface items of ");
@@ -2562,7 +2488,7 @@ public class NodeGen {
_builder.append("\t\t");
_builder.append("\t");
_builder.append("\t");
- _builder.append("}\t\t\t\t\t\t\t\t\t\t");
+ _builder.append("}");
_builder.newLine();
} else {
{
@@ -2825,7 +2751,6 @@ public class NodeGen {
}
}
}
- _builder.append("\t\t");
_builder.newLine();
_builder.append("\t\t");
_builder.append("default:");
diff --git a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/StateMachineGen.java b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/StateMachineGen.java
index bb1ee4fef..4facd625d 100644
--- a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/StateMachineGen.java
+++ b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/StateMachineGen.java
@@ -114,7 +114,10 @@ public class StateMachineGen extends GenericStateMachineGenerator {
return _xblockexpression;
}
- public CharSequence genExtra(final ExpandedModelComponent xpmc) {
+ /**
+ * @param generateImplementation NOT used
+ */
+ public CharSequence genExtra(final ExpandedModelComponent xpmc, final boolean generateImplementation) {
CharSequence _xblockexpression = null;
{
final ModelComponent mc = xpmc.getModelComponent();
diff --git a/plugins/org.eclipse.etrice.generator.cpp/META-INF/MANIFEST.MF b/plugins/org.eclipse.etrice.generator.cpp/META-INF/MANIFEST.MF
index fdeed9308..83b73742f 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.etrice.generator.cpp/META-INF/MANIFEST.MF
@@ -1,26 +1,26 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
-Bundle-Name: C++ Generator
-Bundle-SymbolicName: org.eclipse.etrice.generator.cpp
-Require-Bundle: org.eclipse.etrice.core.room.ui;bundle-version="0.5.0",
+Bundle-Name: eTrice C++ Generator
+Bundle-Vendor: Eclipse eTrice (Incubation)
+Bundle-Version: 0.5.0.qualifier
+Bundle-SymbolicName: org.eclipse.etrice.generator.cpp;singleton:=true
+Bundle-ActivationPolicy: lazy
+Require-Bundle: org.eclipse.etrice.core.genmodel;bundle-version="0.5.0",
+ org.eclipse.etrice.core.etphys;bundle-version="0.5.0",
+ org.eclipse.etrice.core.etmap;bundle-version="0.5.0",
+ org.eclipse.etrice.generator.fsm;bundle-version="0.5.0",
org.eclipse.etrice.generator;bundle-version="0.5.0",
- org.eclipse.etrice.core.config;bundle-version="0.5.0",
+ org.eclipse.etrice.generator.config;bundle-version="0.5.0",
org.eclipse.etrice.generator.doc;bundle-version="0.5.0",
- org.eclipse.etrice.generator.fsm;bundle-version="0.5.0",
- org.eclipse.etrice.core.genmodel;bundle-version="0.5.0",
org.eclipse.core.resources;bundle-version="3.6.0",
org.eclipse.core.runtime;bundle-version="3.6.0",
org.eclipse.ui;bundle-version="3.7.0",
org.eclipse.ui.ide;bundle-version="3.7.0",
- org.eclipse.xtext;bundle-version="2.6.0",
org.eclipse.xtend.lib;bundle-version="2.6.0",
- com.google.guava,
- org.eclipse.xtext.xbase.lib;bundle-version="2.6.0",
- org.eclipse.etrice.core.etmap,
- org.eclipse.etrice.core.etphys,
- org.eclipse.etrice.generator.config
-Bundle-Version: 0.5.0.qualifier
-Bundle-Vendor: Eclipse eTrice (Incubation)
+ org.eclipse.xtext.generator;bundle-version="2.6.0",
+ org.eclipse.xtext.util;bundle-version="2.6.0"
+Import-Package: org.apache.log4j
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Export-Package: org.eclipse.etrice.generator.cpp
-
+Export-Package: org.eclipse.etrice.generator.cpp,
+ org.eclipse.etrice.generator.cpp.gen,
+ org.eclipse.etrice.generator.cpp.setup
diff --git a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/Main.java b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/Main.java
index 64ae7b997..117bd9536 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/Main.java
+++ b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/Main.java
@@ -4,33 +4,31 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* CONTRIBUTORS:
* Henrik Rentz-Reichert (initial contribution)
- *
+ *
*******************************************************************************/
package org.eclipse.etrice.generator.cpp;
-import java.util.Iterator;
-
+import org.eclipse.emf.common.EMFPlugin;
+import org.eclipse.etrice.core.etmap.ETMapStandaloneSetup;
import org.eclipse.etrice.core.etmap.util.ETMapUtil;
+import org.eclipse.etrice.core.etphys.ETPhysStandaloneSetup;
import org.eclipse.etrice.core.genmodel.etricegen.Root;
import org.eclipse.etrice.generator.base.AbstractGenerator;
+import org.eclipse.etrice.generator.base.GlobalGeneratorSettings;
import org.eclipse.etrice.generator.base.IDataConfiguration;
-import org.eclipse.etrice.generator.cpp.gen.GeneratorSettings;
import org.eclipse.etrice.generator.cpp.gen.MainGen;
import org.eclipse.etrice.generator.cpp.gen.Validator;
import org.eclipse.etrice.generator.cpp.setup.GeneratorModule;
import org.eclipse.etrice.generator.doc.gen.GlobalSettings;
-import org.eclipse.xtext.scoping.impl.ImportUriResolver;
import com.google.inject.Inject;
public class Main extends AbstractGenerator {
- public static final String OPTION_ETUNIT = "-etunit";
-
/**
* print usage message to output/console
*/
@@ -50,75 +48,78 @@ public class Main extends AbstractGenerator {
private MainGen mainGenerator;
@Inject
- protected org.eclipse.etrice.generator.doc.gen.MainGen mainDocGenerator;
-
+ protected org.eclipse.etrice.generator.doc.gen.MainGen mainDocGenerator;
+
@Inject
private Validator validator;
-
+
@Inject
protected IDataConfiguration dataConfig;
-
- @Inject
- protected ImportUriResolver uriResolver;
/**
* @return the unique {@link GlobalSettings}
*/
- public static GeneratorSettings getSettings() {
- return (GeneratorSettings) getInstance().getGeneratorSettings();
+ public static GlobalGeneratorSettings getSettings() {
+ return (GlobalGeneratorSettings) getInstance().getGeneratorSettings();
}
-
- /* (non-Javadoc)
- * @see org.eclipse.etrice.generator.base.AbstractGenerator#parseOption(java.lang.String, java.util.Iterator)
+
+ /**
+ * setup the eTrice mapping model plug-in
*/
- @Override
- protected boolean parseOption(String arg, Iterator<String> it) {
- if (arg.equals(OPTION_ETUNIT)) {
- getSettings().setUseEtUnit(true);
- return true;
+ protected void setupMappingModel() {
+ if (!EMFPlugin.IS_ECLIPSE_RUNNING) {
+ ETMapStandaloneSetup.doSetup();
}
-
- return super.parseOption(arg, it);
}
-
+
+ /**
+ * setup the eTrice mapping model plug-in
+ */
+ protected void setupPhysicalModel() {
+ if (!EMFPlugin.IS_ECLIPSE_RUNNING)
+ ETPhysStandaloneSetup.doSetup();
+ }
+
protected int runGenerator() {
setupRoomModel();
dataConfig.doSetup();
-
+ setupMappingModel();
+ setupPhysicalModel();
+
try {
activateModelLocator();
-
+
if (!loadModels(getSettings().getInputModelURIs())) {
logger.logInfo("loading of models failed");
logger.logError("-- terminating", null);
return GENERATOR_ERROR;
}
-
+
if (!validateModels()) {
logger.logInfo("validation failed");
logger.logError("-- terminating", null);
return GENERATOR_ERROR;
}
-
+
if (!dataConfig.setResources(getResourceSet(), logger)) {
logger.logInfo("configuration errors");
logger.logError("-- terminating", null);
return GENERATOR_ERROR;
}
-
+
Root genModel = createGeneratorModel(getSettings().isGenerateAsLibrary(), getSettings().getGeneratorModelPath());
if (diagnostician.isFailed() || genModel==null) {
logger.logInfo("errors during build of generator model");
logger.logError("-- terminating", null);
return GENERATOR_ERROR;
}
-
+
if (!validator.validate(genModel)) {
logger.logInfo("validation failed during build of generator model");
logger.logError("-- terminating", null);
return GENERATOR_ERROR;
}
-
+
ETMapUtil.processModels(genModel, getResourceSet(), diagnostician);
if (getSettings().isDebugMode()) {
logger.logInfo("-- begin dump of mappings");
@@ -130,14 +131,14 @@ public class Main extends AbstractGenerator {
logger.logError("-- terminating", null);
return GENERATOR_ERROR;
}
-
+
logger.logInfo("-- starting code generation");
mainGenerator.doGenerate(genModel.eResource());
-
+
if (getSettings().isGenerateDocumentation()) {
mainDocGenerator.doGenerate(genModel.eResource());
}
-
+
if (diagnostician.isFailed()) {
logger.logInfo("errors during code generation");
logger.logError("-- terminating", null);
@@ -148,7 +149,7 @@ public class Main extends AbstractGenerator {
finally {
deactivateModelLocator();
}
-
+
return GENERATOR_OK;
}
}
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 89823b7fe..e6dec581e 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
@@ -4,10 +4,10 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* CONTRIBUTORS:
* Peter Karlitschek (initial contribution)
- *
+ *
*******************************************************************************/
package org.eclipse.etrice.generator.cpp.gen
@@ -15,61 +15,65 @@ package org.eclipse.etrice.generator.cpp.gen
import com.google.inject.Inject
import com.google.inject.Singleton
import java.util.ArrayList
+import java.util.Map
import org.eclipse.etrice.core.fsm.fSM.ComponentCommunicationType
+import org.eclipse.etrice.core.genmodel.builder.GenmodelConstants
import org.eclipse.etrice.core.genmodel.etricegen.ExpandedActorClass
import org.eclipse.etrice.core.genmodel.etricegen.Root
-import org.eclipse.etrice.core.genmodel.fsm.base.ILogger
+import org.eclipse.etrice.core.genmodel.etricegen.WiredActorClass
import org.eclipse.etrice.core.room.ActorClass
import org.eclipse.etrice.generator.cpp.Main
+import org.eclipse.etrice.generator.fsm.base.FileSystemHelpers
+import org.eclipse.etrice.generator.fsm.base.IGeneratorFileIo
import org.eclipse.etrice.generator.generic.GenericActorClassGenerator
import org.eclipse.etrice.generator.generic.ProcedureHelpers
import org.eclipse.etrice.generator.generic.RoomExtensions
-import org.eclipse.xtext.generator.JavaIoFileSystemAccess
+import org.eclipse.etrice.generator.generic.TypeHelpers
-/**
- * @author Peter Karlitschek
- *
- */
@Singleton
class ActorClassGen extends GenericActorClassGenerator {
-
- @Inject JavaIoFileSystemAccess fileAccess
+
+ @Inject IGeneratorFileIo fileIO
@Inject extension CppExtensions
@Inject extension RoomExtensions
- @Inject extension Initialization
+
@Inject extension ProcedureHelpers
+ @Inject extension Initialization
@Inject extension StateMachineGen
- @Inject ILogger logger
-
- def doGenerate(Root root) {
- for (xpac: root.xpActorClasses) {
- var path = xpac.actorClass.generationTargetPath+xpac.actorClass.getPath
+ @Inject extension TypeHelpers
+ @Inject extension FileSystemHelpers
- logger.logInfo("generating ActorClass header '"+xpac.actorClass.getCppHeaderFileName+"' in '"+path+"'")
- fileAccess.setOutputPath(path)
- fileAccess.generateFile(xpac.actorClass.getCppHeaderFileName, root.generateHeaderFile(xpac, xpac.actorClass))
-
- logger.logInfo("generating ActorClass source '"+xpac.actorClass.getCppSourceFileName+"' in '"+path+"'")
- fileAccess.setOutputPath(path)
- fileAccess.generateFile(xpac.actorClass.getCppSourceFileName, root.generateSourceFile(xpac, xpac.actorClass))
+ def doGenerate(Root root) {
+ val Map<ActorClass, WiredActorClass> ac2wired = newHashMap
+ root.wiredInstances.filter(typeof(WiredActorClass)).forEach[ac2wired.put(actorClass, it)]
+ for (xpac: root.xpActorClasses.filter(cl|cl.actorClass.isValidGenerationLocation)) {
+ val wired = ac2wired.get(xpac.actorClass)
+ val manualBehavior = xpac.actorClass.isBehaviorAnnotationPresent("BehaviorManual")
+ val path = xpac.actorClass.generationTargetPath+xpac.actorClass.getPath
+ val infopath = xpac.actorClass.generationInfoPath+xpac.actorClass.getPath
+ var file = if (manualBehavior) 'Abstract' else ''
+ fileIO.generateFile("generating ActorClass declaration", path, infopath, file + xpac.actorClass.getCppHeaderFileName, root.generateHeaderFile(xpac, wired, manualBehavior))
+ fileIO.generateFile("generating ActorClass implementation", path, infopath, file + xpac.actorClass.getCppSourceFileName, root.generateSourceFile(xpac, wired, manualBehavior))
}
}
-
- def private generateHeaderFile(Root root, ExpandedActorClass xpac, ActorClass ac) {
-// val ctor = ac.operations.filter(op|op.constructor).head
-// val dtor = ac.operations.filter(op|op.destructor).head
-
+
+ def private generateHeaderFile(Root root, ExpandedActorClass xpac, WiredActorClass wired, boolean manualBehavior) {
+ val ac = xpac.actorClass
+ val clsname = if (manualBehavior) "Abstract"+ac.name else ac.name
+ //val models = root.getReferencedModels(ac)
+ val rtBaseClassName = ac.actorBase?.name ?: 'etRuntime::ActorClassBase'
+
'''
/**
* @author generated by eTrice
*
- * Header File of ActorClass «ac.name»
- *
+ * Header File of ActorClass «clsname»
+ *
*/
- «generateIncludeGuardBegin(ac.name)»
-
- #include "platforms/generic/etDatatypes.h"
+ «generateIncludeGuardBegin(clsname)»
+
+ #include "etDatatypes.h"
#include "common/messaging/IRTObject.h"
#include "common/modelbase/PortBase.h"
#include "common/modelbase/InterfaceItemBase.h"
@@ -78,18 +82,9 @@ class ActorClassGen extends GenericActorClassGenerator {
#include "common/messaging/Address.h"
#include "common/messaging/IMessageReceiver.h"
#include "common/debugging/DebuggingService.h"
- «IF Main::settings.isUseEtUnit»
- extern "C" {
- #include "etUnit.h"
- }
- «ENDIF»
#include <string>
#include <vector>
-
- «FOR model : root.getReferencedModels(ac)»
-««« #include "«model.name».h"
- «ENDFOR»
-
+
«FOR pc : root.getReferencedProtocolClasses(ac)»
#include "«pc.path»«pc.name».h"
«ENDFOR»
@@ -97,177 +92,211 @@ class ActorClassGen extends GenericActorClassGenerator {
#include "«dc.path»«dc.name».h"
«ENDFOR»
-
+ using namespace etRuntime; //TODO JH remove
+
«ac.userCode(1, true)»
-
-
- class «ac.name» : public «IF ac.actorBase!=null»«ac.actorBase.name»«ELSE»etRuntime::ActorClassBase«ENDIF» {
-
-
+
+ class «clsname» : public «rtBaseClassName» {
+
+
protected:
//--------------------- ports
- «ac.endPorts.map(port | '''«port.portClassName» «port.name»;''').join("\n")»
+ «FOR ep : ac.getEndPorts»
+ «ep.getPortClassName» «ep.name»;
+ «ENDFOR»
+
//--------------------- saps
- «ac.serviceAccessPoints.map(sap | '''«sap.portClassName» «sap.name»;''').join("\n")»
+ «FOR sap : ac.serviceAccessPoints»
+ «sap.getPortClassName» «sap.name»;
+ «ENDFOR»
+
//--------------------- services
- «ac.serviceImplementations.map(svc | '''«svc.portClassName» «svc.spp.name»;''').join("\n")»
-
+ «FOR svc : ac.serviceImplementations»
+ «svc.getPortClassName» «svc.spp.name»;
+ «ENDFOR»
+
//--------------------- interface item IDs
«xpac.genInterfaceItemConstants»
-
+
«ac.attributes.attributes»
- «operationsImplementation(ac.operations, ac.name)»
-
+ «operationsDeclaration(ac.operations, ac.name)»
+
public:
//--------------------- construction
- «ac.name»(etRuntime::IRTObject* parent, std::string name, const std::vector<std::vector<etRuntime::Address> >& port_addr,
- const std::vector<std::vector<etRuntime::Address> >& peer_addr);
+ «ac.name»(etRuntime::IRTObject* parent, const std::string& name);
««« TODO: check whether attribute setters/getters are necessary at all, if yes own cpp implementation is needed for *,[],& variables
««« «attributeSettersGettersImplementation(ac.attributes, ac.name)»
//--------------------- port getters
- «FOR ep : ac.getEndPorts()»
- «ep.portClassName.getterImplementation(ep.name, ac.name)»
- «ENDFOR»
- «FOR sap : ac.serviceAccessPoints»
- «sap.portClassName.getterImplementation(sap.name, ac.name)»
- «ENDFOR»
- «FOR svc : ac.serviceImplementations»
- «svc.portClassName.getterImplementation(svc.spp.name, ac.name)»
- «ENDFOR»
-
- //--------------------- lifecycle functions
- virtual void init();
- virtual void start();
- «IF !ac.overridesStop()»
- virtual void stop();
- «ENDIF»
- virtual void destroy();
- «IF ac.hasNonEmptyStateMachine»
- «xpac.genStateMachineMethodDeclarations()»
- «ELSEIF !xpac.hasStateMachine()»
- public:
- //--------------------- no state machine
- virtual void receiveEvent(etRuntime::InterfaceItemBase* ifitem, int evt, void* data);
- virtual void executeInitTransition();
- «ENDIF»
+ «ac.endPorts.map[getterImplementation(portClassName+'&', name, clsname)].join(NEWLINE)»
+
+ «ac.serviceAccessPoints.map[getterImplementation(portClassName+'&', name, clsname)].join(NEWLINE)»
+
+ «ac.serviceImplementations.map[getterImplementation(portClassName+'&', spp.name, clsname)].join(NEWLINE)»
- «ac.userCode(2, false)»
+ //--------------------- lifecycle functions
+ virtual void destroy();
+
+ «IF ac.hasNonEmptyStateMachine»
+ «xpac.genStateMachineConstants»
+
+ «xpac.genStateMachineMethods(false)»
+ «IF ac.commType == ComponentCommunicationType::DATA_DRIVEN»
+ void receiveEvent(etRuntime::InterfaceItemBase* ifitem, int evt, void* generic_data);
+ «ENDIF»
+ «IF ac.commType == ComponentCommunicationType::ASYNCHRONOUS || ac.commType == ComponentCommunicationType::DATA_DRIVEN»
+ virtual void receive(const etRuntime::Message* msg);
+ «ENDIF»
+ «ELSEIF xpac.stateMachine.empty»
+««« no state machine in the super classes
+ //--------------------- no state machine
+ virtual void receiveEvent(etRuntime::InterfaceItemBase* ifitem, int evt, void* data);
+ virtual void executeInitTransition() {}
+ «ENDIF»
+
+ «ac.userCode(2, false)»
};
-
-
+
+
«generateIncludeGuardEnd(ac.name)»
'''
}
- def private generateConstructorInitalizerList(ActorClass ac) {
+
+ def private generateConstructorInitalizerList(ActorClass ac) {
var initializerList = new ArrayList<CharSequence>();
- if (ac.actorBase==null) {
- initializerList.add('''ActorClassBase( parent, name, port_addr[0][0], peer_addr[0][0])''')
- }
- else {
- initializerList.add('''«ac.actorBase.name»(*this, parent, name, port_addr, peer_addr)''')
- }
+ initializerList.add('''«ac.actorBase?.name ?: 'ActorClassBase'»(parent, name)''')
+
// own ports
for ( ep : ac.getEndPorts() ) {
- initializerList.add('''«ep.name»(*this, this, "«ep.name»", IFITEM_«ep.name», «IF ep.multiplicity==1»0, «ENDIF»port_addr[IFITEM_«ep.name»]«IF ep.multiplicity==1»[0]«ENDIF», peer_addr[IFITEM_«ep.name»]«IF ep.multiplicity==1»[0]«ENDIF»)''');
+ initializerList.add('''«ep.name»(this, "«ep.name»", IFITEM_«ep.name»)''');
}
// own saps
for ( sap : ac.serviceAccessPoints ) {
- initializerList.add('''«sap.name»(*this, this, "«sap.name»", IFITEM_«sap.name», 0, port_addr[IFITEM_«sap.name»][0], peer_addr[IFITEM_«sap.name»][0])''');
+ initializerList.add('''«sap.name»(this, "«sap.name»", IFITEM_«sap.name»)''');
}
// own service implementations
for (svc : ac.serviceImplementations) {
- initializerList.add('''«svc.spp.name»(*this, this, "«svc.spp.name»", IFITEM_«svc.spp.name», port_addr[IFITEM_«svc.spp.name»], peer_addr[IFITEM_«svc.spp.name»])''');
+ initializerList.add('''«svc.spp.name»(this, "«svc.spp.name»", IFITEM_«svc.spp.name»)''');
}
for (attrib: ac.attributes) {
initializerList.add(attrib.attributeInitialization(false))
}
- return
- '''
- «initializerList.join(',\n')»
- '''
+
+ initializerList.join(',' + NEWLINE)
}
-
- 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 async = xpac.actorClass.commType==ComponentCommunicationType::ASYNCHRONOUS
-
+
+ def private generateSourceFile(Root root, ExpandedActorClass xpac, WiredActorClass wired, boolean manualBehavior) {
+ val ac = xpac.actorClass
+ val clsname = if (manualBehavior) "Abstract"+ac.name else ac.name
+ //val models = root.getReferencedModels(ac)
+ val rtBaseClassName = ac.actorBase?.name ?: 'ActorClassBase'
+
'''
/**
* @author generated by eTrice
*
* Source File of ActorClass «ac.name»
- *
+ *
*/
#include "«ac.getCppHeaderFileName»"
- #include "common/debugging/DebuggingService.h"
+
+ #include "common/messaging/RTObject.h"
+ #include "common/messaging/RTServices.h"
+ #include "etDatatypes.h"
+ #include "etUnit/etUnit.h"
#include <iostream>
-
+ #include <string>
+
+ «FOR ar : ac.actorRefs»
+ #include "«ar.type.path»«ar.type.name».h"
+ «ENDFOR»
+
using namespace etRuntime;
-
-
- «ac.name»::«ac.name»(etRuntime::IRTObject* parent, std::string name, const std::vector<std::vector<etRuntime::Address> >& port_addr,
- const std::vector<std::vector<etRuntime::Address> >& peer_addr)
- : «ac.generateConstructorInitalizerList»
+
+
+ «clsname»::«clsname»(etRuntime::IRTObject* parent, const std::string& name) :
+ «ac.generateConstructorInitalizerList»
{
«IF ac.hasNonEmptyStateMachine»
- history = new int[s_numberOfStates];
- for (int i = 0; i < s_numberOfStates; i++) {
- history[i] = NO_STATE;
- }
+ for (int i = 0; i < s_numberOfStates; i++) {
+ history[i] = NO_STATE;
+ }
«ENDIF»
setClassName("«ac.name»");
«ac.attributes.attributeInitialization(false)»
-
- «IF async»
- getMsgsvc()->addAsyncActor(*this);
+
+ // sub actors
+ «FOR sub : ac.actorRefs»
+ «IF sub.multiplicity>1»
+ for (int i=0; i<«sub.multiplicity»; ++i) {
+ «IF Main::settings.generateMSCInstrumentation»
+ DebuggingService::getInstance().addMessageActorCreate(*this, "«sub.name»«GenmodelConstants::INDEX_SEP»"+i);
+ «ENDIF»
+ new «sub.type.name»(this, "«sub.name»«GenmodelConstants::INDEX_SEP»"+i);
+ }
+ «ELSE»
+ «IF Main::settings.generateMSCInstrumentation»
+ DebuggingService::getInstance().addMessageActorCreate(*this, "«sub.name»");
+ «ENDIF»
+ new «sub.type.name»(this, "«sub.name»");
+ «ENDIF»
+ «ENDFOR»
+
+ // wiring
+ «FOR wire: wired.wires»
+ «if (wire.dataDriven) "DataPortBase" else "InterfaceItemBase"»::connect(this, "«wire.path1.join('/')»", "«wire.path2.join('/')»");
+ «ENDFOR»
+
+ «IF ac.commType == ComponentCommunicationType::ASYNCHRONOUS || ac.commType == ComponentCommunicationType::DATA_DRIVEN»
+ // activate polling for data-driven communication
+ RTServices::getInstance().getMsgSvcCtrl().getMsgSvc(getThread())->addPollingMessageReceiver(*this);
«ENDIF»
-««« «IF ctor!=null»
-««« // user defined constructor body
-««« «AbstractGenerator::getInstance().getTranslatedCode(ctor.detailCode)»
-««« «ENDIF»
- }
-
- void «ac.name»::init(){
- initUser();
- }
-
- void «ac.name»::start(){
- startUser();
+
+ «ac.userStructorBody(true)»
}
-
- «IF !ac.overridesStop()»
- void «ac.name»::stop(){
- stopUser();
+
+ void «ac.name»::destroy(){
+ «ac.userStructorBody(false)»
+ «IF Main::settings.generateMSCInstrumentation»
+ DebuggingService::getInstance().addMessageActorDestroy(*this);
+ «ENDIF»
+ «IF ac.commType == ComponentCommunicationType::ASYNCHRONOUS || ac.commType == ComponentCommunicationType::DATA_DRIVEN»
+ RTServices::getInstance().getMsgSvcCtrl().getMsgSvc(getThread())->removePollingMessageReceiver(*this);
+ «ENDIF»
+ «rtBaseClassName»::destroy();
}
- «ENDIF»
-
-««« void «ac.name»::destroy(){
-««« «IF dtor!=null»
-«««
-««« // user defined destructor body
-««« «AbstractGenerator::getInstance().getTranslatedCode(dtor.detailCode)»
-««« «ENDIF»
-««« }
-
+
+ «operationsImplementation(ac.operations, ac.name)»
+
«IF ac.hasNonEmptyStateMachine»
- «xpac.genStateMachine(false)»
- «ELSEIF !xpac.hasStateMachine()»
+ «xpac.genStateMachineMethods(true)»
+ «IF ac.commType == ComponentCommunicationType::DATA_DRIVEN»
+ void «ac.name»::receiveEvent(InterfaceItemBase* ifitem, int evt, void* generic_data) {
+ handleSystemEvent(ifitem, evt, generic_data);
+ }
+ «ENDIF»
+ «IF ac.commType == ComponentCommunicationType::ASYNCHRONOUS || ac.commType == ComponentCommunicationType::DATA_DRIVEN»
+ void «ac.name»::receive(const Message* msg) {
+ «IF ac.commType == ComponentCommunicationType::ASYNCHRONOUS»
+ receiveEvent(0, -1, 0);
+ «ELSE»
+ receiveEventInternal();
+ «ENDIF»
+ }
+ «ENDIF»
+ «ELSEIF xpac.stateMachine.empty»
+««« no state machine in the super classes
//--------------------- no state machine
- void «ac.name»::receiveEvent(etRuntime::InterfaceItemBase* ifitem, int evt, void* data) {
+ void «ac.name»::receiveEvent(InterfaceItemBase* ifitem, int evt, void* data) {
handleSystemEvent(ifitem, evt, data);
}
-
- void «ac.name»::executeInitTransition(){
- }
«ENDIF»
'''
}
-
-
+
+
}
diff --git a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/CppExtensions.xtend b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/CppExtensions.xtend
index 26bce00b7..aae897625 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/CppExtensions.xtend
+++ b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/CppExtensions.xtend
@@ -4,11 +4,11 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* CONTRIBUTORS:
* Thomas Schuetz and Henrik Rentz-Reichert (initial contribution)
* Peter Karlitschek
- *
+ *
*******************************************************************************/
/*
@@ -21,105 +21,109 @@ package org.eclipse.etrice.generator.cpp.gen
import com.google.inject.Inject
import com.google.inject.Singleton
import java.util.List
+import org.eclipse.emf.ecore.EObject
+import org.eclipse.etrice.core.etphys.eTPhys.NodeRef
+import org.eclipse.etrice.core.genmodel.etricegen.SubSystemInstance
import org.eclipse.etrice.core.genmodel.fsm.fsmgen.IDiagnostician
+import org.eclipse.etrice.core.room.DataClass
import org.eclipse.etrice.core.room.DataType
+import org.eclipse.etrice.core.room.EnumLiteral
+import org.eclipse.etrice.core.room.EnumerationType
import org.eclipse.etrice.core.room.ExternalType
import org.eclipse.etrice.core.room.Message
import org.eclipse.etrice.core.room.PrimitiveType
import org.eclipse.etrice.core.room.RoomClass
import org.eclipse.etrice.core.room.VarDecl
-import org.eclipse.etrice.core.room.DataClass
import org.eclipse.etrice.generator.generic.ILanguageExtension
import org.eclipse.etrice.generator.generic.TypeHelpers
import org.eclipse.xtext.util.Pair
-import org.eclipse.etrice.core.room.EnumerationType
-
-import org.eclipse.etrice.core.room.EnumLiteral
-import org.eclipse.emf.ecore.EObject
@Singleton
class CppExtensions implements ILanguageExtension {
@Inject IDiagnostician diagnostician
@Inject extension TypeHelpers
-
+
override String getTypedDataDefinition(EObject msg) {
generateArglistAndTypedData((msg as Message).data).get(1)
}
+ def String getCppHeaderFileName(RoomClass rc) { rc.name + ".h" }
+
+ def String getCppSourceFileName(RoomClass rc) { rc.name + ".cpp" }
+
+ def String getCppClassName(NodeRef nr, SubSystemInstance ssi) {
+ "Node_" + nr.name + "_" + ssi.name;
+ }
+
+ def String getCppHeaderFileName(NodeRef nr, SubSystemInstance ssi) {
+ nr.getCppClassName(ssi) + ".h";
+ }
+
+ def String getCppSourceFileName(NodeRef nr, SubSystemInstance ssi) {
+ nr.getCppClassName(ssi) + ".cpp";
+ }
- def String getCppHeaderFileName(RoomClass rc) {rc.name+".h"}
- def String getCppSourceFileName(RoomClass rc) {rc.name+".cpp"}
- def String getInstSourceFileName(RoomClass rc) {rc.name+"_Inst.h"}
- def String getDispSourceFileName(RoomClass rc) {rc.name+"_Disp.h"}
-
override String accessLevelPrivate() {""}
override String accessLevelProtected() {""}
override String accessLevelPublic() {""}
-
- override String memberAccess() {"this->"}
+
+ override String memberAccess() {"this->"}
override String selfPointer(String classname, boolean hasArgs) {""}
override String selfPointer(boolean hasArgs) { "" }
-
+
override String operationScope(String classname, boolean isDeclaration) {
if (isDeclaration)
""
else
classname+"::"
}
-
+
override String memberInDeclaration(String namespace, String member) {
return member
}
-
+
override String memberInUse(String namespace, String member) {
return namespace+"."+member
}
-
+
override boolean usesInheritance() {
return true
}
-
+
override boolean usesPointers() {
return true
}
-
- override String genEnumeration(String name, List<Pair<String, String>> entries) {
+
+ override String genEnumeration(String name, List<Pair<String, String>> entries){
+ if(entries.empty)
+ return ''
+
+ '''
+ typedef enum {
+ «FOR entry : entries SEPARATOR ','»
+ «entry.first» = «entry.second»
+ «ENDFOR»
+ } «name»;
'''
- typedef enum {
- «FOR entry: entries»
- «entry.first» = «entry.second»,
- «ENDFOR»
- } «name»;'''.toString
}
+
override String booleanConstant(boolean b) {
b.toString
}
-
+
override String pointerLiteral() { "*" }
override String nullPointer() { "0" }
override String voidPointer() { "void*" }
+ override String typeArrayModifier() { pointerLiteral }
+
+ override String arrayDeclaration(String type, int size, String name, boolean isRef)'''
+ «type»«IF isRef»*«ENDIF» «name»[«size»]
+ '''
- override String arrayDeclaration(String type, int size, String name, boolean isRef) {
- type+" "+name+"["+size+"]";
- }
-
- override String constructorName(String cls) {
- cls
- }
- override String destructorName(String cls) {
- cls+"_dtor"
- }
- override String constructorReturnType() {
- ""
- }
- override String destructorReturnType() {
- "void"
- }
-
def getIncludeGuardString(String filename){
'''_«filename.replaceAll("\\/.", "_").toUpperCase»_H_'''
}
@@ -134,18 +138,18 @@ class CppExtensions implements ILanguageExtension {
#endif /* «filename.getIncludeGuardString» */
'''
}
-
-
+
+
override superCall(String baseClassName, String method, String arguments) {
baseClassName+"::"+method+"("+arguments+");"
}
-
+
override String toValueLiteral(PrimitiveType type, String value){
throw new UnsupportedOperationException("TODO Config for Cpp");
}
-
+
override toEnumLiteral(EnumerationType type, String value) {
throw new UnsupportedOperationException("TODO Config for Cpp")
}
@@ -163,7 +167,7 @@ class CppExtensions implements ILanguageExtension {
}
else {
val dc = dt as DataClass
-
+
'''
{
«FOR att : dc.attributes SEPARATOR ","»
@@ -173,14 +177,14 @@ class CppExtensions implements ILanguageExtension {
'''
}
}
-
+
def String getDefaultValue(EnumerationType type) {
if (type.getLiterals().isEmpty())
""
else
getCastedValue(type.getLiterals().get(0))
}
-
+
override initializationWithDefaultValues(DataType dt, int size) {
val dv = dt.defaultValue
if (size>1) {
@@ -197,20 +201,24 @@ class CppExtensions implements ILanguageExtension {
else
dv
}
-
+
override generateArglistAndTypedData(EObject d) {
- val data = d as VarDecl
- var deref = "*"
+ if (d==null || !(d instanceof VarDecl))
+ return newArrayList("", "", "")
+
+ val data = d as VarDecl
if (data==null)
return newArrayList("", "", "")
-
+
var typeName = if (data.getRefType().getType() instanceof PrimitiveType)
- (data.getRefType().getType() as PrimitiveType).getTargetName()
+ (data.getRefType().getType() as PrimitiveType).targetName
else if (data.getRefType().getType() instanceof EnumerationType)
(data.getRefType().getType() as EnumerationType).targetType
+ else if (data.getRefType().getType() instanceof ExternalType)
+ (data.getRefType().getType() as ExternalType).targetName
else
data.getRefType().getType().getName()
-
+
var castTypeName = if (data.getRefType().getType() instanceof PrimitiveType) {
val ct = (data.getRefType().getType() as PrimitiveType).getCastName()
if (ct!=null && !ct.isEmpty())
@@ -223,51 +231,44 @@ class CppExtensions implements ILanguageExtension {
}
else
typeName
- castTypeName = castTypeName+"*"
-
+ castTypeName += '*'
+ var deRef = '*'
+
if (data.getRefType().isRef()) {
typeName = typeName+"*"
- castTypeName = castTypeName+"*"
- }
- else if (!(data.getRefType().getType() instanceof PrimitiveType)) {
- typeName = typeName+"*"
- castTypeName = castTypeName+"*"
+ deRef = ''
}
- else {
- castTypeName = typeName
- deref = ""
- }
-
- val typedData = typeName+" "+data.getName() + " = " + deref + "(("+castTypeName+") generic_data);\n"
+
+ val typedData = typeName+" "+data.getName() + " = "+deRef+"(static_cast<"+castTypeName+">(generic_data__et));\n"
val dataArg = ", "+data.getName()
val typedArgList = ", "+typeName+" "+data.getName()
-
+
return newArrayList(dataArg, typedData, typedArgList);
}
-
+
override getTargetType(EnumerationType type) {
if (type.getPrimitiveType()!=null)
type.getPrimitiveType().getTargetName()
else
type.getName()
}
-
+
override getCastedValue(EnumLiteral literal) {
val type = literal.eContainer() as EnumerationType
val cast = type.targetType
-
+
if (type.primitiveType!=null)
Long.toString(literal.getLiteralValue())
else
"(("+cast+")"+Long.toString(literal.getLiteralValue())+")"
}
-
+
override getCastType(EnumerationType type) {
if (type.getPrimitiveType()!=null)
type.getPrimitiveType().getCastName()
else
type.getName()
}
-
+
}
diff --git a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/CppTranslationProvider.java b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/CppTranslationProvider.java
index 6d3a9e406..385aa08f1 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/CppTranslationProvider.java
+++ b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/CppTranslationProvider.java
@@ -4,10 +4,10 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* CONTRIBUTORS:
* Henrik Rentz-Reichert (initial contribution)
- *
+ *
*******************************************************************************/
package org.eclipse.etrice.generator.cpp.gen;
@@ -17,6 +17,7 @@ import java.util.ArrayList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.etrice.core.fsm.fSM.AbstractInterfaceItem;
import org.eclipse.etrice.core.fsm.fSM.DetailCode;
+import org.eclipse.etrice.core.room.InterfaceItem;
import org.eclipse.etrice.core.room.Message;
import org.eclipse.etrice.generator.base.DefaultTranslationProvider;
@@ -35,17 +36,17 @@ public class CppTranslationProvider extends DefaultTranslationProvider {
public boolean translateTags() {
return true;
}
-
+
@Override
public String getInterfaceItemMessageText(AbstractInterfaceItem item, EObject abstractMsg, ArrayList<String> args, String index, String orig) {
if (index==null)
return orig;
-
+
if (!(abstractMsg instanceof Message))
return "";
-
+
Message msg = (Message) abstractMsg;
-
+
StringBuilder argtext = new StringBuilder();
for (String arg : args) {
argtext.append(", "+arg);
@@ -54,12 +55,17 @@ public class CppTranslationProvider extends DefaultTranslationProvider {
// TODO: overload operator[] ???
return item.getName()+".get("+index+")."+msg.getName()+"("+argtext.toString()+")";
}
-
+
+ @Override
+ public String getInterfaceItemMessageValue(InterfaceItem item, Message msg, String orig) {
+ return item.getName() + "." + msg.getName() + "()";
+ }
+
@Override
public String translateTag(String tag, DetailCode code) {
if (tag.equals("ifitem.index"))
return "ifitem.getIdx()";
-
+
return super.translateTag(tag, code);
}
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 b29dca461..ad7810817 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
@@ -4,10 +4,10 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* CONTRIBUTORS:
* Peter Karlitschek (initial contribution)
- *
+ *
*******************************************************************************/
package org.eclipse.etrice.generator.cpp.gen
@@ -15,23 +15,17 @@ package org.eclipse.etrice.generator.cpp.gen
import com.google.inject.Inject
import com.google.inject.Singleton
import java.util.List
-import org.eclipse.etrice.core.genmodel.fsm.base.ILogger
import org.eclipse.etrice.core.genmodel.etricegen.Root
+import org.eclipse.etrice.core.genmodel.fsm.base.ILogger
import org.eclipse.etrice.core.room.Attribute
import org.eclipse.etrice.core.room.ComplexType
import org.eclipse.etrice.core.room.DataClass
+import org.eclipse.etrice.core.room.util.RoomHelpers
import org.eclipse.etrice.generator.generic.ProcedureHelpers
import org.eclipse.etrice.generator.generic.RoomExtensions
import org.eclipse.etrice.generator.generic.TypeHelpers
-import org.eclipse.etrice.generator.cpp.gen.Initialization
import org.eclipse.xtext.generator.JavaIoFileSystemAccess
-import org.eclipse.etrice.core.room.util.RoomHelpers
-import org.eclipse.etrice.generator.cpp.Main
-/**
- * @author Peter Karlitschek
- *
- */
@Singleton
class DataClassGen {
@@ -43,7 +37,7 @@ class DataClassGen {
@Inject extension Initialization
@Inject extension RoomHelpers
@Inject ILogger logger
-
+
def doGenerate(Root root) {
logger.logInfo("generating code")
for (dc: root.usedDataClasses) {
@@ -53,74 +47,62 @@ class DataClassGen {
logger.logInfo("generating DataClass header '"+dc.getCppHeaderFileName+"' in '"+path+"'")
fileAccess.setOutputPath(path)
fileAccess.generateFile(dc.getCppHeaderFileName, root.generateHeaderFile(dc))
-
+
// source file
logger.logInfo("generating DataClass source '"+dc.getCppSourceFileName+"' in '"+path+"'")
fileAccess.setOutputPath(path)
fileAccess.generateFile(dc.getCppSourceFileName, root.generateSourceFile(dc))
-
+
}
-
+
}
-
+
def generateHeaderFile(Root root, DataClass dc) {
-// 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)»
-
- «IF dc.base!=null»
- #include "«dc.base.path»«dc.base.name».h"
- «ENDIF»
+
+ #include "etDatatypes.h"
+ «IF dc.base!=null»#include "«dc.base.path»«dc.base.name».h"«ENDIF»
«FOR classes : root.getReferencedDataClasses(dc)»
- #include "«classes.path»«classes.name».h"
- «ENDFOR»
- «var models = root.getReferencedModels(dc)»
- «FOR model : models»
- «FOR classes : model.dataClasses»
- #include "«classes.path»«classes.name».h"
+ #include "«classes.path»«classes.name».h"
«ENDFOR»
+ «FOR model : root.getReferencedModels(dc)»
+ «FOR classes : model.dataClasses»
+ #include "«classes.path»«classes.name».h"
+ «ENDFOR»
«ENDFOR»
-
+
«helpers.userCode(dc.userCode1)»
-
-
+
+
class «dc.name»«IF dc.base!=null» : public «dc.base.name»«ENDIF» {
-
+
public:
«helpers.userCode(dc.userCode2)»
-
+
«helpers.attributes(dc.attributes)»
-
+
«helpers.attributeSettersGettersImplementation(dc.attributes, dc.name)»
-
+
«helpers.operationsDeclaration(dc.operations, dc.name)»
-
+
// default constructor, copy constructor and assignment operator
«dc.name»();
«dc.name»(const «dc.name»& rhs);
«dc.name»& operator=(const «dc.name»& rhs);
-
+
// constructor using fields
- «dc.name»(«dc.argList»);
-
- «IF dc.base!=null»
- // constructor using base class constructor
- «dc.name»(«dc.base.name» _super, «dc.attributes.argListConstructor.toString»);
- «ENDIF»
-
+ «IF !dc.attributes.empty»«dc.name»(«dc.attributes.argList»);«ENDIF»
};
-
+
«generateIncludeGuardEnd(dc.name)»
-
+
'''
}
-
+
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 baseName = dc.base?.name
'''
/**
* @author generated by eTrice
@@ -129,71 +111,44 @@ class DataClassGen {
*/
#include "«dc.getCppHeaderFileName»"
- «IF Main::settings.isUseEtUnit»
- extern "C" {
- #include "etUnit.h"
- }
- «ENDIF»
-
+
+ #include "etUnit/etUnit.h"
+
«helpers.userCode(dc.userCode3)»
-
+
// default constructor
- «dc.name»::«dc.name»()
+ «dc.name»::«dc.name»()
«IF dc.base!=null»
:«dc.base.name»()
«ENDIF»
{
«dc.attributes.attributeInitialization(false)»
-««« «IF ctor!=null»
-««« {
-««« // user defined constructor body
-««« «FOR l : ctor.detailCode.lines»
-««« «l»
-««« «ENDFOR»
-««« }
-««« «ENDIF»
+
+ «dc.userStructorBody(true)»
}
-
+
// copy constructor
«dc.name»::«dc.name»(const «dc.name»& rhs)
- :
- «IF dc.base!=null»
- «dc.base.name»(rhs),
- «ENDIF»
- «FOR a : dc.attributes SEPARATOR ","»
- «a.name»(rhs.«a.name»)
- «ENDFOR»
+ «constructorList((#[if(baseName != null) baseName +'(rhs)'] + dc.attributes.map[name+'(rhs.'+name+')']).filterNull)»
{
}
// constructor using fields
- «dc.name»::«dc.name»(«dc.argList»)
- :
- «IF dc.base!=null»
- «dc.base.name»(«dc.base.paramList»),
- «ENDIF»
- «FOR a : dc.attributes SEPARATOR ","»
- «a.name»(«a.name»_)
- «ENDFOR»
- {
- }
-
- «IF dc.base!=null»
- // constructor using base class constructor
- «dc.name»::«dc.name»(«dc.base.name» _super, «dc.attributes.argListConstructor.toString»)
- :
- «dc.base.name»(_super),
- «FOR a : dc.attributes SEPARATOR ","»
- «a.name»(«a.name»_)
- «ENDFOR»
- {
- }
+ «IF !dc.attributes.empty»
+ «dc.name»::«dc.name»(«dc.attributes.argList»)
+ :
+ «FOR a : dc.attributes SEPARATOR ","»
+ «a.name»(«a.name»)
+ «ENDFOR»
+ {
+ «dc.userStructorBody(true)»
+ }
«ENDIF»
-
+
// assignment operator
«dc.name»& «dc.name»::operator=(const «dc.name»& rhs)
- {
+ {
if (this == &rhs) { return *this; };
«IF dc.base!=null»
«dc.base.name»::operator=(rhs);
@@ -202,46 +157,50 @@ class DataClassGen {
«a.name»= rhs.«a.name»;
«ENDFOR»
return *this;
- }
-
+ }
+
«helpers.operationsImplementation(dc.operations, dc.name)»
-
+
'''}
-
- def paramList(DataClass _dc) {
- var result = ""
- var dc = _dc
- while (dc!=null) {
- result = dc.attributes.paramList.toString + result
- dc = dc.base
- if (dc!=null)
- result = ", "+result
- }
- return result
- }
-
- def paramList(List<Attribute> attributes) {
- '''«FOR a: attributes SEPARATOR ", "»«a.name»_«ENDFOR»'''
- }
-
- def argList(DataClass _dc) {
- var result = ""
- var dc = _dc
- while (dc!=null) {
- result = dc.attributes.argListConstructor.toString + result
- dc = dc.base
- if (dc!=null)
- result = ", "+result
- }
- return result
- }
-
- def argListConstructor(List<Attribute> attributes) {
- '''«FOR a : attributes SEPARATOR ", "»«a.type.type.typeName»«IF a.size>1»[]«ENDIF» «a.name»_«ENDFOR»'''
- }
-
-
+ def constructorList(Iterable<? extends CharSequence> items)'''
+ «FOR s : items BEFORE ':' SEPARATOR ','»
+ «s»
+ «ENDFOR»
+ '''
+
+// def paramList(DataClass _dc) {
+// var result = ""
+// var dc = _dc
+// while (dc!=null) {
+// result = dc.attributes.paramList.toString + result
+// dc = dc.base
+// if (dc!=null)
+// result = ", "+result
+// }
+// return result
+// }
+
+// def paramList(List<Attribute> attributes) {
+// '''«FOR a: attributes SEPARATOR ", "»«a.name»_«ENDFOR»'''
+// }
+//
+// def argList(DataClass _dc) {
+// var result = ""
+// var dc = _dc
+// while (dc!=null) {
+// result = dc.attributes.argListConstructor.toString + result
+// dc = dc.base
+// if (dc!=null)
+// result = ", "+result
+// }
+// return result
+// }
+//
+// def argListConstructor(List<Attribute> attributes) {
+// '''«FOR a : attributes SEPARATOR ", "»«a.type.type.typeName»«IF a.size>1»[]«ENDIF» «a.name»_«ENDFOR»'''
+// }
+
def deepCopy(DataClass _dc) {
var result = ""
var dc = _dc
@@ -251,7 +210,7 @@ class DataClassGen {
}
return result
}
-
+
def deepCopy(List<Attribute> attributes) {
'''
«FOR a : attributes»
diff --git a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/GeneratorSettings.java b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/GeneratorSettings.java
deleted file mode 100644
index 823b5513f..000000000
--- a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/GeneratorSettings.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 protos software gmbh (http://www.protos.de).
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * CONTRIBUTORS:
- * Henrik Rentz-Reichert (initial contribution)
- *
- *******************************************************************************/
-
-package org.eclipse.etrice.generator.cpp.gen;
-
-import org.eclipse.etrice.generator.base.GlobalGeneratorSettings;
-
-/**
- * @author Henrik Rentz-Reichert
- *
- */
-public class GeneratorSettings extends GlobalGeneratorSettings {
-
- private boolean useEtUnit = false;
-
- public boolean isUseEtUnit() {
- return useEtUnit;
- }
-
- public void setUseEtUnit(boolean useEtUnit) {
- this.useEtUnit = useEtUnit;
- }
-}
diff --git a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/Initialization.xtend b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/Initialization.xtend
index c70d5d8bf..c7af37f5d 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/Initialization.xtend
+++ b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/Initialization.xtend
@@ -4,11 +4,11 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* CONTRIBUTORS:
* Henrik Rentz-Reichert (initial contribution)
* Peter Karlitschek
- *
+ *
*******************************************************************************/
package org.eclipse.etrice.generator.cpp.gen
@@ -29,7 +29,7 @@ class Initialization {
@Inject ILanguageExtension languageExt
// @Inject IDataConfiguration dataConfigExt
// @Inject ProcedureHelpers procedureHelpers
-
+
def attributeInitialization(List<Attribute> attribs, boolean useClassDefaultsOnly) {
'''
// initialize attributes
@@ -58,7 +58,7 @@ class Initialization {
«ENDFOR»
'''
}
-
+
def initializeArrayWithValues(String varName, String[] values) {
'''
«var i = -1»
@@ -73,7 +73,7 @@ class Initialization {
var value = a.defaultValueLiteral
if (value != null) {
if (a.size == 0 || aType.characterType) {
- if (a.type.isRef)
+ if (a.type.isRef)
'''«a.name»(new «aType.name»(«value»))'''
else
'''«a.name»(«value»)'''
@@ -84,7 +84,7 @@ class Initialization {
else {
'''«a.name»()'''
}
- }
+ }
else if (aType instanceof ComplexType || a.size>1 || !useClassDefaultsOnly) {
if (a.size==0) {
if (a.type.isRef)
@@ -92,10 +92,10 @@ class Initialization {
else
'''«a.name»(«languageExt.defaultValue(aType)»)'''
}
- else
+ else
'''«a.name»()'''
}
}
-
-
+
+
} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/MainGen.xtend b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/MainGen.xtend
index 450633b95..025a8ec7d 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/MainGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/MainGen.xtend
@@ -25,8 +25,8 @@ class MainGen {
@Inject DataClassGen dataClassGen
@Inject ProtocolClassGen protocolClassGen
@Inject ActorClassGen actorClassGen
- @Inject SubSystemClassGen subsystemClassGen
- @Inject SubSystemRunnerGen subsystemRunnerGen
+ @Inject NodeGen subsystemClassGen
+ @Inject NodeRunnerGen subsystemRunnerGen
@Inject PrepareFileSystem prepFS
def void doGenerate(Resource resource) {
diff --git a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/NodeGen.xtend b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/NodeGen.xtend
new file mode 100644
index 000000000..4304070eb
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/NodeGen.xtend
@@ -0,0 +1,250 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Draeger Medical GmbH (http://www.draeger.com).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Peter Karlitschek (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.generator.cpp.gen
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import java.util.Collection
+import java.util.Map
+import org.eclipse.etrice.core.etmap.util.ETMapUtil
+import org.eclipse.etrice.core.etphys.eTPhys.ExecMode
+import org.eclipse.etrice.core.etphys.eTPhys.PhysicalThread
+import org.eclipse.etrice.core.genmodel.builder.GenmodelConstants
+import org.eclipse.etrice.core.genmodel.etricegen.Root
+import org.eclipse.etrice.core.genmodel.etricegen.SubSystemInstance
+import org.eclipse.etrice.core.genmodel.etricegen.WiredSubSystemClass
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.IDiagnostician
+import org.eclipse.etrice.core.room.SubSystemClass
+import org.eclipse.etrice.generator.cpp.Main
+import org.eclipse.etrice.generator.fsm.base.FileSystemHelpers
+import org.eclipse.etrice.generator.fsm.base.IGeneratorFileIo
+import org.eclipse.etrice.generator.generic.ProcedureHelpers
+import org.eclipse.etrice.generator.generic.RoomExtensions
+
+import static extension org.eclipse.etrice.generator.fsm.base.Indexed.*
+import org.eclipse.etrice.core.common.converter.TimeConverter
+
+@Singleton
+class NodeGen {
+
+ @Inject extension CppExtensions
+ @Inject extension RoomExtensions
+ @Inject extension ProcedureHelpers
+ @Inject extension FileSystemHelpers
+
+ @Inject IGeneratorFileIo fileIO
+ @Inject IDiagnostician diagnostician
+
+ def doGenerate(Root root) {
+ val Map<SubSystemClass, WiredSubSystemClass> sscc2wired = newHashMap
+ root.wiredInstances.filter(typeof(WiredSubSystemClass)).forEach[sscc2wired.put(subSystemClass, it)]
+
+ for (nr : ETMapUtil::getNodeRefs()) {
+ for (instpath : ETMapUtil::getSubSystemInstancePaths(nr)) {
+ val ssi = root.getInstance(instpath) as SubSystemInstance
+ if (ssi!=null && ssi.subSystemClass.validGenerationLocation) {
+ val wired = sscc2wired.get(ssi.subSystemClass)
+ val path = ssi.subSystemClass.generationTargetPath+ssi.subSystemClass.getPath
+ val infopath = ssi.subSystemClass.generationInfoPath+ssi.subSystemClass.getPath
+
+ //checkDataPorts(ssi)
+
+ val usedThreads = ETMapUtil::getUsedThreads(nr, ssi)
+
+ fileIO.generateFile("generating Node declaration", path, infopath, getCppHeaderFileName(nr, ssi), root.generateHeaderFile(ssi, wired, usedThreads))
+ fileIO.generateFile("generating Node implementation", path, infopath, getCppSourceFileName(nr, ssi), root.generateSourceFile(ssi, wired, usedThreads))
+ }
+ }
+ }
+ }
+
+ def generateHeaderFile(Root root, SubSystemInstance comp, WiredSubSystemClass wired, Collection<PhysicalThread> usedThreads) {
+ val cc = comp.subSystemClass
+ val models = root.getReferencedModels(cc)
+ val nr = ETMapUtil::getNodeRef(comp)
+ val clsname = nr.getCppClassName(comp)
+ val threads = nr.type.threads.filter(t|usedThreads.contains(t))
+
+ '''
+ /**
+ * @author generated by eTrice
+ *
+ * Header File of SubSystemClass «clsname»
+ *
+ */
+
+ «generateIncludeGuardBegin(clsname)»
+
+ #include "common/modelbase/SubSystemClassBase.h"
+
+««« «FOR model : root.getReferencedModels(cc)»
+««« ««« #include "«model.name».h"
+««« «ENDFOR»
+ «cc.userCode(1, false)»
+
+ class «clsname» : public etRuntime::SubSystemClassBase{
+
+ «cc.userCode(2, false)»
+
+ public:
+
+ «FOR thread : threads.indexed»
+ static const int «thread.value.threadId»;
+ «ENDFOR»
+
+ «clsname»(IRTObject* parent, const std::string& name);
+
+ virtual void receiveEvent(etRuntime::InterfaceItemBase* ifitem, int evt, void* data);
+ virtual void instantiateMessageServices();
+ virtual void instantiateActors();
+
+ virtual void init();
+
+ «IF Main::settings.generateMSCInstrumentation»
+ etBool hasGeneratedMSCInstrumentation() const { return true; }
+ virtual void destroy();
+ «ENDIF»
+
+ private:
+
+ «clsname»();
+ «clsname»(«clsname» const&);
+ «clsname»& operator=(«clsname» const&);
+ };
+
+ «generateIncludeGuardEnd(cc.name)»
+ '''
+ }
+
+ def private getThreadId(PhysicalThread thread) {
+ "THREAD_"+thread.name.toUpperCase
+ }
+
+ def generateSourceFile(Root root, SubSystemInstance comp, WiredSubSystemClass wired, Collection<PhysicalThread> usedThreads) {
+ val cc = comp.subSystemClass
+ val models = root.getReferencedModels(cc)
+ val nr = ETMapUtil::getNodeRef(comp)
+ val clsname = nr.getCppClassName(comp)
+ val threads = nr.type.threads.filter(t|usedThreads.contains(t))
+
+ '''
+ /**
+ * @author generated by eTrice
+ *
+ * Source File of SubsystemClass «clsname»
+ *
+ */
+
+ #include "«getCppHeaderFileName(nr, comp)»"
+
+ #include "common/debugging/DebuggingService.h"
+ #include "common/messaging/IMessageService.h"
+ #include "common/messaging/MessageService.h"
+ #include "common/messaging/MessageServiceController.h"
+ #include "common/messaging/RTServices.h"
+ #include "common/modelbase/InterfaceItemBase.h"
+
+ «FOR ai : comp.actorInstances»
+ #include "«ai.actorClass.path»«ai.actorClass.name».h"
+ «ENDFOR»
+ #include <iostream>
+
+ using namespace etRuntime;
+
+ «FOR thread : threads.indexed»
+ const int «clsname»::«thread.value.threadId» = «thread.index0»;
+ «ENDFOR»
+
+ «clsname»::«clsname»(IRTObject* parent, const std::string& name) :
+ SubSystemClassBase(parent, name)
+ {
+ }
+
+ void «clsname»::receiveEvent(InterfaceItemBase* ifitem, int evt, void* data){
+ }
+
+ void «clsname»::instantiateMessageServices(){
+
+ IMessageService* msgService;
+ «FOR thread: threads»
+ {
+ «IF thread.execmode==ExecMode::POLLED || thread.execmode==ExecMode::MIXED»
+ etTime interval;
+ interval.sec = «TimeConverter::split(thread.time, TimeConverter.SEC, true)»;
+ interval.nSec = «TimeConverter::split(thread.time, TimeConverter.MILLI_SEC, false)»L;
+
+ msgService = new MessageService(this, IMessageService::«thread.execmode.getName», interval, 0, «thread.threadId», "MessageService_«thread.name»", «thread.prio»);
+ «ELSE»
+ msgService = new MessageService(this, IMessageService::«thread.execmode.getName», 0, «thread.threadId», "MessageService_«thread.name»", «thread.prio»);
+ «ENDIF»
+ RTServices::getInstance().getMsgSvcCtrl().addMsgSvc(*msgService);
+ }
+ «ENDFOR»
+ }
+
+ void «clsname»::instantiateActors(){
+
+ // thread mappings
+ «FOR ai : comp.allContainedInstances»
+ «val mapped = ETMapUtil::getMappedThread(ai)»
+ «IF !(mapped.implicit || mapped.asParent)»
+ addPathToThread("«ai.path»", «mapped.thread.threadId»);
+ «ENDIF»
+ «ENDFOR»
+
+ // sub actors
+ «FOR sub : cc.actorRefs»
+ «IF sub.multiplicity>1»
+ for (int i=0; i<«sub.multiplicity»; ++i) {
+ «IF Main::settings.generateMSCInstrumentation»
+ DebuggingService::getInstance().addMessageActorCreate(*this, "«sub.name»«GenmodelConstants::INDEX_SEP»"+i);
+ «ENDIF»
+ new «sub.type.name»(this, "«sub.name»«GenmodelConstants::INDEX_SEP»"+i);
+ }
+ «ELSE»
+ «IF Main::settings.generateMSCInstrumentation»
+ DebuggingService::getInstance().addMessageActorCreate(*this, "«sub.name»");
+ «ENDIF»
+ new «sub.type.name»(this, "«sub.name»");
+ «ENDIF»
+ «ENDFOR»
+
+ // wiring
+ «FOR wire: wired.wires»
+ «if (wire.dataDriven) "DataPortBase" else "InterfaceItemBase"»::connect(this, "«wire.path1.join('/')»", "«wire.path2.join('/')»");
+ «ENDFOR»
+ }
+
+ void «clsname»::init(){
+ «IF Main::settings.generateMSCInstrumentation»
+ DebuggingService::getInstance().addVisibleComment("begin sub system initialization");
+ «ENDIF»
+ SubSystemClassBase::init();
+ «IF Main::settings.generateMSCInstrumentation»
+ DebuggingService::getInstance().addVisibleComment("done sub system initialization");
+ «ENDIF»
+ }
+ «IF Main::settings.generateMSCInstrumentation»
+
+ void «clsname»::destroy() {
+ DebuggingService::getInstance().addVisibleComment("begin sub system destruction");
+ SubSystemClassBase::destroy();
+ DebuggingService::getInstance().addVisibleComment("done sub system destruction");
+ }
+ «ENDIF»
+
+ '''
+ }
+
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/NodeRunnerGen.xtend b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/NodeRunnerGen.xtend
new file mode 100644
index 000000000..f83fe8682
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/NodeRunnerGen.xtend
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Draeger Medical GmbH (http://www.draeger.com).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Peter Karlitschek (initial contribution)
+ *
+ *******************************************************************************/
+package org.eclipse.etrice.generator.cpp.gen
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import org.eclipse.etrice.core.etmap.util.ETMapUtil
+import org.eclipse.etrice.core.genmodel.etricegen.Root
+import org.eclipse.etrice.core.genmodel.etricegen.SubSystemInstance
+import org.eclipse.etrice.core.genmodel.etricegen.SystemInstance
+import org.eclipse.etrice.generator.fsm.base.FileSystemHelpers
+import org.eclipse.etrice.generator.fsm.base.IGeneratorFileIo
+import org.eclipse.etrice.generator.generic.RoomExtensions
+
+
+@Singleton
+class NodeRunnerGen {
+
+ @Inject extension RoomExtensions roomExt
+ @Inject extension CppExtensions
+ @Inject extension FileSystemHelpers
+
+ @Inject IGeneratorFileIo fileIO
+
+ def doGenerate(Root root) {
+ for (nr : ETMapUtil::getNodeRefs()) {
+ for (instpath : ETMapUtil::getSubSystemInstancePaths(nr)) {
+ val ssi = root.getInstance(instpath) as SubSystemInstance
+ if (ssi!=null && ssi.subSystemClass.validGenerationLocation) {
+ val filepath = ssi.subSystemClass.generationTargetPath+ssi.subSystemClass.getPath
+ val infopath = ssi.subSystemClass.generationInfoPath+ssi.subSystemClass.getPath
+ fileIO.generateFile("generating SubSystemRunner declaration", filepath, infopath, nr.getCppClassName(ssi)+"Runner.h", root.generateHeaderFile(ssi))
+ fileIO.generateFile("generating SubSystemRunner implementation", filepath, infopath, nr.getCppClassName(ssi)+"Runner.cpp", root.generateSourceFile(ssi))
+ }
+ }
+ }
+ }
+
+ def generateHeaderFile(Root root, SubSystemInstance ssc) {
+ //val cc = ssc.subSystemClass
+ val nr = ETMapUtil::getNodeRef(ssc)
+ val clsname = nr.getCppClassName(ssc)
+ '''
+ /**
+ * @author generated by eTrice
+ *
+ * this class contains the main function running component «ssc.name»
+ * it instantiates «ssc.name» and starts and ends the lifecycle
+ */
+
+ «generateIncludeGuardBegin(clsname+"Runner")»
+
+ #include "common/modelbase/SubSystemRunnerBase.h"
+
+ class «clsname+"Runner"» : public etRuntime::SubSystemRunnerBase {
+
+ };
+
+ «generateIncludeGuardEnd(clsname+"Runner")»
+ '''
+ }
+
+ def generateSourceFile(Root root, SubSystemInstance ssc) {
+ //val cc = ssc.subSystemClass
+ val nr = ETMapUtil::getNodeRef(ssc)
+ val clsname = nr.getCppClassName(ssc)
+ '''
+ /**
+ * @author generated by eTrice
+ *
+ * this class contains the main function running component «ssc.name»
+ * it instantiates «ssc.name» and starts and ends the lifecycle
+ */
+
+
+ #include "«clsname»Runner.h"
+
+ #include "«clsname».h"
+ #include "common/modelbase/RTSystem.h"
+
+ using namespace etRuntime;
+
+ /**
+ * main function
+ * creates component and starts and stops the lifecycle
+ */
+ int main(int argc, char* argv[]) {
+ // instantiate the main component
+ RTSystem* sys = «IF ssc.eContainer instanceof SystemInstance»new RTSystem("«(ssc.eContainer as SystemInstance).name»")«ELSE»0«ENDIF»;
+ «clsname»* main_component = new «clsname»(sys, "«ssc.name»");
+
+ «clsname»Runner::run(*main_component, argc, argv);
+
+ // TODO JH crash
+ //delete sys;
+
+ return 0;
+ }
+
+
+ '''
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ProtocolClassGen.xtend b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ProtocolClassGen.xtend
index 6658923ba..b5771527d 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ProtocolClassGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ProtocolClassGen.xtend
@@ -4,21 +4,20 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* CONTRIBUTORS:
* Peter Karlitschek (initial contribution)
- *
+ *
*******************************************************************************/
package org.eclipse.etrice.generator.cpp.gen
import com.google.inject.Inject
import com.google.inject.Singleton
-import java.util.ArrayList
+import java.util.List
import org.eclipse.etrice.core.genmodel.etricegen.Root
import org.eclipse.etrice.core.genmodel.fsm.base.ILogger
import org.eclipse.etrice.core.room.CommunicationType
-import org.eclipse.etrice.core.room.DataClass
import org.eclipse.etrice.core.room.InterfaceItem
import org.eclipse.etrice.core.room.Message
import org.eclipse.etrice.core.room.Port
@@ -28,100 +27,101 @@ import org.eclipse.etrice.core.room.ProtocolClass
import org.eclipse.etrice.core.room.SAP
import org.eclipse.etrice.core.room.SPP
import org.eclipse.etrice.generator.cpp.Main
+import org.eclipse.etrice.generator.fsm.base.FileSystemHelpers
+import org.eclipse.etrice.generator.fsm.base.IGeneratorFileIo
import org.eclipse.etrice.generator.generic.GenericProtocolClassGenerator
import org.eclipse.etrice.generator.generic.ProcedureHelpers
import org.eclipse.etrice.generator.generic.RoomExtensions
import org.eclipse.etrice.generator.generic.TypeHelpers
-import org.eclipse.xtext.generator.JavaIoFileSystemAccess
-/**
- * @author Peter Karlitschek
- *
- */
@Singleton
class ProtocolClassGen extends GenericProtocolClassGenerator {
- @Inject extension JavaIoFileSystemAccess fileAccess
+ @Inject IGeneratorFileIo fileIO
@Inject extension CppExtensions stdExt
@Inject extension RoomExtensions roomExt
@Inject extension ProcedureHelpers helpers
@Inject extension TypeHelpers
@Inject extension Initialization
+ @Inject extension FileSystemHelpers
@Inject ILogger logger
-
- def doGenerate(Root root) {
- for (pc: root.usedProtocolClasses) {
- var path = pc.generationTargetPath+pc.getPath
- logger.logInfo("generating ProtocolClass header '"+pc.getCppHeaderFileName+"' in '"+path+"'")
- fileAccess.setOutputPath(path)
- fileAccess.generateFile(pc.getCppHeaderFileName, root.generateHeaderFile(pc))
+ def doGenerate(Root root) {
+
+ for (pc: root.usedProtocolClasses.filter(cl|cl.isValidGenerationLocation)) {
+ val path = pc.generationTargetPath+pc.getPath
+ val infopath = pc.generationInfoPath+pc.getPath
+ switch (pc.commType) {
+ case CommunicationType::EVENT_DRIVEN:{
+ fileIO.generateFile("generating ProtocolClass declaration", path, infopath, pc.cppHeaderFileName, root.generateHeaderFile(pc))
+ fileIO.generateFile("generating ProtocolClass implementation", path, infopath, pc.cppSourceFileName, root.generateSourceFile(pc))
+ }
+ case CommunicationType::DATA_DRIVEN:{
+ fileIO.generateFile("generating ProtocolClass declaration", path, infopath, pc.cppHeaderFileName, root.generateDataDrivenHeaderFile(pc))
+ fileIO.generateFile("generating ProtocolClass implementation", path, infopath, pc.cppSourceFileName, root.generateDataDrivenSourceFile(pc))
+ }
+ case CommunicationType::SYNCHRONOUS:
+ logger.logError("synchronous protocols not supported yet", pc)
+ }
- logger.logInfo("generating ProtocolClass source '"+pc.getCppSourceFileName+"' in '"+path+"'")
- fileAccess.setOutputPath(path)
- fileAccess.generateFile(pc.getCppSourceFileName, root.generateSourceFile(pc))
}
}
-
- def private generateHeaderFile(Root root, ProtocolClass pc) {'''
+
+ def protected generateHeaderFile(Root root, ProtocolClass pc) {'''
/**
* @author generated by eTrice
*
* Header File of ProtocolClass «pc.name»
- *
+ *
*/
«generateIncludeGuardBegin(pc.name)»
-
- #include "platforms/generic/etDatatypes.h"
- #include "common/messaging/IRTObject.h"
- #include "common/modelbase/PortBase.h"
+
#include "common/modelbase/InterfaceItemBase.h"
- #include "common/messaging/Address.h"
- #include "common/messaging/Message.h"
- #include <vector>
+ #include "common/modelbase/PortBase.h"
+ #include "common/modelbase/ReplicatedInterfaceItemBase.h"
+ #include "common/modelbase/ReplicatedPortBase.h"
+ #include <etDatatypes.h>
#include <string>
-
- namespace etRuntime {
- class IEventReceiver;
-
- }
-
- «helpers.userCode(pc.userCode1)»
-
+
+ «pc.userCode(1)»
+
«FOR dataClass : root.getReferencedDataClasses(pc)»
- #include "«dataClass.path»«dataClass.name».h"
+ #include "«dataClass.path»«dataClass.name».h"
«ENDFOR»
class «pc.name» {
public:
- «IF pc.commType==CommunicationType::EVENT_DRIVEN» /* message IDs */
+ /* message IDs */
«genMessageIDs(pc)»
+
+ «pc.userCode(2)»
+
static bool isValidEvtID(int evtId) {
return ((MSG_MIN < evtId) && (evtId < MSG_MAX));
- };
+ }
static bool isValidOutgoingEvtID(int evtId) {
return ((MSG_MIN < evtId) && (evtId < «IF pc.incomingMessages.size == 0»MSG_MAX«ELSE»IN_«pc.incomingMessages.get(0).name»«ENDIF»));
- };
+ }
static bool isValidIncomingEvtID(int evtId) {
return ((«IF pc.incomingMessages.size == 0»MSG_MAX«ELSE»IN_«pc.incomingMessages.get(0).name»«ENDIF» <= evtId) && (evtId < MSG_MAX));
- };
- static std::string getMessageString(int msg_id);
-
+ }
+ static const std::string& getMessageString(int msg_id);
+
private:
- static std::string s_messageStrings[];
- «ENDIF»
- «helpers.userCode(pc.userCode2)»
+ static const std::string s_messageStrings[];
+
+
};
-
+
«portClassDeclaration(pc, false)»
«portClassDeclaration(pc, true)»
«generateIncludeGuardEnd(pc.name)»
'''
}
-
- def private portClassDeclaration(ProtocolClass pc, Boolean conj) {
+
+ def protected portClassDeclaration(ProtocolClass pc, boolean conj) {
var pclass = pc.getPortClass(conj)
var portClassName = pc.getPortClassName(conj)
var replPortClassName = pc.getPortClassName(conj, true)
@@ -131,89 +131,108 @@ class ProtocolClassGen extends GenericProtocolClassGenerator {
//------------------------------------------------------------------------------------------------------------
class «portClassName» : public etRuntime::PortBase {
«IF pclass!=null»
- «helpers.userCode(pclass.userCode)»
+ «pclass.userCode.userCode»
«ENDIF»
public:
- // constructors
- «portClassName»(etRuntime::IEventReceiver& actor, etRuntime::IRTObject* parent, std::string name, int localId, etRuntime::Address addr, etRuntime::Address peerAddress, bool doRegistration = true);
- «portClassName»(etRuntime::IEventReceiver& actor, etRuntime::IRTObject* parent, std::string name, int localId, int idx, etRuntime::Address addr, etRuntime::Address peerAddress, bool doRegistration = true);
-
- virtual void receive(etRuntime::Message* m);
+ «portClassName»(etRuntime::IInterfaceItemOwner* actor, const std::string& name, int localId);
+ «portClassName»(etRuntime::IInterfaceItemOwner* actor, const std::string& name, int localId, int idx);
+
+ «IF Main::settings.generateMSCInstrumentation»
+ virtual void destroy();
+ «ENDIF»
+
+ virtual void receive(const etRuntime::Message* m);
+
«IF pclass!=null»
- «helpers.attributes(pclass.attributes)»
- «helpers.operationsDeclaration(pclass.operations, portClassName)»
+ «pclass.attributes.attributes»
+ «pclass.operations.operationsDeclaration(portClassName)»
«ENDIF»
-
- // outgoing messages
+
+ // sent messages
«FOR m : pc.getAllMessages(conj)»
- «sendMessageDeclaration(m,conj)»
+ «messageSignature(m)»;
«ENDFOR»
};
-
+
//------------------------------------------------------------------------------------------------------------
// «IF conj»conjugated «ENDIF»replicated port class
//------------------------------------------------------------------------------------------------------------
- class «replPortClassName» {
- private:
- int m_replication;
- «portClassName»* m_ports; //dynamic array used instead of vector to avoid copy construction
-
+ class «replPortClassName» : public etRuntime::ReplicatedPortBase {
+
public:
- «replPortClassName»(etRuntime::IEventReceiver& actor, etRuntime::IRTObject* parent, std::string name, int localId, std::vector<etRuntime::Address> addr, std::vector<etRuntime::Address> peerAddress);
- virtual ~«replPortClassName»() {};
-
- int getReplication() { return m_replication; }
- int getIndexOf(const etRuntime::InterfaceItemBase& ifitem){ return ifitem.getIdx(); }
- «portClassName» get(int i) {return m_ports[i];}
-
- «IF pc.commType==CommunicationType::EVENT_DRIVEN»
- // outgoing messages
- «FOR m : pc.getAllMessages(conj)»
- «sendMessageDeclaration(m,conj)»
+ «replPortClassName»(etRuntime::IInterfaceItemOwner* actor, const std::string& name, int localId);
+
+ int getReplication() const { return getNInterfaceItems(); }
+ int getIndexOf(const etRuntime::InterfaceItemBase& ifitem) const { return ifitem.getIdx(); }
+ «portClassName»& get(int idx) const { return *dynamic_cast<«portClassName»*>(getInterfaceItem(idx)); }
+
+ «IF conj»
+ // incoming messages
+ «FOR m : pc.getAllIncomingMessages()»
+ «messageSignature(m)»;
+ «ENDFOR»
+ «ELSE»
+ // outgoing messages
+ «FOR m : pc.getAllOutgoingMessages()»
+ «messageSignature(m)»;
«ENDFOR»
«ENDIF»
-
+
+ protected:
+ virtual etRuntime::InterfaceItemBase* createInterfaceItem(etRuntime::IInterfaceItemOwner* rcv, const std::string& name, int lid, int idx) {
+ return new «portClassName»(rcv, name, lid, idx);
+ }
+
};
'''
}
- def private generateSourceFile(Root root, ProtocolClass pc) {'''
+ def protected generateSourceFile(Root root, ProtocolClass pc) {'''
/**
* @author generated by eTrice
*
* Source File of ProtocolClass «pc.name»
- *
+ *
*/
#include "«pc.getCppHeaderFileName»"
+
#include "common/debugging/DebuggingService.h"
+ #include "common/messaging/AbstractMessageReceiver.h"
+ #include "common/messaging/Address.h"
+ #include "common/messaging/Message.h"
+ #include "common/modelbase/IEventReceiver.h"
#include <iostream>
- «IF Main::settings.isUseEtUnit»
- extern "C" {
- #include "etUnit.h"
- }
- «ENDIF»
+ #include <iterator>
+ #include <string>
+ #include <vector>
using namespace etRuntime;
-
- «helpers.userCode(pc.userCode3)»
-
- «IF pc.commType==CommunicationType::EVENT_DRIVEN»
- «helpers.userCode(pc.userCode2)»
-
+
+
+ «pc.userCode(3)»
+
+ /* message names as strings for debugging (generate MSC) */
+ const std::string «pc.name»::s_messageStrings[] = {"MIN", «FOR m : pc.getAllOutgoingMessages()»"«m.name»",«ENDFOR» «FOR m : pc.getAllIncomingMessages()»"«m.name»",«ENDFOR»"MAX"};
+
+ const std::string& «pc.name»::getMessageString(int msg_id) {
+ if ((MSG_MIN < msg_id ) && ( msg_id < MSG_MAX )) {
+ return s_messageStrings[msg_id];
+ } else {
+ // id out of range
+ static const std::string errorMsg = "Message ID out of range";
+ return errorMsg;
+ }
+ }
+
«portClassImplementation(pc, false)»
«portClassImplementation(pc, true)»
-
- /*--------------------- debug helpers */
- «generateDebugHelpersImplementation(root, pc)»
- «ENDIF»
-
-
+
'''
}
-
- def portClassImplementation(ProtocolClass pc, Boolean conj) {
+
+ def protected portClassImplementation(ProtocolClass pc, boolean conj) {
var pclass = pc.getPortClass(conj)
var portClassName = pc.getPortClassName(conj)
var replPortClassName = pc.getPortClassName(conj, true)
@@ -221,35 +240,43 @@ class ProtocolClassGen extends GenericProtocolClassGenerator {
//------------------------------------------------------------------------------------------------------------
// «IF conj»conjugated «ENDIF»port class
//------------------------------------------------------------------------------------------------------------
-
- «portClassName»::«portClassName»(etRuntime::IEventReceiver& actor, etRuntime::IRTObject* parent, std::string name, int localId, Address addr, Address peerAddress, bool doRegistration)
- : «pclass.generateConstructorInitalizerList("0")»
+
+ «portClassName»::«portClassName»(IInterfaceItemOwner* actor, const std::string& name, int localId) :
+ «pclass.generateConstructorInitalizerList('0')»
{
«IF pclass!=null»«pclass.attributes.attributeInitialization(false)»«ENDIF»
- if (doRegistration) {
+ «IF Main::settings.generateMSCInstrumentation»
DebuggingService::getInstance().addPortInstance(*this);
- }
+ «ENDIF»
}
- «portClassName»::«portClassName»(etRuntime::IEventReceiver& actor, etRuntime::IRTObject* parent, std::string name, int localId, int idx, Address addr, Address peerAddress, bool doRegistration)
- : «pclass.generateConstructorInitalizerList("idx")»
+ «portClassName»::«portClassName»(IInterfaceItemOwner* actor, const std::string& name, int localId, int idx) :
+ «pclass.generateConstructorInitalizerList('idx')»
{
«IF pclass!=null»«pclass.attributes.attributeInitialization(false)»«ENDIF»
- if (doRegistration) {
+ «IF Main::settings.generateMSCInstrumentation»
DebuggingService::getInstance().addPortInstance(*this);
- }
+ «ENDIF»
}
-
- void «portClassName»::receive(Message* msg) {
+ «IF Main::settings.generateMSCInstrumentation»
+
+ void «portClassName»::destroy() {
+ DebuggingService::getInstance().removePortInstance(*this);
+ PortBase::destroy();
+ }
+ «ENDIF»
+
+ void «portClassName»::receive(const Message* msg) {
+ // TODO JH further
if (! «pc.name»::«IF conj»isValidOutgoingEvtID«ELSE»isValidIncomingEvtID«ENDIF»(msg->getEvtId())) {
std::cout << "unknown" << std::endl;
}
- else {
- if (msg->hasDebugFlagSet()) { // TODO: model switch for activation of this flag
- DebuggingService::getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), «pc.name»::getMessageString(msg->getEvtId()));
- }
-
- «IF pc.handlesReceive(conj)»
+
+ «IF Main::settings.generateMSCInstrumentation»
+ DebuggingService::getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), «pc.name»::getMessageString(msg->getEvtId()));
+ «ENDIF»
+
+ «IF pc.handlesReceive(conj)»
switch (msg->getEvtId()) {
«FOR hdlr : pc.getReceiveHandlers(conj)»
case «pc.name»::«hdlr.msg.getCodeName()»:
@@ -262,136 +289,79 @@ class ProtocolClassGen extends GenericProtocolClassGenerator {
«ENDFOR»
default:
«ENDIF»
- getEventReceiver().receiveEvent(this, msg->getEvtId(), msg->getData());
- «IF pc.handlesReceive(conj)»
+ getActor()->receiveEvent(this, msg->getEvtId(), msg->getData());
+ «IF pc.handlesReceive(conj)»
break;
}
- «ENDIF»
- }
- };
+ «ENDIF»
+ }
«IF pclass!=null»
- «helpers.operationsImplementation(pclass.operations, portClassName)»
+ «pclass.operations.operationsImplementation(portClassName)»
«ENDIF»
-
+
// sent messages
«FOR m : pc.getAllMessages(conj)»
«sendMessage(m, pc.name, portClassName, conj)»
«ENDFOR»
-
+
//------------------------------------------------------------------------------------------------------------
// «IF conj»conjugated «ENDIF»replicated port class
//------------------------------------------------------------------------------------------------------------
- «replPortClassName»::«replPortClassName»(etRuntime::IEventReceiver& actor, etRuntime::IRTObject* parent, std::string name, int localId, std::vector<Address> addr, std::vector<Address> peerAddress)
- : m_replication(addr.size()),
- m_ports()
+ «replPortClassName»::«replPortClassName»(IInterfaceItemOwner* actor, const std::string& name, int localId) :
+ ReplicatedPortBase(actor, name, localId)
{
- char numstr[10]; // enough to hold all numbers up to 32-bits
-
- m_ports = reinterpret_cast<«portClassName»*> (new char[sizeof(«portClassName») * addr.size()]);
- for (int i = 0; i < m_replication; ++i) {
- snprintf(numstr, sizeof(numstr), "%d", i);
- //placement new to avoid copy construction, therefore no vector is used
- new (&m_ports[i]) «portClassName»(actor, parent, name + numstr, localId, i, addr[i], peerAddress[i]);
- }
- };
-
-
- // outgoing messages
- «FOR m : pc.getAllMessages(conj)»
- «messageSignatureDefinition(m, replPortClassName)»{
- for (int i=0; i<m_replication; ++i) {
- m_ports[i].«messageCall(m)»;
- }
- }
- «ENDFOR»
- '''
}
-
- def generateConstructorInitalizerList(PortClass pc, String index) {
- var initializerList = new ArrayList<CharSequence>();
- initializerList.add('''PortBase(actor, parent, name, localId, «index», addr, peerAddress)''')
- if (pc != null) {
- for (attrib: pc.attributes) {
- initializerList.add(attrib.attributeInitialization(false))
+
+ «IF conj»
+ // incoming messages
+ «FOR m : pc.getAllIncomingMessages()»
+ «messageSignatureDefinition(m, replPortClassName)»{
+ for (std::vector<etRuntime::InterfaceItemBase*>::iterator it = getItems().begin(); it != getItems().end(); ++it) {
+ (dynamic_cast<«portClassName»*>(*it))->«messageCall(m)»;
+ }
}
- }
- return
- '''
- «initializerList.join(',\n')»
- '''
+ «ENDFOR»
+ «ELSE»
+ // outgoing messages
+ «FOR m : pc.getAllOutgoingMessages()»
+ «messageSignatureDefinition(m, replPortClassName)»{
+ for (std::vector<etRuntime::InterfaceItemBase*>::iterator it = getItems().begin(); it != getItems().end(); ++it) {
+ (dynamic_cast<«portClassName»*>(*it))->«messageCall(m)»;
+ }
+ }
+ «ENDFOR»
+ «ENDIF»
+ '''
}
-
-
+ def private generateConstructorInitalizerList(PortClass pc, String index) {
+ val List<CharSequence> initList = newArrayList
+ initList += '''PortBase(actor, name, localId, «index»)'''
+ if(pc != null)
+ initList += pc.attributes.map[attributeInitialization(false)]
- def private messageCall(Message m) {
- '''«m.name»(«IF m.data!=null» «m.data.name»«ENDIF»)'''
+ return initList.join(','+NEWLINE)
}
-
-
- def private generateDebugHelpersImplementation(Root root, ProtocolClass pc){'''
-
-««« TODO: make this optional or different for smaller footprint
- /* message names as strings for debugging (generate MSC) */
- std::string «pc.name»::s_messageStrings[]
- = {"MIN",
- «FOR m : pc.getAllOutgoingMessages()»
- "«m.name»",
- «ENDFOR»
- «FOR m : pc.getAllIncomingMessages()»
- "«m.name»",
- «ENDFOR»
- "MAX"};
-
- std::string «pc.name»::getMessageString(int msg_id) {
- if ((MSG_MIN < msg_id ) && ( msg_id < MSG_MAX )) {
- return s_messageStrings[msg_id];
- } else {
- // id out of range
- return "Message ID out of range";
- }
- }
-
- '''
+ def protected messageCall(Message m) {
+ '''«m.name»(«IF m.data!=null» «m.data.name»«ENDIF»)'''
}
-
- def messageSignature(Message m) {
- '''«IF m.priv»private:«ELSE»public:«ENDIF» void «m.name»(«IF m.data!=null»«m.data.refType.type.typeName» «m.data.name»«ENDIF»)'''
- }
- def messageSignatureExplicit(Message m) {
- var dc = (m.data.refType.type as DataClass)
- '''public: void «m.name»(«IF dc.base!=null»«dc.base.typeName» _super, «ENDIF»«FOR a : dc.attributes SEPARATOR ", "»«a.type.type.typeName»«IF a.size>1»[]«ENDIF» «a.name»«ENDFOR»)'''
+ def protected messageSignature(Message m) {
+ '''«IF m.priv»private:«ELSE»public:«ENDIF» void «m.name»(«IF m.data!=null»«m.data.refType.type.typeName» «m.data.name»«ENDIF»)'''
}
- def messageSignatureDefinition(Message m, String classPrefix) {
+ def protected messageSignatureDefinition(Message m, String classPrefix) {
'''void «classPrefix»::«m.name»(«IF m.data!=null»«m.data.refType.type.typeName» «m.data.name»«ENDIF»)'''
}
- def messageSignatureExplicitDefinition(Message m, String classPrefix) {
- var dc = (m.data.refType.type as DataClass)
- '''void «classPrefix»::«m.name»(«IF dc.base!=null»«dc.base.typeName» _super, «ENDIF»«FOR a : dc.attributes SEPARATOR ", "»«a.type.type.typeName»«IF a.size>1»[]«ENDIF» «a.name»«ENDFOR»)'''
- }
-
-// def messageCall(Message m) {
-// '''«m.name»(«IF m.data!=null» «m.data.name»«ENDIF»)'''
-// }
-
- def sendMessageDeclaration(Message m, boolean conj) {
- '''
- «messageSignature(m)»;
- «IF m.data!=null && m.data.refType.type instanceof DataClass»
- «messageSignatureExplicit(m)»;
- «ENDIF»
- '''
- }
-
- def sendMessage(Message m, String portClassName, String classPrefix, boolean conj) {
+ def protected sendMessage(Message m, String portClassName, String classPrefix, boolean conj) {
var dir = if (conj) "IN" else "OUT"
var hdlr = m.getSendHandler(conj)
+ val dataArg = if(m.data != null) ''', «IF m.data.refType.ref»«m.data.name»«ELSE»&«m.data.name», sizeof(«m.data.refType.type.typeName»)«ENDIF»'''
+ val message = '''new Message(getPeerAddress(), «portClassName»::«dir»_«m.name»«dataArg?:''»)'''
'''
«messageSignatureDefinition(m, classPrefix)» {
«IF hdlr!=null»
@@ -399,26 +369,148 @@ class ProtocolClassGen extends GenericProtocolClassGenerator {
«ENDFOR»
«ELSE»
DebuggingService::getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(),
- «portClassName»::getMessageString(«portClassName»::«dir»_«m.name»));
+ «portClassName»::getMessageString(«portClassName»::«dir»_«m.name»));
if (getPeerAddress().isValid()){
- «IF m.data==null»getPeerMsgReceiver()->receive(new Message(getPeerAddress(), «portClassName»::«dir»_«m.name»));
- «ELSE»getPeerMsgReceiver()->receive(new Message(getPeerAddress(),«portClassName»::«dir»_«m.name»,
- reinterpret_cast<void*>(«IF (!m.data.refType.ref && !(m.data.refType.type instanceof PrimitiveType))»&«ENDIF»«m.data.name»),
- sizeof(«m.data.refType.type.typeName»)));
- «ENDIF»
+ getPeerMsgReceiver()->receive(«message»);
}
«ENDIF»
}
-
- «IF m.data!=null && m.data.refType.type instanceof DataClass»
- «messageSignatureExplicitDefinition(m, classPrefix)» {
- «m.name»(«m.data.refType.type.name»(«IF (m.data.refType.type as DataClass).base!=null»_super, «ENDIF»«FOR a : (m.data.refType.type as DataClass).attributes SEPARATOR ", "»«a.name»«ENDFOR»));
- }
- «ENDIF»
'''
- //TODO derived data classes are not yet handled correctly
}
+
+ def protected generateDataDrivenHeaderFile(Root root, ProtocolClass pc) {
+ val sentMsgs = pc.allIncomingMessages.filter(m|m.data!=null)
+ val models = root.getReferencedModels(pc)
+ '''
+ /**
+ * @author generated by eTrice
+ *
+ * Header File of ProtocolClass «pc.name»
+ *
+ */
+
+ «generateIncludeGuardBegin(pc.name)»
+
+ #include "etDatatypes.h"
+ #include "common/modelbase/DataPort.h"
+ «FOR dataClass : root.getReferencedDataClasses(pc)»
+ #include "«dataClass.path»«dataClass.name».h"
+ «ENDFOR»
+
+ «pc.userCode(1)»
+
+««« «FOR model : models»
+««« import «model.name».*;
+««« «ENDFOR»
+
+ class «pc.name» {
+
+ «pc.userCode(2)»
+
+ };
+
+ // send port holds data
+ class «pc.getPortClassName(true)» : public etRuntime::DataSendPort {
+
+ public:
+ «pc.getPortClassName(true)»(etRuntime::IRTObject* parent, const std::string& name, int localId);
+
+ // getters and setters
+ «FOR msg : sentMsgs»
+ void «msg.name»(«msg.data.refType.type.typeName» «msg.name») {
+ m_«msg.name» = «msg.name»;
+ }
+ «msg.data.refType.type.typeName» «msg.name»() const {
+ return m_«msg.name»;
+ }
+ «ENDFOR»
+
+ private:
+ «FOR msg : sentMsgs»
+ «msg.data.refType.type.typeName» m_«msg.name»;
+ «ENDFOR»
+ };
+
+ // receive port accesses send port
+ class «pc.getPortClassName(false)» : public etRuntime::DataReceivePort {
+
+ public:
+ «pc.getPortClassName(false)»(etRuntime::IRTObject* parent, const std::string& name, int localId);
+
+ // getters
+ «FOR msg : sentMsgs»
+ «msg.data.refType.type.typeName» «msg.name»() const;
+ «ENDFOR»
+
+ protected:
+ virtual void connect(etRuntime::DataSendPort* dataSendPort);
+
+ private:
+ «pc.getPortClassName(true)»* m_peer;
+
+ };
+
+ «generateIncludeGuardEnd(pc.name)»
+ '''
+ }
+
+ def protected generateDataDrivenSourceFile(Root root, ProtocolClass pc) {
+ val sentMsgs = pc.allIncomingMessages.filter(m|m.data!=null)
+ val models = root.getReferencedModels(pc)
+ '''
+ /**
+ * @author generated by eTrice
+ *
+ * Source File of ProtocolClass «pc.name»
+ *
+ */
+
+ #include "«pc.getCppHeaderFileName»"
+
+ using namespace etRuntime;
+
+ «pc.userCode(3)»
+
+««« «FOR model : models»
+««« import «model.name».*;
+««« «ENDFOR»
+ // send port holds data
+
+ // constructor
+ «pc.getPortClassName(true)»::«pc.getPortClassName(true)»(IRTObject* parent, const std::string& name, int localId) :
+ DataSendPort(parent, name, localId)
+ {
+ }
+
+ // receive port accesses send port
+
+ // constructor
+ «pc.getPortClassName(false)»::«pc.getPortClassName(false)»(IRTObject* parent, const std::string& name, int localId) :
+ DataReceivePort(parent, name, localId),
+ m_peer(0)
+ {
+
+ }
+
+ // getters
+ «FOR msg : sentMsgs»
+ «msg.data.refType.type.typeName» «pc.getPortClassName(false)»::«msg.name»() const {
+ // TODO needs default value
+ //if (m_peer == 0)
+ /* return «msg.data.refType.type.defaultValue»; */
+ return m_peer->«msg.name»();
+ }
+ «ENDFOR»
+
+ void «pc.getPortClassName(false)»::connect(DataSendPort* dataSendPort) {
+ «pc.getPortClassName(true)»* peer = dynamic_cast<«pc.getPortClassName(true)»*>(dataSendPort);
+ if (peer != 0)
+ m_peer = peer;
+ }
+ '''
+ }
+
override getMessageID(Message msg, InterfaceItem item) {
if (item instanceof Port) {
var p = item as Port;
@@ -436,8 +528,8 @@ class ProtocolClassGen extends GenericProtocolClassGenerator {
return "unknown interface item";
}
-
- def String enumInUse(String namespace, String member) {
+
+ def protected String enumInUse(String namespace, String member) {
return namespace+"::"+member
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/StateMachineGen.xtend b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/StateMachineGen.xtend
index f8a84c8ca..de45d9c2c 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/StateMachineGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/StateMachineGen.xtend
@@ -4,86 +4,85 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* CONTRIBUTORS:
* Henrik Rentz-Reichert (initial contribution)
* Peter Karlitschek
- *
+ *
*******************************************************************************/
package org.eclipse.etrice.generator.cpp.gen
import com.google.inject.Inject
import com.google.inject.Singleton
-import java.util.ArrayList
import org.eclipse.etrice.core.genmodel.fsm.fsmgen.ExpandedModelComponent
-import org.eclipse.etrice.core.room.ActorClass
import org.eclipse.etrice.generator.generic.GenericStateMachineGenerator
import org.eclipse.etrice.generator.generic.RoomExtensions
-import org.eclipse.xtext.util.Pair
+import org.eclipse.etrice.generator.cpp.Main
+import org.eclipse.etrice.core.room.ActorClass
-import static org.eclipse.xtext.util.Tuples.*
-/**
- * @author Peter Karlitschek
- *
- */
@Singleton
class StateMachineGen extends GenericStateMachineGenerator {
-
+
@Inject extension RoomExtensions
- @Inject ProtocolClassGen cppProtGen
-
- override genExtraDecl(ExpandedModelComponent xpac) {
-// val ac = xpac.actorClass
- '''
- protected:
- static std::string s_stateStrings[];
- static const int s_numberOfStates;
-
- private:
- void setState(int new_state);
- '''}
-
- override genExtra(ExpandedModelComponent xpac) {
- val ac = xpac.modelComponent as ActorClass
- '''
- std::string «ac.name»::s_stateStrings[] = {"<no state>","<top>",«FOR state : ac.getAllBaseStatesLeavesLast() SEPARATOR ","»"«state.genStatePathName»"
- «ENDFOR»};
- const int «ac.name»::s_numberOfStates = «ac.getAllBaseStatesLeavesLast().size + 2»;
-
- void «ac.name»::setState(int new_state) {
- DebuggingService::getInstance().addActorState(*this, s_stateStrings[new_state]);
- if (s_stateStrings[new_state]!="Idle") {
-««« TODOTS: model switch for activation
- std::cout << getInstancePath() << " -> " << s_stateStrings[new_state] << std::endl;
- }
- m_state = new_state;
- }
- '''}
-
- override genTriggerConstants(ExpandedModelComponent xpac) {
- val triggers = if (langExt.usesInheritance)
- xpac.getOwnTriggers() else xpac.triggers
- val list = new ArrayList<Pair<String, String>>()
- list.add(pair("POLLING", "0"));
- for (mif : triggers) {
- list.add(pair(xpac.getTriggerCodeName(mif), "IFITEM_"+mif.from.name+" + EVT_SHIFT*"+cppProtGen.getMessageID(mif)))
+ override genExtra(ExpandedModelComponent xpac, boolean generateImplementation) {
+ val states = newArrayList
+ var ac = xpac.modelComponent
+ val clsName = xpac.modelComponent.componentName
+
+// it is crucial that we obey the order that is used for state IDs
+// that means we have to collect base classes first and each base class list with leaf states last
+ while (ac!=null) {
+ states.addAll(0, ac.allBaseStates.leafStatesLast)
+ ac = ac.base
}
-
- return langExt.genEnumeration("triggers", list)
+ if(generateImplementation)
+ '''
+ «IF Main::settings.generateMSCInstrumentation || Main::settings.generateWithVerboseOutput»
+ // state names
+ const std::string «clsName»::s_stateStrings[] = {
+ "<no state>",
+ "<top>",
+ «FOR state : states SEPARATOR ","»
+ "«state.genStatePathName»"
+ «ENDFOR»
+ };
+ «ENDIF»
+ const int «clsName»::s_numberOfStates = «2+states.size»;
+
+ void «clsName»::setState(int new_state) {
+ «IF Main::settings.generateMSCInstrumentation»
+ DebuggingService::getInstance().addActorState(*this, s_stateStrings[new_state]);
+ «ENDIF»
+ «IF Main::settings.generateWithVerboseOutput»
+ if (s_stateStrings[new_state] != "Idle") {
+ std::cout << getInstancePath() << " -> " << s_stateStrings[new_state] << std::endl;
+ }
+ «ENDIF»
+ m_state = new_state;
+ }
+ '''
+ else
+ '''
+ «IF Main::settings.generateMSCInstrumentation || Main::settings.generateWithVerboseOutput»
+ static const std::string s_stateStrings[];
+ «ENDIF»
+ static const int s_numberOfStates;
+
+ int history[«2+states.size»];
+
+ void setState(int new_state);
+ '''
}
-
- override constPointer(String classname) {
- return "const " + classname + "*"
+
+ override public stateType() {
+ "etInt16"
}
-
+
override boolType() {
- return "bool"
+ "etBool"
}
-
-
-
}
diff --git a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/SubSystemClassGen.xtend b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/SubSystemClassGen.xtend
deleted file mode 100644
index c2944db1a..000000000
--- a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/SubSystemClassGen.xtend
+++ /dev/null
@@ -1,302 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Draeger Medical GmbH (http://www.draeger.com).
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * CONTRIBUTORS:
- * Peter Karlitschek (initial contribution)
- *
- *******************************************************************************/
-
-package org.eclipse.etrice.generator.cpp.gen
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import org.eclipse.etrice.core.genmodel.fsm.base.ILogger
-import org.eclipse.etrice.core.genmodel.etricegen.ActorInstance
-import org.eclipse.etrice.core.genmodel.etricegen.Root
-import org.eclipse.etrice.core.genmodel.etricegen.SubSystemInstance
-import org.eclipse.etrice.core.room.SubSystemClass
-import org.eclipse.etrice.generator.generic.ProcedureHelpers
-import org.eclipse.etrice.generator.generic.RoomExtensions
-import org.eclipse.xtext.generator.JavaIoFileSystemAccess
-
-import static extension org.eclipse.etrice.generator.fsm.base.Indexed.*
-import org.eclipse.etrice.generator.base.IDataConfiguration
-
-/**
- * @author Peter Karlitschek
- *
- */
-@Singleton
-class SubSystemClassGen {
-
- @Inject JavaIoFileSystemAccess fileAccess
- @Inject extension CppExtensions
- @Inject extension RoomExtensions
- @Inject extension ProcedureHelpers
- @Inject IDataConfiguration dataConfigExt
- @Inject ConfigGenAddon configGenAddon
- @Inject ConfigGenAddon configAddon
- @Inject ILogger logger
-
- def doGenerate(Root root) {
- for (ssi: root.subSystemInstances) {
- var path = ssi.subSystemClass.generationTargetPath+ssi.subSystemClass.getPath
- var file = ssi.subSystemClass.getCppHeaderFileName
- logger.logInfo("generating SubSystemClass declaration: '"+file+"' in '"+path+"'")
- fileAccess.setOutputPath(path)
- fileAccess.generateFile(file, root.generateHeaderFile(ssi, ssi.subSystemClass))
-
- file = ssi.subSystemClass.getCppSourceFileName
- logger.logInfo("generating SubSystemClass implementation: '"+file+"' in '"+path+"'")
- fileAccess.setOutputPath(path)
- fileAccess.generateFile(file, root.generateSourceFile(ssi, ssi.subSystemClass))
-
-// file = ssi.subSystemClass.getInstSourceFileName
-// logger.logInfo("generating SubSystemClass instance file: '"+file+"' in '"+path+"'")
-// fileAccess.setOutputPath(path)
-// fileAccess.generateFile(file, root.generateInstanceFile(ssi, ssi.subSystemClass))
-//
-// file = ssi.subSystemClass.getDispSourceFileName
-// logger.logInfo("generating SubSystemClass dispatcher file: '"+file+"' in '"+path+"'")
-// fileAccess.setOutputPath(path)
-// fileAccess.generateFile(file, root.generateDispatcherFile(ssi, ssi.subSystemClass))
- }
- }
-
- def generateHeaderFile(Root root, SubSystemInstance comp, SubSystemClass cc) {'''
-
- /**
- * @author generated by eTrice
- *
- * Header File of SubSystemClass «cc.name»
- *
- */
-
- «generateIncludeGuardBegin(cc.name)»
-
- #include "platforms/generic/etDatatypes.h"
- #include "common/messaging/IRTObject.h"
- #include "common/modelbase/PortBase.h"
- #include "common/modelbase/InterfaceItemBase.h"
- #include "common/modelbase/ActorClassBase.h"
- #include "common/modelbase/SubSystemClassBase.h"
- #include "common/messaging/Address.h"
- #include "common/messaging/IMessageReceiver.h"
- #include "common/debugging/DebuggingService.h"
- #include <string>
- #include <vector>
-
- «FOR model : root.getReferencedModels(cc)»
-««« #include "«model.name».h"
- «ENDFOR»
-
-
- «cc.userCode(1, false)»
-
- class «cc.name» : public etRuntime::SubSystemClassBase{
-
- «cc.userCode(2, false)»
-
- public:
- «cc.name»(IRTObject* parent, std::string name)
- : etRuntime::SubSystemClassBase(parent, name)
- {
- }
-
- virtual void receiveEvent(etRuntime::InterfaceItemBase* ifitem, int evt, void* data);
- virtual void instantiateMessageServices();
- virtual void instantiateActors();
-
- private:
- std::vector<etRuntime::MessageService*> m_msgServices;
- };
-
- «generateIncludeGuardEnd(cc.name)»
- '''
- }
-
- def generateSourceFile(Root root, SubSystemInstance comp, SubSystemClass cc) {'''
-
- /**
- * @author generated by eTrice
- *
- * Source File of SubsystemClass «cc.name»
- *
- */
-
- #include "«cc.getCppHeaderFileName»"
- #include "common/debugging/DebuggingService.h"
- #include "common/messaging/RTSystemServicesProtocol.h"
- «FOR ai : comp.allContainedInstances»
- #include "«ai.actorClass.path»«ai.actorClass.name».h"
- «ENDFOR»
- #include <iostream>
-
- using namespace etRuntime;
-
- void «cc.name»::receiveEvent(InterfaceItemBase* ifitem, int evt, void* data){
- }
-
- void «cc.name»::instantiateMessageServices(){
-
- m_msgServices.push_back( new MessageService(this, Address(0, 0, 0),"MessageService_Main") );
- «FOR thread : cc.threads»
- m_msgServices.push_back(new MessageService(this, Address(0, «cc.threads.indexOf(thread)+1», 0),"MessageService_«thread.name»", /* threadprio */ 0));
- «ENDFOR»
- for (std::vector<MessageService*>::iterator it=m_msgServices.begin(); it != m_msgServices.end(); ++it) {
- RTServices::getInstance().getMsgSvcCtrl().addMsgSvc( *(*it));
- }
- }
-
- void «cc.name»::instantiateActors(){
- // all addresses
- // Addresses for the Subsystem Systemport
- «FOR ai : comp.allContainedInstances.indexed(comp.maxObjId)»
- Address addr_item_SystemPort_«comp.allContainedInstances.indexOf(ai.value)»(0,0,«ai.index1»);
- «ENDFOR»
-
- «FOR ai : comp.allContainedInstances»
- // actor instance «ai.path» itself => Systemport Address
- // TODOTJ: For each Actor, multiple addresses should be generated (actor?, systemport, debugport)
- Address addr_item_«ai.path.getPathName()»(0,«ai.threadId»,«ai.objId»);
- // interface items of «ai.path»
- «FOR pi : ai.orderedIfItemInstances»
- «IF pi.replicated»
- «FOR peer : pi.peers»
- «var i = pi.peers.indexOf(peer)»
- Address addr_item_«pi.path.getPathName()»_«i»(0,«pi.threadId»,«pi.objId+i»);
- «ENDFOR»
- «ELSE»
- Address addr_item_«pi.path.getPathName()»(0,«ai.threadId»,«pi.objId»);
- «ENDIF»
- «ENDFOR»
- «ENDFOR»
-
- // instantiate all actor instances
- m_instances.reserve(«comp.allContainedInstances.size»);
- «FOR ai : comp.allContainedInstances»
- //----------------------------------------------------------------------------------------------
- // addresses for actor instance: «ai.name»
- //----------------------------------------------------------------------------------------------
- «generateOwnInterfaceItemAddresses(ai)»
- «generatePeerInterfaceItemAddresses(ai, comp)»
-
- m_instances[«comp.allContainedInstances.indexOf(ai)»] = new «ai.actorClass.name»(
- «IF ai.eContainer instanceof SubSystemInstance»
- this,
- «ELSE»
- m_instances[«comp.allContainedInstances.indexOf(ai.eContainer)»],
- «ENDIF»
- "«ai.name»",
- «ai.name»_ownInterfaceItemAddresses,
- «ai.name»_peerInterfaceItemAddresses
- );
- «ENDFOR»
-
-««« // apply instance attribute configurations
-««« «FOR ai : comp.allContainedInstances»
-««« «IF !(ai.configAttributes.empty && ai.getConfigPorts.empty)»
-««« {
-««« «ai.actorClass.name» inst = («ai.actorClass.name») instances[«comp.allContainedInstances.indexOf(ai)»];
-««« «configAddon.applyInstanceConfig("inst", ai.actorClass.name, ai.configAttributes)»
-««« «FOR portConfig : ai.configPorts»
-««« «configAddon.applyInstanceConfig(("inst."+portConfig.item.name.invokeGetter(ai.actorClass.name)), portConfig.item.portClassName, portConfig.attributes)»
-««« «ENDFOR»
-««« }
-««« «ENDIF»
-««« «ENDFOR»
-
- // apply instance attribute configurations
- «FOR ai: comp.allContainedInstances»
- «val cfg = configGenAddon.genActorInstanceConfig(ai, "inst")»
- «IF cfg.length>0»
- {
- «ai.actorClass.name» inst = («ai.actorClass.name») instances[«comp.allContainedInstances.indexOf(ai)»];
- «cfg»
- }
- «ENDIF»
- «ENDFOR»
-
- //----------------------------------------------------------------------------------------------
- // addresses for the subsystem system port
- //----------------------------------------------------------------------------------------------
-
- std::vector<Address> ownAddresses(«comp.allContainedInstances.size»);
- «FOR ai : comp.allContainedInstances»
- ownAddresses[«comp.allContainedInstances.indexOf(ai)»] = addr_item_SystemPort_«comp.allContainedInstances.indexOf(ai)»;
- «ENDFOR»
- std::vector<Address> peerAddresses(«comp.allContainedInstances.size»);
- «FOR ai : comp.allContainedInstances»
- peerAddresses[«comp.allContainedInstances.indexOf(ai)»] = addr_item_«ai.path.getPathName()»;
- «ENDFOR»
-
-
- // create the subsystem system port
- m_RTSystemPort = new RTSystemServicesProtocolConjPortRepl(*this, this, "RTSystemPort",
- 0, //local ID
- ownAddresses,
- peerAddresses);
-
- }
-
-
- '''
- }
- def generateOwnInterfaceItemAddresses(ActorInstance ai) '''
- std::vector<std::vector<Address> > «ai.name»_ownInterfaceItemAddresses;
-
- std::vector<Address> «ai.name»_actorInstanceAddresses(1);
- «ai.name»_actorInstanceAddresses[0] = addr_item_«ai.path.getPathName()»;
-
- «ai.name»_ownInterfaceItemAddresses.push_back(«ai.name»_actorInstanceAddresses);
- «FOR pi : ai.orderedIfItemInstances»
- «IF pi.replicated»
- «IF pi.peers.empty»
- std::vector<Address> «ai.name»_«pi.name»Addresses;
- «ELSE»
- std::vector<Address> «ai.name»_«pi.name»Addresses(«pi.peers.size»);
- «FOR peer : pi.peers»
- «ai.name»_«pi.name»Addresses[«pi.peers.indexOf(peer)»] = addr_item_«pi.path.getPathName()»_«pi.peers.indexOf(peer)»;
- «ENDFOR»
- «ENDIF»
- «ELSE»
- std::vector<Address> «ai.name»_«pi.name»Addresses(1);
- «ai.name»_«pi.name»Addresses[0] = addr_item_«pi.path.getPathName()»;
- «ENDIF»
- «ai.name»_ownInterfaceItemAddresses.push_back(«ai.name»_«pi.name»Addresses);
-
- «ENDFOR»
- '''
-
- def generatePeerInterfaceItemAddresses(ActorInstance ai, SubSystemInstance comp) '''
- std::vector<std::vector<Address> > «ai.name»_peerInterfaceItemAddresses;
-
- std::vector<Address> «ai.name»_systemPortAddresses(1);
- «ai.name»_systemPortAddresses[0] = addr_item_SystemPort_«comp.allContainedInstances.indexOf(ai)»;
-
- «ai.name»_peerInterfaceItemAddresses.push_back(«ai.name»_systemPortAddresses);
- «FOR pi : ai.orderedIfItemInstances »
- «IF pi.replicated && pi.peers.isEmpty»
- «ELSE»
- «IF pi.peers.empty»
- std::vector<Address> «ai.name»_«pi.name»PeerAddresses;
- «ELSE»
- std::vector<Address> «ai.name»_«pi.name»PeerAddresses(«pi.peers.size»);
- «FOR pp : pi.peers»
- «IF pp.replicated»
- «ai.name»_«pi.name»PeerAddresses[«pi.peers.indexOf(pp)»] = addr_item_«pp.path.getPathName()»_«pp.peers.indexOf(pi)»;
- «ELSE»
- «ai.name»_«pi.name»PeerAddresses[«pi.peers.indexOf(pp)»] = addr_item_«pp.path.getPathName()»;
- «ENDIF»
- «ENDFOR»
- «ENDIF»
- «ai.name»_peerInterfaceItemAddresses.push_back(«ai.name»_«pi.name»PeerAddresses);
- «ENDIF»
- «ENDFOR»
- '''
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/SubSystemRunnerGen.xtend b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/SubSystemRunnerGen.xtend
deleted file mode 100644
index 18f9c60a7..000000000
--- a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/SubSystemRunnerGen.xtend
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Draeger Medical GmbH (http://www.draeger.com).
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * CONTRIBUTORS:
- * Peter Karlitschek (initial contribution)
- *
- *******************************************************************************/
-package org.eclipse.etrice.generator.cpp.gen
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import org.eclipse.etrice.core.room.SubSystemClass
-import org.eclipse.etrice.core.genmodel.etricegen.Root
-import org.eclipse.etrice.core.genmodel.etricegen.SubSystemInstance
-import org.eclipse.xtext.generator.JavaIoFileSystemAccess
-import org.eclipse.etrice.generator.generic.RoomExtensions
-
-/**
- * @author Peter Karlitschek
- *
- */
-@Singleton
-class SubSystemRunnerGen {
-
- @Inject extension JavaIoFileSystemAccess fileAccess
- @Inject extension CppExtensions
- @Inject extension RoomExtensions roomExt
-
- def doGenerate(Root root) {
- for (sc: root.subSystemInstances) {
- fileAccess.setOutputPath(sc.subSystemClass.generationTargetPath+sc.subSystemClass.getPath)
- fileAccess.generateFile( sc.subSystemClass.name+"_Runner.h", root.generateHeaderFile(sc, sc.subSystemClass))
-
- fileAccess.setOutputPath(sc.subSystemClass.generationTargetPath+sc.subSystemClass.getPath)
- fileAccess.generateFile( sc.subSystemClass.name+"_Runner.cpp", root.generateSourceFile(sc, sc.subSystemClass))
- }
- }
-
- def generateHeaderFile(Root root, SubSystemInstance ssc, SubSystemClass cc) {'''
- /**
- * @author generated by eTrice
- *
- * this class contains the main function running component «cc.name»
- * it instantiates «cc.name» and starts and ends the lifecycle
- */
-
- «generateIncludeGuardBegin(cc.name+"_Runner")»
-
- #include "common/modelbase/SubSystemRunnerBase.h"
-
- class «cc.name+"Runner"» :public etRuntime::SubSystemRunnerBase {
-
- };
-
- «generateIncludeGuardEnd(cc.name+"_Runner")»
- '''
- }
-
- def generateSourceFile(Root root, SubSystemInstance ssi, SubSystemClass ssc) {'''
- /**
- * @author generated by eTrice
- *
- * this class contains the main function running component «ssc.name»
- * it instantiates «ssc.name» and starts and ends the lifecycle
- */
-
-
- #include "«ssc.name».h"
- #include "«ssc.name»_Runner.h"
-
- #include <iostream>
-
-
- /**
- * main function
- * creates component and starts and stops the lifecycle
- */
-
-
- int main(int argc, char* argv[]) {
- «ssc.name» mainComponent(0, "«ssc.name»");
- «ssc.name+"Runner"»::run(mainComponent, argc, argv);
- return 0;
- }
-
-
- '''
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/setup/GeneratorModule.java b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/setup/GeneratorModule.java
index f286a7157..2c92ef8ca 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/setup/GeneratorModule.java
+++ b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/setup/GeneratorModule.java
@@ -4,10 +4,10 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* CONTRIBUTORS:
* Henrik Rentz-Reichert (initial contribution)
- *
+ *
*******************************************************************************/
package org.eclipse.etrice.generator.cpp.setup;
@@ -15,13 +15,15 @@ package org.eclipse.etrice.generator.cpp.setup;
import org.eclipse.etrice.core.common.scoping.ModelLocatorUriResolver;
import org.eclipse.etrice.generator.base.AbstractGenerator;
import org.eclipse.etrice.generator.base.AbstractGeneratorBaseModule;
-import org.eclipse.etrice.generator.base.GlobalGeneratorSettings;
import org.eclipse.etrice.generator.base.IDataConfiguration;
import org.eclipse.etrice.generator.base.ITranslationProvider;
import org.eclipse.etrice.generator.cpp.Main;
+import org.eclipse.etrice.generator.cpp.gen.ActorClassGen;
import org.eclipse.etrice.generator.cpp.gen.CppExtensions;
import org.eclipse.etrice.generator.cpp.gen.CppTranslationProvider;
-import org.eclipse.etrice.generator.cpp.gen.GeneratorSettings;
+import org.eclipse.etrice.generator.cpp.gen.ProtocolClassGen;
+import org.eclipse.etrice.generator.generic.GenericActorClassGenerator;
+import org.eclipse.etrice.generator.generic.GenericProtocolClassGenerator;
import org.eclipse.etrice.generator.generic.ILanguageExtension;
import org.eclipse.xtext.scoping.impl.ImportUriResolver;
@@ -32,12 +34,12 @@ public class GeneratorModule extends AbstractGeneratorBaseModule {
// @Override
public void configure(Binder binder) {
super.configure(binder);
-
+
binder.bind(AbstractGenerator.class).to(Main.class);
+ binder.bind(GenericProtocolClassGenerator.class).to(ProtocolClassGen.class);
+ binder.bind(GenericActorClassGenerator.class).to(ActorClassGen.class);
binder.bind(ImportUriResolver.class).to(ModelLocatorUriResolver.class);
-
- binder.bind(GlobalGeneratorSettings.class).to(GeneratorSettings.class);
}
public Class<? extends ILanguageExtension> bindILanguageExtension() {
diff --git a/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/ActorClassGen.java b/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/ActorClassGen.java
index 9f4550dec..5ffc61237 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/ActorClassGen.java
+++ b/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/ActorClassGen.java
@@ -11,48 +11,55 @@
package org.eclipse.etrice.generator.cpp.gen;
import com.google.common.base.Objects;
+import com.google.common.collect.Iterables;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import org.eclipse.emf.common.util.EList;
import org.eclipse.etrice.core.fsm.fSM.ComponentCommunicationType;
+import org.eclipse.etrice.core.fsm.fSM.StateGraph;
+import org.eclipse.etrice.core.genmodel.builder.GenmodelConstants;
import org.eclipse.etrice.core.genmodel.etricegen.ExpandedActorClass;
import org.eclipse.etrice.core.genmodel.etricegen.Root;
-import org.eclipse.etrice.core.genmodel.fsm.base.ILogger;
+import org.eclipse.etrice.core.genmodel.etricegen.Wire;
+import org.eclipse.etrice.core.genmodel.etricegen.WiredActorClass;
+import org.eclipse.etrice.core.genmodel.etricegen.WiredStructureClass;
import org.eclipse.etrice.core.room.ActorClass;
+import org.eclipse.etrice.core.room.ActorRef;
import org.eclipse.etrice.core.room.Attribute;
import org.eclipse.etrice.core.room.DataClass;
import org.eclipse.etrice.core.room.Port;
import org.eclipse.etrice.core.room.ProtocolClass;
-import org.eclipse.etrice.core.room.RoomModel;
import org.eclipse.etrice.core.room.SAP;
import org.eclipse.etrice.core.room.SPP;
import org.eclipse.etrice.core.room.ServiceImplementation;
import org.eclipse.etrice.core.room.StandardOperation;
+import org.eclipse.etrice.generator.base.GlobalGeneratorSettings;
import org.eclipse.etrice.generator.cpp.Main;
import org.eclipse.etrice.generator.cpp.gen.CppExtensions;
-import org.eclipse.etrice.generator.cpp.gen.GeneratorSettings;
import org.eclipse.etrice.generator.cpp.gen.Initialization;
import org.eclipse.etrice.generator.cpp.gen.StateMachineGen;
+import org.eclipse.etrice.generator.fsm.base.FileSystemHelpers;
+import org.eclipse.etrice.generator.fsm.base.IGeneratorFileIo;
import org.eclipse.etrice.generator.generic.GenericActorClassGenerator;
import org.eclipse.etrice.generator.generic.ProcedureHelpers;
import org.eclipse.etrice.generator.generic.RoomExtensions;
+import org.eclipse.etrice.generator.generic.TypeHelpers;
import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.generator.JavaIoFileSystemAccess;
+import org.eclipse.xtext.xbase.lib.CollectionLiterals;
import org.eclipse.xtext.xbase.lib.Extension;
import org.eclipse.xtext.xbase.lib.Functions.Function1;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
import org.eclipse.xtext.xbase.lib.ListExtensions;
+import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
-/**
- * @author Peter Karlitschek
- */
@Singleton
@SuppressWarnings("all")
public class ActorClassGen extends GenericActorClassGenerator {
@Inject
- private JavaIoFileSystemAccess fileAccess;
+ private IGeneratorFileIo fileIO;
@Inject
@Extension
@@ -64,547 +71,506 @@ public class ActorClassGen extends GenericActorClassGenerator {
@Inject
@Extension
- private Initialization _initialization;
+ private ProcedureHelpers _procedureHelpers;
@Inject
@Extension
- private ProcedureHelpers _procedureHelpers;
+ private Initialization _initialization;
@Inject
@Extension
private StateMachineGen _stateMachineGen;
@Inject
- private ILogger logger;
+ @Extension
+ private TypeHelpers _typeHelpers;
+
+ @Inject
+ @Extension
+ private FileSystemHelpers _fileSystemHelpers;
public void doGenerate(final Root root) {
+ final Map<ActorClass, WiredActorClass> ac2wired = CollectionLiterals.<ActorClass, WiredActorClass>newHashMap();
+ EList<WiredStructureClass> _wiredInstances = root.getWiredInstances();
+ Iterable<WiredActorClass> _filter = Iterables.<WiredActorClass>filter(_wiredInstances, WiredActorClass.class);
+ final Procedure1<WiredActorClass> _function = new Procedure1<WiredActorClass>() {
+ public void apply(final WiredActorClass it) {
+ ActorClass _actorClass = it.getActorClass();
+ ac2wired.put(_actorClass, it);
+ }
+ };
+ IterableExtensions.<WiredActorClass>forEach(_filter, _function);
EList<ExpandedActorClass> _xpActorClasses = root.getXpActorClasses();
- for (final ExpandedActorClass xpac : _xpActorClasses) {
+ final Function1<ExpandedActorClass, Boolean> _function_1 = new Function1<ExpandedActorClass, Boolean>() {
+ public Boolean apply(final ExpandedActorClass cl) {
+ ActorClass _actorClass = cl.getActorClass();
+ return Boolean.valueOf(ActorClassGen.this._fileSystemHelpers.isValidGenerationLocation(_actorClass));
+ }
+ };
+ Iterable<ExpandedActorClass> _filter_1 = IterableExtensions.<ExpandedActorClass>filter(_xpActorClasses, _function_1);
+ for (final ExpandedActorClass xpac : _filter_1) {
{
ActorClass _actorClass = xpac.getActorClass();
- String _generationTargetPath = this._roomExtensions.getGenerationTargetPath(_actorClass);
+ final WiredActorClass wired = ac2wired.get(_actorClass);
ActorClass _actorClass_1 = xpac.getActorClass();
- String _path = this._roomExtensions.getPath(_actorClass_1);
- String path = (_generationTargetPath + _path);
+ final boolean manualBehavior = this._roomHelpers.isBehaviorAnnotationPresent(_actorClass_1, "BehaviorManual");
ActorClass _actorClass_2 = xpac.getActorClass();
- String _cppHeaderFileName = this._cppExtensions.getCppHeaderFileName(_actorClass_2);
- String _plus = ("generating ActorClass header \'" + _cppHeaderFileName);
- String _plus_1 = (_plus + "\' in \'");
- String _plus_2 = (_plus_1 + path);
- String _plus_3 = (_plus_2 + "\'");
- this.logger.logInfo(_plus_3);
- this.fileAccess.setOutputPath(path);
+ String _generationTargetPath = this._roomExtensions.getGenerationTargetPath(_actorClass_2);
ActorClass _actorClass_3 = xpac.getActorClass();
- String _cppHeaderFileName_1 = this._cppExtensions.getCppHeaderFileName(_actorClass_3);
+ String _path = this._roomExtensions.getPath(_actorClass_3);
+ final String path = (_generationTargetPath + _path);
ActorClass _actorClass_4 = xpac.getActorClass();
- CharSequence _generateHeaderFile = this.generateHeaderFile(root, xpac, _actorClass_4);
- this.fileAccess.generateFile(_cppHeaderFileName_1, _generateHeaderFile);
+ String _generationInfoPath = this._roomExtensions.getGenerationInfoPath(_actorClass_4);
ActorClass _actorClass_5 = xpac.getActorClass();
- String _cppSourceFileName = this._cppExtensions.getCppSourceFileName(_actorClass_5);
- String _plus_4 = ("generating ActorClass source \'" + _cppSourceFileName);
- String _plus_5 = (_plus_4 + "\' in \'");
- String _plus_6 = (_plus_5 + path);
- String _plus_7 = (_plus_6 + "\'");
- this.logger.logInfo(_plus_7);
- this.fileAccess.setOutputPath(path);
+ String _path_1 = this._roomExtensions.getPath(_actorClass_5);
+ final String infopath = (_generationInfoPath + _path_1);
+ String _xifexpression = null;
+ if (manualBehavior) {
+ _xifexpression = "Abstract";
+ } else {
+ _xifexpression = "";
+ }
+ String file = _xifexpression;
ActorClass _actorClass_6 = xpac.getActorClass();
- String _cppSourceFileName_1 = this._cppExtensions.getCppSourceFileName(_actorClass_6);
+ String _cppHeaderFileName = this._cppExtensions.getCppHeaderFileName(_actorClass_6);
+ String _plus = (file + _cppHeaderFileName);
+ CharSequence _generateHeaderFile = this.generateHeaderFile(root, xpac, wired, manualBehavior);
+ this.fileIO.generateFile("generating ActorClass declaration", path, infopath, _plus, _generateHeaderFile);
ActorClass _actorClass_7 = xpac.getActorClass();
- CharSequence _generateSourceFile = this.generateSourceFile(root, xpac, _actorClass_7);
- this.fileAccess.generateFile(_cppSourceFileName_1, _generateSourceFile);
+ String _cppSourceFileName = this._cppExtensions.getCppSourceFileName(_actorClass_7);
+ String _plus_1 = (file + _cppSourceFileName);
+ CharSequence _generateSourceFile = this.generateSourceFile(root, xpac, wired, manualBehavior);
+ this.fileIO.generateFile("generating ActorClass implementation", path, infopath, _plus_1, _generateSourceFile);
}
}
}
- private CharSequence generateHeaderFile(final Root root, final ExpandedActorClass xpac, final ActorClass ac) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("\t");
- _builder.append("/**");
- _builder.newLine();
- _builder.append("\t ");
- _builder.append("* @author generated by eTrice");
- _builder.newLine();
- _builder.append("\t ");
- _builder.append("*");
- _builder.newLine();
- _builder.append("\t ");
- _builder.append("* Header File of ActorClass ");
- String _name = ac.getName();
- _builder.append(_name, "\t ");
- _builder.newLineIfNotEmpty();
- _builder.append("\t ");
- _builder.append("* ");
- _builder.newLine();
- _builder.append("\t ");
- _builder.append("*/");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- String _name_1 = ac.getName();
- CharSequence _generateIncludeGuardBegin = this._cppExtensions.generateIncludeGuardBegin(_name_1);
- _builder.append(_generateIncludeGuardBegin, "\t");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t");
- _builder.append("#include \"platforms/generic/etDatatypes.h\"");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("#include \"common/messaging/IRTObject.h\"");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("#include \"common/modelbase/PortBase.h\"");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("#include \"common/modelbase/InterfaceItemBase.h\"");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("#include \"common/modelbase/ActorClassBase.h\"");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("#include \"common/modelbase/SubSystemClassBase.h\"");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("#include \"common/messaging/Address.h\"");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("#include \"common/messaging/IMessageReceiver.h\"");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("#include \"common/debugging/DebuggingService.h\"");
- _builder.newLine();
+ private CharSequence generateHeaderFile(final Root root, final ExpandedActorClass xpac, final WiredActorClass wired, final boolean manualBehavior) {
+ CharSequence _xblockexpression = null;
{
- GeneratorSettings _settings = Main.getSettings();
- boolean _isUseEtUnit = _settings.isUseEtUnit();
- if (_isUseEtUnit) {
- _builder.append("\t");
- _builder.append("extern \"C\" {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("#include \"etUnit.h\"");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
+ final ActorClass ac = xpac.getActorClass();
+ String _xifexpression = null;
+ if (manualBehavior) {
+ String _name = ac.getName();
+ _xifexpression = ("Abstract" + _name);
+ } else {
+ _xifexpression = ac.getName();
}
- }
- _builder.append("\t");
- _builder.append("#include <string>");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("#include <vector>");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- {
- EList<RoomModel> _referencedModels = root.getReferencedModels(ac);
- for(final RoomModel model : _referencedModels) {
+ final String clsname = _xifexpression;
+ String _elvis = null;
+ ActorClass _actorBase = ac.getActorBase();
+ String _name_1 = null;
+ if (_actorBase!=null) {
+ _name_1=_actorBase.getName();
}
- }
- _builder.append("\t");
- _builder.newLine();
- {
- EList<ProtocolClass> _referencedProtocolClasses = root.getReferencedProtocolClasses(ac);
- for(final ProtocolClass pc : _referencedProtocolClasses) {
- _builder.append("\t");
- _builder.append("#include \"");
- String _path = this._roomExtensions.getPath(pc);
- _builder.append(_path, "\t");
- String _name_2 = pc.getName();
- _builder.append(_name_2, "\t");
- _builder.append(".h\"");
- _builder.newLineIfNotEmpty();
+ if (_name_1 != null) {
+ _elvis = _name_1;
+ } else {
+ _elvis = "etRuntime::ActorClassBase";
}
- }
- {
- EList<DataClass> _referencedDataClasses = root.getReferencedDataClasses(ac);
- for(final DataClass dc : _referencedDataClasses) {
- _builder.append("\t");
- _builder.append("#include \"");
- String _path_1 = this._roomExtensions.getPath(dc);
- _builder.append(_path_1, "\t");
- String _name_3 = dc.getName();
- _builder.append(_name_3, "\t");
- _builder.append(".h\"");
- _builder.newLineIfNotEmpty();
+ final String rtBaseClassName = _elvis;
+ StringConcatenation _builder = new StringConcatenation();
+ _builder.append("/**");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("* @author generated by eTrice");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("*");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("* Header File of ActorClass ");
+ _builder.append(clsname, " ");
+ _builder.newLineIfNotEmpty();
+ _builder.append(" ");
+ _builder.append("*");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("*/");
+ _builder.newLine();
+ _builder.newLine();
+ CharSequence _generateIncludeGuardBegin = this._cppExtensions.generateIncludeGuardBegin(clsname);
+ _builder.append(_generateIncludeGuardBegin, "");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("#include \"etDatatypes.h\"");
+ _builder.newLine();
+ _builder.append("#include \"common/messaging/IRTObject.h\"");
+ _builder.newLine();
+ _builder.append("#include \"common/modelbase/PortBase.h\"");
+ _builder.newLine();
+ _builder.append("#include \"common/modelbase/InterfaceItemBase.h\"");
+ _builder.newLine();
+ _builder.append("#include \"common/modelbase/ActorClassBase.h\"");
+ _builder.newLine();
+ _builder.append("#include \"common/modelbase/SubSystemClassBase.h\"");
+ _builder.newLine();
+ _builder.append("#include \"common/messaging/Address.h\"");
+ _builder.newLine();
+ _builder.append("#include \"common/messaging/IMessageReceiver.h\"");
+ _builder.newLine();
+ _builder.append("#include \"common/debugging/DebuggingService.h\"");
+ _builder.newLine();
+ _builder.append("#include <string>");
+ _builder.newLine();
+ _builder.append("#include <vector>");
+ _builder.newLine();
+ _builder.newLine();
+ {
+ EList<ProtocolClass> _referencedProtocolClasses = root.getReferencedProtocolClasses(ac);
+ for(final ProtocolClass pc : _referencedProtocolClasses) {
+ _builder.append("#include \"");
+ String _path = this._roomExtensions.getPath(pc);
+ _builder.append(_path, "");
+ String _name_2 = pc.getName();
+ _builder.append(_name_2, "");
+ _builder.append(".h\"");
+ _builder.newLineIfNotEmpty();
+ }
}
- }
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _userCode = this._procedureHelpers.userCode(ac, 1, true);
- _builder.append(_userCode, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("class ");
- String _name_4 = ac.getName();
- _builder.append(_name_4, "\t");
- _builder.append(" : public ");
- {
- ActorClass _actorBase = ac.getActorBase();
- boolean _notEquals = (!Objects.equal(_actorBase, null));
- if (_notEquals) {
- ActorClass _actorBase_1 = ac.getActorBase();
- String _name_5 = _actorBase_1.getName();
- _builder.append(_name_5, "\t");
- } else {
- _builder.append("etRuntime::ActorClassBase");
+ {
+ EList<DataClass> _referencedDataClasses = root.getReferencedDataClasses(ac);
+ for(final DataClass dc : _referencedDataClasses) {
+ _builder.append("#include \"");
+ String _path_1 = this._roomExtensions.getPath(dc);
+ _builder.append(_path_1, "");
+ String _name_3 = dc.getName();
+ _builder.append(_name_3, "");
+ _builder.append(".h\"");
+ _builder.newLineIfNotEmpty();
+ }
}
- }
- _builder.append(" {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("protected:");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("//--------------------- ports");
- _builder.newLine();
- _builder.append("\t\t\t");
- List<Port> _endPorts = this._roomHelpers.getEndPorts(ac);
- final Function1<Port, String> _function = new Function1<Port, String>() {
- public String apply(final Port port) {
- StringConcatenation _builder = new StringConcatenation();
- String _portClassName = ActorClassGen.this._roomExtensions.getPortClassName(port);
- _builder.append(_portClassName, "");
- _builder.append(" ");
- String _name = port.getName();
- _builder.append(_name, "");
- _builder.append(";");
- return _builder.toString();
+ _builder.newLine();
+ _builder.append("using namespace etRuntime; //TODO JH remove");
+ _builder.newLine();
+ _builder.newLine();
+ CharSequence _userCode = this._procedureHelpers.userCode(ac, 1, true);
+ _builder.append(_userCode, "");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("class ");
+ _builder.append(clsname, "");
+ _builder.append(" : public ");
+ _builder.append(rtBaseClassName, "");
+ _builder.append(" {");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("protected:");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("//--------------------- ports");
+ _builder.newLine();
+ {
+ List<Port> _endPorts = this._roomHelpers.getEndPorts(ac);
+ for(final Port ep : _endPorts) {
+ _builder.append("\t\t");
+ String _portClassName = this._roomExtensions.getPortClassName(ep);
+ _builder.append(_portClassName, "\t\t");
+ _builder.append(" ");
+ String _name_4 = ep.getName();
+ _builder.append(_name_4, "\t\t");
+ _builder.append(";");
+ _builder.newLineIfNotEmpty();
+ }
}
- };
- List<String> _map = ListExtensions.<Port, String>map(_endPorts, _function);
- String _join = IterableExtensions.join(_map, "\n");
- _builder.append(_join, "\t\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("//--------------------- saps");
- _builder.newLine();
- _builder.append("\t\t\t");
- EList<SAP> _serviceAccessPoints = ac.getServiceAccessPoints();
- final Function1<SAP, String> _function_1 = new Function1<SAP, String>() {
- public String apply(final SAP sap) {
- StringConcatenation _builder = new StringConcatenation();
- String _portClassName = ActorClassGen.this._roomExtensions.getPortClassName(sap);
- _builder.append(_portClassName, "");
- _builder.append(" ");
- String _name = sap.getName();
- _builder.append(_name, "");
- _builder.append(";");
- return _builder.toString();
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("//--------------------- saps");
+ _builder.newLine();
+ {
+ EList<SAP> _serviceAccessPoints = ac.getServiceAccessPoints();
+ for(final SAP sap : _serviceAccessPoints) {
+ _builder.append("\t\t");
+ String _portClassName_1 = this._roomExtensions.getPortClassName(sap);
+ _builder.append(_portClassName_1, "\t\t");
+ _builder.append(" ");
+ String _name_5 = sap.getName();
+ _builder.append(_name_5, "\t\t");
+ _builder.append(";");
+ _builder.newLineIfNotEmpty();
+ }
}
- };
- List<String> _map_1 = ListExtensions.<SAP, String>map(_serviceAccessPoints, _function_1);
- String _join_1 = IterableExtensions.join(_map_1, "\n");
- _builder.append(_join_1, "\t\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("//--------------------- services");
- _builder.newLine();
- _builder.append("\t\t\t");
- EList<ServiceImplementation> _serviceImplementations = ac.getServiceImplementations();
- final Function1<ServiceImplementation, String> _function_2 = new Function1<ServiceImplementation, String>() {
- public String apply(final ServiceImplementation svc) {
- StringConcatenation _builder = new StringConcatenation();
- String _portClassName = ActorClassGen.this._roomExtensions.getPortClassName(svc);
- _builder.append(_portClassName, "");
- _builder.append(" ");
- SPP _spp = svc.getSpp();
- String _name = _spp.getName();
- _builder.append(_name, "");
- _builder.append(";");
- return _builder.toString();
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("//--------------------- services");
+ _builder.newLine();
+ {
+ EList<ServiceImplementation> _serviceImplementations = ac.getServiceImplementations();
+ for(final ServiceImplementation svc : _serviceImplementations) {
+ _builder.append("\t\t");
+ String _portClassName_2 = this._roomExtensions.getPortClassName(svc);
+ _builder.append(_portClassName_2, "\t\t");
+ _builder.append(" ");
+ SPP _spp = svc.getSpp();
+ String _name_6 = _spp.getName();
+ _builder.append(_name_6, "\t\t");
+ _builder.append(";");
+ _builder.newLineIfNotEmpty();
+ }
}
- };
- List<String> _map_2 = ListExtensions.<ServiceImplementation, String>map(_serviceImplementations, _function_2);
- String _join_2 = IterableExtensions.join(_map_2, "\n");
- _builder.append(_join_2, "\t\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("//--------------------- interface item IDs");
- _builder.newLine();
- _builder.append("\t\t\t");
- String _genInterfaceItemConstants = this.genInterfaceItemConstants(xpac);
- _builder.append(_genInterfaceItemConstants, "\t\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t\t");
- _builder.newLine();
- _builder.append("\t\t\t");
- EList<Attribute> _attributes = ac.getAttributes();
- CharSequence _attributes_1 = this._procedureHelpers.attributes(_attributes);
- _builder.append(_attributes_1, "\t\t\t");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t\t\t");
- EList<StandardOperation> _operations = ac.getOperations();
- String _name_6 = ac.getName();
- CharSequence _operationsImplementation = this._procedureHelpers.operationsImplementation(_operations, _name_6);
- _builder.append(_operationsImplementation, "\t\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("public:");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("//--------------------- construction");
- _builder.newLine();
- _builder.append("\t\t\t");
- String _name_7 = ac.getName();
- _builder.append(_name_7, "\t\t\t");
- _builder.append("(etRuntime::IRTObject* parent, std::string name, const std::vector<std::vector<etRuntime::Address> >& port_addr, ");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ");
- _builder.append("const std::vector<std::vector<etRuntime::Address> >& peer_addr);");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("//--------------------- port getters");
- _builder.newLine();
- {
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("//--------------------- interface item IDs");
+ _builder.newLine();
+ _builder.append("\t\t");
+ String _genInterfaceItemConstants = this.genInterfaceItemConstants(xpac);
+ _builder.append(_genInterfaceItemConstants, "\t\t");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("\t\t");
+ EList<Attribute> _attributes = ac.getAttributes();
+ CharSequence _attributes_1 = this._procedureHelpers.attributes(_attributes);
+ _builder.append(_attributes_1, "\t\t");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("\t\t");
+ EList<StandardOperation> _operations = ac.getOperations();
+ String _name_7 = ac.getName();
+ CharSequence _operationsDeclaration = this._procedureHelpers.operationsDeclaration(_operations, _name_7);
+ _builder.append(_operationsDeclaration, "\t\t");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("public:");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("//--------------------- construction");
+ _builder.newLine();
+ _builder.append("\t\t");
+ String _name_8 = ac.getName();
+ _builder.append(_name_8, "\t\t");
+ _builder.append("(etRuntime::IRTObject* parent, const std::string& name);");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("//--------------------- port getters");
+ _builder.newLine();
+ _builder.append("\t\t");
List<Port> _endPorts_1 = this._roomHelpers.getEndPorts(ac);
- for(final Port ep : _endPorts_1) {
- _builder.append("\t\t");
- String _portClassName = this._roomExtensions.getPortClassName(ep);
- String _name_8 = ep.getName();
- String _name_9 = ac.getName();
- CharSequence _terImplementation = this._procedureHelpers.getterImplementation(_portClassName, _name_8, _name_9);
- _builder.append(_terImplementation, "\t\t");
- _builder.newLineIfNotEmpty();
- }
- }
- {
+ final Function1<Port, CharSequence> _function = new Function1<Port, CharSequence>() {
+ public CharSequence apply(final Port it) {
+ String _portClassName = ActorClassGen.this._roomExtensions.getPortClassName(it);
+ String _plus = (_portClassName + "&");
+ String _name = it.getName();
+ return ActorClassGen.this._procedureHelpers.getterImplementation(_plus, _name, clsname);
+ }
+ };
+ List<CharSequence> _map = ListExtensions.<Port, CharSequence>map(_endPorts_1, _function);
+ String _join = IterableExtensions.join(_map, this._roomExtensions.NEWLINE);
+ _builder.append(_join, "\t\t");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("\t\t");
EList<SAP> _serviceAccessPoints_1 = ac.getServiceAccessPoints();
- for(final SAP sap : _serviceAccessPoints_1) {
- _builder.append("\t\t");
- String _portClassName_1 = this._roomExtensions.getPortClassName(sap);
- String _name_10 = sap.getName();
- String _name_11 = ac.getName();
- CharSequence _terImplementation_1 = this._procedureHelpers.getterImplementation(_portClassName_1, _name_10, _name_11);
- _builder.append(_terImplementation_1, "\t\t");
- _builder.newLineIfNotEmpty();
- }
- }
- {
+ final Function1<SAP, CharSequence> _function_1 = new Function1<SAP, CharSequence>() {
+ public CharSequence apply(final SAP it) {
+ String _portClassName = ActorClassGen.this._roomExtensions.getPortClassName(it);
+ String _plus = (_portClassName + "&");
+ String _name = it.getName();
+ return ActorClassGen.this._procedureHelpers.getterImplementation(_plus, _name, clsname);
+ }
+ };
+ List<CharSequence> _map_1 = ListExtensions.<SAP, CharSequence>map(_serviceAccessPoints_1, _function_1);
+ String _join_1 = IterableExtensions.join(_map_1, this._roomExtensions.NEWLINE);
+ _builder.append(_join_1, "\t\t");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("\t\t");
EList<ServiceImplementation> _serviceImplementations_1 = ac.getServiceImplementations();
- for(final ServiceImplementation svc : _serviceImplementations_1) {
- _builder.append("\t\t");
- String _portClassName_2 = this._roomExtensions.getPortClassName(svc);
- SPP _spp = svc.getSpp();
- String _name_12 = _spp.getName();
- String _name_13 = ac.getName();
- CharSequence _terImplementation_2 = this._procedureHelpers.getterImplementation(_portClassName_2, _name_12, _name_13);
- _builder.append(_terImplementation_2, "\t\t");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("//--------------------- lifecycle functions");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("virtual void init();");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("virtual void start();");
- _builder.newLine();
- {
- boolean _overridesStop = this._roomExtensions.overridesStop(ac);
- boolean _not = (!_overridesStop);
- if (_not) {
- _builder.append("\t\t");
- _builder.append("virtual void stop();");
- _builder.newLine();
- }
- }
- _builder.append("\t\t\t");
- _builder.append("virtual void destroy();\t\t\t");
- _builder.newLine();
- {
- boolean _hasNonEmptyStateMachine = this._roomHelpers.hasNonEmptyStateMachine(ac);
- if (_hasNonEmptyStateMachine) {
- _builder.append("\t\t");
- CharSequence _genStateMachineMethodDeclarations = this._stateMachineGen.genStateMachineMethodDeclarations(xpac);
- _builder.append(_genStateMachineMethodDeclarations, "\t\t");
- _builder.newLineIfNotEmpty();
- } else {
- boolean _hasStateMachine = xpac.hasStateMachine();
- boolean _not_1 = (!_hasStateMachine);
- if (_not_1) {
- _builder.append("\t\t");
- _builder.append("public: ");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append("//--------------------- no state machine");
- _builder.newLine();
+ final Function1<ServiceImplementation, CharSequence> _function_2 = new Function1<ServiceImplementation, CharSequence>() {
+ public CharSequence apply(final ServiceImplementation it) {
+ String _portClassName = ActorClassGen.this._roomExtensions.getPortClassName(it);
+ String _plus = (_portClassName + "&");
+ SPP _spp = it.getSpp();
+ String _name = _spp.getName();
+ return ActorClassGen.this._procedureHelpers.getterImplementation(_plus, _name, clsname);
+ }
+ };
+ List<CharSequence> _map_2 = ListExtensions.<ServiceImplementation, CharSequence>map(_serviceImplementations_1, _function_2);
+ String _join_2 = IterableExtensions.join(_map_2, this._roomExtensions.NEWLINE);
+ _builder.append(_join_2, "\t\t");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("//--------------------- lifecycle functions");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("virtual void destroy();");
+ _builder.newLine();
+ _builder.newLine();
+ {
+ boolean _hasNonEmptyStateMachine = this._roomHelpers.hasNonEmptyStateMachine(ac);
+ if (_hasNonEmptyStateMachine) {
_builder.append("\t\t");
- _builder.append("\t");
- _builder.append("virtual void receiveEvent(etRuntime::InterfaceItemBase* ifitem, int evt, void* data);");
+ CharSequence _genStateMachineConstants = this._stateMachineGen.genStateMachineConstants(xpac);
+ _builder.append(_genStateMachineConstants, "\t\t");
+ _builder.newLineIfNotEmpty();
_builder.newLine();
_builder.append("\t\t");
- _builder.append("\t");
- _builder.append("virtual void executeInitTransition();");
- _builder.newLine();
+ CharSequence _genStateMachineMethods = this._stateMachineGen.genStateMachineMethods(xpac, false);
+ _builder.append(_genStateMachineMethods, "\t\t");
+ _builder.newLineIfNotEmpty();
+ {
+ ComponentCommunicationType _commType = ac.getCommType();
+ boolean _equals = Objects.equal(_commType, ComponentCommunicationType.DATA_DRIVEN);
+ if (_equals) {
+ _builder.append("\t\t");
+ _builder.append("void receiveEvent(etRuntime::InterfaceItemBase* ifitem, int evt, void* generic_data);");
+ _builder.newLine();
+ }
+ }
+ {
+ boolean _or = false;
+ ComponentCommunicationType _commType_1 = ac.getCommType();
+ boolean _equals_1 = Objects.equal(_commType_1, ComponentCommunicationType.ASYNCHRONOUS);
+ if (_equals_1) {
+ _or = true;
+ } else {
+ ComponentCommunicationType _commType_2 = ac.getCommType();
+ boolean _equals_2 = Objects.equal(_commType_2, ComponentCommunicationType.DATA_DRIVEN);
+ _or = _equals_2;
+ }
+ if (_or) {
+ _builder.append("\t\t");
+ _builder.append("virtual void receive(const etRuntime::Message* msg);");
+ _builder.newLine();
+ }
+ }
+ } else {
+ StateGraph _stateMachine = xpac.getStateMachine();
+ boolean _isEmpty = this._roomHelpers.isEmpty(_stateMachine);
+ if (_isEmpty) {
+ _builder.append("\t\t");
+ _builder.append("//--------------------- no state machine");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("virtual void receiveEvent(etRuntime::InterfaceItemBase* ifitem, int evt, void* data);");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("virtual void executeInitTransition() {}");
+ _builder.newLine();
+ }
}
}
+ _builder.newLine();
+ _builder.append("\t\t");
+ CharSequence _userCode_1 = this._procedureHelpers.userCode(ac, 2, false);
+ _builder.append(_userCode_1, "\t\t");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("};");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.newLine();
+ String _name_9 = ac.getName();
+ CharSequence _generateIncludeGuardEnd = this._cppExtensions.generateIncludeGuardEnd(_name_9);
+ _builder.append(_generateIncludeGuardEnd, "");
+ _builder.newLineIfNotEmpty();
+ _xblockexpression = _builder;
}
- _builder.newLine();
- _builder.append("\t\t");
- CharSequence _userCode_1 = this._procedureHelpers.userCode(ac, 2, false);
- _builder.append(_userCode_1, "\t\t");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t");
- _builder.append("};");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- String _name_14 = ac.getName();
- CharSequence _generateIncludeGuardEnd = this._cppExtensions.generateIncludeGuardEnd(_name_14);
- _builder.append(_generateIncludeGuardEnd, "\t");
- _builder.newLineIfNotEmpty();
- return _builder;
+ return _xblockexpression;
}
private String generateConstructorInitalizerList(final ActorClass ac) {
- ArrayList<CharSequence> initializerList = new ArrayList<CharSequence>();
- ActorClass _actorBase = ac.getActorBase();
- boolean _equals = Objects.equal(_actorBase, null);
- if (_equals) {
+ String _xblockexpression = null;
+ {
+ ArrayList<CharSequence> initializerList = new ArrayList<CharSequence>();
StringConcatenation _builder = new StringConcatenation();
- _builder.append("ActorClassBase( parent, name, port_addr[0][0], peer_addr[0][0])");
+ String _elvis = null;
+ ActorClass _actorBase = ac.getActorBase();
+ String _name = null;
+ if (_actorBase!=null) {
+ _name=_actorBase.getName();
+ }
+ if (_name != null) {
+ _elvis = _name;
+ } else {
+ _elvis = "ActorClassBase";
+ }
+ _builder.append(_elvis, "");
+ _builder.append("(parent, name)");
initializerList.add(_builder);
- } else {
- StringConcatenation _builder_1 = new StringConcatenation();
- ActorClass _actorBase_1 = ac.getActorBase();
- String _name = _actorBase_1.getName();
- _builder_1.append(_name, "");
- _builder_1.append("(*this, parent, name, port_addr, peer_addr)");
- initializerList.add(_builder_1);
- }
- List<Port> _endPorts = this._roomHelpers.getEndPorts(ac);
- for (final Port ep : _endPorts) {
- StringConcatenation _builder_2 = new StringConcatenation();
- String _name_1 = ep.getName();
- _builder_2.append(_name_1, "");
- _builder_2.append("(*this, this, \"");
- String _name_2 = ep.getName();
- _builder_2.append(_name_2, "");
- _builder_2.append("\", IFITEM_");
- String _name_3 = ep.getName();
- _builder_2.append(_name_3, "");
- _builder_2.append(", ");
- {
- int _multiplicity = ep.getMultiplicity();
- boolean _equals_1 = (_multiplicity == 1);
- if (_equals_1) {
- _builder_2.append("0, ");
- }
+ List<Port> _endPorts = this._roomHelpers.getEndPorts(ac);
+ for (final Port ep : _endPorts) {
+ StringConcatenation _builder_1 = new StringConcatenation();
+ String _name_1 = ep.getName();
+ _builder_1.append(_name_1, "");
+ _builder_1.append("(this, \"");
+ String _name_2 = ep.getName();
+ _builder_1.append(_name_2, "");
+ _builder_1.append("\", IFITEM_");
+ String _name_3 = ep.getName();
+ _builder_1.append(_name_3, "");
+ _builder_1.append(")");
+ initializerList.add(_builder_1);
}
- _builder_2.append("port_addr[IFITEM_");
- String _name_4 = ep.getName();
- _builder_2.append(_name_4, "");
- _builder_2.append("]");
- {
- int _multiplicity_1 = ep.getMultiplicity();
- boolean _equals_2 = (_multiplicity_1 == 1);
- if (_equals_2) {
- _builder_2.append("[0]");
- }
+ EList<SAP> _serviceAccessPoints = ac.getServiceAccessPoints();
+ for (final SAP sap : _serviceAccessPoints) {
+ StringConcatenation _builder_2 = new StringConcatenation();
+ String _name_4 = sap.getName();
+ _builder_2.append(_name_4, "");
+ _builder_2.append("(this, \"");
+ String _name_5 = sap.getName();
+ _builder_2.append(_name_5, "");
+ _builder_2.append("\", IFITEM_");
+ String _name_6 = sap.getName();
+ _builder_2.append(_name_6, "");
+ _builder_2.append(")");
+ initializerList.add(_builder_2);
}
- _builder_2.append(", peer_addr[IFITEM_");
- String _name_5 = ep.getName();
- _builder_2.append(_name_5, "");
- _builder_2.append("]");
- {
- int _multiplicity_2 = ep.getMultiplicity();
- boolean _equals_3 = (_multiplicity_2 == 1);
- if (_equals_3) {
- _builder_2.append("[0]");
- }
+ EList<ServiceImplementation> _serviceImplementations = ac.getServiceImplementations();
+ for (final ServiceImplementation svc : _serviceImplementations) {
+ StringConcatenation _builder_3 = new StringConcatenation();
+ SPP _spp = svc.getSpp();
+ String _name_7 = _spp.getName();
+ _builder_3.append(_name_7, "");
+ _builder_3.append("(this, \"");
+ SPP _spp_1 = svc.getSpp();
+ String _name_8 = _spp_1.getName();
+ _builder_3.append(_name_8, "");
+ _builder_3.append("\", IFITEM_");
+ SPP _spp_2 = svc.getSpp();
+ String _name_9 = _spp_2.getName();
+ _builder_3.append(_name_9, "");
+ _builder_3.append(")");
+ initializerList.add(_builder_3);
}
- _builder_2.append(")");
- initializerList.add(_builder_2);
- }
- EList<SAP> _serviceAccessPoints = ac.getServiceAccessPoints();
- for (final SAP sap : _serviceAccessPoints) {
- StringConcatenation _builder_3 = new StringConcatenation();
- String _name_6 = sap.getName();
- _builder_3.append(_name_6, "");
- _builder_3.append("(*this, this, \"");
- String _name_7 = sap.getName();
- _builder_3.append(_name_7, "");
- _builder_3.append("\", IFITEM_");
- String _name_8 = sap.getName();
- _builder_3.append(_name_8, "");
- _builder_3.append(", 0, port_addr[IFITEM_");
- String _name_9 = sap.getName();
- _builder_3.append(_name_9, "");
- _builder_3.append("][0], peer_addr[IFITEM_");
- String _name_10 = sap.getName();
- _builder_3.append(_name_10, "");
- _builder_3.append("][0])");
- initializerList.add(_builder_3);
- }
- EList<ServiceImplementation> _serviceImplementations = ac.getServiceImplementations();
- for (final ServiceImplementation svc : _serviceImplementations) {
- StringConcatenation _builder_4 = new StringConcatenation();
- SPP _spp = svc.getSpp();
- String _name_11 = _spp.getName();
- _builder_4.append(_name_11, "");
- _builder_4.append("(*this, this, \"");
- SPP _spp_1 = svc.getSpp();
- String _name_12 = _spp_1.getName();
- _builder_4.append(_name_12, "");
- _builder_4.append("\", IFITEM_");
- SPP _spp_2 = svc.getSpp();
- String _name_13 = _spp_2.getName();
- _builder_4.append(_name_13, "");
- _builder_4.append(", port_addr[IFITEM_");
- SPP _spp_3 = svc.getSpp();
- String _name_14 = _spp_3.getName();
- _builder_4.append(_name_14, "");
- _builder_4.append("], peer_addr[IFITEM_");
- SPP _spp_4 = svc.getSpp();
- String _name_15 = _spp_4.getName();
- _builder_4.append(_name_15, "");
- _builder_4.append("])");
- initializerList.add(_builder_4);
- }
- EList<Attribute> _attributes = ac.getAttributes();
- for (final Attribute attrib : _attributes) {
- CharSequence _attributeInitialization = this._initialization.attributeInitialization(attrib, false);
- initializerList.add(_attributeInitialization);
+ EList<Attribute> _attributes = ac.getAttributes();
+ for (final Attribute attrib : _attributes) {
+ CharSequence _attributeInitialization = this._initialization.attributeInitialization(attrib, false);
+ initializerList.add(_attributeInitialization);
+ }
+ _xblockexpression = IterableExtensions.join(initializerList, ("," + this._roomExtensions.NEWLINE));
}
- StringConcatenation _builder_5 = new StringConcatenation();
- String _join = IterableExtensions.join(initializerList, ",\n");
- _builder_5.append(_join, "");
- _builder_5.newLineIfNotEmpty();
- return _builder_5.toString();
+ return _xblockexpression;
}
- private CharSequence generateSourceFile(final Root root, final ExpandedActorClass xpac, final ActorClass ac) {
+ private CharSequence generateSourceFile(final Root root, final ExpandedActorClass xpac, final WiredActorClass wired, final boolean manualBehavior) {
CharSequence _xblockexpression = null;
{
- ActorClass _actorClass = xpac.getActorClass();
- ComponentCommunicationType _commType = _actorClass.getCommType();
- final boolean async = Objects.equal(_commType, ComponentCommunicationType.ASYNCHRONOUS);
+ final ActorClass ac = xpac.getActorClass();
+ String _xifexpression = null;
+ if (manualBehavior) {
+ String _name = ac.getName();
+ _xifexpression = ("Abstract" + _name);
+ } else {
+ _xifexpression = ac.getName();
+ }
+ final String clsname = _xifexpression;
+ String _elvis = null;
+ ActorClass _actorBase = ac.getActorBase();
+ String _name_1 = null;
+ if (_actorBase!=null) {
+ _name_1=_actorBase.getName();
+ }
+ if (_name_1 != null) {
+ _elvis = _name_1;
+ } else {
+ _elvis = "ActorClassBase";
+ }
+ final String rtBaseClassName = _elvis;
StringConcatenation _builder = new StringConcatenation();
_builder.append("/**");
_builder.newLine();
@@ -616,11 +582,11 @@ public class ActorClassGen extends GenericActorClassGenerator {
_builder.newLine();
_builder.append(" ");
_builder.append("* Source File of ActorClass ");
- String _name = ac.getName();
- _builder.append(_name, " ");
+ String _name_2 = ac.getName();
+ _builder.append(_name_2, " ");
_builder.newLineIfNotEmpty();
_builder.append(" ");
- _builder.append("* ");
+ _builder.append("*");
_builder.newLine();
_builder.append(" ");
_builder.append("*/");
@@ -631,28 +597,47 @@ public class ActorClassGen extends GenericActorClassGenerator {
_builder.append(_cppHeaderFileName, "");
_builder.append("\"");
_builder.newLineIfNotEmpty();
- _builder.append("#include \"common/debugging/DebuggingService.h\"");
+ _builder.newLine();
+ _builder.append("#include \"common/messaging/RTObject.h\"");
+ _builder.newLine();
+ _builder.append("#include \"common/messaging/RTServices.h\"");
+ _builder.newLine();
+ _builder.append("#include \"etDatatypes.h\"");
+ _builder.newLine();
+ _builder.append("#include \"etUnit/etUnit.h\"");
_builder.newLine();
_builder.append("#include <iostream>");
_builder.newLine();
+ _builder.append("#include <string>");
+ _builder.newLine();
+ _builder.newLine();
+ {
+ EList<ActorRef> _actorRefs = ac.getActorRefs();
+ for(final ActorRef ar : _actorRefs) {
+ _builder.append("#include \"");
+ ActorClass _type = ar.getType();
+ String _path = this._roomExtensions.getPath(_type);
+ _builder.append(_path, "");
+ ActorClass _type_1 = ar.getType();
+ String _name_3 = _type_1.getName();
+ _builder.append(_name_3, "");
+ _builder.append(".h\"");
+ _builder.newLineIfNotEmpty();
+ }
+ }
_builder.newLine();
_builder.append("using namespace etRuntime;");
_builder.newLine();
_builder.newLine();
_builder.newLine();
- String _name_1 = ac.getName();
- _builder.append(_name_1, "");
+ _builder.append(clsname, "");
_builder.append("::");
- String _name_2 = ac.getName();
- _builder.append(_name_2, "");
- _builder.append("(etRuntime::IRTObject* parent, std::string name, const std::vector<std::vector<etRuntime::Address> >& port_addr, ");
+ _builder.append(clsname, "");
+ _builder.append("(etRuntime::IRTObject* parent, const std::string& name) :");
_builder.newLineIfNotEmpty();
- _builder.append(" \t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t ");
- _builder.append("const std::vector<std::vector<etRuntime::Address> >& peer_addr)");
- _builder.newLine();
- _builder.append(": ");
+ _builder.append("\t\t");
String _generateConstructorInitalizerList = this.generateConstructorInitalizerList(ac);
- _builder.append(_generateConstructorInitalizerList, "");
+ _builder.append(_generateConstructorInitalizerList, "\t\t");
_builder.newLineIfNotEmpty();
_builder.append("{");
_builder.newLine();
@@ -660,9 +645,6 @@ public class ActorClassGen extends GenericActorClassGenerator {
boolean _hasNonEmptyStateMachine = this._roomHelpers.hasNonEmptyStateMachine(ac);
if (_hasNonEmptyStateMachine) {
_builder.append("\t");
- _builder.append("history = new int[s_numberOfStates];");
- _builder.newLine();
- _builder.append("\t");
_builder.append("for (int i = 0; i < s_numberOfStates; i++) {");
_builder.newLine();
_builder.append("\t");
@@ -676,8 +658,8 @@ public class ActorClassGen extends GenericActorClassGenerator {
}
_builder.append("\t");
_builder.append("setClassName(\"");
- String _name_3 = ac.getName();
- _builder.append(_name_3, "\t");
+ String _name_4 = ac.getName();
+ _builder.append(_name_4, "\t");
_builder.append("\");");
_builder.newLineIfNotEmpty();
_builder.append("\t");
@@ -686,86 +668,255 @@ public class ActorClassGen extends GenericActorClassGenerator {
_builder.append(_attributeInitialization, "\t");
_builder.newLineIfNotEmpty();
_builder.newLine();
+ _builder.append("\t");
+ _builder.append("// sub actors");
+ _builder.newLine();
+ {
+ EList<ActorRef> _actorRefs_1 = ac.getActorRefs();
+ for(final ActorRef sub : _actorRefs_1) {
+ {
+ int _multiplicity = sub.getMultiplicity();
+ boolean _greaterThan = (_multiplicity > 1);
+ if (_greaterThan) {
+ _builder.append("\t");
+ _builder.append("for (int i=0; i<");
+ int _multiplicity_1 = sub.getMultiplicity();
+ _builder.append(_multiplicity_1, "\t");
+ _builder.append("; ++i) {");
+ _builder.newLineIfNotEmpty();
+ {
+ GlobalGeneratorSettings _settings = Main.getSettings();
+ boolean _isGenerateMSCInstrumentation = _settings.isGenerateMSCInstrumentation();
+ if (_isGenerateMSCInstrumentation) {
+ _builder.append("\t");
+ _builder.append("\t");
+ _builder.append("DebuggingService::getInstance().addMessageActorCreate(*this, \"");
+ String _name_5 = sub.getName();
+ _builder.append(_name_5, "\t\t");
+ _builder.append(GenmodelConstants.INDEX_SEP, "\t\t");
+ _builder.append("\"+i);");
+ _builder.newLineIfNotEmpty();
+ }
+ }
+ _builder.append("\t");
+ _builder.append("\t");
+ _builder.append("new ");
+ ActorClass _type_2 = sub.getType();
+ String _name_6 = _type_2.getName();
+ _builder.append(_name_6, "\t\t");
+ _builder.append("(this, \"");
+ String _name_7 = sub.getName();
+ _builder.append(_name_7, "\t\t");
+ _builder.append(GenmodelConstants.INDEX_SEP, "\t\t");
+ _builder.append("\"+i);");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ } else {
+ {
+ GlobalGeneratorSettings _settings_1 = Main.getSettings();
+ boolean _isGenerateMSCInstrumentation_1 = _settings_1.isGenerateMSCInstrumentation();
+ if (_isGenerateMSCInstrumentation_1) {
+ _builder.append("\t");
+ _builder.append("DebuggingService::getInstance().addMessageActorCreate(*this, \"");
+ String _name_8 = sub.getName();
+ _builder.append(_name_8, "\t");
+ _builder.append("\");");
+ _builder.newLineIfNotEmpty();
+ }
+ }
+ _builder.append("\t");
+ _builder.append("new ");
+ ActorClass _type_3 = sub.getType();
+ String _name_9 = _type_3.getName();
+ _builder.append(_name_9, "\t");
+ _builder.append("(this, \"");
+ String _name_10 = sub.getName();
+ _builder.append(_name_10, "\t");
+ _builder.append("\");");
+ _builder.newLineIfNotEmpty();
+ }
+ }
+ }
+ }
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("// wiring");
+ _builder.newLine();
{
- if (async) {
+ EList<Wire> _wires = wired.getWires();
+ for(final Wire wire : _wires) {
_builder.append("\t");
- _builder.append("getMsgsvc()->addAsyncActor(*this);");
- _builder.newLine();
+ String _xifexpression_1 = null;
+ boolean _isDataDriven = wire.isDataDriven();
+ if (_isDataDriven) {
+ _xifexpression_1 = "DataPortBase";
+ } else {
+ _xifexpression_1 = "InterfaceItemBase";
+ }
+ _builder.append(_xifexpression_1, "\t");
+ _builder.append("::connect(this, \"");
+ EList<String> _path1 = wire.getPath1();
+ String _join = IterableExtensions.join(_path1, "/");
+ _builder.append(_join, "\t");
+ _builder.append("\", \"");
+ EList<String> _path2 = wire.getPath2();
+ String _join_1 = IterableExtensions.join(_path2, "/");
+ _builder.append(_join_1, "\t");
+ _builder.append("\");");
+ _builder.newLineIfNotEmpty();
}
}
- _builder.append("}");
_builder.newLine();
+ {
+ boolean _or = false;
+ ComponentCommunicationType _commType = ac.getCommType();
+ boolean _equals = Objects.equal(_commType, ComponentCommunicationType.ASYNCHRONOUS);
+ if (_equals) {
+ _or = true;
+ } else {
+ ComponentCommunicationType _commType_1 = ac.getCommType();
+ boolean _equals_1 = Objects.equal(_commType_1, ComponentCommunicationType.DATA_DRIVEN);
+ _or = _equals_1;
+ }
+ if (_or) {
+ _builder.append("\t");
+ _builder.append("// activate polling for data-driven communication");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("RTServices::getInstance().getMsgSvcCtrl().getMsgSvc(getThread())->addPollingMessageReceiver(*this);");
+ _builder.newLine();
+ }
+ }
_builder.newLine();
- _builder.append("void ");
- String _name_4 = ac.getName();
- _builder.append(_name_4, "");
- _builder.append("::init(){");
- _builder.newLineIfNotEmpty();
_builder.append("\t");
- _builder.append("initUser();");
- _builder.newLine();
+ String _userStructorBody = this._procedureHelpers.userStructorBody(ac, true);
+ _builder.append(_userStructorBody, "\t");
+ _builder.newLineIfNotEmpty();
_builder.append("}");
_builder.newLine();
_builder.newLine();
_builder.append("void ");
- String _name_5 = ac.getName();
- _builder.append(_name_5, "");
- _builder.append("::start(){");
+ String _name_11 = ac.getName();
+ _builder.append(_name_11, "");
+ _builder.append("::destroy(){");
_builder.newLineIfNotEmpty();
_builder.append("\t");
- _builder.append("startUser();");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
+ String _userStructorBody_1 = this._procedureHelpers.userStructorBody(ac, false);
+ _builder.append(_userStructorBody_1, "\t");
+ _builder.newLineIfNotEmpty();
{
- boolean _overridesStop = this._roomExtensions.overridesStop(ac);
- boolean _not = (!_overridesStop);
- if (_not) {
- _builder.append("void ");
- String _name_6 = ac.getName();
- _builder.append(_name_6, "");
- _builder.append("::stop(){");
- _builder.newLineIfNotEmpty();
+ GlobalGeneratorSettings _settings_2 = Main.getSettings();
+ boolean _isGenerateMSCInstrumentation_2 = _settings_2.isGenerateMSCInstrumentation();
+ if (_isGenerateMSCInstrumentation_2) {
_builder.append("\t");
- _builder.append("stopUser();");
+ _builder.append("DebuggingService::getInstance().addMessageActorDestroy(*this);");
_builder.newLine();
- _builder.append("}");
+ }
+ }
+ {
+ boolean _or_1 = false;
+ ComponentCommunicationType _commType_2 = ac.getCommType();
+ boolean _equals_2 = Objects.equal(_commType_2, ComponentCommunicationType.ASYNCHRONOUS);
+ if (_equals_2) {
+ _or_1 = true;
+ } else {
+ ComponentCommunicationType _commType_3 = ac.getCommType();
+ boolean _equals_3 = Objects.equal(_commType_3, ComponentCommunicationType.DATA_DRIVEN);
+ _or_1 = _equals_3;
+ }
+ if (_or_1) {
+ _builder.append("\t");
+ _builder.append("RTServices::getInstance().getMsgSvcCtrl().getMsgSvc(getThread())->removePollingMessageReceiver(*this);");
_builder.newLine();
}
}
+ _builder.append("\t");
+ _builder.append(rtBaseClassName, "\t");
+ _builder.append("::destroy();");
+ _builder.newLineIfNotEmpty();
+ _builder.append("}");
+ _builder.newLine();
_builder.newLine();
+ EList<StandardOperation> _operations = ac.getOperations();
+ String _name_12 = ac.getName();
+ CharSequence _operationsImplementation = this._procedureHelpers.operationsImplementation(_operations, _name_12);
+ _builder.append(_operationsImplementation, "");
+ _builder.newLineIfNotEmpty();
_builder.newLine();
{
boolean _hasNonEmptyStateMachine_1 = this._roomHelpers.hasNonEmptyStateMachine(ac);
if (_hasNonEmptyStateMachine_1) {
- CharSequence _genStateMachine = this._stateMachineGen.genStateMachine(xpac, false);
- _builder.append(_genStateMachine, "");
+ CharSequence _genStateMachineMethods = this._stateMachineGen.genStateMachineMethods(xpac, true);
+ _builder.append(_genStateMachineMethods, "");
_builder.newLineIfNotEmpty();
+ {
+ ComponentCommunicationType _commType_4 = ac.getCommType();
+ boolean _equals_4 = Objects.equal(_commType_4, ComponentCommunicationType.DATA_DRIVEN);
+ if (_equals_4) {
+ _builder.append("void ");
+ String _name_13 = ac.getName();
+ _builder.append(_name_13, "");
+ _builder.append("::receiveEvent(InterfaceItemBase* ifitem, int evt, void* generic_data) {");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("handleSystemEvent(ifitem, evt, generic_data);");
+ _builder.newLine();
+ _builder.append("}");
+ _builder.newLine();
+ }
+ }
+ {
+ boolean _or_2 = false;
+ ComponentCommunicationType _commType_5 = ac.getCommType();
+ boolean _equals_5 = Objects.equal(_commType_5, ComponentCommunicationType.ASYNCHRONOUS);
+ if (_equals_5) {
+ _or_2 = true;
+ } else {
+ ComponentCommunicationType _commType_6 = ac.getCommType();
+ boolean _equals_6 = Objects.equal(_commType_6, ComponentCommunicationType.DATA_DRIVEN);
+ _or_2 = _equals_6;
+ }
+ if (_or_2) {
+ _builder.append("void ");
+ String _name_14 = ac.getName();
+ _builder.append(_name_14, "");
+ _builder.append("::receive(const Message* msg) {");
+ _builder.newLineIfNotEmpty();
+ {
+ ComponentCommunicationType _commType_7 = ac.getCommType();
+ boolean _equals_7 = Objects.equal(_commType_7, ComponentCommunicationType.ASYNCHRONOUS);
+ if (_equals_7) {
+ _builder.append("\t");
+ _builder.append("receiveEvent(0, -1, 0);");
+ _builder.newLine();
+ } else {
+ _builder.append("\t");
+ _builder.append("receiveEventInternal();");
+ _builder.newLine();
+ }
+ }
+ _builder.append("}");
+ _builder.newLine();
+ }
+ }
} else {
- boolean _hasStateMachine = xpac.hasStateMachine();
- boolean _not_1 = (!_hasStateMachine);
- if (_not_1) {
+ StateGraph _stateMachine = xpac.getStateMachine();
+ boolean _isEmpty = this._roomHelpers.isEmpty(_stateMachine);
+ if (_isEmpty) {
_builder.append("//--------------------- no state machine");
_builder.newLine();
_builder.append("void ");
- String _name_7 = ac.getName();
- _builder.append(_name_7, "");
- _builder.append("::receiveEvent(etRuntime::InterfaceItemBase* ifitem, int evt, void* data) {");
+ String _name_15 = ac.getName();
+ _builder.append(_name_15, "");
+ _builder.append("::receiveEvent(InterfaceItemBase* ifitem, int evt, void* data) {");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("handleSystemEvent(ifitem, evt, data);");
_builder.newLine();
_builder.append("}");
_builder.newLine();
- _builder.newLine();
- _builder.append("void ");
- String _name_8 = ac.getName();
- _builder.append(_name_8, "");
- _builder.append("::executeInitTransition(){");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
}
}
}
diff --git a/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/CppExtensions.java b/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/CppExtensions.java
index afa30d77e..d21aaf225 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/CppExtensions.java
+++ b/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/CppExtensions.java
@@ -18,6 +18,8 @@ import java.util.List;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.etrice.core.etphys.eTPhys.NodeRef;
+import org.eclipse.etrice.core.genmodel.etricegen.SubSystemInstance;
import org.eclipse.etrice.core.genmodel.fsm.fsmgen.IDiagnostician;
import org.eclipse.etrice.core.room.Attribute;
import org.eclipse.etrice.core.room.DataClass;
@@ -64,14 +66,22 @@ public class CppExtensions implements ILanguageExtension {
return (_name + ".cpp");
}
- public String getInstSourceFileName(final RoomClass rc) {
- String _name = rc.getName();
- return (_name + "_Inst.h");
+ public String getCppClassName(final NodeRef nr, final SubSystemInstance ssi) {
+ String _name = nr.getName();
+ String _plus = ("Node_" + _name);
+ String _plus_1 = (_plus + "_");
+ String _name_1 = ssi.getName();
+ return (_plus_1 + _name_1);
}
- public String getDispSourceFileName(final RoomClass rc) {
- String _name = rc.getName();
- return (_name + "_Disp.h");
+ public String getCppHeaderFileName(final NodeRef nr, final SubSystemInstance ssi) {
+ String _cppClassName = this.getCppClassName(nr, ssi);
+ return (_cppClassName + ".h");
+ }
+
+ public String getCppSourceFileName(final NodeRef nr, final SubSystemInstance ssi) {
+ String _cppClassName = this.getCppClassName(nr, ssi);
+ return (_cppClassName + ".cpp");
}
public String accessLevelPrivate() {
@@ -125,24 +135,39 @@ public class CppExtensions implements ILanguageExtension {
}
public String genEnumeration(final String name, final List<Pair<String, String>> entries) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("typedef enum {");
- _builder.newLine();
+ String _xblockexpression = null;
{
- for(final Pair<String, String> entry : entries) {
- String _first = entry.getFirst();
- _builder.append(_first, "");
- _builder.append(" = ");
- String _second = entry.getSecond();
- _builder.append(_second, "");
- _builder.append(",");
- _builder.newLineIfNotEmpty();
+ boolean _isEmpty = entries.isEmpty();
+ if (_isEmpty) {
+ return "";
}
+ StringConcatenation _builder = new StringConcatenation();
+ _builder.append("typedef enum {");
+ _builder.newLine();
+ {
+ boolean _hasElements = false;
+ for(final Pair<String, String> entry : entries) {
+ if (!_hasElements) {
+ _hasElements = true;
+ } else {
+ _builder.appendImmediate(",", "\t");
+ }
+ _builder.append("\t");
+ String _first = entry.getFirst();
+ _builder.append(_first, "\t");
+ _builder.append(" = ");
+ String _second = entry.getSecond();
+ _builder.append(_second, "\t");
+ _builder.newLineIfNotEmpty();
+ }
+ }
+ _builder.append("} ");
+ _builder.append(name, "");
+ _builder.append(";");
+ _builder.newLineIfNotEmpty();
+ _xblockexpression = _builder.toString();
}
- _builder.append("} ");
- _builder.append(name, "");
- _builder.append(";");
- return _builder.toString();
+ return _xblockexpression;
}
public String booleanConstant(final boolean b) {
@@ -161,24 +186,25 @@ public class CppExtensions implements ILanguageExtension {
return "void*";
}
- public String arrayDeclaration(final String type, final int size, final String name, final boolean isRef) {
- return (((((type + " ") + name) + "[") + Integer.valueOf(size)) + "]");
- }
-
- public String constructorName(final String cls) {
- return cls;
- }
-
- public String destructorName(final String cls) {
- return (cls + "_dtor");
- }
-
- public String constructorReturnType() {
- return "";
+ public String typeArrayModifier() {
+ return this.pointerLiteral();
}
- public String destructorReturnType() {
- return "void";
+ public String arrayDeclaration(final String type, final int size, final String name, final boolean isRef) {
+ StringConcatenation _builder = new StringConcatenation();
+ _builder.append(type, "");
+ {
+ if (isRef) {
+ _builder.append("*");
+ }
+ }
+ _builder.append(" ");
+ _builder.append(name, "");
+ _builder.append("[");
+ _builder.append(size, "");
+ _builder.append("]");
+ _builder.newLineIfNotEmpty();
+ return _builder.toString();
}
public CharSequence getIncludeGuardString(final String filename) {
@@ -327,10 +353,19 @@ public class CppExtensions implements ILanguageExtension {
}
public String[] generateArglistAndTypedData(final EObject d) {
- final VarDecl data = ((VarDecl) d);
- String deref = "*";
- boolean _equals = Objects.equal(data, null);
+ boolean _or = false;
+ boolean _equals = Objects.equal(d, null);
if (_equals) {
+ _or = true;
+ } else {
+ _or = (!(d instanceof VarDecl));
+ }
+ if (_or) {
+ return ((String[])Conversions.unwrapArray(CollectionLiterals.<String>newArrayList("", "", ""), String.class));
+ }
+ final VarDecl data = ((VarDecl) d);
+ boolean _equals_1 = Objects.equal(data, null);
+ if (_equals_1) {
return ((String[])Conversions.unwrapArray(CollectionLiterals.<String>newArrayList("", "", ""), String.class));
}
String _xifexpression = null;
@@ -349,23 +384,33 @@ public class CppExtensions implements ILanguageExtension {
DataType _type_3 = _refType_3.getType();
_xifexpression_1 = this.getTargetType(((EnumerationType) _type_3));
} else {
+ String _xifexpression_2 = null;
RefableType _refType_4 = data.getRefType();
DataType _type_4 = _refType_4.getType();
- _xifexpression_1 = _type_4.getName();
+ if ((_type_4 instanceof ExternalType)) {
+ RefableType _refType_5 = data.getRefType();
+ DataType _type_5 = _refType_5.getType();
+ _xifexpression_2 = ((ExternalType) _type_5).getTargetName();
+ } else {
+ RefableType _refType_6 = data.getRefType();
+ DataType _type_6 = _refType_6.getType();
+ _xifexpression_2 = _type_6.getName();
+ }
+ _xifexpression_1 = _xifexpression_2;
}
_xifexpression = _xifexpression_1;
}
String typeName = _xifexpression;
- String _xifexpression_2 = null;
- RefableType _refType_5 = data.getRefType();
- DataType _type_5 = _refType_5.getType();
- if ((_type_5 instanceof PrimitiveType)) {
+ String _xifexpression_3 = null;
+ RefableType _refType_7 = data.getRefType();
+ DataType _type_7 = _refType_7.getType();
+ if ((_type_7 instanceof PrimitiveType)) {
String _xblockexpression = null;
{
- RefableType _refType_6 = data.getRefType();
- DataType _type_6 = _refType_6.getType();
- final String ct = ((PrimitiveType) _type_6).getCastName();
- String _xifexpression_3 = null;
+ RefableType _refType_8 = data.getRefType();
+ DataType _type_8 = _refType_8.getType();
+ final String ct = ((PrimitiveType) _type_8).getCastName();
+ String _xifexpression_4 = null;
boolean _and = false;
boolean _notEquals = (!Objects.equal(ct, null));
if (!_notEquals) {
@@ -376,51 +421,43 @@ public class CppExtensions implements ILanguageExtension {
_and = _not;
}
if (_and) {
- _xifexpression_3 = ct;
+ _xifexpression_4 = ct;
} else {
- _xifexpression_3 = typeName;
+ _xifexpression_4 = typeName;
}
- _xblockexpression = _xifexpression_3;
+ _xblockexpression = _xifexpression_4;
}
- _xifexpression_2 = _xblockexpression;
+ _xifexpression_3 = _xblockexpression;
} else {
- String _xifexpression_3 = null;
- RefableType _refType_6 = data.getRefType();
- DataType _type_6 = _refType_6.getType();
- if ((_type_6 instanceof EnumerationType)) {
- RefableType _refType_7 = data.getRefType();
- DataType _type_7 = _refType_7.getType();
- _xifexpression_3 = this.getCastType(((EnumerationType) _type_7));
+ String _xifexpression_4 = null;
+ RefableType _refType_8 = data.getRefType();
+ DataType _type_8 = _refType_8.getType();
+ if ((_type_8 instanceof EnumerationType)) {
+ RefableType _refType_9 = data.getRefType();
+ DataType _type_9 = _refType_9.getType();
+ _xifexpression_4 = this.getCastType(((EnumerationType) _type_9));
} else {
- _xifexpression_3 = typeName;
+ _xifexpression_4 = typeName;
}
- _xifexpression_2 = _xifexpression_3;
+ _xifexpression_3 = _xifexpression_4;
}
- String castTypeName = _xifexpression_2;
- castTypeName = (castTypeName + "*");
- RefableType _refType_8 = data.getRefType();
- boolean _isRef = _refType_8.isRef();
+ String castTypeName = _xifexpression_3;
+ String _castTypeName = castTypeName;
+ castTypeName = (_castTypeName + "*");
+ String deRef = "*";
+ RefableType _refType_10 = data.getRefType();
+ boolean _isRef = _refType_10.isRef();
if (_isRef) {
typeName = (typeName + "*");
- castTypeName = (castTypeName + "*");
- } else {
- RefableType _refType_9 = data.getRefType();
- DataType _type_8 = _refType_9.getType();
- if ((!(_type_8 instanceof PrimitiveType))) {
- typeName = (typeName + "*");
- castTypeName = (castTypeName + "*");
- } else {
- castTypeName = typeName;
- deref = "";
- }
+ deRef = "";
}
String _name = data.getName();
String _plus = ((typeName + " ") + _name);
String _plus_1 = (_plus + " = ");
- String _plus_2 = (_plus_1 + deref);
- String _plus_3 = (_plus_2 + "((");
+ String _plus_2 = (_plus_1 + deRef);
+ String _plus_3 = (_plus_2 + "(static_cast<");
String _plus_4 = (_plus_3 + castTypeName);
- final String typedData = (_plus_4 + ") generic_data);\n");
+ final String typedData = (_plus_4 + ">(generic_data__et));\n");
String _name_1 = data.getName();
final String dataArg = (", " + _name_1);
String _name_2 = data.getName();
diff --git a/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/DataClassGen.java b/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/DataClassGen.java
index 52ae2a728..51c89f577 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/DataClassGen.java
+++ b/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/DataClassGen.java
@@ -11,8 +11,10 @@
package org.eclipse.etrice.generator.cpp.gen;
import com.google.common.base.Objects;
+import com.google.common.collect.Iterables;
import com.google.inject.Inject;
import com.google.inject.Singleton;
+import java.util.Collections;
import java.util.List;
import org.eclipse.emf.common.util.EList;
import org.eclipse.etrice.core.fsm.fSM.DetailCode;
@@ -26,20 +28,19 @@ import org.eclipse.etrice.core.room.RefableType;
import org.eclipse.etrice.core.room.RoomModel;
import org.eclipse.etrice.core.room.StandardOperation;
import org.eclipse.etrice.core.room.util.RoomHelpers;
-import org.eclipse.etrice.generator.cpp.Main;
import org.eclipse.etrice.generator.cpp.gen.CppExtensions;
-import org.eclipse.etrice.generator.cpp.gen.GeneratorSettings;
import org.eclipse.etrice.generator.cpp.gen.Initialization;
import org.eclipse.etrice.generator.generic.ProcedureHelpers;
import org.eclipse.etrice.generator.generic.RoomExtensions;
import org.eclipse.etrice.generator.generic.TypeHelpers;
import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.generator.JavaIoFileSystemAccess;
+import org.eclipse.xtext.xbase.lib.CollectionLiterals;
import org.eclipse.xtext.xbase.lib.Extension;
+import org.eclipse.xtext.xbase.lib.Functions.Function1;
+import org.eclipse.xtext.xbase.lib.IterableExtensions;
+import org.eclipse.xtext.xbase.lib.ListExtensions;
-/**
- * @author Peter Karlitschek
- */
@Singleton
@SuppressWarnings("all")
public class DataClassGen {
@@ -115,6 +116,8 @@ public class DataClassGen {
_builder.append(_generateIncludeGuardBegin, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
+ _builder.append("#include \"etDatatypes.h\"");
+ _builder.newLine();
{
DataClass _base = dc.getBase();
boolean _notEquals = (!Objects.equal(_base, null));
@@ -127,9 +130,9 @@ public class DataClassGen {
String _name_1 = _base_2.getName();
_builder.append(_name_1, "");
_builder.append(".h\"");
- _builder.newLineIfNotEmpty();
}
}
+ _builder.newLineIfNotEmpty();
{
EList<DataClass> _referencedDataClasses = root.getReferencedDataClasses(dc);
for(final DataClass classes : _referencedDataClasses) {
@@ -142,10 +145,9 @@ public class DataClassGen {
_builder.newLineIfNotEmpty();
}
}
- EList<RoomModel> models = root.getReferencedModels(dc);
- _builder.newLineIfNotEmpty();
{
- for(final RoomModel model : models) {
+ EList<RoomModel> _referencedModels = root.getReferencedModels(dc);
+ for(final RoomModel model : _referencedModels) {
{
EList<DataClass> _dataClasses = model.getDataClasses();
for(final DataClass classes_1 : _dataClasses) {
@@ -182,7 +184,6 @@ public class DataClassGen {
}
_builder.append(" {");
_builder.newLineIfNotEmpty();
- _builder.append("\t");
_builder.newLine();
_builder.append("public:");
_builder.newLine();
@@ -191,14 +192,12 @@ public class DataClassGen {
CharSequence _userCode_1 = this.helpers.userCode(_userCode2);
_builder.append(_userCode_1, "\t");
_builder.newLineIfNotEmpty();
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
EList<Attribute> _attributes = dc.getAttributes();
CharSequence _attributes_1 = this.helpers.attributes(_attributes);
_builder.append(_attributes_1, "\t");
_builder.newLineIfNotEmpty();
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
EList<Attribute> _attributes_2 = dc.getAttributes();
@@ -206,7 +205,6 @@ public class DataClassGen {
CharSequence _attributeSettersGettersImplementation = this.helpers.attributeSettersGettersImplementation(_attributes_2, _name_6);
_builder.append(_attributeSettersGettersImplementation, "\t");
_builder.newLineIfNotEmpty();
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
EList<StandardOperation> _operations = dc.getOperations();
@@ -214,7 +212,6 @@ public class DataClassGen {
CharSequence _operationsDeclaration = this.helpers.operationsDeclaration(_operations, _name_7);
_builder.append(_operationsDeclaration, "\t");
_builder.newLineIfNotEmpty();
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("// default constructor, copy constructor and assignment operator");
@@ -240,51 +237,31 @@ public class DataClassGen {
_builder.append(_name_12, "\t");
_builder.append("& rhs);");
_builder.newLineIfNotEmpty();
- _builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("// constructor using fields");
_builder.newLine();
_builder.append("\t");
- String _name_13 = dc.getName();
- _builder.append(_name_13, "\t");
- _builder.append("(");
- String _argList = this.argList(dc);
- _builder.append(_argList, "\t");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
{
- DataClass _base_5 = dc.getBase();
- boolean _notEquals_2 = (!Objects.equal(_base_5, null));
- if (_notEquals_2) {
- _builder.append("\t");
- _builder.append("// constructor using base class constructor");
- _builder.newLine();
- _builder.append("\t");
- String _name_14 = dc.getName();
- _builder.append(_name_14, "\t");
+ EList<Attribute> _attributes_3 = dc.getAttributes();
+ boolean _isEmpty = _attributes_3.isEmpty();
+ boolean _not = (!_isEmpty);
+ if (_not) {
+ String _name_13 = dc.getName();
+ _builder.append(_name_13, "\t");
_builder.append("(");
- DataClass _base_6 = dc.getBase();
- String _name_15 = _base_6.getName();
- _builder.append(_name_15, "\t");
- _builder.append(" _super, ");
- EList<Attribute> _attributes_3 = dc.getAttributes();
- CharSequence _argListConstructor = this.argListConstructor(_attributes_3);
- String _string = _argListConstructor.toString();
- _builder.append(_string, "\t");
+ EList<Attribute> _attributes_4 = dc.getAttributes();
+ CharSequence _argList = this.helpers.argList(_attributes_4);
+ _builder.append(_argList, "\t");
_builder.append(");");
- _builder.newLineIfNotEmpty();
}
}
- _builder.append("\t");
- _builder.newLine();
+ _builder.newLineIfNotEmpty();
_builder.append("};");
_builder.newLine();
_builder.newLine();
- String _name_16 = dc.getName();
- CharSequence _generateIncludeGuardEnd = this.stdExt.generateIncludeGuardEnd(_name_16);
+ String _name_14 = dc.getName();
+ CharSequence _generateIncludeGuardEnd = this.stdExt.generateIncludeGuardEnd(_name_14);
_builder.append(_generateIncludeGuardEnd, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
@@ -292,387 +269,246 @@ public class DataClassGen {
}
public CharSequence generateSourceFile(final Root root, final DataClass dc) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("/**");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("* @author generated by eTrice");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("*");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("* Source File of DataClass ");
- String _name = dc.getName();
- _builder.append(_name, " ");
- _builder.newLineIfNotEmpty();
- _builder.append(" ");
- _builder.append("*/");
- _builder.newLine();
- _builder.newLine();
- _builder.append("#include \"");
- String _cppHeaderFileName = this.stdExt.getCppHeaderFileName(dc);
- _builder.append(_cppHeaderFileName, "");
- _builder.append("\"");
- _builder.newLineIfNotEmpty();
- {
- GeneratorSettings _settings = Main.getSettings();
- boolean _isUseEtUnit = _settings.isUseEtUnit();
- if (_isUseEtUnit) {
- _builder.append("extern \"C\" {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("#include \"etUnit.h\"");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- }
- }
- _builder.newLine();
- DetailCode _userCode3 = dc.getUserCode3();
- CharSequence _userCode = this.helpers.userCode(_userCode3);
- _builder.append(_userCode, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.newLine();
- _builder.append("// default constructor");
- _builder.newLine();
- String _name_1 = dc.getName();
- _builder.append(_name_1, "");
- _builder.append("::");
- String _name_2 = dc.getName();
- _builder.append(_name_2, "");
- _builder.append("() ");
- _builder.newLineIfNotEmpty();
+ CharSequence _xblockexpression = null;
{
DataClass _base = dc.getBase();
- boolean _notEquals = (!Objects.equal(_base, null));
- if (_notEquals) {
- _builder.append("\t");
- _builder.append(":");
+ String _name = null;
+ if (_base!=null) {
+ _name=_base.getName();
+ }
+ final String baseName = _name;
+ StringConcatenation _builder = new StringConcatenation();
+ _builder.append("/**");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("* @author generated by eTrice");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("*");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("* Source File of DataClass ");
+ String _name_1 = dc.getName();
+ _builder.append(_name_1, " ");
+ _builder.newLineIfNotEmpty();
+ _builder.append(" ");
+ _builder.append("*/");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("#include \"");
+ String _cppHeaderFileName = this.stdExt.getCppHeaderFileName(dc);
+ _builder.append(_cppHeaderFileName, "");
+ _builder.append("\"");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("#include \"etUnit/etUnit.h\"");
+ _builder.newLine();
+ _builder.newLine();
+ DetailCode _userCode3 = dc.getUserCode3();
+ CharSequence _userCode = this.helpers.userCode(_userCode3);
+ _builder.append(_userCode, "");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("// default constructor");
+ _builder.newLine();
+ String _name_2 = dc.getName();
+ _builder.append(_name_2, "");
+ _builder.append("::");
+ String _name_3 = dc.getName();
+ _builder.append(_name_3, "");
+ _builder.append("()");
+ _builder.newLineIfNotEmpty();
+ {
DataClass _base_1 = dc.getBase();
- String _name_3 = _base_1.getName();
- _builder.append(_name_3, "\t");
- _builder.append("()");
- _builder.newLineIfNotEmpty();
+ boolean _notEquals = (!Objects.equal(_base_1, null));
+ if (_notEquals) {
+ _builder.append("\t");
+ _builder.append(":");
+ DataClass _base_2 = dc.getBase();
+ String _name_4 = _base_2.getName();
+ _builder.append(_name_4, "\t");
+ _builder.append("()");
+ _builder.newLineIfNotEmpty();
+ }
}
- }
- _builder.append("{");
- _builder.newLine();
- _builder.append("\t");
- EList<Attribute> _attributes = dc.getAttributes();
- CharSequence _attributeInitialization = this._initialization.attributeInitialization(_attributes, false);
- _builder.append(_attributeInitialization, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("// copy constructor");
- _builder.newLine();
- String _name_4 = dc.getName();
- _builder.append(_name_4, "");
- _builder.append("::");
- String _name_5 = dc.getName();
- _builder.append(_name_5, "");
- _builder.append("(const ");
- String _name_6 = dc.getName();
- _builder.append(_name_6, "");
- _builder.append("& rhs)");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append(":");
- _builder.newLine();
- {
- DataClass _base_2 = dc.getBase();
- boolean _notEquals_1 = (!Objects.equal(_base_2, null));
+ _builder.append("{");
+ _builder.newLine();
+ _builder.append("\t");
+ EList<Attribute> _attributes = dc.getAttributes();
+ CharSequence _attributeInitialization = this._initialization.attributeInitialization(_attributes, false);
+ _builder.append(_attributeInitialization, "\t");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("\t");
+ String _userStructorBody = this.helpers.userStructorBody(dc, true);
+ _builder.append(_userStructorBody, "\t");
+ _builder.newLineIfNotEmpty();
+ _builder.append("}");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("// copy constructor");
+ _builder.newLine();
+ String _name_5 = dc.getName();
+ _builder.append(_name_5, "");
+ _builder.append("::");
+ String _name_6 = dc.getName();
+ _builder.append(_name_6, "");
+ _builder.append("(const ");
+ String _name_7 = dc.getName();
+ _builder.append(_name_7, "");
+ _builder.append("& rhs)");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ String _xifexpression = null;
+ boolean _notEquals_1 = (!Objects.equal(baseName, null));
if (_notEquals_1) {
- _builder.append("\t");
- DataClass _base_3 = dc.getBase();
- String _name_7 = _base_3.getName();
- _builder.append(_name_7, "\t");
- _builder.append("(rhs),");
- _builder.newLineIfNotEmpty();
+ _xifexpression = (baseName + "(rhs)");
}
- }
- {
EList<Attribute> _attributes_1 = dc.getAttributes();
- boolean _hasElements = false;
- for(final Attribute a : _attributes_1) {
- if (!_hasElements) {
- _hasElements = true;
- } else {
- _builder.appendImmediate(",", "\t");
- }
- _builder.append("\t");
- String _name_8 = a.getName();
- _builder.append(_name_8, "\t");
- _builder.append("(rhs.");
- String _name_9 = a.getName();
- _builder.append(_name_9, "\t");
- _builder.append(")");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("{");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- _builder.append("// constructor using fields");
- _builder.newLine();
- String _name_10 = dc.getName();
- _builder.append(_name_10, "");
- _builder.append("::");
- String _name_11 = dc.getName();
- _builder.append(_name_11, "");
- _builder.append("(");
- String _argList = this.argList(dc);
- _builder.append(_argList, "");
- _builder.append(") ");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append(":");
- _builder.newLine();
- {
- DataClass _base_4 = dc.getBase();
- boolean _notEquals_2 = (!Objects.equal(_base_4, null));
- if (_notEquals_2) {
- _builder.append("\t");
- DataClass _base_5 = dc.getBase();
- String _name_12 = _base_5.getName();
- _builder.append(_name_12, "\t");
- _builder.append("(");
- DataClass _base_6 = dc.getBase();
- String _paramList = this.paramList(_base_6);
- _builder.append(_paramList, "\t");
- _builder.append("),");
- _builder.newLineIfNotEmpty();
- }
- }
- {
- EList<Attribute> _attributes_2 = dc.getAttributes();
- boolean _hasElements_1 = false;
- for(final Attribute a_1 : _attributes_2) {
- if (!_hasElements_1) {
- _hasElements_1 = true;
- } else {
- _builder.appendImmediate(",", "\t");
+ final Function1<Attribute, String> _function = new Function1<Attribute, String>() {
+ public String apply(final Attribute it) {
+ String _name = it.getName();
+ String _plus = (_name + "(rhs.");
+ String _name_1 = it.getName();
+ String _plus_1 = (_plus + _name_1);
+ return (_plus_1 + ")");
}
- _builder.append("\t");
- String _name_13 = a_1.getName();
- _builder.append(_name_13, "\t");
- _builder.append("(");
- String _name_14 = a_1.getName();
- _builder.append(_name_14, "\t");
- _builder.append("_)");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("{");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- {
- DataClass _base_7 = dc.getBase();
- boolean _notEquals_3 = (!Objects.equal(_base_7, null));
- if (_notEquals_3) {
- _builder.append("// constructor using base class constructor");
- _builder.newLine();
- String _name_15 = dc.getName();
- _builder.append(_name_15, "");
- _builder.append("::");
- String _name_16 = dc.getName();
- _builder.append(_name_16, "");
- _builder.append("(");
- DataClass _base_8 = dc.getBase();
- String _name_17 = _base_8.getName();
- _builder.append(_name_17, "");
- _builder.append(" _super, ");
- EList<Attribute> _attributes_3 = dc.getAttributes();
- CharSequence _argListConstructor = this.argListConstructor(_attributes_3);
- String _string = _argListConstructor.toString();
- _builder.append(_string, "");
- _builder.append(")");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append(":");
- _builder.newLine();
- _builder.append("\t");
- DataClass _base_9 = dc.getBase();
- String _name_18 = _base_9.getName();
- _builder.append(_name_18, "\t");
- _builder.append("(_super),");
- _builder.newLineIfNotEmpty();
- {
- EList<Attribute> _attributes_4 = dc.getAttributes();
- boolean _hasElements_2 = false;
- for(final Attribute a_2 : _attributes_4) {
- if (!_hasElements_2) {
- _hasElements_2 = true;
- } else {
- _builder.appendImmediate(",", "\t");
+ };
+ List<String> _map = ListExtensions.<Attribute, String>map(_attributes_1, _function);
+ Iterable<String> _plus = Iterables.<String>concat(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList(_xifexpression)), _map);
+ Iterable<String> _filterNull = IterableExtensions.<String>filterNull(_plus);
+ CharSequence _constructorList = this.constructorList(_filterNull);
+ _builder.append(_constructorList, "\t");
+ _builder.newLineIfNotEmpty();
+ _builder.append("{");
+ _builder.newLine();
+ _builder.append("}");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("// constructor using fields");
+ _builder.newLine();
+ {
+ EList<Attribute> _attributes_2 = dc.getAttributes();
+ boolean _isEmpty = _attributes_2.isEmpty();
+ boolean _not = (!_isEmpty);
+ if (_not) {
+ String _name_8 = dc.getName();
+ _builder.append(_name_8, "");
+ _builder.append("::");
+ String _name_9 = dc.getName();
+ _builder.append(_name_9, "");
+ _builder.append("(");
+ EList<Attribute> _attributes_3 = dc.getAttributes();
+ CharSequence _argList = this.helpers.argList(_attributes_3);
+ _builder.append(_argList, "");
+ _builder.append(")");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append(":");
+ _builder.newLine();
+ {
+ EList<Attribute> _attributes_4 = dc.getAttributes();
+ boolean _hasElements = false;
+ for(final Attribute a : _attributes_4) {
+ if (!_hasElements) {
+ _hasElements = true;
+ } else {
+ _builder.appendImmediate(",", "\t");
+ }
+ _builder.append("\t");
+ String _name_10 = a.getName();
+ _builder.append(_name_10, "\t");
+ _builder.append("(");
+ String _name_11 = a.getName();
+ _builder.append(_name_11, "\t");
+ _builder.append(")");
+ _builder.newLineIfNotEmpty();
}
- _builder.append("\t");
- String _name_19 = a_2.getName();
- _builder.append(_name_19, "\t");
- _builder.append("(");
- String _name_20 = a_2.getName();
- _builder.append(_name_20, "\t");
- _builder.append("_)");
- _builder.newLineIfNotEmpty();
}
+ _builder.append("{");
+ _builder.newLine();
+ _builder.append("\t");
+ String _userStructorBody_1 = this.helpers.userStructorBody(dc, true);
+ _builder.append(_userStructorBody_1, "\t");
+ _builder.newLineIfNotEmpty();
+ _builder.append("}");
+ _builder.newLine();
}
- _builder.append("{");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- }
- }
- _builder.newLine();
- _builder.append("// assignment operator");
- _builder.newLine();
- String _name_21 = dc.getName();
- _builder.append(_name_21, "");
- _builder.append("& ");
- String _name_22 = dc.getName();
- _builder.append(_name_22, "");
- _builder.append("::operator=(const ");
- String _name_23 = dc.getName();
- _builder.append(_name_23, "");
- _builder.append("& rhs)");
- _builder.newLineIfNotEmpty();
- _builder.append("{\t\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (this == &rhs) { return *this; };");
- _builder.newLine();
- {
- DataClass _base_10 = dc.getBase();
- boolean _notEquals_4 = (!Objects.equal(_base_10, null));
- if (_notEquals_4) {
- _builder.append("\t");
- DataClass _base_11 = dc.getBase();
- String _name_24 = _base_11.getName();
- _builder.append(_name_24, "\t");
- _builder.append("::operator=(rhs);");
- _builder.newLineIfNotEmpty();
- }
- }
- {
- EList<Attribute> _attributes_5 = dc.getAttributes();
- for(final Attribute a_3 : _attributes_5) {
- _builder.append("\t");
- String _name_25 = a_3.getName();
- _builder.append(_name_25, "\t");
- _builder.append("= rhs.");
- String _name_26 = a_3.getName();
- _builder.append(_name_26, "\t");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
}
- }
- _builder.append("\t");
- _builder.append("return *this;");
- _builder.newLine();
- _builder.append("}\t\t\t");
- _builder.newLine();
- _builder.newLine();
- EList<StandardOperation> _operations = dc.getOperations();
- String _name_27 = dc.getName();
- CharSequence _operationsImplementation = this.helpers.operationsImplementation(_operations, _name_27);
- _builder.append(_operationsImplementation, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- return _builder;
- }
-
- public String paramList(final DataClass _dc) {
- String result = "";
- DataClass dc = _dc;
- while ((!Objects.equal(dc, null))) {
+ _builder.newLine();
+ _builder.append("// assignment operator");
+ _builder.newLine();
+ String _name_12 = dc.getName();
+ _builder.append(_name_12, "");
+ _builder.append("& ");
+ String _name_13 = dc.getName();
+ _builder.append(_name_13, "");
+ _builder.append("::operator=(const ");
+ String _name_14 = dc.getName();
+ _builder.append(_name_14, "");
+ _builder.append("& rhs)");
+ _builder.newLineIfNotEmpty();
+ _builder.append("{");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("if (this == &rhs) { return *this; };");
+ _builder.newLine();
{
- EList<Attribute> _attributes = dc.getAttributes();
- CharSequence _paramList = this.paramList(_attributes);
- String _string = _paramList.toString();
- String _plus = (_string + result);
- result = _plus;
- DataClass _base = dc.getBase();
- dc = _base;
- boolean _notEquals = (!Objects.equal(dc, null));
- if (_notEquals) {
- result = (", " + result);
- }
- }
- }
- return result;
- }
-
- public CharSequence paramList(final List<Attribute> attributes) {
- StringConcatenation _builder = new StringConcatenation();
- {
- boolean _hasElements = false;
- for(final Attribute a : attributes) {
- if (!_hasElements) {
- _hasElements = true;
- } else {
- _builder.appendImmediate(", ", "");
+ DataClass _base_3 = dc.getBase();
+ boolean _notEquals_2 = (!Objects.equal(_base_3, null));
+ if (_notEquals_2) {
+ _builder.append("\t");
+ DataClass _base_4 = dc.getBase();
+ String _name_15 = _base_4.getName();
+ _builder.append(_name_15, "\t");
+ _builder.append("::operator=(rhs);");
+ _builder.newLineIfNotEmpty();
}
- String _name = a.getName();
- _builder.append(_name, "");
- _builder.append("_");
}
- }
- return _builder;
- }
-
- public String argList(final DataClass _dc) {
- String result = "";
- DataClass dc = _dc;
- while ((!Objects.equal(dc, null))) {
{
- EList<Attribute> _attributes = dc.getAttributes();
- CharSequence _argListConstructor = this.argListConstructor(_attributes);
- String _string = _argListConstructor.toString();
- String _plus = (_string + result);
- result = _plus;
- DataClass _base = dc.getBase();
- dc = _base;
- boolean _notEquals = (!Objects.equal(dc, null));
- if (_notEquals) {
- result = (", " + result);
+ EList<Attribute> _attributes_5 = dc.getAttributes();
+ for(final Attribute a_1 : _attributes_5) {
+ _builder.append("\t");
+ String _name_16 = a_1.getName();
+ _builder.append(_name_16, "\t");
+ _builder.append("= rhs.");
+ String _name_17 = a_1.getName();
+ _builder.append(_name_17, "\t");
+ _builder.append(";");
+ _builder.newLineIfNotEmpty();
}
}
+ _builder.append("\t");
+ _builder.append("return *this;");
+ _builder.newLine();
+ _builder.append("}");
+ _builder.newLine();
+ _builder.newLine();
+ EList<StandardOperation> _operations = dc.getOperations();
+ String _name_18 = dc.getName();
+ CharSequence _operationsImplementation = this.helpers.operationsImplementation(_operations, _name_18);
+ _builder.append(_operationsImplementation, "");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _xblockexpression = _builder;
}
- return result;
+ return _xblockexpression;
}
- public CharSequence argListConstructor(final List<Attribute> attributes) {
+ public CharSequence constructorList(final Iterable<? extends CharSequence> items) {
StringConcatenation _builder = new StringConcatenation();
{
boolean _hasElements = false;
- for(final Attribute a : attributes) {
+ for(final CharSequence s : items) {
if (!_hasElements) {
_hasElements = true;
+ _builder.append(":", "");
} else {
- _builder.appendImmediate(", ", "");
+ _builder.appendImmediate(",", "");
}
- RefableType _type = a.getType();
- DataType _type_1 = _type.getType();
- String _typeName = this.typeHelpers.typeName(_type_1);
- _builder.append(_typeName, "");
- {
- int _size = a.getSize();
- boolean _greaterThan = (_size > 1);
- if (_greaterThan) {
- _builder.append("[]");
- }
- }
- _builder.append(" ");
- String _name = a.getName();
- _builder.append(_name, "");
- _builder.append("_");
+ _builder.append(s, "");
+ _builder.newLineIfNotEmpty();
}
}
return _builder;
diff --git a/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/MainGen.java b/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/MainGen.java
index ccae32727..91fb4674e 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/MainGen.java
+++ b/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/MainGen.java
@@ -19,9 +19,9 @@ import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.etrice.core.genmodel.etricegen.Root;
import org.eclipse.etrice.generator.cpp.gen.ActorClassGen;
import org.eclipse.etrice.generator.cpp.gen.DataClassGen;
+import org.eclipse.etrice.generator.cpp.gen.NodeGen;
+import org.eclipse.etrice.generator.cpp.gen.NodeRunnerGen;
import org.eclipse.etrice.generator.cpp.gen.ProtocolClassGen;
-import org.eclipse.etrice.generator.cpp.gen.SubSystemClassGen;
-import org.eclipse.etrice.generator.cpp.gen.SubSystemRunnerGen;
import org.eclipse.etrice.generator.generic.PrepareFileSystem;
@Singleton
@@ -37,10 +37,10 @@ public class MainGen {
private ActorClassGen actorClassGen;
@Inject
- private SubSystemClassGen subsystemClassGen;
+ private NodeGen subsystemClassGen;
@Inject
- private SubSystemRunnerGen subsystemRunnerGen;
+ private NodeRunnerGen subsystemRunnerGen;
@Inject
private PrepareFileSystem prepFS;
diff --git a/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/NodeGen.java b/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/NodeGen.java
new file mode 100644
index 000000000..a7b953871
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/NodeGen.java
@@ -0,0 +1,680 @@
+/**
+ * Copyright (c) 2011 Draeger Medical GmbH (http://www.draeger.com).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Peter Karlitschek (initial contribution)
+ */
+package org.eclipse.etrice.generator.cpp.gen;
+
+import com.google.common.base.Objects;
+import com.google.common.collect.Iterables;
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.etrice.core.common.converter.TimeConverter;
+import org.eclipse.etrice.core.etmap.util.ETMapUtil;
+import org.eclipse.etrice.core.etphys.eTPhys.ExecMode;
+import org.eclipse.etrice.core.etphys.eTPhys.NodeClass;
+import org.eclipse.etrice.core.etphys.eTPhys.NodeRef;
+import org.eclipse.etrice.core.etphys.eTPhys.PhysicalThread;
+import org.eclipse.etrice.core.genmodel.builder.GenmodelConstants;
+import org.eclipse.etrice.core.genmodel.etricegen.ActorInstance;
+import org.eclipse.etrice.core.genmodel.etricegen.Root;
+import org.eclipse.etrice.core.genmodel.etricegen.StructureInstance;
+import org.eclipse.etrice.core.genmodel.etricegen.SubSystemInstance;
+import org.eclipse.etrice.core.genmodel.etricegen.Wire;
+import org.eclipse.etrice.core.genmodel.etricegen.WiredStructureClass;
+import org.eclipse.etrice.core.genmodel.etricegen.WiredSubSystemClass;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.IDiagnostician;
+import org.eclipse.etrice.core.room.ActorClass;
+import org.eclipse.etrice.core.room.ActorRef;
+import org.eclipse.etrice.core.room.RoomModel;
+import org.eclipse.etrice.core.room.SubSystemClass;
+import org.eclipse.etrice.generator.base.GlobalGeneratorSettings;
+import org.eclipse.etrice.generator.cpp.Main;
+import org.eclipse.etrice.generator.cpp.gen.CppExtensions;
+import org.eclipse.etrice.generator.fsm.base.FileSystemHelpers;
+import org.eclipse.etrice.generator.fsm.base.IGeneratorFileIo;
+import org.eclipse.etrice.generator.fsm.base.Indexed;
+import org.eclipse.etrice.generator.generic.ProcedureHelpers;
+import org.eclipse.etrice.generator.generic.RoomExtensions;
+import org.eclipse.xtend2.lib.StringConcatenation;
+import org.eclipse.xtext.xbase.lib.CollectionLiterals;
+import org.eclipse.xtext.xbase.lib.Extension;
+import org.eclipse.xtext.xbase.lib.Functions.Function1;
+import org.eclipse.xtext.xbase.lib.IterableExtensions;
+import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
+
+@Singleton
+@SuppressWarnings("all")
+public class NodeGen {
+ @Inject
+ @Extension
+ private CppExtensions _cppExtensions;
+
+ @Inject
+ @Extension
+ private RoomExtensions _roomExtensions;
+
+ @Inject
+ @Extension
+ private ProcedureHelpers _procedureHelpers;
+
+ @Inject
+ @Extension
+ private FileSystemHelpers _fileSystemHelpers;
+
+ @Inject
+ private IGeneratorFileIo fileIO;
+
+ @Inject
+ private IDiagnostician diagnostician;
+
+ public void doGenerate(final Root root) {
+ final Map<SubSystemClass, WiredSubSystemClass> sscc2wired = CollectionLiterals.<SubSystemClass, WiredSubSystemClass>newHashMap();
+ EList<WiredStructureClass> _wiredInstances = root.getWiredInstances();
+ Iterable<WiredSubSystemClass> _filter = Iterables.<WiredSubSystemClass>filter(_wiredInstances, WiredSubSystemClass.class);
+ final Procedure1<WiredSubSystemClass> _function = new Procedure1<WiredSubSystemClass>() {
+ public void apply(final WiredSubSystemClass it) {
+ SubSystemClass _subSystemClass = it.getSubSystemClass();
+ sscc2wired.put(_subSystemClass, it);
+ }
+ };
+ IterableExtensions.<WiredSubSystemClass>forEach(_filter, _function);
+ Collection<NodeRef> _nodeRefs = ETMapUtil.getNodeRefs();
+ for (final NodeRef nr : _nodeRefs) {
+ List<String> _subSystemInstancePaths = ETMapUtil.getSubSystemInstancePaths(nr);
+ for (final String instpath : _subSystemInstancePaths) {
+ {
+ StructureInstance _instance = root.getInstance(instpath);
+ final SubSystemInstance ssi = ((SubSystemInstance) _instance);
+ boolean _and = false;
+ boolean _notEquals = (!Objects.equal(ssi, null));
+ if (!_notEquals) {
+ _and = false;
+ } else {
+ SubSystemClass _subSystemClass = ssi.getSubSystemClass();
+ boolean _isValidGenerationLocation = this._fileSystemHelpers.isValidGenerationLocation(_subSystemClass);
+ _and = _isValidGenerationLocation;
+ }
+ if (_and) {
+ SubSystemClass _subSystemClass_1 = ssi.getSubSystemClass();
+ final WiredSubSystemClass wired = sscc2wired.get(_subSystemClass_1);
+ SubSystemClass _subSystemClass_2 = ssi.getSubSystemClass();
+ String _generationTargetPath = this._roomExtensions.getGenerationTargetPath(_subSystemClass_2);
+ SubSystemClass _subSystemClass_3 = ssi.getSubSystemClass();
+ String _path = this._roomExtensions.getPath(_subSystemClass_3);
+ final String path = (_generationTargetPath + _path);
+ SubSystemClass _subSystemClass_4 = ssi.getSubSystemClass();
+ String _generationInfoPath = this._roomExtensions.getGenerationInfoPath(_subSystemClass_4);
+ SubSystemClass _subSystemClass_5 = ssi.getSubSystemClass();
+ String _path_1 = this._roomExtensions.getPath(_subSystemClass_5);
+ final String infopath = (_generationInfoPath + _path_1);
+ final Set<PhysicalThread> usedThreads = ETMapUtil.getUsedThreads(nr, ssi);
+ String _cppHeaderFileName = this._cppExtensions.getCppHeaderFileName(nr, ssi);
+ CharSequence _generateHeaderFile = this.generateHeaderFile(root, ssi, wired, usedThreads);
+ this.fileIO.generateFile("generating Node declaration", path, infopath, _cppHeaderFileName, _generateHeaderFile);
+ String _cppSourceFileName = this._cppExtensions.getCppSourceFileName(nr, ssi);
+ CharSequence _generateSourceFile = this.generateSourceFile(root, ssi, wired, usedThreads);
+ this.fileIO.generateFile("generating Node implementation", path, infopath, _cppSourceFileName, _generateSourceFile);
+ }
+ }
+ }
+ }
+ }
+
+ public CharSequence generateHeaderFile(final Root root, final SubSystemInstance comp, final WiredSubSystemClass wired, final Collection<PhysicalThread> usedThreads) {
+ CharSequence _xblockexpression = null;
+ {
+ final SubSystemClass cc = comp.getSubSystemClass();
+ final EList<RoomModel> models = root.getReferencedModels(cc);
+ final NodeRef nr = ETMapUtil.getNodeRef(comp);
+ final String clsname = this._cppExtensions.getCppClassName(nr, comp);
+ NodeClass _type = nr.getType();
+ EList<PhysicalThread> _threads = _type.getThreads();
+ final Function1<PhysicalThread, Boolean> _function = new Function1<PhysicalThread, Boolean>() {
+ public Boolean apply(final PhysicalThread t) {
+ return Boolean.valueOf(usedThreads.contains(t));
+ }
+ };
+ final Iterable<PhysicalThread> threads = IterableExtensions.<PhysicalThread>filter(_threads, _function);
+ StringConcatenation _builder = new StringConcatenation();
+ _builder.append("/**");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("* @author generated by eTrice");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("*");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("* Header File of SubSystemClass ");
+ _builder.append(clsname, " ");
+ _builder.newLineIfNotEmpty();
+ _builder.append(" ");
+ _builder.append("*");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("*/");
+ _builder.newLine();
+ _builder.newLine();
+ CharSequence _generateIncludeGuardBegin = this._cppExtensions.generateIncludeGuardBegin(clsname);
+ _builder.append(_generateIncludeGuardBegin, "");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("#include \"common/modelbase/SubSystemClassBase.h\"");
+ _builder.newLine();
+ _builder.newLine();
+ CharSequence _userCode = this._procedureHelpers.userCode(cc, 1, false);
+ _builder.append(_userCode, "");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("class ");
+ _builder.append(clsname, "");
+ _builder.append(" : public etRuntime::SubSystemClassBase{");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("\t");
+ CharSequence _userCode_1 = this._procedureHelpers.userCode(cc, 2, false);
+ _builder.append(_userCode_1, "\t");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("public:");
+ _builder.newLine();
+ _builder.newLine();
+ {
+ Iterable<Indexed<PhysicalThread>> _indexed = Indexed.<PhysicalThread>indexed(threads);
+ for(final Indexed<PhysicalThread> thread : _indexed) {
+ _builder.append("\t\t");
+ _builder.append("static const int ");
+ PhysicalThread _value = thread.getValue();
+ String _threadId = this.getThreadId(_value);
+ _builder.append(_threadId, "\t\t");
+ _builder.append(";");
+ _builder.newLineIfNotEmpty();
+ }
+ }
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append(clsname, "\t\t");
+ _builder.append("(IRTObject* parent, const std::string& name);");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("virtual void receiveEvent(etRuntime::InterfaceItemBase* ifitem, int evt, void* data);");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("virtual void instantiateMessageServices();");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("virtual void instantiateActors();");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("virtual void init();");
+ _builder.newLine();
+ _builder.newLine();
+ {
+ GlobalGeneratorSettings _settings = Main.getSettings();
+ boolean _isGenerateMSCInstrumentation = _settings.isGenerateMSCInstrumentation();
+ if (_isGenerateMSCInstrumentation) {
+ _builder.append("\t\t");
+ _builder.append("etBool hasGeneratedMSCInstrumentation() const { return true; }");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("virtual void destroy();");
+ _builder.newLine();
+ }
+ }
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("private:");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append(clsname, "\t\t");
+ _builder.append("();");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t\t");
+ _builder.append(clsname, "\t\t");
+ _builder.append("(");
+ _builder.append(clsname, "\t\t");
+ _builder.append(" const&);");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t\t");
+ _builder.append(clsname, "\t\t");
+ _builder.append("& operator=(");
+ _builder.append(clsname, "\t\t");
+ _builder.append(" const&);");
+ _builder.newLineIfNotEmpty();
+ _builder.append("};");
+ _builder.newLine();
+ _builder.newLine();
+ String _name = cc.getName();
+ CharSequence _generateIncludeGuardEnd = this._cppExtensions.generateIncludeGuardEnd(_name);
+ _builder.append(_generateIncludeGuardEnd, "");
+ _builder.newLineIfNotEmpty();
+ _xblockexpression = _builder;
+ }
+ return _xblockexpression;
+ }
+
+ private String getThreadId(final PhysicalThread thread) {
+ String _name = thread.getName();
+ String _upperCase = _name.toUpperCase();
+ return ("THREAD_" + _upperCase);
+ }
+
+ public CharSequence generateSourceFile(final Root root, final SubSystemInstance comp, final WiredSubSystemClass wired, final Collection<PhysicalThread> usedThreads) {
+ CharSequence _xblockexpression = null;
+ {
+ final SubSystemClass cc = comp.getSubSystemClass();
+ final EList<RoomModel> models = root.getReferencedModels(cc);
+ final NodeRef nr = ETMapUtil.getNodeRef(comp);
+ final String clsname = this._cppExtensions.getCppClassName(nr, comp);
+ NodeClass _type = nr.getType();
+ EList<PhysicalThread> _threads = _type.getThreads();
+ final Function1<PhysicalThread, Boolean> _function = new Function1<PhysicalThread, Boolean>() {
+ public Boolean apply(final PhysicalThread t) {
+ return Boolean.valueOf(usedThreads.contains(t));
+ }
+ };
+ final Iterable<PhysicalThread> threads = IterableExtensions.<PhysicalThread>filter(_threads, _function);
+ StringConcatenation _builder = new StringConcatenation();
+ _builder.append("/**");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("* @author generated by eTrice");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("*");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("* Source File of SubsystemClass ");
+ _builder.append(clsname, " ");
+ _builder.newLineIfNotEmpty();
+ _builder.append(" ");
+ _builder.append("*");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("*/");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("#include \"");
+ String _cppHeaderFileName = this._cppExtensions.getCppHeaderFileName(nr, comp);
+ _builder.append(_cppHeaderFileName, "");
+ _builder.append("\"");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("#include \"common/debugging/DebuggingService.h\"");
+ _builder.newLine();
+ _builder.append("#include \"common/messaging/IMessageService.h\"");
+ _builder.newLine();
+ _builder.append("#include \"common/messaging/MessageService.h\"");
+ _builder.newLine();
+ _builder.append("#include \"common/messaging/MessageServiceController.h\"");
+ _builder.newLine();
+ _builder.append("#include \"common/messaging/RTServices.h\"");
+ _builder.newLine();
+ _builder.append("#include \"common/modelbase/InterfaceItemBase.h\"");
+ _builder.newLine();
+ _builder.newLine();
+ {
+ EList<ActorInstance> _actorInstances = comp.getActorInstances();
+ for(final ActorInstance ai : _actorInstances) {
+ _builder.append("#include \"");
+ ActorClass _actorClass = ai.getActorClass();
+ String _path = this._roomExtensions.getPath(_actorClass);
+ _builder.append(_path, "");
+ ActorClass _actorClass_1 = ai.getActorClass();
+ String _name = _actorClass_1.getName();
+ _builder.append(_name, "");
+ _builder.append(".h\"");
+ _builder.newLineIfNotEmpty();
+ }
+ }
+ _builder.append("#include <iostream>");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("using namespace etRuntime;");
+ _builder.newLine();
+ _builder.newLine();
+ {
+ Iterable<Indexed<PhysicalThread>> _indexed = Indexed.<PhysicalThread>indexed(threads);
+ for(final Indexed<PhysicalThread> thread : _indexed) {
+ _builder.append("const int ");
+ _builder.append(clsname, "");
+ _builder.append("::");
+ PhysicalThread _value = thread.getValue();
+ String _threadId = this.getThreadId(_value);
+ _builder.append(_threadId, "");
+ _builder.append(" = ");
+ int _index0 = thread.getIndex0();
+ _builder.append(_index0, "");
+ _builder.append(";");
+ _builder.newLineIfNotEmpty();
+ }
+ }
+ _builder.newLine();
+ _builder.append(clsname, "");
+ _builder.append("::");
+ _builder.append(clsname, "");
+ _builder.append("(IRTObject* parent, const std::string& name) :");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t\t");
+ _builder.append("SubSystemClassBase(parent, name)");
+ _builder.newLine();
+ _builder.append("{");
+ _builder.newLine();
+ _builder.append("}");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("void ");
+ _builder.append(clsname, "");
+ _builder.append("::receiveEvent(InterfaceItemBase* ifitem, int evt, void* data){");
+ _builder.newLineIfNotEmpty();
+ _builder.append("}");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("void ");
+ _builder.append(clsname, "");
+ _builder.append("::instantiateMessageServices(){");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("IMessageService* msgService;");
+ _builder.newLine();
+ {
+ for(final PhysicalThread thread_1 : threads) {
+ _builder.append("\t");
+ _builder.append("{");
+ _builder.newLine();
+ {
+ boolean _or = false;
+ ExecMode _execmode = thread_1.getExecmode();
+ boolean _equals = Objects.equal(_execmode, ExecMode.POLLED);
+ if (_equals) {
+ _or = true;
+ } else {
+ ExecMode _execmode_1 = thread_1.getExecmode();
+ boolean _equals_1 = Objects.equal(_execmode_1, ExecMode.MIXED);
+ _or = _equals_1;
+ }
+ if (_or) {
+ _builder.append("\t");
+ _builder.append("\t");
+ _builder.append("etTime interval;");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("\t");
+ _builder.append("interval.sec = ");
+ long _time = thread_1.getTime();
+ long _split = TimeConverter.split(_time, TimeConverter.SEC, true);
+ _builder.append(_split, "\t\t");
+ _builder.append(";");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("\t");
+ _builder.append("interval.nSec = ");
+ long _time_1 = thread_1.getTime();
+ long _split_1 = TimeConverter.split(_time_1, TimeConverter.MILLI_SEC, false);
+ _builder.append(_split_1, "\t\t");
+ _builder.append("L;");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("\t");
+ _builder.append("msgService = new MessageService(this, IMessageService::");
+ ExecMode _execmode_2 = thread_1.getExecmode();
+ String _name_1 = _execmode_2.getName();
+ _builder.append(_name_1, "\t\t");
+ _builder.append(", interval, 0, ");
+ String _threadId_1 = this.getThreadId(thread_1);
+ _builder.append(_threadId_1, "\t\t");
+ _builder.append(", \"MessageService_");
+ String _name_2 = thread_1.getName();
+ _builder.append(_name_2, "\t\t");
+ _builder.append("\", ");
+ int _prio = thread_1.getPrio();
+ _builder.append(_prio, "\t\t");
+ _builder.append(");");
+ _builder.newLineIfNotEmpty();
+ } else {
+ _builder.append("\t");
+ _builder.append("\t");
+ _builder.append("msgService = new MessageService(this, IMessageService::");
+ ExecMode _execmode_3 = thread_1.getExecmode();
+ String _name_3 = _execmode_3.getName();
+ _builder.append(_name_3, "\t\t");
+ _builder.append(", 0, ");
+ String _threadId_2 = this.getThreadId(thread_1);
+ _builder.append(_threadId_2, "\t\t");
+ _builder.append(", \"MessageService_");
+ String _name_4 = thread_1.getName();
+ _builder.append(_name_4, "\t\t");
+ _builder.append("\", ");
+ int _prio_1 = thread_1.getPrio();
+ _builder.append(_prio_1, "\t\t");
+ _builder.append(");");
+ _builder.newLineIfNotEmpty();
+ }
+ }
+ _builder.append("\t");
+ _builder.append("\t");
+ _builder.append("RTServices::getInstance().getMsgSvcCtrl().addMsgSvc(*msgService);");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ }
+ }
+ _builder.append("}");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("void ");
+ _builder.append(clsname, "");
+ _builder.append("::instantiateActors(){");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("// thread mappings");
+ _builder.newLine();
+ {
+ EList<ActorInstance> _allContainedInstances = comp.getAllContainedInstances();
+ for(final ActorInstance ai_1 : _allContainedInstances) {
+ _builder.append("\t");
+ final ETMapUtil.MappedThread mapped = ETMapUtil.getMappedThread(ai_1);
+ _builder.newLineIfNotEmpty();
+ {
+ boolean _or_1 = false;
+ boolean _isImplicit = mapped.isImplicit();
+ if (_isImplicit) {
+ _or_1 = true;
+ } else {
+ boolean _isAsParent = mapped.isAsParent();
+ _or_1 = _isAsParent;
+ }
+ boolean _not = (!_or_1);
+ if (_not) {
+ _builder.append("\t");
+ _builder.append("addPathToThread(\"");
+ String _path_1 = ai_1.getPath();
+ _builder.append(_path_1, "\t");
+ _builder.append("\", ");
+ PhysicalThread _thread = mapped.getThread();
+ String _threadId_3 = this.getThreadId(_thread);
+ _builder.append(_threadId_3, "\t");
+ _builder.append(");");
+ _builder.newLineIfNotEmpty();
+ }
+ }
+ }
+ }
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("// sub actors");
+ _builder.newLine();
+ {
+ EList<ActorRef> _actorRefs = cc.getActorRefs();
+ for(final ActorRef sub : _actorRefs) {
+ {
+ int _multiplicity = sub.getMultiplicity();
+ boolean _greaterThan = (_multiplicity > 1);
+ if (_greaterThan) {
+ _builder.append("\t");
+ _builder.append("for (int i=0; i<");
+ int _multiplicity_1 = sub.getMultiplicity();
+ _builder.append(_multiplicity_1, "\t");
+ _builder.append("; ++i) {");
+ _builder.newLineIfNotEmpty();
+ {
+ GlobalGeneratorSettings _settings = Main.getSettings();
+ boolean _isGenerateMSCInstrumentation = _settings.isGenerateMSCInstrumentation();
+ if (_isGenerateMSCInstrumentation) {
+ _builder.append("\t");
+ _builder.append("\t");
+ _builder.append("DebuggingService::getInstance().addMessageActorCreate(*this, \"");
+ String _name_5 = sub.getName();
+ _builder.append(_name_5, "\t\t");
+ _builder.append(GenmodelConstants.INDEX_SEP, "\t\t");
+ _builder.append("\"+i);");
+ _builder.newLineIfNotEmpty();
+ }
+ }
+ _builder.append("\t");
+ _builder.append("\t");
+ _builder.append("new ");
+ ActorClass _type_1 = sub.getType();
+ String _name_6 = _type_1.getName();
+ _builder.append(_name_6, "\t\t");
+ _builder.append("(this, \"");
+ String _name_7 = sub.getName();
+ _builder.append(_name_7, "\t\t");
+ _builder.append(GenmodelConstants.INDEX_SEP, "\t\t");
+ _builder.append("\"+i);");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ } else {
+ {
+ GlobalGeneratorSettings _settings_1 = Main.getSettings();
+ boolean _isGenerateMSCInstrumentation_1 = _settings_1.isGenerateMSCInstrumentation();
+ if (_isGenerateMSCInstrumentation_1) {
+ _builder.append("\t");
+ _builder.append("DebuggingService::getInstance().addMessageActorCreate(*this, \"");
+ String _name_8 = sub.getName();
+ _builder.append(_name_8, "\t");
+ _builder.append("\");");
+ _builder.newLineIfNotEmpty();
+ }
+ }
+ _builder.append("\t");
+ _builder.append("new ");
+ ActorClass _type_2 = sub.getType();
+ String _name_9 = _type_2.getName();
+ _builder.append(_name_9, "\t");
+ _builder.append("(this, \"");
+ String _name_10 = sub.getName();
+ _builder.append(_name_10, "\t");
+ _builder.append("\");");
+ _builder.newLineIfNotEmpty();
+ }
+ }
+ }
+ }
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("// wiring");
+ _builder.newLine();
+ {
+ EList<Wire> _wires = wired.getWires();
+ for(final Wire wire : _wires) {
+ _builder.append("\t");
+ String _xifexpression = null;
+ boolean _isDataDriven = wire.isDataDriven();
+ if (_isDataDriven) {
+ _xifexpression = "DataPortBase";
+ } else {
+ _xifexpression = "InterfaceItemBase";
+ }
+ _builder.append(_xifexpression, "\t");
+ _builder.append("::connect(this, \"");
+ EList<String> _path1 = wire.getPath1();
+ String _join = IterableExtensions.join(_path1, "/");
+ _builder.append(_join, "\t");
+ _builder.append("\", \"");
+ EList<String> _path2 = wire.getPath2();
+ String _join_1 = IterableExtensions.join(_path2, "/");
+ _builder.append(_join_1, "\t");
+ _builder.append("\");");
+ _builder.newLineIfNotEmpty();
+ }
+ }
+ _builder.append("}");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("void ");
+ _builder.append(clsname, "");
+ _builder.append("::init(){");
+ _builder.newLineIfNotEmpty();
+ {
+ GlobalGeneratorSettings _settings_2 = Main.getSettings();
+ boolean _isGenerateMSCInstrumentation_2 = _settings_2.isGenerateMSCInstrumentation();
+ if (_isGenerateMSCInstrumentation_2) {
+ _builder.append("\t");
+ _builder.append("DebuggingService::getInstance().addVisibleComment(\"begin sub system initialization\");");
+ _builder.newLine();
+ }
+ }
+ _builder.append("\t");
+ _builder.append("SubSystemClassBase::init();");
+ _builder.newLine();
+ {
+ GlobalGeneratorSettings _settings_3 = Main.getSettings();
+ boolean _isGenerateMSCInstrumentation_3 = _settings_3.isGenerateMSCInstrumentation();
+ if (_isGenerateMSCInstrumentation_3) {
+ _builder.append("\t");
+ _builder.append("DebuggingService::getInstance().addVisibleComment(\"done sub system initialization\");");
+ _builder.newLine();
+ }
+ }
+ _builder.append("}");
+ _builder.newLine();
+ {
+ GlobalGeneratorSettings _settings_4 = Main.getSettings();
+ boolean _isGenerateMSCInstrumentation_4 = _settings_4.isGenerateMSCInstrumentation();
+ if (_isGenerateMSCInstrumentation_4) {
+ _builder.newLine();
+ _builder.append("void ");
+ _builder.append(clsname, "");
+ _builder.append("::destroy() {");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("DebuggingService::getInstance().addVisibleComment(\"begin sub system destruction\");");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("SubSystemClassBase::destroy();");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("DebuggingService::getInstance().addVisibleComment(\"done sub system destruction\");");
+ _builder.newLine();
+ _builder.append("}");
+ _builder.newLine();
+ }
+ }
+ _builder.newLine();
+ _xblockexpression = _builder;
+ }
+ return _xblockexpression;
+ }
+}
diff --git a/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/NodeRunnerGen.java b/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/NodeRunnerGen.java
new file mode 100644
index 000000000..f545a6b45
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/NodeRunnerGen.java
@@ -0,0 +1,255 @@
+/**
+ * Copyright (c) 2011 Draeger Medical GmbH (http://www.draeger.com).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Peter Karlitschek (initial contribution)
+ */
+package org.eclipse.etrice.generator.cpp.gen;
+
+import com.google.common.base.Objects;
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.etrice.core.etmap.util.ETMapUtil;
+import org.eclipse.etrice.core.etphys.eTPhys.NodeRef;
+import org.eclipse.etrice.core.genmodel.etricegen.Root;
+import org.eclipse.etrice.core.genmodel.etricegen.StructureInstance;
+import org.eclipse.etrice.core.genmodel.etricegen.SubSystemInstance;
+import org.eclipse.etrice.core.genmodel.etricegen.SystemInstance;
+import org.eclipse.etrice.core.room.SubSystemClass;
+import org.eclipse.etrice.generator.cpp.gen.CppExtensions;
+import org.eclipse.etrice.generator.fsm.base.FileSystemHelpers;
+import org.eclipse.etrice.generator.fsm.base.IGeneratorFileIo;
+import org.eclipse.etrice.generator.generic.RoomExtensions;
+import org.eclipse.xtend2.lib.StringConcatenation;
+import org.eclipse.xtext.xbase.lib.Extension;
+
+@Singleton
+@SuppressWarnings("all")
+public class NodeRunnerGen {
+ @Inject
+ @Extension
+ private RoomExtensions roomExt;
+
+ @Inject
+ @Extension
+ private CppExtensions _cppExtensions;
+
+ @Inject
+ @Extension
+ private FileSystemHelpers _fileSystemHelpers;
+
+ @Inject
+ private IGeneratorFileIo fileIO;
+
+ public void doGenerate(final Root root) {
+ Collection<NodeRef> _nodeRefs = ETMapUtil.getNodeRefs();
+ for (final NodeRef nr : _nodeRefs) {
+ List<String> _subSystemInstancePaths = ETMapUtil.getSubSystemInstancePaths(nr);
+ for (final String instpath : _subSystemInstancePaths) {
+ {
+ StructureInstance _instance = root.getInstance(instpath);
+ final SubSystemInstance ssi = ((SubSystemInstance) _instance);
+ boolean _and = false;
+ boolean _notEquals = (!Objects.equal(ssi, null));
+ if (!_notEquals) {
+ _and = false;
+ } else {
+ SubSystemClass _subSystemClass = ssi.getSubSystemClass();
+ boolean _isValidGenerationLocation = this._fileSystemHelpers.isValidGenerationLocation(_subSystemClass);
+ _and = _isValidGenerationLocation;
+ }
+ if (_and) {
+ SubSystemClass _subSystemClass_1 = ssi.getSubSystemClass();
+ String _generationTargetPath = this.roomExt.getGenerationTargetPath(_subSystemClass_1);
+ SubSystemClass _subSystemClass_2 = ssi.getSubSystemClass();
+ String _path = this.roomExt.getPath(_subSystemClass_2);
+ final String filepath = (_generationTargetPath + _path);
+ SubSystemClass _subSystemClass_3 = ssi.getSubSystemClass();
+ String _generationInfoPath = this.roomExt.getGenerationInfoPath(_subSystemClass_3);
+ SubSystemClass _subSystemClass_4 = ssi.getSubSystemClass();
+ String _path_1 = this.roomExt.getPath(_subSystemClass_4);
+ final String infopath = (_generationInfoPath + _path_1);
+ String _cppClassName = this._cppExtensions.getCppClassName(nr, ssi);
+ String _plus = (_cppClassName + "Runner.h");
+ CharSequence _generateHeaderFile = this.generateHeaderFile(root, ssi);
+ this.fileIO.generateFile("generating SubSystemRunner declaration", filepath, infopath, _plus, _generateHeaderFile);
+ String _cppClassName_1 = this._cppExtensions.getCppClassName(nr, ssi);
+ String _plus_1 = (_cppClassName_1 + "Runner.cpp");
+ CharSequence _generateSourceFile = this.generateSourceFile(root, ssi);
+ this.fileIO.generateFile("generating SubSystemRunner implementation", filepath, infopath, _plus_1, _generateSourceFile);
+ }
+ }
+ }
+ }
+ }
+
+ public CharSequence generateHeaderFile(final Root root, final SubSystemInstance ssc) {
+ CharSequence _xblockexpression = null;
+ {
+ final NodeRef nr = ETMapUtil.getNodeRef(ssc);
+ final String clsname = this._cppExtensions.getCppClassName(nr, ssc);
+ StringConcatenation _builder = new StringConcatenation();
+ _builder.append("/**");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("* @author generated by eTrice");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("*");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("* this class contains the main function running component ");
+ String _name = ssc.getName();
+ _builder.append(_name, " ");
+ _builder.newLineIfNotEmpty();
+ _builder.append(" ");
+ _builder.append("* it instantiates ");
+ String _name_1 = ssc.getName();
+ _builder.append(_name_1, " ");
+ _builder.append(" and starts and ends the lifecycle");
+ _builder.newLineIfNotEmpty();
+ _builder.append(" ");
+ _builder.append("*/");
+ _builder.newLine();
+ _builder.newLine();
+ CharSequence _generateIncludeGuardBegin = this._cppExtensions.generateIncludeGuardBegin((clsname + "Runner"));
+ _builder.append(_generateIncludeGuardBegin, "");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("#include \"common/modelbase/SubSystemRunnerBase.h\"");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("class ");
+ _builder.append((clsname + "Runner"), "");
+ _builder.append(" : public etRuntime::SubSystemRunnerBase {");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("};");
+ _builder.newLine();
+ _builder.newLine();
+ CharSequence _generateIncludeGuardEnd = this._cppExtensions.generateIncludeGuardEnd((clsname + "Runner"));
+ _builder.append(_generateIncludeGuardEnd, "");
+ _builder.newLineIfNotEmpty();
+ _xblockexpression = _builder;
+ }
+ return _xblockexpression;
+ }
+
+ public CharSequence generateSourceFile(final Root root, final SubSystemInstance ssc) {
+ CharSequence _xblockexpression = null;
+ {
+ final NodeRef nr = ETMapUtil.getNodeRef(ssc);
+ final String clsname = this._cppExtensions.getCppClassName(nr, ssc);
+ StringConcatenation _builder = new StringConcatenation();
+ _builder.append("/**");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("* @author generated by eTrice");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("*");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("* this class contains the main function running component ");
+ String _name = ssc.getName();
+ _builder.append(_name, " ");
+ _builder.newLineIfNotEmpty();
+ _builder.append(" ");
+ _builder.append("* it instantiates ");
+ String _name_1 = ssc.getName();
+ _builder.append(_name_1, " ");
+ _builder.append(" and starts and ends the lifecycle");
+ _builder.newLineIfNotEmpty();
+ _builder.append(" ");
+ _builder.append("*/");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("#include \"");
+ _builder.append(clsname, "");
+ _builder.append("Runner.h\"");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("#include \"");
+ _builder.append(clsname, "");
+ _builder.append(".h\"");
+ _builder.newLineIfNotEmpty();
+ _builder.append("#include \"common/modelbase/RTSystem.h\"");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("using namespace etRuntime;");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("/**");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("* main function");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("* creates component and starts and stops the lifecycle");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("*/");
+ _builder.newLine();
+ _builder.append("int main(int argc, char* argv[]) {");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("// instantiate the main component");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("RTSystem* sys = ");
+ {
+ EObject _eContainer = ssc.eContainer();
+ if ((_eContainer instanceof SystemInstance)) {
+ _builder.append("new RTSystem(\"");
+ EObject _eContainer_1 = ssc.eContainer();
+ String _name_2 = ((SystemInstance) _eContainer_1).getName();
+ _builder.append(_name_2, "\t");
+ _builder.append("\")");
+ } else {
+ _builder.append("0");
+ }
+ }
+ _builder.append(";");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append(clsname, "\t");
+ _builder.append("* main_component = new ");
+ _builder.append(clsname, "\t");
+ _builder.append("(sys, \"");
+ String _name_3 = ssc.getName();
+ _builder.append(_name_3, "\t");
+ _builder.append("\");");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append(clsname, "\t");
+ _builder.append("Runner::run(*main_component, argc, argv);");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("// TODO JH crash");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("//delete sys;");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("return 0;");
+ _builder.newLine();
+ _builder.append("}");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.newLine();
+ _xblockexpression = _builder;
+ }
+ return _xblockexpression;
+ }
+}
diff --git a/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/ProtocolClassGen.java b/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/ProtocolClassGen.java
index 4cb5c5ba6..bf8c8d675 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/ProtocolClassGen.java
+++ b/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/ProtocolClassGen.java
@@ -11,9 +11,9 @@
package org.eclipse.etrice.generator.cpp.gen;
import com.google.common.base.Objects;
+import com.google.common.collect.Iterables;
import com.google.inject.Inject;
import com.google.inject.Singleton;
-import java.util.ArrayList;
import java.util.List;
import org.eclipse.emf.common.util.EList;
import org.eclipse.etrice.core.fsm.fSM.DetailCode;
@@ -30,34 +30,34 @@ import org.eclipse.etrice.core.room.MessageHandler;
import org.eclipse.etrice.core.room.Port;
import org.eclipse.etrice.core.room.PortClass;
import org.eclipse.etrice.core.room.PortOperation;
-import org.eclipse.etrice.core.room.PrimitiveType;
import org.eclipse.etrice.core.room.ProtocolClass;
import org.eclipse.etrice.core.room.RefableType;
+import org.eclipse.etrice.core.room.RoomModel;
import org.eclipse.etrice.core.room.SAP;
import org.eclipse.etrice.core.room.SPP;
import org.eclipse.etrice.core.room.VarDecl;
+import org.eclipse.etrice.generator.base.GlobalGeneratorSettings;
import org.eclipse.etrice.generator.cpp.Main;
import org.eclipse.etrice.generator.cpp.gen.CppExtensions;
-import org.eclipse.etrice.generator.cpp.gen.GeneratorSettings;
import org.eclipse.etrice.generator.cpp.gen.Initialization;
+import org.eclipse.etrice.generator.fsm.base.FileSystemHelpers;
+import org.eclipse.etrice.generator.fsm.base.IGeneratorFileIo;
import org.eclipse.etrice.generator.generic.GenericProtocolClassGenerator;
import org.eclipse.etrice.generator.generic.ProcedureHelpers;
import org.eclipse.etrice.generator.generic.RoomExtensions;
import org.eclipse.etrice.generator.generic.TypeHelpers;
import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.generator.JavaIoFileSystemAccess;
+import org.eclipse.xtext.xbase.lib.CollectionLiterals;
import org.eclipse.xtext.xbase.lib.Extension;
+import org.eclipse.xtext.xbase.lib.Functions.Function1;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
+import org.eclipse.xtext.xbase.lib.ListExtensions;
-/**
- * @author Peter Karlitschek
- */
@Singleton
@SuppressWarnings("all")
public class ProtocolClassGen extends GenericProtocolClassGenerator {
@Inject
- @Extension
- private JavaIoFileSystemAccess fileAccess;
+ private IGeneratorFileIo fileIO;
@Inject
@Extension
@@ -80,40 +80,59 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
private Initialization _initialization;
@Inject
+ @Extension
+ private FileSystemHelpers _fileSystemHelpers;
+
+ @Inject
private ILogger logger;
public void doGenerate(final Root root) {
EList<ProtocolClass> _usedProtocolClasses = root.getUsedProtocolClasses();
- for (final ProtocolClass pc : _usedProtocolClasses) {
+ final Function1<ProtocolClass, Boolean> _function = new Function1<ProtocolClass, Boolean>() {
+ public Boolean apply(final ProtocolClass cl) {
+ return Boolean.valueOf(ProtocolClassGen.this._fileSystemHelpers.isValidGenerationLocation(cl));
+ }
+ };
+ Iterable<ProtocolClass> _filter = IterableExtensions.<ProtocolClass>filter(_usedProtocolClasses, _function);
+ for (final ProtocolClass pc : _filter) {
{
String _generationTargetPath = this.roomExt.getGenerationTargetPath(pc);
String _path = this.roomExt.getPath(pc);
- String path = (_generationTargetPath + _path);
- String _cppHeaderFileName = this.stdExt.getCppHeaderFileName(pc);
- String _plus = ("generating ProtocolClass header \'" + _cppHeaderFileName);
- String _plus_1 = (_plus + "\' in \'");
- String _plus_2 = (_plus_1 + path);
- String _plus_3 = (_plus_2 + "\'");
- this.logger.logInfo(_plus_3);
- this.fileAccess.setOutputPath(path);
- String _cppHeaderFileName_1 = this.stdExt.getCppHeaderFileName(pc);
- CharSequence _generateHeaderFile = this.generateHeaderFile(root, pc);
- this.fileAccess.generateFile(_cppHeaderFileName_1, _generateHeaderFile);
- String _cppSourceFileName = this.stdExt.getCppSourceFileName(pc);
- String _plus_4 = ("generating ProtocolClass source \'" + _cppSourceFileName);
- String _plus_5 = (_plus_4 + "\' in \'");
- String _plus_6 = (_plus_5 + path);
- String _plus_7 = (_plus_6 + "\'");
- this.logger.logInfo(_plus_7);
- this.fileAccess.setOutputPath(path);
- String _cppSourceFileName_1 = this.stdExt.getCppSourceFileName(pc);
- CharSequence _generateSourceFile = this.generateSourceFile(root, pc);
- this.fileAccess.generateFile(_cppSourceFileName_1, _generateSourceFile);
+ final String path = (_generationTargetPath + _path);
+ String _generationInfoPath = this.roomExt.getGenerationInfoPath(pc);
+ String _path_1 = this.roomExt.getPath(pc);
+ final String infopath = (_generationInfoPath + _path_1);
+ CommunicationType _commType = pc.getCommType();
+ if (_commType != null) {
+ switch (_commType) {
+ case EVENT_DRIVEN:
+ String _cppHeaderFileName = this.stdExt.getCppHeaderFileName(pc);
+ CharSequence _generateHeaderFile = this.generateHeaderFile(root, pc);
+ this.fileIO.generateFile("generating ProtocolClass declaration", path, infopath, _cppHeaderFileName, _generateHeaderFile);
+ String _cppSourceFileName = this.stdExt.getCppSourceFileName(pc);
+ CharSequence _generateSourceFile = this.generateSourceFile(root, pc);
+ this.fileIO.generateFile("generating ProtocolClass implementation", path, infopath, _cppSourceFileName, _generateSourceFile);
+ break;
+ case DATA_DRIVEN:
+ String _cppHeaderFileName_1 = this.stdExt.getCppHeaderFileName(pc);
+ CharSequence _generateDataDrivenHeaderFile = this.generateDataDrivenHeaderFile(root, pc);
+ this.fileIO.generateFile("generating ProtocolClass declaration", path, infopath, _cppHeaderFileName_1, _generateDataDrivenHeaderFile);
+ String _cppSourceFileName_1 = this.stdExt.getCppSourceFileName(pc);
+ CharSequence _generateDataDrivenSourceFile = this.generateDataDrivenSourceFile(root, pc);
+ this.fileIO.generateFile("generating ProtocolClass implementation", path, infopath, _cppSourceFileName_1, _generateDataDrivenSourceFile);
+ break;
+ case SYNCHRONOUS:
+ this.logger.logError("synchronous protocols not supported yet", pc);
+ break;
+ default:
+ break;
+ }
+ }
}
}
}
- private CharSequence generateHeaderFile(final Root root, final ProtocolClass pc) {
+ protected CharSequence generateHeaderFile(final Root root, final ProtocolClass pc) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("/**");
_builder.newLine();
@@ -129,7 +148,7 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.append(_name, " ");
_builder.newLineIfNotEmpty();
_builder.append(" ");
- _builder.append("* ");
+ _builder.append("*");
_builder.newLine();
_builder.append(" ");
_builder.append("*/");
@@ -140,36 +159,20 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.append(_generateIncludeGuardBegin, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
- _builder.append("#include \"platforms/generic/etDatatypes.h\"");
- _builder.newLine();
- _builder.append("#include \"common/messaging/IRTObject.h\"");
+ _builder.append("#include \"common/modelbase/InterfaceItemBase.h\"");
_builder.newLine();
_builder.append("#include \"common/modelbase/PortBase.h\"");
_builder.newLine();
- _builder.append("#include \"common/modelbase/InterfaceItemBase.h\"");
+ _builder.append("#include \"common/modelbase/ReplicatedInterfaceItemBase.h\"");
_builder.newLine();
- _builder.append("#include \"common/messaging/Address.h\"");
+ _builder.append("#include \"common/modelbase/ReplicatedPortBase.h\"");
_builder.newLine();
- _builder.append("#include \"common/messaging/Message.h\"");
- _builder.newLine();
- _builder.append("#include <vector>");
+ _builder.append("#include <etDatatypes.h>");
_builder.newLine();
_builder.append("#include <string>");
_builder.newLine();
- _builder.append("\t\t");
- _builder.newLine();
- _builder.append("namespace etRuntime {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("class IEventReceiver;");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
_builder.newLine();
- DetailCode _userCode1 = pc.getUserCode1();
- CharSequence _userCode = this.helpers.userCode(_userCode1);
+ CharSequence _userCode = this.helpers.userCode(pc, 1);
_builder.append(_userCode, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
@@ -194,98 +197,95 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.append(" ");
_builder.append("public:");
_builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("/* message IDs */");
+ _builder.newLine();
+ _builder.append("\t\t");
+ String _genMessageIDs = this.genMessageIDs(pc);
+ _builder.append(_genMessageIDs, "\t\t");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("\t\t");
+ CharSequence _userCode_1 = this.helpers.userCode(pc, 2);
+ _builder.append(_userCode_1, "\t\t");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("static bool isValidEvtID(int evtId) {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("return ((MSG_MIN < evtId) && (evtId < MSG_MAX));");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("static bool isValidOutgoingEvtID(int evtId) {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("return ((MSG_MIN < evtId) && (evtId < ");
{
- CommunicationType _commType = pc.getCommType();
- boolean _equals = Objects.equal(_commType, CommunicationType.EVENT_DRIVEN);
+ EList<Message> _incomingMessages = pc.getIncomingMessages();
+ int _size = _incomingMessages.size();
+ boolean _equals = (_size == 0);
if (_equals) {
- _builder.append("\t /* message IDs */");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- String _genMessageIDs = this.genMessageIDs(pc);
- _builder.append(_genMessageIDs, "\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("static bool isValidEvtID(int evtId) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("return ((MSG_MIN < evtId) && (evtId < MSG_MAX));");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("};");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("static bool isValidOutgoingEvtID(int evtId) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("return ((MSG_MIN < evtId) && (evtId < ");
- {
- EList<Message> _incomingMessages = pc.getIncomingMessages();
- int _size = _incomingMessages.size();
- boolean _equals_1 = (_size == 0);
- if (_equals_1) {
- _builder.append("MSG_MAX");
- } else {
- _builder.append("IN_");
- EList<Message> _incomingMessages_1 = pc.getIncomingMessages();
- Message _get = _incomingMessages_1.get(0);
- String _name_4 = _get.getName();
- _builder.append(_name_4, "\t\t\t");
- }
- }
- _builder.append("));");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("};");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("static bool isValidIncomingEvtID(int evtId) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("return ((");
- {
- EList<Message> _incomingMessages_2 = pc.getIncomingMessages();
- int _size_1 = _incomingMessages_2.size();
- boolean _equals_2 = (_size_1 == 0);
- if (_equals_2) {
- _builder.append("MSG_MAX");
- } else {
- _builder.append("IN_");
- EList<Message> _incomingMessages_3 = pc.getIncomingMessages();
- Message _get_1 = _incomingMessages_3.get(0);
- String _name_5 = _get_1.getName();
- _builder.append(_name_5, "\t\t\t");
- }
- }
- _builder.append(" <= evtId) && (evtId < MSG_MAX));");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("};");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("static std::string getMessageString(int msg_id);");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("private:");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("static std::string s_messageStrings[];");
- _builder.newLine();
+ _builder.append("MSG_MAX");
+ } else {
+ _builder.append("IN_");
+ EList<Message> _incomingMessages_1 = pc.getIncomingMessages();
+ Message _get = _incomingMessages_1.get(0);
+ String _name_4 = _get.getName();
+ _builder.append(_name_4, "\t\t\t");
}
}
+ _builder.append("));");
+ _builder.newLineIfNotEmpty();
_builder.append("\t\t");
- DetailCode _userCode2 = pc.getUserCode2();
- CharSequence _userCode_1 = this.helpers.userCode(_userCode2);
- _builder.append(_userCode_1, "\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("static bool isValidIncomingEvtID(int evtId) {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("return ((");
+ {
+ EList<Message> _incomingMessages_2 = pc.getIncomingMessages();
+ int _size_1 = _incomingMessages_2.size();
+ boolean _equals_1 = (_size_1 == 0);
+ if (_equals_1) {
+ _builder.append("MSG_MAX");
+ } else {
+ _builder.append("IN_");
+ EList<Message> _incomingMessages_3 = pc.getIncomingMessages();
+ Message _get_1 = _incomingMessages_3.get(0);
+ String _name_5 = _get_1.getName();
+ _builder.append(_name_5, "\t\t\t");
+ }
+ }
+ _builder.append(" <= evtId) && (evtId < MSG_MAX));");
_builder.newLineIfNotEmpty();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("static const std::string& getMessageString(int msg_id);");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("private:");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("static const std::string s_messageStrings[];");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.newLine();
_builder.append("};");
_builder.newLine();
_builder.newLine();
- CharSequence _portClassDeclaration = this.portClassDeclaration(pc, Boolean.valueOf(false));
+ CharSequence _portClassDeclaration = this.portClassDeclaration(pc, false);
_builder.append(_portClassDeclaration, "");
_builder.newLineIfNotEmpty();
- CharSequence _portClassDeclaration_1 = this.portClassDeclaration(pc, Boolean.valueOf(true));
+ CharSequence _portClassDeclaration_1 = this.portClassDeclaration(pc, true);
_builder.append(_portClassDeclaration_1, "");
_builder.newLineIfNotEmpty();
String _name_6 = pc.getName();
@@ -295,18 +295,18 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
return _builder;
}
- private CharSequence portClassDeclaration(final ProtocolClass pc, final Boolean conj) {
+ protected CharSequence portClassDeclaration(final ProtocolClass pc, final boolean conj) {
CharSequence _xblockexpression = null;
{
- PortClass pclass = this.roomExt.getPortClass(pc, (conj).booleanValue());
- String portClassName = this.roomExt.getPortClassName(pc, (conj).booleanValue());
- String replPortClassName = this.roomExt.getPortClassName(pc, (conj).booleanValue(), true);
+ PortClass pclass = this.roomExt.getPortClass(pc, conj);
+ String portClassName = this.roomExt.getPortClassName(pc, conj);
+ String replPortClassName = this.roomExt.getPortClassName(pc, conj, true);
StringConcatenation _builder = new StringConcatenation();
_builder.append("//------------------------------------------------------------------------------------------------------------");
_builder.newLine();
_builder.append("// ");
{
- if ((conj).booleanValue()) {
+ if (conj) {
_builder.append("conjugated ");
}
}
@@ -331,20 +331,28 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.append(" ");
_builder.append("public:");
_builder.newLine();
- _builder.append("\t");
- _builder.append("// constructors");
- _builder.newLine();
_builder.append("\t ");
_builder.append(portClassName, "\t ");
- _builder.append("(etRuntime::IEventReceiver& actor, etRuntime::IRTObject* parent, std::string name, int localId, etRuntime::Address addr, etRuntime::Address peerAddress, bool doRegistration = true); ");
+