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 /runtime
parentdc98de4bb145d8d3789909e32c11765596165fbb (diff)
downloadorg.eclipse.etrice-81750c5e633ad14e7ab25b016564af20fec0a1cc.tar.gz
org.eclipse.etrice-81750c5e633ad14e7ab25b016564af20fec0a1cc.tar.xz
org.eclipse.etrice-81750c5e633ad14e7ab25b016564af20fec0a1cc.zip
[generators] added cpp generator draft
Diffstat (limited to 'runtime')
-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.cpp23
-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.h (renamed from runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/IMessageReceiver.cpp)20
-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
113 files changed, 3654 insertions, 3040 deletions
diff --git a/runtime/org.eclipse.etrice.modellib.c/.cproject b/runtime/org.eclipse.etrice.modellib.c/.cproject
index 127a203dc..3637b3de5 100644
--- a/runtime/org.eclipse.etrice.modellib.c/.cproject
+++ b/runtime/org.eclipse.etrice.modellib.c/.cproject
@@ -12,13 +12,13 @@
</externalSetting>
</externalSettings>
<extensions>
- <extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.lib.debug.847049798" name="WindowsMinGW" parent="cdt.managedbuild.config.gnu.mingw.lib.debug">
+ <configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" 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.staticLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.lib.debug.847049798" name="WindowsMinGW" parent="cdt.managedbuild.config.gnu.mingw.lib.debug">
<folderInfo id="cdt.managedbuild.config.gnu.mingw.lib.debug.847049798." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.mingw.lib.debug.384751993" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.lib.debug">
<targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.lib.debug.890594653" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.lib.debug"/>
@@ -49,6 +49,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.2005279778" superClass="gnu.c.compiler.option.dialect.std" value="gnu.c.compiler.dialect.c99" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.161900119" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.base.1011028586" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.base"/>
@@ -85,11 +86,11 @@
</externalSetting>
</externalSettings>
<extensions>
- <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" 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"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
@@ -161,11 +162,11 @@
</externalSetting>
</externalSettings>
<extensions>
- <extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" 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"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
diff --git a/runtime/org.eclipse.etrice.modellib.cpp/.cproject b/runtime/org.eclipse.etrice.modellib.cpp/.cproject
index 0746c4ef3..717915687 100644
--- a/runtime/org.eclipse.etrice.modellib.cpp/.cproject
+++ b/runtime/org.eclipse.etrice.modellib.cpp/.cproject
@@ -2,31 +2,35 @@
<?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.lib.debug.44153035">
- <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.lib.debug.44153035" moduleId="org.eclipse.cdt.core.settings" name="Debug">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.lib.debug.44153035" moduleId="org.eclipse.cdt.core.settings" name="WindowsMinGW">
<externalSettings>
<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/Debug"/>
+ <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>
<extensions>
- <extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
<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.PE" point="org.eclipse.cdt.core.BinaryParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <configuration artifactExtension="a" artifactName="org.eclipse.etrice.modellib.cpp" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" 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.staticLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.lib.debug.44153035" name="Debug" parent="cdt.managedbuild.config.gnu.mingw.lib.debug">
+ <configuration artifactExtension="a" artifactName="org.eclipse.etrice.modellib.cpp" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" 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.staticLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.lib.debug.44153035" name="WindowsMinGW" parent="cdt.managedbuild.config.gnu.mingw.lib.debug">
<folderInfo id="cdt.managedbuild.config.gnu.mingw.lib.debug.44153035." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.mingw.lib.debug.528335783" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.lib.debug">
<targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.lib.debug.1299569783" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.lib.debug"/>
- <builder buildPath="${workspace_loc:/org.eclipse.etrice.modellib.cpp/Debug}" id="cdt.managedbuild.tool.gnu.builder.mingw.base.2013445161" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="cdt.managedbuild.tool.gnu.builder.mingw.base"/>
+ <builder buildPath="${workspace_loc:/org.eclipse.etrice.modellib.cpp}/WindowsMinGW" id="cdt.managedbuild.tool.gnu.builder.mingw.base.334543344" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="cdt.managedbuild.tool.gnu.builder.mingw.base"/>
<tool id="cdt.managedbuild.tool.gnu.assembler.mingw.lib.debug.724387525" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.lib.debug">
<option id="gnu.both.asm.option.include.paths.1757143474" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
+ <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.modellib.cpp/src-gen}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src/platforms/generic}&quot;"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1284881452" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
@@ -35,19 +39,28 @@
<option id="gnu.cpp.compiler.mingw.lib.debug.option.optimization.level.1721757225" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.lib.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
<option id="gnu.cpp.compiler.mingw.lib.debug.option.debugging.level.1204207148" name="Debug Level" superClass="gnu.cpp.compiler.mingw.lib.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.include.paths.1001723439" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+ <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.modellib.cpp/src-gen}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src/platforms/generic}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src-gen}&quot;"/>
</option>
+ <option id="gnu.cpp.compiler.option.dialect.std.1027459885" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" value="gnu.cpp.compiler.dialect.c++98" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.warnings.pedantic.error.1553779395" name="Pedantic warnings as errors (-pedantic-errors)" superClass="gnu.cpp.compiler.option.warnings.pedantic.error" value="true" valueType="boolean"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.402201359" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.lib.debug.485632379" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.lib.debug">
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.mingw.lib.debug.option.optimization.level.386071444" name="Optimization Level" superClass="gnu.c.compiler.mingw.lib.debug.option.optimization.level" valueType="enumerated"/>
<option id="gnu.c.compiler.mingw.lib.debug.option.debugging.level.2121576926" name="Debug Level" superClass="gnu.c.compiler.mingw.lib.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
<option id="gnu.c.compiler.option.include.paths.1424766451" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
+ <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.modellib.cpp/src-gen}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src/platforms/generic}&quot;"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.2050037191" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
@@ -55,95 +68,231 @@
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base.386321355" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base"/>
</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"/>
+ <storageModule moduleId="org.eclipse.cdt.core.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>
+ </storageModule>
</cconfiguration>
- <cconfiguration id="cdt.managedbuild.config.gnu.mingw.lib.release.369390927">
- <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.lib.release.369390927" moduleId="org.eclipse.cdt.core.settings" name="Release">
+ <cconfiguration id="cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.90416093">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.90416093" moduleId="org.eclipse.cdt.core.settings" name="ExternalMakefile">
<externalSettings>
<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/Release"/>
+ <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>
<extensions>
- <extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
<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.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"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.lib.release.369390927" name="Release" parent="cdt.managedbuild.config.gnu.mingw.lib.release">
- <folderInfo id="cdt.managedbuild.config.gnu.mingw.lib.release.369390927." name="/" resourcePath="">
- <toolChain id="cdt.managedbuild.toolchain.gnu.mingw.lib.release.863050384" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.lib.release">
- <targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.lib.release.1531613870" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.lib.release"/>
- <builder buildPath="${workspace_loc:/org.eclipse.etrice.modellib.cpp/Release}" id="cdt.managedbuild.tool.gnu.builder.mingw.base.658172533" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="cdt.managedbuild.tool.gnu.builder.mingw.base"/>
- <tool id="cdt.managedbuild.tool.gnu.assembler.mingw.lib.release.1090371584" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.lib.release">
- <option id="gnu.both.asm.option.include.paths.2079893992" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
+ <configuration artifactExtension="a" artifactName="org.eclipse.etrice.modellib.cpp" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" 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.staticLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.90416093" name="ExternalMakefile" parent="cdt.managedbuild.config.gnu.mingw.lib.debug">
+ <folderInfo id="cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.90416093." name="/" resourcePath="">
+ <toolChain id="cdt.managedbuild.toolchain.gnu.mingw.lib.debug.488608050" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.lib.debug">
+ <targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.lib.debug.2112042599" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.lib.debug"/>
+ <builder id="cdt.managedbuild.target.gnu.builder.base.1876012904" incrementalBuildTarget="build" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.assembler.mingw.lib.debug.1018894377" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.lib.debug">
+ <option id="gnu.both.asm.option.include.paths.54562668" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
+ <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:/org.eclipse.etrice.modellib.cpp/src-gen}&quot;"/>
- <listOptionValue builtIn="false" value="/org.eclipse.etrice.runtime.cpp/src/platform/generic"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src/platforms/generic}&quot;"/>
</option>
- <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1692202427" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+ <inputType id="cdt.managedbuild.tool.gnu.assembler.input.287217142" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
- <tool id="cdt.managedbuild.tool.gnu.archiver.mingw.lib.release.859095155" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.lib.release"/>
- <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.lib.release.756312591" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.lib.release">
- <option id="gnu.cpp.compiler.mingw.lib.release.option.optimization.level.2147476314" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.lib.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
- <option id="gnu.cpp.compiler.mingw.lib.release.option.debugging.level.1387780898" name="Debug Level" superClass="gnu.cpp.compiler.mingw.lib.release.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
- <option id="gnu.cpp.compiler.option.include.paths.528505037" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+ <tool id="cdt.managedbuild.tool.gnu.archiver.mingw.lib.debug.1527067482" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.lib.debug"/>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.lib.debug.448305340" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.lib.debug">
+ <option id="gnu.cpp.compiler.mingw.lib.debug.option.optimization.level.117342493" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.lib.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.mingw.lib.debug.option.debugging.level.1035517938" name="Debug Level" superClass="gnu.cpp.compiler.mingw.lib.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.include.paths.27501825" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+ <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.54501712" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.lib.debug.929736773" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.lib.debug">
+ <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.mingw.lib.debug.option.optimization.level.456166370" name="Optimization Level" superClass="gnu.c.compiler.mingw.lib.debug.option.optimization.level" valueType="enumerated"/>
+ <option id="gnu.c.compiler.mingw.lib.debug.option.debugging.level.1203197176" name="Debug Level" superClass="gnu.c.compiler.mingw.lib.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.include.paths.776631792" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
+ <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.249749500" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.base.7150152" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base.1795174830" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base"/>
+ </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>
+ </storageModule>
+ </cconfiguration>
+ <cconfiguration id="cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.551809464">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.551809464" moduleId="org.eclipse.cdt.core.settings" name="LinuxPosix">
+ <externalSettings>
+ <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>
+ <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.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"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactExtension="a" artifactName="org.eclipse.etrice.modellib.cpp" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" 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.staticLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.551809464" name="LinuxPosix" parent="cdt.managedbuild.config.gnu.mingw.lib.debug">
+ <folderInfo id="cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.551809464." name="/" resourcePath="">
+ <toolChain id="cdt.managedbuild.toolchain.gnu.base.1769544793" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.base">
+ <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.target.gnu.platform.base.1007475917" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/>
+ <builder buildPath="${workspace_loc:/org.eclipse.etrice.modellib.cpp}/LinuxPosix" id="cdt.managedbuild.target.gnu.builder.base.255029229" keepEnvironmentInBuildfile="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.archiver.base.1464497979" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.1653033041" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base">
+ <option id="gnu.cpp.compiler.option.include.paths.1352950879" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+ <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.modellib.cpp/src-gen}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src/platforms/generic}&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>
- <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1763050360" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+ <option id="gnu.cpp.compiler.option.optimization.level.1192159685" 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.536107719" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.dialect.std.141185236" superClass="gnu.cpp.compiler.option.dialect.std" value="gnu.cpp.compiler.dialect.c++98" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.warnings.pedantic.495840162" superClass="gnu.cpp.compiler.option.warnings.pedantic" value="true" valueType="boolean"/>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1729514812" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.compiler.base.1143151683" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.base">
+ <option id="gnu.c.compiler.option.include.paths.1608033267" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths"/>
+ <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.863477407" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.debugging.level.567501402" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1482592347" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
- <tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.lib.release.129970568" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.lib.release">
- <option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.mingw.lib.release.option.optimization.level.1329568783" name="Optimization Level" superClass="gnu.c.compiler.mingw.lib.release.option.optimization.level" valueType="enumerated"/>
- <option id="gnu.c.compiler.mingw.lib.release.option.debugging.level.1807223219" name="Debug Level" superClass="gnu.c.compiler.mingw.lib.release.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/>
- <option id="gnu.c.compiler.option.include.paths.316043543" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
+ <tool id="cdt.managedbuild.tool.gnu.c.linker.base.918402900" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.linker.base.900175608" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.assembler.base.2102428941" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.base">
+ <option id="gnu.both.asm.option.include.paths.1581322722" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
+ <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.modellib.cpp/src-gen}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src/platforms/generic}&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;"/>
</option>
- <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.760635415" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ <inputType id="cdt.managedbuild.tool.gnu.assembler.input.2112266569" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
- <tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.base.1854320864" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.base"/>
- <tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base.1472356875" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base"/>
</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"/>
+ <storageModule moduleId="org.eclipse.cdt.core.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>
+ </storageModule>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="org.eclipse.etrice.modellib.cpp.cdt.managedbuild.target.gnu.mingw.lib.704211053" name="Static Library" projectType="cdt.managedbuild.target.gnu.mingw.lib"/>
</storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
+ <storageModule moduleId="refreshScope" versionNumber="2">
+ <configuration configurationName="ExternalMakefile">
+ <resource resourceType="PROJECT" workspacePath="/org.eclipse.etrice.modellib.cpp"/>
+ </configuration>
+ <configuration configurationName="WindowsMinGW">
+ <resource resourceType="PROJECT" workspacePath="/org.eclipse.etrice.modellib.cpp"/>
+ </configuration>
+ </storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.551809464;cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.551809464.;cdt.managedbuild.tool.gnu.c.compiler.mingw.lib.debug.456186999;cdt.managedbuild.tool.gnu.c.compiler.input.278038575">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.lib.debug.44153035;cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.lib.debug.118960948;cdt.managedbuild.tool.gnu.cpp.compiler.input.402201359">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.lib.release.369390927;cdt.managedbuild.config.gnu.mingw.lib.release.369390927.;cdt.managedbuild.tool.gnu.c.compiler.mingw.lib.release.129970568;cdt.managedbuild.tool.gnu.c.compiler.input.760635415">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
</scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.90416093;cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.90416093.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.lib.debug.448305340;cdt.managedbuild.tool.gnu.cpp.compiler.input.54501712">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.lib.debug.44153035;cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.;cdt.managedbuild.tool.gnu.c.compiler.mingw.lib.debug.485632379;cdt.managedbuild.tool.gnu.c.compiler.input.2050037191">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
</scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.551809464;cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.551809464.;cdt.managedbuild.tool.gnu.c.compiler.base.1143151683;cdt.managedbuild.tool.gnu.c.compiler.input.1482592347">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.551809464;cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.551809464.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.lib.debug.254249640;cdt.managedbuild.tool.gnu.cpp.compiler.input.10447823">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.lib.release.369390927;cdt.managedbuild.config.gnu.mingw.lib.release.369390927.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.lib.release.756312591;cdt.managedbuild.tool.gnu.cpp.compiler.input.1763050360">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
</scannerConfigBuildInfo>
- </storageModule>
- <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
- <storageModule moduleId="refreshScope" versionNumber="2">
- <configuration configurationName="Release">
- <resource resourceType="PROJECT" workspacePath="/org.eclipse.etrice.modellib.cpp"/>
- </configuration>
- <configuration configurationName="Debug">
- <resource resourceType="PROJECT" workspacePath="/org.eclipse.etrice.modellib.cpp"/>
- </configuration>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.551809464;cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.551809464.;cdt.managedbuild.tool.gnu.cpp.compiler.base.1653033041;cdt.managedbuild.tool.gnu.cpp.compiler.input.1729514812">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.90416093;cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.90416093.;cdt.managedbuild.tool.gnu.c.compiler.mingw.lib.debug.929736773;cdt.managedbuild.tool.gnu.c.compiler.input.249749500">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </scannerConfigBuildInfo>
</storageModule>
</cproject>
diff --git a/runtime/org.eclipse.etrice.modellib.cpp/.gitignore b/runtime/org.eclipse.etrice.modellib.cpp/.gitignore
index 0f3a6b1b9..5d84de410 100644
--- a/runtime/org.eclipse.etrice.modellib.cpp/.gitignore
+++ b/runtime/org.eclipse.etrice.modellib.cpp/.gitignore
@@ -1,2 +1,14 @@
-Debug
-Release
+WindowsMinGW
+LinuxPosix
+
+src-gen/*
+!src-gen/readme.txt
+src-gen-info/*
+!src-gen-info/readme.txt
+
+*.aux
+*.lof
+*.gz
+*.toc
+*.log
+/MinGWDebug/
diff --git a/runtime/org.eclipse.etrice.modellib.cpp/.project b/runtime/org.eclipse.etrice.modellib.cpp/.project
index 34286da09..218d6fc34 100644
--- a/runtime/org.eclipse.etrice.modellib.cpp/.project
+++ b/runtime/org.eclipse.etrice.modellib.cpp/.project
@@ -3,6 +3,7 @@
<name>org.eclipse.etrice.modellib.cpp</name>
<comment></comment>
<projects>
+ <project>org.eclipse.etrice.runtime.cpp</project>
</projects>
<buildSpec>
<buildCommand>
diff --git a/runtime/org.eclipse.etrice.modellib.cpp/.settings/org.eclipse.cdt.core.prefs b/runtime/org.eclipse.etrice.modellib.cpp/.settings/org.eclipse.cdt.core.prefs
new file mode 100644
index 000000000..1cbabde2f
--- /dev/null
+++ b/runtime/org.eclipse.etrice.modellib.cpp/.settings/org.eclipse.cdt.core.prefs
@@ -0,0 +1,12 @@
+eclipse.preferences.version=1
+environment/project/cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.90416093/CPP_RUNTIME_ROOTDIR/delimiter=;
+environment/project/cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.90416093/CPP_RUNTIME_ROOTDIR/operation=append
+environment/project/cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.90416093/CPP_RUNTIME_ROOTDIR/value=${workspace_loc\:org.eclipse.etrice.runtime.cpp}
+environment/project/cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.90416093/ECLIPSE_MODE/delimiter=;
+environment/project/cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.90416093/ECLIPSE_MODE/operation=append
+environment/project/cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.90416093/ECLIPSE_MODE/value=true
+environment/project/cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.90416093/RUNTIME_ROOTDIR/delimiter=;
+environment/project/cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.90416093/RUNTIME_ROOTDIR/operation=append
+environment/project/cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.90416093/RUNTIME_ROOTDIR/value=${workspace_loc\:org.eclipse.etrice.runtime.c}
+environment/project/cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.90416093/append=true
+environment/project/cdt.managedbuild.config.gnu.mingw.lib.debug.44153035.90416093/appendContributed=true
diff --git a/runtime/org.eclipse.etrice.modellib.cpp/Makefile b/runtime/org.eclipse.etrice.modellib.cpp/Makefile
new file mode 100644
index 000000000..4236856be
--- /dev/null
+++ b/runtime/org.eclipse.etrice.modellib.cpp/Makefile
@@ -0,0 +1,20 @@
+ifeq ($(strip ${RUNTIME_ROOTDIR}),)
+ RUNTIME_ROOTDIR := ../org.eclipse.etrice.runtime.c
+endif
+ifeq ($(strip ${CPP_RUNTIME_ROOTDIR}),)
+ CPP_RUNTIME_ROOTDIR := ../org.eclipse.etrice.runtime.cpp
+endif
+
+include ${CPP_RUNTIME_ROOTDIR}/buildTools/runtime.mk
+
+# ---
+IN_TARGET := lib$(notdir $(shell pwd)).a
+IN_INCDIRS += ./src-gen
+IN_SRCDIRS_REC := ./src-gen
+CC = ${CXX}
+IN_CFLAGS += -std=c++98 -O0 -g3 -pedantic -Wall
+# ---
+
+
+# Create rules
+include ${RUNTIME_ROOTDIR}/buildTools/Makefile.mk \ No newline at end of file
diff --git a/runtime/org.eclipse.etrice.modellib.cpp/buildTools/modellib.mk b/runtime/org.eclipse.etrice.modellib.cpp/buildTools/modellib.mk
new file mode 100644
index 000000000..a21037ef4
--- /dev/null
+++ b/runtime/org.eclipse.etrice.modellib.cpp/buildTools/modellib.mk
@@ -0,0 +1,17 @@
+include ${RUNTIME_ROOTDIR}/buildTools/defaults.mk
+
+# ---
+IN_INCDIRS += ${CPP_MODELLIB_ROOTDIR}/src-gen
+
+IN_LDFLAGS += -L${CPP_MODELLIB_ROOTDIR}/${TARGET_BUILD_DIR}
+IN_LDLIBS += -lorg.eclipse.etrice.modellib.cpp
+ifeq ($(strip ${ECLIPSE_MODE}),)
+ IN_PREREQS += liborg.eclipse.etrice.modellib.cpp.a
+endif
+
+liborg.eclipse.etrice.modellib.cpp.a:
+ ${MAKE} -C ${CPP_MODELLIB_ROOTDIR} build
+
+clean_liborg.eclipse.etrice.modellib.cpp.a:
+ ${MAKE} -C ${CPP_MODELLIB_ROOTDIR} clean
+
diff --git a/runtime/org.eclipse.etrice.modellib.cpp/gen_modellib.launch b/runtime/org.eclipse.etrice.modellib.cpp/gen_modellib.launch
index 7d753659a..20bfb754c 100644
--- a/runtime/org.eclipse.etrice.modellib.cpp/gen_modellib.launch
+++ b/runtime/org.eclipse.etrice.modellib.cpp/gen_modellib.launch
@@ -1,13 +1,20 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.etrice.generator.launch.cpp.launchConfigurationType">
+<booleanAttribute key="DataLogging" value="false"/>
+<booleanAttribute key="Debug" value="false"/>
+<booleanAttribute key="GenDocumentation" value="false"/>
<booleanAttribute key="GenInstanceDiagram" value="false"/>
<stringAttribute key="GenModelPath" value=""/>
<booleanAttribute key="Lib" value="true"/>
+<booleanAttribute key="MSC" value="true"/>
<listAttribute key="ModelFiles">
-<listEntry value="${workspace_loc:/org.eclipse.etrice.modellib.cpp/model/Language.room}"/>
<listEntry value="${workspace_loc:/org.eclipse.etrice.modellib.cpp/model/TimingService.room}"/>
<listEntry value="${workspace_loc:/org.eclipse.etrice.modellib.cpp/model/Types.room}"/>
</listAttribute>
+<booleanAttribute key="OverrideDirectories" value="false"/>
<booleanAttribute key="SaveGenModel" value="false"/>
+<booleanAttribute key="UseTranslation" value="true"/>
+<booleanAttribute key="Verbose" value="false"/>
+<booleanAttribute key="etUnit" value="false"/>
<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;resources&gt;&#13;&#10;&lt;item path=&quot;/org.eclipse.etrice.modellib.cpp/src-gen&quot; type=&quot;2&quot;/&gt;&#13;&#10;&lt;/resources&gt;}"/>
</launchConfiguration>
diff --git a/runtime/org.eclipse.etrice.modellib.cpp/model/GenericPhysical.etphys b/runtime/org.eclipse.etrice.modellib.cpp/model/GenericPhysical.etphys
new file mode 100644
index 000000000..27f442b9c
--- /dev/null
+++ b/runtime/org.eclipse.etrice.modellib.cpp/model/GenericPhysical.etphys
@@ -0,0 +1,43 @@
+PhysicalModel room.generic.physical {
+
+ PhysicalSystem GenericPhysicalSystem {
+ NodeRef node : GenericNodeClass
+ }
+
+ NodeClass GenericNodeClass {
+ 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/runtime/org.eclipse.etrice.modellib.cpp/model/Tests.room b/runtime/org.eclipse.etrice.modellib.cpp/model/Tests.room
new file mode 100644
index 000000000..48e49e03d
--- /dev/null
+++ b/runtime/org.eclipse.etrice.modellib.cpp/model/Tests.room
@@ -0,0 +1,16 @@
+RoomModel room.basic.etunit {
+
+ import room.basic.types.* from "Types.room"
+
+ /**
+ * A SubSystemClass or ActorClass having this annotation is construed as an instance.<br>
+ * During generation the necessary instantiation (LogicalSystem, SubSystemRef etc.) and mapping will be created.
+ * <p>
+ * Must not have LogicalThreads. Globally only once allowed. Runtime execution on DefaultThread of given PhysicalSystem.
+ * </p>
+ */
+ AnnotationType TestInstance {
+ target = { SubSystemClass, ActorClass }
+ }
+
+} \ No newline at end of file
diff --git a/runtime/org.eclipse.etrice.modellib.cpp/model/TimingService.room b/runtime/org.eclipse.etrice.modellib.cpp/model/TimingService.room
index f90df84a7..ba8953ff4 100644
--- a/runtime/org.eclipse.etrice.modellib.cpp/model/TimingService.room
+++ b/runtime/org.eclipse.etrice.modellib.cpp/model/TimingService.room
@@ -8,139 +8,141 @@ RoomModel room.basic.service.timing {
}
Structure {
usercode1 {
- "
- #include \"common/platform/etTimer.h\"
- #define ET_NB_OF_TCBS 10
- typedef struct etTCB etTimerControlBlock;
- struct etTCB {
- etTargetTime_t expTime;
- etTargetTime_t pTime;
- int32 portIdx;
- etTimerControlBlock* next;
- };
- "
+ "#include \"osal/etTime.h\" "
+ "#define ET_NB_OF_TCBS 30"
+ "typedef struct etTCB etTimerControlBlock;"
+ "struct etTCB {"
+ " etTime expTime;"
+ " etTime pTime;"
+ " int32 portIdx;"
+ " etTimerControlBlock* next;"
+ "};"
}
usercode2 {
- "//uc2"
+ "// uc2"
+ } usercode3 {
+ "// uc3"
}
- usercode3{
- "//etTimerControlBlock tcbs[ET_NB_OF_TCBS];"
- }
- ServiceImplementation of timer
- Attribute tcbs[10]:tcb
- Attribute usedTcbsRoot : tcb ref
- Attribute freeTcbsRoot : tcb ref
+ Attribute tcbs [ 30 ]: tcb
+ Attribute usedTcbsRoot: tcb ref
+ Attribute freeTcbsRoot: tcb ref
+ ServiceImplementation of timer
}
Behavior {
- Operation getTcb():tcb ref{"
- etTimerControlBlock* temp = freeTcbsRoot;
-
- if(freeTcbsRoot!=0) {
- freeTcbsRoot=freeTcbsRoot->next;
- temp->next=0;
- }
- return temp;
- "}
- Operation returnTcb(block:tcb ref){"
- block->next=freeTcbsRoot;
- freeTcbsRoot=block;
- "}
- Operation removeTcbFromUsedList(idx:int32){"
- etTimerControlBlock* temp=usedTcbsRoot;
- etTimerControlBlock* temp2=usedTcbsRoot;
-
- if (temp==0) return;
-
- if (usedTcbsRoot->portIdx == idx){
- // element found, the first one
- usedTcbsRoot = usedTcbsRoot->next;
- returnTcb(temp);
- return;
- }
+ Operation getTcb(): tcb ref {
+ "etTimerControlBlock* temp = freeTcbsRoot;"
+ ""
+ "if (freeTcbsRoot != 0) {"
+ " freeTcbsRoot = freeTcbsRoot->next;"
+ " temp->next = 0;"
+ "}"
+ "return temp;"
+ ""
+ }
+ Operation returnTcb(block: tcb ref) {
+ "block->next = freeTcbsRoot;"
+ "freeTcbsRoot = block;"
+ }
+ Operation removeTcbFromUsedList(idx: int32) {
+ "etTimerControlBlock* temp = usedTcbsRoot;"
+ "etTimerControlBlock* temp2 = usedTcbsRoot;"
+ ""
+ "if (temp == 0)"
+ " return;"
+ ""
+ "if (usedTcbsRoot->portIdx == idx) {"
+ " /* element found, the first one */"
+ " usedTcbsRoot = usedTcbsRoot->next;"
+ " returnTcb(temp);"
+ " return;"
+ "}"
+ ""
+ "temp = temp->next;"
+ "while (temp != 0) {"
+ " if (temp->portIdx == idx) {"
+ " temp2->next = temp->next;"
+ " returnTcb(temp);"
+ " return;"
+ " } else {"
+ " /* try next */"
+ " temp2 = temp;"
+ " temp = temp->next;"
+ " }"
+ "}"
+ }
+ Operation putTcbToUsedList(block: tcb ref) {
+ "etTimerControlBlock* temp = usedTcbsRoot;"
+ "etTimerControlBlock* temp2 = usedTcbsRoot;"
+ ""
+ "if (temp == 0) {"
+ " /* list empty put new block to root */"
+ " block->next = 0;"
+ " usedTcbsRoot = block;"
+ " return;"
+ "}"
+ ""
+ "while (1) {"
+ " if (temp != 0) {"
+ " if (isTimeGreater(&block->expTime, &temp->expTime)) {"
+ " /* try next position */"
+ " temp2 = temp;"
+ " temp = temp->next;"
+ " } else {"
+ " /* right position found */"
+ " block->next = temp;"
+ " if (temp == usedTcbsRoot) {"
+ " usedTcbsRoot = block;"
+ " } else {"
+ " temp2->next = block;"
+ " }"
+ " return;"
+ " }"
+ " } else {"
+ " /* end of list reached */"
+ " block->next = 0;"
+ " temp2->next = block;"
+ " return;"
+ " }"
+ "}"
+ }
+ Operation isTimeGreater(t1: targetTime ref, t2: targetTime ref): boolean {
+ "if (t1->sec > t2->sec)"
+ " return ET_TRUE;"
+ "if (t1->sec < t2->sec)"
+ " return ET_FALSE;"
+ "if (t1->nSec > t2->nSec)"
+ " return ET_TRUE;"
+ "return ET_FALSE;"
+ }
+ Operation addTime(t1: targetTime ref, t2: targetTime ref) {
+ "t1->sec += t2->sec;"
+ "t1->nSec += t2->nSec;"
+ "while (t1->nSec >= 1000000000L) {"
+ " t1->sec++;"
+ " t1->nSec -= 1000000000L;"
+ "}"
+ }
- temp=temp->next;
- while(temp!=0){
- if(temp->portIdx==idx){
- temp2->next=temp->next;
- returnTcb(temp);
- return;
- }else{
- // try next
- temp2=temp;
- temp=temp->next;
- }
- }
- "}
- Operation putTcbToUsedList(block:tcb ref){"
- etTimerControlBlock* temp=usedTcbsRoot;
- etTimerControlBlock* temp2=usedTcbsRoot;
+ // Operation printList(){
+ // "etTimerControlBlock* temp=usedTcbsRoot;"
+ // " printf(\"list: \");"
+ // " while (temp!=0){"
+ // " printf(\"(%ld,%ld),\",temp->expTime.sec,temp->expTime.nSec);"
+ // " temp=temp->next;"
+ // " }"
+ // " printf(\"\\n\");"
+ // }
- if (temp==0){
- // list empty put new block to root
- block->next=0;
- usedTcbsRoot=block;
- return;
- }
-
- while(1){
- if (temp != 0){
- if (isTimeGreater(&block->expTime,&temp->expTime)){
- //try next position
- temp2=temp;
- temp=temp->next;
- }else{
- // right position found
- block->next=temp;
- if(temp==usedTcbsRoot){
- usedTcbsRoot=block;
- }else{
- temp2->next=block;
- }
- return;
- }
- }else{
- // end of list reached
- block->next=0;
- temp2->next=block;
- return;
- }
- }
- "}
- Operation isTimeGreater(t1:targetTime ref, t2 :targetTime ref):boolean{"
- if (t1->sec > t2->sec) return TRUE;
- if (t1->sec < t2->sec) return FALSE;
- if (t1->nSec > t2->nSec) return TRUE;
- return FALSE;
- "}
-
- Operation addTime(t1:targetTime ref, t2:targetTime ref){"
- t1->sec += t2->sec;
- t1->nSec += t2->nSec;
- while(t1->nSec >= 1000000000L){
- t1->sec++;
- t1->nSec-=1000000000L;
- }
- "}
-
- Operation printList(){"
- etTimerControlBlock* temp=usedTcbsRoot;
- printf(\"list: \");
- while (temp!=0){
- printf(\"(%ld,%ld),\",temp->expTime.sec,temp->expTime.nSec);
- temp=temp->next;
- }
- printf(\"\\n\");
- "}
StateMachine {
Transition tr0: initial -> Operational {
action {
"int i;"
- "usedTcbsRoot=0;"
- "freeTcbsRoot=&tcbs[0];"
- "tcbs[ET_NB_OF_TCBS-1].next=0;"
- "for (i=0;i<ET_NB_OF_TCBS-1;i++){"
- "\ttcbs[i].next=&tcbs[i+1];"
- "\t}"
+ "usedTcbsRoot = 0;"
+ "freeTcbsRoot = &tcbs[0];"
+ "tcbs[ET_NB_OF_TCBS - 1].next = 0;"
+ "for (i = 0; i < ET_NB_OF_TCBS - 1; i++) {"
+ "\ttcbs[i].next = &tcbs[i + 1];"
+ "}"
}
}
Transition tr1: Operational -> Operational {
@@ -149,17 +151,17 @@ RoomModel room.basic.service.timing {
}
action {
"etTimerControlBlock* timer = getTcb();"
- "etTargetTime_t t;"
- "if (timer!= 0){"
- "\tt.sec=time/1000;"
- "\tt.nSec=(time%1000)*1000000L;"
+ "etTime t;"
+ "if (timer != 0) {"
+ "\tt.sec = time / 1000;"
+ "\tt.nSec = (time % 1000) * 1000000L;"
"\ttimer->pTime.sec = 0;"
"\ttimer->pTime.nSec = 0;"
- "\ttimer->portIdx=ifitem->getIdx();"
+ "\ttimer->portIdx = ifitem->getIdx();"
"\tgetTimeFromTarget(&(timer->expTime));"
- "\taddTime(&(timer->expTime),&t);"
+ "\taddTime(&(timer->expTime), &t);"
"\tputTcbToUsedList(timer);"
- "\t}"
+ "}"
}
}
Transition tr3: Operational -> Operational {
@@ -168,16 +170,16 @@ RoomModel room.basic.service.timing {
}
action {
"etTimerControlBlock* timer = getTcb();"
- "etTargetTime_t t;"
- "if (timer!= 0){"
- "\tt.sec=time/1000;"
- "\tt.nSec=(time%1000)*1000000L;"
+ "etTime t;"
+ "if (timer != 0) {"
+ "\tt.sec = time / 1000;"
+ "\tt.nSec = (time % 1000) * 1000000L;"
"\ttimer->pTime = t;"
- "\ttimer->portIdx=ifitem->getIdx();"
+ "\ttimer->portIdx = ifitem->getIdx();"
"\tgetTimeFromTarget(&(timer->expTime));"
- "\taddTime(&(timer->expTime),&t);"
+ "\taddTime(&(timer->expTime), &t);"
"\tputTcbToUsedList(timer);"
- "\t}"
+ "}"
}
}
Transition tr4: Operational -> Operational {
@@ -194,38 +196,36 @@ RoomModel room.basic.service.timing {
} do {
"// maintain timers"
"etTimerControlBlock* temp;"
- "etTargetTime_t t;"
+ "etTime t;"
""
"getTimeFromTarget(&t);"
- "while (usedTcbsRoot !=0 ){"
- "\tif (isTimeGreater(&t,&(usedTcbsRoot->expTime))){"
- "\t\ttimer[usedTcbsRoot->portIdx].timeout();"
- "\t\ttemp=usedTcbsRoot;"
- "\t\tusedTcbsRoot=usedTcbsRoot->next;"
- "\t\tif((temp->pTime.sec==0)&&(temp->pTime.nSec==0)){"
+ "while (usedTcbsRoot != 0) {"
+ "\tif (isTimeGreater(&t, &(usedTcbsRoot->expTime))) {"
+ "\t\ttimer.get(usedTcbsRoot->portIdx).timeout();"
+ "\t\ttemp = usedTcbsRoot;"
+ "\t\tusedTcbsRoot = usedTcbsRoot->next;"
+ "\t\tif ((temp->pTime.sec == 0) && (temp->pTime.nSec == 0)) {"
"\t\t\t// single shot timer"
"\t\t\treturnTcb(temp);"
- "\t\t}else{"
+ "\t\t} else {"
"\t\t\t// periodic timer"
- "\t\t\taddTime(&temp->expTime,&temp->pTime);"
+ "\t\t\taddTime(&temp->expTime, &temp->pTime);"
"\t\t\tputTcbToUsedList(temp);"
- "\t\t\t}"
- "\t\t}else{"
- "\t\t\tbreak;"
- "\t\t\t}"
+ "\t\t}"
+ "\t} else {"
+ "\t\tbreak;"
"\t}"
+ "}"
}
}
}
}
}
-
ProtocolClass PTimer {
- usercode1 {"
- #define ET_TIMER_RUNNING 0x01
- #define ET_TIMER_PERIODIC 0x02
- "
+ usercode1 {
+ "#define ET_TIMER_RUNNING 0x01"
+ "#define ET_TIMER_PERIODIC 0x02"
}
usercode2 {
"//uc2 "
@@ -240,35 +240,37 @@ RoomModel room.basic.service.timing {
}
conjugated PortClass
{
- handle incoming startTimer{
- "
- if (status==0){
+ Attribute status: int8 = "0"
+ handle
+ incoming startTimer {
+ "if (status==0){
status=ET_TIMER_RUNNING | ET_TIMER_PERIODIC;
DebuggingService::getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(),
PTimer::getMessageString(PTimer::IN_startTimer));
if (getPeerAddress().isValid()){
- getPeerMsgReceiver()->receive(new Message(getPeerAddress(),PTimer::IN_startTimer,
- reinterpret_cast<void*>(time),
+ getPeerMsgReceiver()->receive(new Message(getPeerAddress(),PTimer::IN_startTimer,
+ &time,
sizeof(uint32)));
}
}
- "
- }
- handle incoming startTimeout{
"
- if (status==0){
+ }
+ handle
+ incoming startTimeout {
+ "if (status==0){
status = ET_TIMER_RUNNING;
DebuggingService::getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(),
PTimer::getMessageString(PTimer::IN_startTimeout));
if (getPeerAddress().isValid()){
- getPeerMsgReceiver()->receive(new Message(getPeerAddress(),PTimer::IN_startTimeout,
- reinterpret_cast<void*>(time),
+ getPeerMsgReceiver()->receive(new Message(getPeerAddress(),PTimer::IN_startTimeout,
+ &time,
sizeof(uint32)));
}
}
- "
+ "
}
- handle outgoing timeout{
+ handle
+ outgoing timeout {
"
//TODO: clear active bit in case of single shot timer
if (status!=0){
@@ -277,25 +279,26 @@ RoomModel room.basic.service.timing {
status=0;
}
// msg to fsm
- getEventReceiver().receiveEvent(this, msg->getEvtId(), msg->getData());
+ getActor()->receiveEvent(this, msg->getEvtId(), msg->getData());
}
"
}
- handle incoming kill {
+ handle
+ incoming kill {
"
if (status!=0){
status=0;
DebuggingService::getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(),
PTimer::getMessageString(PTimer::IN_kill));
if (getPeerAddress().isValid()){
- getPeerMsgReceiver()->receive(new Message(getPeerAddress(),PTimer::IN_kill, 0, 0));
+ getPeerMsgReceiver()->receive(new Message(getPeerAddress(),PTimer::IN_kill));
}
}
"
}
- Attribute status:int8="0"
}
}
- ExternalType tcb -> "etTimerControlBlock"
- ExternalType targetTime -> "etTargetTime_t"
+
+ ExternalType tcb -> "etTimerControlBlock" default "{{0,0},{0,0},0,NULL}"
+ ExternalType targetTime -> "etTime" default "{0,0}"
} \ No newline at end of file
diff --git a/runtime/org.eclipse.etrice.modellib.cpp/model/Types.room b/runtime/org.eclipse.etrice.modellib.cpp/model/Types.room
index b9f15df1e..b3c4b89d5 100644
--- a/runtime/org.eclipse.etrice.modellib.cpp/model/Types.room
+++ b/runtime/org.eclipse.etrice.modellib.cpp/model/Types.room
@@ -17,5 +17,7 @@ RoomModel room.basic.types {
// TODO: define strings for C
PrimitiveType charPtr:ptCharacter -> charPtr default "0"
- PrimitiveType string:ptCharacter -> charPtr default "0"
+ PrimitiveType string:ptCharacter -> string default "0"
+
+ ExternalType voidType -> "void" default "NULL"
} \ No newline at end of file
diff --git a/runtime/org.eclipse.etrice.modellib.cpp/model/diagrams/room.basic.service.timing.ATimingService.behavior b/runtime/org.eclipse.etrice.modellib.cpp/model/diagrams/room.basic.service.timing.ATimingService.behavior
index 8a72fd245..bb4cfad57 100644
--- a/runtime/org.eclipse.etrice.modellib.cpp/model/diagrams/room.basic.service.timing.ATimingService.behavior
+++ b/runtime/org.eclipse.etrice.modellib.cpp/model/diagrams/room.basic.service.timing.ATimingService.behavior
@@ -1,5 +1,5 @@
<?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 ATimingService" pictogramLinks="//@link //@children.0/@link //@children.0/@children.1/@link //@children.0/@children.2/@link //@connections.0/@link //@connections.1/@link //@connections.2/@link //@connections.3/@link" verticalGridUnit="10" version="0.9.0">
+<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 ATimingService" pictogramLinks="//@link //@children.0/@link //@children.0/@children.1/@link //@children.0/@children.2/@link //@connections.0/@link //@connections.1/@link //@connections.2/@link //@connections.3/@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="../TimingService.room#ActorClass:ATimingService"/>
@@ -55,7 +55,7 @@
<link>
<businessObjects href="../TimingService.room#SimpleState:ATimingService$Operational"/>
</link>
- <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.1 //@connections.2 //@connections.3" incomingConnections="//@connections.0 //@connections.1 //@connections.2 //@connections.3" referencedGraphicsAlgorithm="//@children.0/@children.2/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.1 //@connections.2 //@connections.3" incomingConnections="//@connections.0 //@connections.1 //@connections.2 //@connections.3"/>
<children visible="true">
<graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="375" height="156" x="30" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="Operational"/>
</children>
diff --git a/runtime/org.eclipse.etrice.modellib.cpp/model/diagrams/room.basic.service.timing.ATimingService.structure b/runtime/org.eclipse.etrice.modellib.cpp/model/diagrams/room.basic.service.timing.ATimingService.structure
index 593420d2c..068747c43 100644
--- a/runtime/org.eclipse.etrice.modellib.cpp/model/diagrams/room.basic.service.timing.ATimingService.structure
+++ b/runtime/org.eclipse.etrice.modellib.cpp/model/diagrams/room.basic.service.timing.ATimingService.structure
@@ -1,5 +1,5 @@
<?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 ATimingService" pictogramLinks="//@children.0/@link //@link //@children.0/@children.0/@link" verticalGridUnit="10" version="0.9.0">
+<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 ATimingService" pictogramLinks="//@children.0/@link //@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="../TimingService.room#ActorClass:ATimingService"/>
@@ -15,16 +15,17 @@
</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="245">
<graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.2" foreground="//@colors.2" lineWidth="2" transparency="0.0" width="40" height="40" x="20" y="20"/>
</graphicsAlgorithm>
<link>
- <businessObjects href="../TimingService.room#SPPRef:ATimingService$timer"/>
+ <businessObjects href="../TimingService.room#SPP:ATimingService$timer"/>
</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" horizontalAlignment="ALIGNMENT_CENTER" value="timer"/>
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="80" height="20" font="//@fonts.0" value="timer"/>
</children>
</children>
</children>
diff --git a/runtime/org.eclipse.etrice.modellib.cpp/src-gen-info/readme.txt b/runtime/org.eclipse.etrice.modellib.cpp/src-gen-info/readme.txt
new file mode 100644
index 000000000..1dc2b35ab
--- /dev/null
+++ b/runtime/org.eclipse.etrice.modellib.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/runtime/org.eclipse.etrice.modellib.cpp/src-gen/room/basic/service/timing/ATimingService.cpp b/runtime/org.eclipse.etrice.modellib.cpp/src-gen/room/basic/service/timing/ATimingService.cpp
deleted file mode 100644
index 1bbb17da9..000000000
--- a/runtime/org.eclipse.etrice.modellib.cpp/src-gen/room/basic/service/timing/ATimingService.cpp
+++ /dev/null
@@ -1,263 +0,0 @@
-/**
- * @author generated by eTrice
- *
- * Source File of ActorClass ATimingService
- *
- */
-
-#include "ATimingService.h"
-#include "common/debugging/DebuggingService.h"
-#include <iostream>
-
-using namespace etRuntime;
-
-
-ATimingService::ATimingService(etRuntime::IRTObject* parent, std::string name, const std::vector<std::vector<etRuntime::Address> >& port_addr,
- const std::vector<std::vector<etRuntime::Address> >& peer_addr)
-: ActorClassBase( parent, name, port_addr[0][0], peer_addr[0][0]),
-timer(*this, this, "timer", IFITEM_timer, port_addr[IFITEM_timer], peer_addr[IFITEM_timer]),
-tcbs(),
-usedTcbsRoot(0),
-freeTcbsRoot(0)
-{
- history = new int[s_numberOfStates];
- for (int i = 0; i < s_numberOfStates; i++) {
- history[i] = NO_STATE;
- }
- setClassName("ATimingService");
- // initialize attributes
- for (int i=0;i<10;i++){
- tcbs[i] = etTimerControlBlock();
- }
-
- getMsgsvc()->addAsyncActor(*this);
-}
-
-void ATimingService::init(){
- initUser();
-}
-
-void ATimingService::start(){
- startUser();
-}
-
-void ATimingService::stop(){
- stopUser();
-}
-
-void ATimingService::destroy(){
-}
-
-
-std::string ATimingService::s_stateStrings[] = {"<no state>","<top>","Operational"
-};
-const int ATimingService::s_numberOfStates = 3;
-
-void ATimingService::setState(int new_state) {
- DebuggingService::getInstance().addActorState(*this, s_stateStrings[new_state]);
- if (s_stateStrings[new_state]!="Idle") {
- std::cout << getInstancePath() << " -> " << s_stateStrings[new_state] << std::endl;
- }
- m_state = new_state;
-}
-
-/* Entry and Exit Codes */
-void ATimingService::entry_Operational() {
- // prepare
-}
- void ATimingService::do_Operational() {
- // maintain timers
- etTimerControlBlock* temp;
- etTargetTime_t t;
-
- getTimeFromTarget(&t);
- while (usedTcbsRoot !=0 ){
- if (isTimeGreater(&t,&(usedTcbsRoot->expTime))){
- timer.get(usedTcbsRoot->portIdx).timeout();
- temp=usedTcbsRoot;
- usedTcbsRoot=usedTcbsRoot->next;
- if((temp->pTime.sec==0)&&(temp->pTime.nSec==0)){
- // single shot timer
- returnTcb(temp);
- }else{
- // periodic timer
- addTime(&temp->expTime,&temp->pTime);
- putTcbToUsedList(temp);
- }
- }else{
- break;
- }
- }
-}
-
-/* Action Codes */
-void ATimingService::action_TRANS_INITIAL_TO__Operational() {
- int i;
- usedTcbsRoot=0;
- freeTcbsRoot=&tcbs[0];
- tcbs[ET_NB_OF_TCBS-1].next=0;
- for (i=0;i<ET_NB_OF_TCBS-1;i++){
- tcbs[i].next=&tcbs[i+1];
- }
-}
-void ATimingService::action_TRANS_tr1_FROM_Operational_TO_Operational_BY_startTimeouttimer_tr1(const InterfaceItemBase* ifitem, uint32 time) {
- etTimerControlBlock* timer = getTcb();
- etTargetTime_t t;
- if (timer!= 0){
- t.sec=time/1000;
- t.nSec=(time%1000)*1000000L;
- timer->pTime.sec = 0;
- timer->pTime.nSec = 0;
- timer->portIdx=ifitem->getIdx();
- getTimeFromTarget(&(timer->expTime));
- addTime(&(timer->expTime),&t);
- putTcbToUsedList(timer);
- }
-}
-void ATimingService::action_TRANS_tr3_FROM_Operational_TO_Operational_BY_startTimertimer_tr3(const InterfaceItemBase* ifitem, uint32 time) {
- etTimerControlBlock* timer = getTcb();
- etTargetTime_t t;
- if (timer!= 0){
- t.sec=time/1000;
- t.nSec=(time%1000)*1000000L;
- timer->pTime = t;
- timer->portIdx=ifitem->getIdx();
- getTimeFromTarget(&(timer->expTime));
- addTime(&(timer->expTime),&t);
- putTcbToUsedList(timer);
- }
-}
-void ATimingService::action_TRANS_tr4_FROM_Operational_TO_Operational_BY_killtimer_tr4(const InterfaceItemBase* ifitem) {
- removeTcbFromUsedList(ifitem->getIdx());
-}
-
-/**
- * calls exit codes while exiting from the current state to one of its
- * parent states while remembering the history
- * @param current - the current state
- * @param to - the final parent state
- * @param handler - entry and exit codes are called only if not handler (for handler TransitionPoints)
- */
-void ATimingService::exitTo(int current, int to, bool handler) {
- while (current!=to) {
- switch (current) {
- case STATE_Operational:
- this->history[STATE_TOP] = STATE_Operational;
- current = STATE_TOP;
- break;
- }
- }
-}
-
-/**
- * calls action, entry and exit codes along a transition chain. The generic data are cast to typed data
- * matching the trigger of this chain. The ID of the final state is returned
- * @param chain - the chain ID
- * @param generic_data - the generic data pointer
- * @return the ID of the final state
- */
-int ATimingService::executeTransitionChain(int chain, const InterfaceItemBase* ifitem, void* generic_data) {
- switch (chain) {
- case CHAIN_TRANS_INITIAL_TO__Operational:
- {
- action_TRANS_INITIAL_TO__Operational();
- return STATE_Operational;
- }
- case CHAIN_TRANS_tr1_FROM_Operational_TO_Operational_BY_startTimeouttimer_tr1:
- {
- uint32 time = ((uint32) generic_data);
- action_TRANS_tr1_FROM_Operational_TO_Operational_BY_startTimeouttimer_tr1(ifitem, time);
- return STATE_Operational;
- }
- case CHAIN_TRANS_tr3_FROM_Operational_TO_Operational_BY_startTimertimer_tr3:
- {
- uint32 time = ((uint32) generic_data);
- action_TRANS_tr3_FROM_Operational_TO_Operational_BY_startTimertimer_tr3(ifitem, time);
- return STATE_Operational;
- }
- case CHAIN_TRANS_tr4_FROM_Operational_TO_Operational_BY_killtimer_tr4:
- {
- action_TRANS_tr4_FROM_Operational_TO_Operational_BY_killtimer_tr4(ifitem);
- return STATE_Operational;
- }
- }
- return NO_STATE;
-}
-
-/**
- * calls entry codes while entering a state's history. The ID of the final leaf state is returned
- * @param state - the state which is entered
- * @param handler - entry code is executed if not handler
- * @return - the ID of the final leaf state
- */
-int ATimingService::enterHistory(int state, bool handler, bool skip_entry) {
- while (true) {
- switch (state) {
- case STATE_Operational:
- if (!(skip_entry || handler)) entry_Operational();
- // in leaf state: return state id
- return STATE_Operational;
- case STATE_TOP:
- state = this->history[STATE_TOP];
- break;
- }
- skip_entry = false;
- }
- //return NO_STATE; // required by CDT but detected as unreachable by JDT because of while (true)
-}
-
-void ATimingService::executeInitTransition() {
- int chain = CHAIN_TRANS_INITIAL_TO__Operational;
- int next = ATimingService::executeTransitionChain(chain, 0, 0);
- next = ATimingService::enterHistory(next, false, false);
- setState(next);
-}
-
-/* receiveEvent contains the main implementation of the FSM */
-void ATimingService::receiveEvent(InterfaceItemBase* ifitem, int evt, void* generic_data) {
- int trigger = (ifitem==0)? POLLING : ifitem->getLocalId() + EVT_SHIFT*evt;
- int chain = NOT_CAUGHT;
- int catching_state = NO_STATE;
- bool is_handler = false;
- bool skip_entry = false;
-
- if (!handleSystemEvent(ifitem, evt, generic_data)) {
- switch (getState()) {
- case STATE_Operational:
- switch(trigger) {
- case POLLING:
- do_Operational();
- break;
- case TRIG_timer__startTimeout:
- {
- chain = CHAIN_TRANS_tr1_FROM_Operational_TO_Operational_BY_startTimeouttimer_tr1;
- catching_state = STATE_TOP;
- }
- break;
- case TRIG_timer__startTimer:
- {
- chain = CHAIN_TRANS_tr3_FROM_Operational_TO_Operational_BY_startTimertimer_tr3;
- catching_state = STATE_TOP;
- }
- break;
- case TRIG_timer__kill:
- {
- chain = CHAIN_TRANS_tr4_FROM_Operational_TO_Operational_BY_killtimer_tr4;
- catching_state = STATE_TOP;
- }
- break;
- }
- break;
- }
- }
- if (chain != NOT_CAUGHT) {
- ATimingService::exitTo(getState(), catching_state, is_handler);
- int next = ATimingService::executeTransitionChain(chain, ifitem, generic_data);
- next = ATimingService::enterHistory(next, is_handler, skip_entry);
- setState(next);
- }
-}
-
-//******************************************
-// END of generated code for FSM
-//******************************************
diff --git a/runtime/org.eclipse.etrice.modellib.cpp/src-gen/room/basic/service/timing/ATimingService.h b/runtime/org.eclipse.etrice.modellib.cpp/src-gen/room/basic/service/timing/ATimingService.h
deleted file mode 100644
index 9b48f789f..000000000
--- a/runtime/org.eclipse.etrice.modellib.cpp/src-gen/room/basic/service/timing/ATimingService.h
+++ /dev/null
@@ -1,262 +0,0 @@
- /**
- * @author generated by eTrice
- *
- * Header File of ActorClass ATimingService
- *
- */
-
- #ifndef _ATIMINGSERVICE_H_
- #define _ATIMINGSERVICE_H_
-
- #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>
-
-
- #include "room/basic/service/timing/PTimer.h"
-
-
- /*--------------------- begin user code ---------------------*/
-
- #include "common/platform/etTimer.h"
- #define ET_NB_OF_TCBS 10
- typedef struct etTCB etTimerControlBlock;
- struct etTCB {
- etTargetTime_t expTime;
- etTargetTime_t pTime;
- int32 portIdx;
- etTimerControlBlock* next;
- };
-
- /*--------------------- end user code ---------------------*/
-
-
- class ATimingService : public etRuntime::ActorClassBase {
-
-
- protected:
- //--------------------- ports
- //--------------------- saps
- //--------------------- services
- PTimerReplPort timer;
-
- //--------------------- interface item IDs
- typedef enum {
- IFITEM_timer = 1,
- } interface_items;
-
- /*--------------------- attributes ---------------------*/
- etTimerControlBlock tcbs[10];
- etTimerControlBlock* usedTcbsRoot;
- etTimerControlBlock* freeTcbsRoot;
-
- /*--------------------- operations ---------------------*/
- etTimerControlBlock* getTcb() {
-
- etTimerControlBlock* temp = freeTcbsRoot;
-
- if(freeTcbsRoot!=0) {
- freeTcbsRoot=freeTcbsRoot->next;
- temp->next=0;
- }
- return temp;
- }
- void returnTcb(etTimerControlBlock* block) {
-
- block->next=freeTcbsRoot;
- freeTcbsRoot=block;
- }
- void removeTcbFromUsedList(int32 idx) {
-
- etTimerControlBlock* temp=usedTcbsRoot;
- etTimerControlBlock* temp2=usedTcbsRoot;
-
- if (temp==0) return;
-
- if (usedTcbsRoot->portIdx == idx){
- // element found, the first one
- usedTcbsRoot = usedTcbsRoot->next;
- returnTcb(temp);
- return;
- }
-
- temp=temp->next;
- while(temp!=0){
- if(temp->portIdx==idx){
- temp2->next=temp->next;
- returnTcb(temp);
- return;
- }else{
- // try next
- temp2=temp;
- temp=temp->next;
- }
- }
- }
- void putTcbToUsedList(etTimerControlBlock* block) {
-
- etTimerControlBlock* temp=usedTcbsRoot;
- etTimerControlBlock* temp2=usedTcbsRoot;
-
- if (temp==0){
- // list empty put new block to root
- block->next=0;
- usedTcbsRoot=block;
- return;
- }
-
- while(1){
- if (temp != 0){
- if (isTimeGreater(&block->expTime,&temp->expTime)){
- //try next position
- temp2=temp;
- temp=temp->next;
- }else{
- // right position found
- block->next=temp;
- if(temp==usedTcbsRoot){
- usedTcbsRoot=block;
- }else{
- temp2->next=block;
- }
- return;
- }
- }else{
- // end of list reached
- block->next=0;
- temp2->next=block;
- return;
- }
- }
- }
- bool isTimeGreater(etTargetTime_t* t1, etTargetTime_t* t2) {
-
- if (t1->sec > t2->sec) return TRUE;
- if (t1->sec < t2->sec) return FALSE;
- if (t1->nSec > t2->nSec) return TRUE;
- return FALSE;
- }
- void addTime(etTargetTime_t* t1, etTargetTime_t* t2) {
-
- t1->sec += t2->sec;
- t1->nSec += t2->nSec;
- while(t1->nSec >= 1000000000L){
- t1->sec++;
- t1->nSec-=1000000000L;
- }
- }
- void printList() {
-
- etTimerControlBlock* temp=usedTcbsRoot;
- printf("list: ");
- while (temp!=0){
- printf("(%ld,%ld),",temp->expTime.sec,temp->expTime.nSec);
- temp=temp->next;
- }
- printf("\n");
- }
-
- public:
- //--------------------- construction
- ATimingService(etRuntime::IRTObject* parent, std::string name, const std::vector<std::vector<etRuntime::Address> >& port_addr,
- const std::vector<std::vector<etRuntime::Address> >& peer_addr);
-
- //--------------------- port getters
- PTimerReplPort getTimer (){
- return this->timer;
- }
-
- //--------------------- lifecycle functions
- virtual void init();
- virtual void start();
- virtual void stop();
- virtual void destroy();
-
- /* state IDs */
- typedef enum {
- STATE_Operational = 2,
- } state_ids;
-
- /* transition chains */
- typedef enum {
- CHAIN_TRANS_INITIAL_TO__Operational = 1,
- CHAIN_TRANS_tr1_FROM_Operational_TO_Operational_BY_startTimeouttimer_tr1 = 2,
- CHAIN_TRANS_tr3_FROM_Operational_TO_Operational_BY_startTimertimer_tr3 = 3,
- CHAIN_TRANS_tr4_FROM_Operational_TO_Operational_BY_killtimer_tr4 = 4,
- } chain_ids;
-
- /* triggers */
- typedef enum {
- POLLING = 0,
- TRIG_timer__kill = IFITEM_timer + EVT_SHIFT*PTimer::IN_kill,
- TRIG_timer__startTimeout = IFITEM_timer + EVT_SHIFT*PTimer::IN_startTimeout,
- TRIG_timer__startTimer = IFITEM_timer + EVT_SHIFT*PTimer::IN_startTimer,
- } triggers;
-
- protected:
- static std::string s_stateStrings[];
- static const int s_numberOfStates;
-
- private:
- void setState(int new_state);
-
- /* Entry and Exit Codes */
- void entry_Operational();
- void do_Operational();
-
- /* Action Codes */
- void action_TRANS_INITIAL_TO__Operational();
- void action_TRANS_tr1_FROM_Operational_TO_Operational_BY_startTimeouttimer_tr1(const etRuntime::InterfaceItemBase* ifitem, uint32 time);
- void action_TRANS_tr3_FROM_Operational_TO_Operational_BY_startTimertimer_tr3(const etRuntime::InterfaceItemBase* ifitem, uint32 time);
- void action_TRANS_tr4_FROM_Operational_TO_Operational_BY_killtimer_tr4(const etRuntime::InterfaceItemBase* ifitem);
-
- private:
- /**
- * calls exit codes while exiting from the current state to one of its
- * parent states while remembering the history
- * @param current - the current state
- * @param to - the final parent state
- * @param handler - entry and exit codes are called only if not handler (for handler TransitionPoints)
- */
- void exitTo(int current, int to, bool handler);
-
- /**
- * calls action, entry and exit codes along a transition chain. The generic data are cast to typed data
- * matching the trigger of this chain. The ID of the final state is returned
- * @param chain - the chain ID
- * @param generic_data - the generic data pointer
- * @return the ID of the final state
- */
- int executeTransitionChain(int chain, const etRuntime::InterfaceItemBase* ifitem, void* generic_data);
-
- /**
- * calls entry codes while entering a state's history. The ID of the final leaf state is returned
- * @param state - the state which is entered
- * @param handler - entry code is executed if not handler
- * @return - the ID of the final leaf state
- */
- int enterHistory(int state, bool handler, bool skip_entry);
-
- public:
-
- void executeInitTransition();
-
- /* receiveEvent contains the main implementation of the FSM */
- void receiveEvent(etRuntime::InterfaceItemBase* ifitem, int evt, void* generic_data);
-
- /*--------------------- begin user code ---------------------*/
- //uc2
- /*--------------------- end user code ---------------------*/
-
- };
-
-
- #endif /* _ATIMINGSERVICE_H_ */
diff --git a/runtime/org.eclipse.etrice.modellib.cpp/src-gen/room/basic/service/timing/PTimer.cpp b/runtime/org.eclipse.etrice.modellib.cpp/src-gen/room/basic/service/timing/PTimer.cpp
deleted file mode 100644
index 7672294d1..000000000
--- a/runtime/org.eclipse.etrice.modellib.cpp/src-gen/room/basic/service/timing/PTimer.cpp
+++ /dev/null
@@ -1,242 +0,0 @@
- /**
- * @author generated by eTrice
- *
- * Source File of ProtocolClass PTimer
- *
- */
-
- #include "PTimer.h"
- #include "common/debugging/DebuggingService.h"
- #include <iostream>
-
- using namespace etRuntime;
-
-
- /*--------------------- begin user code ---------------------*/
- //uc2
- /*--------------------- end user code ---------------------*/
-
- //------------------------------------------------------------------------------------------------------------
- // port class
- //------------------------------------------------------------------------------------------------------------
-
- PTimerPort::PTimerPort(etRuntime::IEventReceiver& actor, etRuntime::IRTObject* parent, std::string name, int localId, Address addr, Address peerAddress, bool doRegistration)
- : PortBase(actor, parent, name, localId, 0, addr, peerAddress)
- {
- if (doRegistration) {
- DebuggingService::getInstance().addPortInstance(*this);
- }
- }
-
- PTimerPort::PTimerPort(etRuntime::IEventReceiver& actor, etRuntime::IRTObject* parent, std::string name, int localId, int idx, Address addr, Address peerAddress, bool doRegistration)
- : PortBase(actor, parent, name, localId, idx, addr, peerAddress)
- {
- if (doRegistration) {
- DebuggingService::getInstance().addPortInstance(*this);
- }
- }
-
- void PTimerPort::receive(Message* msg) {
- if (! PTimer::isValidIncomingEvtID(msg->getEvtId())) {
- std::cout << "unknown" << std::endl;
- }
- else {
- if (msg->hasDebugFlagSet()) { // TODO: model switch for activation of this flag
- DebuggingService::getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), PTimer::getMessageString(msg->getEvtId()));
- }
-
- getEventReceiver().receiveEvent(this, msg->getEvtId(), msg->getData());
- }
- };
-
-
- // sent messages
- void PTimerPort::timeout() {
- DebuggingService::getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(),
- PTimer::getMessageString(PTimer::OUT_timeout));
- if (getPeerAddress().isValid()){
- getPeerMsgReceiver()->receive(new Message(getPeerAddress(), PTimer::OUT_timeout));
- }
- }
-
-
- //------------------------------------------------------------------------------------------------------------
- // replicated port class
- //------------------------------------------------------------------------------------------------------------
- PTimerReplPort::PTimerReplPort(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()
- {
- char numstr[10]; // enough to hold all numbers up to 32-bits
-
- m_ports = reinterpret_cast<PTimerPort*> (new char[sizeof(PTimerPort) * 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]) PTimerPort(actor, parent, name + numstr, localId, i, addr[i], peerAddress[i]);
- }
- };
-
-
- // outgoing messages
- void PTimerReplPort::timeout(){
- for (int i=0; i<m_replication; ++i) {
- m_ports[i].timeout();
- }
- }
- //------------------------------------------------------------------------------------------------------------
- // conjugated port class
- //------------------------------------------------------------------------------------------------------------
-
- PTimerConjPort::PTimerConjPort(etRuntime::IEventReceiver& actor, etRuntime::IRTObject* parent, std::string name, int localId, Address addr, Address peerAddress, bool doRegistration)
- : PortBase(actor, parent, name, localId, 0, addr, peerAddress),
- status(0)
- {
- // initialize attributes
- if (doRegistration) {
- DebuggingService::getInstance().addPortInstance(*this);
- }
- }
-
- PTimerConjPort::PTimerConjPort(etRuntime::IEventReceiver& actor, etRuntime::IRTObject* parent, std::string name, int localId, int idx, Address addr, Address peerAddress, bool doRegistration)
- : PortBase(actor, parent, name, localId, idx, addr, peerAddress),
- status(0)
- {
- // initialize attributes
- if (doRegistration) {
- DebuggingService::getInstance().addPortInstance(*this);
- }
- }
-
- void PTimerConjPort::receive(Message* msg) {
- if (! PTimer::isValidOutgoingEvtID(msg->getEvtId())) {
- std::cout << "unknown" << std::endl;
- }
- else {
- if (msg->hasDebugFlagSet()) { // TODO: model switch for activation of this flag
- DebuggingService::getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), PTimer::getMessageString(msg->getEvtId()));
- }
-
- switch (msg->getEvtId()) {
- case PTimer::OUT_timeout:
- {
-
- //TODO: clear active bit in case of single shot timer
- if (status!=0){
- if (status==ET_TIMER_RUNNING){
- // single shot timer
- status=0;
- }
- // msg to fsm
- getEventReceiver().receiveEvent(this, msg->getEvtId(), msg->getData());
- }
- }
- break;
- default:
- getEventReceiver().receiveEvent(this, msg->getEvtId(), msg->getData());
- break;
- }
- }
- };
-
- /*--------------------- operations ---------------------*/
-
- // sent messages
- void PTimerConjPort::startTimer(uint32 time) {
-
- if (status==0){
- status=ET_TIMER_RUNNING | ET_TIMER_PERIODIC;
- DebuggingService::getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(),
- PTimer::getMessageString(PTimer::IN_startTimer));
- if (getPeerAddress().isValid()){
- getPeerMsgReceiver()->receive(new Message(getPeerAddress(),PTimer::IN_startTimer,
- reinterpret_cast<void*>(time),
- sizeof(uint32)));
- }
- }
- }
-
- void PTimerConjPort::startTimeout(uint32 time) {
-
- if (status==0){
- status = ET_TIMER_RUNNING;
- DebuggingService::getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(),
- PTimer::getMessageString(PTimer::IN_startTimeout));
- if (getPeerAddress().isValid()){
- getPeerMsgReceiver()->receive(new Message(getPeerAddress(),PTimer::IN_startTimeout,
- reinterpret_cast<void*>(time),
- sizeof(uint32)));
- }
- }
- }
-
- void PTimerConjPort::kill() {
-
- if (status!=0){
- status=0;
- DebuggingService::getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(),
- PTimer::getMessageString(PTimer::IN_kill));
- if (getPeerAddress().isValid()){
- getPeerMsgReceiver()->receive(new Message(getPeerAddress(),PTimer::IN_kill, 0, 0));
- }
- }
- }
-
-
- //------------------------------------------------------------------------------------------------------------
- // conjugated replicated port class
- //------------------------------------------------------------------------------------------------------------
- PTimerConjReplPort::PTimerConjReplPort(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()
- {
- char numstr[10]; // enough to hold all numbers up to 32-bits
-
- m_ports = reinterpret_cast<PTimerConjPort*> (new char[sizeof(PTimerConjPort) * 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]) PTimerConjPort(actor, parent, name + numstr, localId, i, addr[i], peerAddress[i]);
- }
- };
-
-
- // outgoing messages
- void PTimerConjReplPort::startTimer(uint32 time){
- for (int i=0; i<m_replication; ++i) {
- m_ports[i].startTimer( time);
- }
- }
- void PTimerConjReplPort::startTimeout(uint32 time){
- for (int i=0; i<m_replication; ++i) {
- m_ports[i].startTimeout( time);
- }
- }
- void PTimerConjReplPort::kill(){
- for (int i=0; i<m_replication; ++i) {
- m_ports[i].kill();
- }
- }
-
- /*--------------------- debug helpers */
-
- /* message names as strings for debugging (generate MSC) */
- std::string PTimer::s_messageStrings[]
- = {"MIN",
- "timeout",
- "startTimer",
- "startTimeout",
- "kill",
- "MAX"};
-
- std::string PTimer::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";
- }
- }
-
-
-
diff --git a/runtime/org.eclipse.etrice.modellib.cpp/src-gen/room/basic/service/timing/PTimer.h b/runtime/org.eclipse.etrice.modellib.cpp/src-gen/room/basic/service/timing/PTimer.h
deleted file mode 100644
index d98ea2520..000000000
--- a/runtime/org.eclipse.etrice.modellib.cpp/src-gen/room/basic/service/timing/PTimer.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/**
- * @author generated by eTrice
- *
- * Header File of ProtocolClass PTimer
- *
- */
-
-#ifndef _PTIMER_H_
-#define _PTIMER_H_
-
-#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 <string>
-
-namespace etRuntime {
- class IEventReceiver;
-
-}
-
-/*--------------------- begin user code ---------------------*/
-
- #define ET_TIMER_RUNNING 0x01
- #define ET_TIMER_PERIODIC 0x02
-
-/*--------------------- end user code ---------------------*/
-
-
-class PTimer {
- public:
- /* message IDs */
- typedef enum {
- MSG_MIN = 0,
- OUT_timeout = 1,
- IN_startTimer = 2,
- IN_startTimeout = 3,
- IN_kill = 4,
- MSG_MAX = 5,
- } msg_ids;
- static bool isValidEvtID(int evtId) {
- return ((MSG_MIN < evtId) && (evtId < MSG_MAX));
- };
- static bool isValidOutgoingEvtID(int evtId) {
- return ((MSG_MIN < evtId) && (evtId < IN_startTimer));
- };
- static bool isValidIncomingEvtID(int evtId) {
- return ((IN_startTimer <= evtId) && (evtId < MSG_MAX));
- };
- static std::string getMessageString(int msg_id);
-
- private:
- static std::string s_messageStrings[];
- /*--------------------- begin user code ---------------------*/
- //uc2
- /*--------------------- end user code ---------------------*/
-};
-
-//------------------------------------------------------------------------------------------------------------
-// port class
-//------------------------------------------------------------------------------------------------------------
-class PTimerPort : public etRuntime::PortBase {
- public:
- // constructors
- PTimerPort(etRuntime::IEventReceiver& actor, etRuntime::IRTObject* parent, std::string name, int localId, etRuntime::Address addr, etRuntime::Address peerAddress, bool doRegistration = true);
- PTimerPort(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);
-
- // outgoing messages
- public: void timeout();
-};
-
-//------------------------------------------------------------------------------------------------------------
-// replicated port class
-//------------------------------------------------------------------------------------------------------------
-class PTimerReplPort {
- private:
- int m_replication;
- PTimerPort* m_ports; //dynamic array used instead of vector to avoid copy construction
-
- public:
- PTimerReplPort(etRuntime::IEventReceiver& actor, etRuntime::IRTObject* parent, std::string name, int localId, std::vector<etRuntime::Address> addr, std::vector<etRuntime::Address> peerAddress);
- virtual ~PTimerReplPort() {};
-
- int getReplication() { return m_replication; }
- int getIndexOf(const etRuntime::InterfaceItemBase& ifitem){ return ifitem.getIdx(); }
- PTimerPort get(int i) {return m_ports[i];}
-
- // outgoing messages
- public: void timeout();
-
-};
-//------------------------------------------------------------------------------------------------------------
-// conjugated port class
-//------------------------------------------------------------------------------------------------------------
-class PTimerConjPort : public etRuntime::PortBase {
- public:
- // constructors
- PTimerConjPort(etRuntime::IEventReceiver& actor, etRuntime::IRTObject* parent, std::string name, int localId, etRuntime::Address addr, etRuntime::Address peerAddress, bool doRegistration = true);
- PTimerConjPort(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);
- /*--------------------- attributes ---------------------*/
- int8 status;
- /*--------------------- operations ---------------------*/
-
- // outgoing messages
- public: void startTimer(uint32 time);
- public: void startTimeout(uint32 time);
- public: void kill();
-};
-
-//------------------------------------------------------------------------------------------------------------
-// conjugated replicated port class
-//------------------------------------------------------------------------------------------------------------
-class PTimerConjReplPort {
- private:
- int m_replication;
- PTimerConjPort* m_ports; //dynamic array used instead of vector to avoid copy construction
-
- public:
- PTimerConjReplPort(etRuntime::IEventReceiver& actor, etRuntime::IRTObject* parent, std::string name, int localId, std::vector<etRuntime::Address> addr, std::vector<etRuntime::Address> peerAddress);
- virtual ~PTimerConjReplPort() {};
-
- int getReplication() { return m_replication; }
- int getIndexOf(const etRuntime::InterfaceItemBase& ifitem){ return ifitem.getIdx(); }
- PTimerConjPort get(int i) {return m_ports[i];}
-
- // outgoing messages
- public: void startTimer(uint32 time);
- public: void startTimeout(uint32 time);
- public: void kill();
-
-};
-#endif /* _PTIMER_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.c/.cproject b/runtime/org.eclipse.etrice.runtime.c/.cproject
index 4b64a3634..e08c4b926 100644
--- a/runtime/org.eclipse.etrice.runtime.c/.cproject
+++ b/runtime/org.eclipse.etrice.runtime.c/.cproject
@@ -15,13 +15,13 @@
</externalSetting>
</externalSettings>
<extensions>
- <extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919" name="WindowsMinGW" parent="cdt.managedbuild.config.gnu.mingw.lib.debug">
+ <configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" 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.staticLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919" name="WindowsMinGW" parent="cdt.managedbuild.config.gnu.mingw.lib.debug">
<folderInfo id="cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.mingw.lib.debug.592670815" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.lib.debug">
<targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.lib.debug.801787195" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.lib.debug"/>
@@ -43,6 +43,8 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/util}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/platforms/MT_WIN_MinGW}&quot;"/>
</option>
+ <option id="gnu.c.compiler.option.dialect.std.1095860550" name="Language standard" superClass="gnu.c.compiler.option.dialect.std" value="gnu.c.compiler.dialect.c99" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.warnings.pedantic.1900907598" name="Pedantic (-pedantic)" superClass="gnu.c.compiler.option.warnings.pedantic" value="true" valueType="boolean"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.316560634" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.base.2104156208" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.base"/>
@@ -70,11 +72,11 @@
</externalSetting>
</externalSettings>
<extensions>
- <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" 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"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
@@ -97,6 +99,8 @@
</option>
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.1123878180" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
<option id="gnu.c.compiler.option.debugging.level.878097472" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.dialect.std.706501680" name="Language standard" superClass="gnu.c.compiler.option.dialect.std" value="gnu.c.compiler.dialect.c99" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.warnings.pedantic.1531135222" name="Pedantic (-pedantic)" superClass="gnu.c.compiler.option.warnings.pedantic" value="false" valueType="boolean"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.2145340965" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.base.148289955" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base"/>
@@ -129,15 +133,15 @@
</externalSetting>
</externalSettings>
<extensions>
- <extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" 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"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919.18376023" name="ExternalMakefile" parent="cdt.managedbuild.config.gnu.mingw.lib.debug">
+ <configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" 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.staticLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919.18376023" name="ExternalMakefile" parent="cdt.managedbuild.config.gnu.mingw.lib.debug">
<folderInfo id="cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919.18376023." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.mingw.lib.debug.1317763190" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.lib.debug">
<targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.lib.debug.1009481846" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.lib.debug"/>
@@ -178,17 +182,17 @@
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope" versionNumber="2">
- <configuration configurationName="WindowsMinGW"/>
- <configuration configurationName="LinuxPosix"/>
- <configuration configurationName="MinGWDebug">
+ <configuration configurationName="ExternalMakefile">
<resource resourceType="PROJECT" workspacePath="/org.eclipse.etrice.runtime.c"/>
</configuration>
- <configuration configurationName="ExternalMakefile">
+ <configuration configurationName="MinGWDebug">
<resource resourceType="PROJECT" workspacePath="/org.eclipse.etrice.runtime.c"/>
</configuration>
+ <configuration configurationName="WindowsMinGW"/>
<configuration configurationName="Debug">
<resource resourceType="PROJECT" workspacePath="/org.eclipse.etrice.runtime.c"/>
</configuration>
+ <configuration configurationName="LinuxPosix"/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
<storageModule moduleId="scannerConfiguration">
diff --git a/runtime/org.eclipse.etrice.runtime.c/.gitignore b/runtime/org.eclipse.etrice.runtime.c/.gitignore
index 811cd3775..d81a69793 100644
--- a/runtime/org.eclipse.etrice.runtime.c/.gitignore
+++ b/runtime/org.eclipse.etrice.runtime.c/.gitignore
@@ -2,5 +2,3 @@ bin
src-gen-info
WindowsMinGW
LinuxPosix
-/MinGWDebug/
-/PosixDebug/
diff --git a/runtime/org.eclipse.etrice.runtime.c/buildTools/Makefile b/runtime/org.eclipse.etrice.runtime.c/buildTools/Makefile
index 1c3586189..69efa78f5 100644
--- a/runtime/org.eclipse.etrice.runtime.c/buildTools/Makefile
+++ b/runtime/org.eclipse.etrice.runtime.c/buildTools/Makefile
@@ -1,9 +1,12 @@
+## Example Makefile
+
# environment variables: RUNTIME_ROOTDIR, MODELLIB_ROOTDIR, TARGET_PLATFORM, TARGET_BUILD_DIR, ECLIPSE_MODE
# default is windows mingw
-# CDT Environment:
+# examples CDT Environment:
# RUNTIME_ROOTDIR: ${workspace_loc:org.eclipse.etrice.runtime.c}
# MODELLIB_ROOTDIR: ${workspace_loc:org.eclipse.etrice.modellib.c}
+# ECLIPSE_MODE (no value)
ifeq ($(strip ${RUNTIME_ROOTDIR}),)
RUNTIME_ROOTDIR := ../org.eclipse.etrice.runtime.c
diff --git a/runtime/org.eclipse.etrice.runtime.c/buildTools/Makefile.mk b/runtime/org.eclipse.etrice.runtime.c/buildTools/Makefile.mk
index fa93315de..4c06f5e56 100644
--- a/runtime/org.eclipse.etrice.runtime.c/buildTools/Makefile.mk
+++ b/runtime/org.eclipse.etrice.runtime.c/buildTools/Makefile.mk
@@ -15,7 +15,9 @@
# IN_LDLIBS
# IN_PREREQS
-# Note: Variables set from environment or make parameter are unmodifiable.
+# Note: avoid trailing spaces !
+
+# Note: Variables from environment or cmd are unmodifiable.
# E.g. use additional variables:
# IN_SRCDIRS_REC += ${APP_SRCDIRS_REC}
# IN_SRCDIRS_REC += ...
@@ -50,6 +52,7 @@ endef
ifeq ($(strip ${IN_BUILD_DIR}),)
+# TODO: TARGET_BUILD_DIR should not be here
IN_BUILD_DIR := ${TARGET_BUILD_DIR}
endif
@@ -73,6 +76,7 @@ M_OBJS :=
M_SOURCES := $(call CANONICAL_PATH, ${M_SOURCES})
M_SOURCES += $(call CANONICAL_PATH,$(foreach DIR,${IN_SRCDIRS_REC},$(call REC_FILE_SEARCH,${DIR}/,*.c)))
+M_SOURCES += $(call CANONICAL_PATH,$(foreach DIR,${IN_SRCDIRS_REC},$(call REC_FILE_SEARCH,${DIR}/,*.cpp)))
M_OBJS += $(addprefix ${M_BUILD_DIR}/,$(addsuffix .o,$(basename ${M_SOURCES})))
M_DEFS := $(addprefix -D,${M_DEFS})
@@ -85,6 +89,10 @@ ${M_BUILD_DIR}/%.o: %.c
$(strip ${CC} -o $@ -c ${M_CFLAGS} ${M_SRC_CFLAGS} ${M_INCDIRS} \
${M_SRC_INCDIRS} ${M_SRC_DEFS} ${M_DEFS} $<)
+${M_BUILD_DIR}/%.o: %.cpp
+ @mkdir -p $(dir $@)
+ $(strip ${CXX} -o $@ -c ${M_CFLAGS} ${M_SRC_CFLAGS} ${M_INCDIRS} \
+ ${M_SRC_INCDIRS} ${M_SRC_DEFS} ${M_DEFS} $<)
.PHONY: build clean-all
diff --git a/runtime/org.eclipse.etrice.runtime.c/buildTools/defaults.mk b/runtime/org.eclipse.etrice.runtime.c/buildTools/defaults.mk
index a8543042d..4692d3c8b 100644
--- a/runtime/org.eclipse.etrice.runtime.c/buildTools/defaults.mk
+++ b/runtime/org.eclipse.etrice.runtime.c/buildTools/defaults.mk
@@ -3,7 +3,7 @@
# MODELLIB_ROOTDIR e.g. ${workspace_loc:org.eclipse.etrice.modellib.c} default: ../org.eclipse.etrice.modellib.c
# TARGET_PLATFORM MT_WIN_MinGW|MT_POSIX_GENERIC_GCC default MT_WIN_MinGW
# TARGET_BUILD_DIR automatically derived from TARGET_PLATFORM
-# ECLIPSE_MODE if set, makefile won't build modellib and runtime (let eclipse handle this)
+# ECLIPSE_MODE if present, makefile won't build modellib and runtime (let eclipse handle this)
#ifeq ($(strip ${RUNTIME_ROOTDIR}),)
# RUNTIME_ROOTDIR := ../org.eclipse.etrice.runtime.c
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etLogger.h b/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etLogger.h
index 2c9c386bf..a4bb8c0c2 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etLogger.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etLogger.h
@@ -17,6 +17,9 @@
*
* \author: tschuetz
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
#ifndef _ETLOGGER_H_
#define _ETLOGGER_H_
@@ -93,3 +96,7 @@ void etLogger_logInfoF(const char* format, ... );
void etLogger_fprintf(etFileHandle file, const char* format, ... );
#endif /* _ETLOGGER_H_ */
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/etStdDatatypes.h b/runtime/org.eclipse.etrice.runtime.c/src/common/etStdDatatypes.h
index 294068261..90f583d60 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/etStdDatatypes.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/etStdDatatypes.h
@@ -13,6 +13,9 @@
/*
* Generic version for most platforms based on std.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
#ifndef _ETSTDDATATYPES_H_
#define _ETSTDDATATYPES_H_
@@ -30,7 +33,7 @@
/* --- Data types for room.basic.types */
-// bool already defined
+/* bool already defined */
typedef uint8_t uint8;
typedef uint16_t uint16;
typedef uint32_t uint32;
@@ -58,11 +61,11 @@ typedef char* charPtr;
/*--- Cross language support (e.g. Java,C/C++) */
#define null NULL
-// typedef x boolean
+/* typedef x boolean */
/*-----------------------------------------------------------*/
-//--- Required types of runtime
+/*--- Required types of runtime */
typedef bool etBool;
#define ET_TRUE true
#define ET_FALSE false
@@ -115,3 +118,7 @@ typedef etInt16 etAddressId;
/*-----------------------------------------------------------*/
#endif /* _ETSTDDATATYPES_H_ */
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.h b/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.h
index 99c5bb3e0..ff1902cac 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.h
@@ -19,6 +19,9 @@
*
* \author Thomas Schuetz
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
#ifndef _ETUNIT_H_
#define _ETUNIT_H_
@@ -387,4 +390,7 @@ void expectOrderEnd(etInt16 id, const char* msg, etInt16 identifier, const char*
#endif /* _ETUNIT_H_ */
+#ifdef __cplusplus
+}
+#endif
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etMutex.h b/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etMutex.h
index 27d0c1118..ec7ae3634 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etMutex.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etMutex.h
@@ -18,6 +18,9 @@
*
* \author Thomas Schuetz, Thomas Jung
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
#ifndef _ETMUTEX_H_
#define _ETMUTEX_H_
@@ -56,3 +59,7 @@ void etMutex_enter(etMutex* self);
void etMutex_leave(etMutex* self);
#endif /* _ETMUTEX_H_ */
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etSema.h b/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etSema.h
index 6642f69a3..8c2fefb3b 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etSema.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etSema.h
@@ -9,6 +9,9 @@
* Thomas Schuetz (initial contribution)
*
*******************************************************************************/
+#ifdef __cplusplus
+extern "C" {
+#endif
#ifndef _ETSEMA_H_
#define _ETSEMA_H_
@@ -57,3 +60,7 @@ void etSema_waitForWakeup(etSema* self);
#endif /* _ETSEMA_H_ */
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etTcpSockets.h b/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etTcpSockets.h
index 310ecc76a..a50017b55 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etTcpSockets.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etTcpSockets.h
@@ -17,6 +17,9 @@
*
* \author Henrik Rentz-Reichert
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
#ifndef _ETTCPSOCKETS_H_
#define _ETTCPSOCKETS_H_
@@ -173,3 +176,7 @@ etSocketError etWriteSocket(etSocketConnectionData* self, int size, const int8*
etSocketError etCloseSocket(etSocketConnectionData* self);
#endif /* _ETTCPSOCKETS_H_ */
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etThread.h b/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etThread.h
index a176f9d6a..980ccc476 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etThread.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etThread.h
@@ -18,6 +18,10 @@
* \author Thomas Schuetz, Thomas Jung
*
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifndef _ETTHREAD_H_
#define _ETTHREAD_H_
@@ -97,3 +101,7 @@ etOSThreadId etThread_self_id(void);
#endif /* _ETTHREAD_H_ */
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etTime.h b/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etTime.h
index fa51d50ed..75dab0edd 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etTime.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etTime.h
@@ -18,6 +18,10 @@
* \author Thomas Schuetz
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifndef _ETTIME_H_
#define _ETTIME_H_
@@ -43,3 +47,7 @@ typedef struct etTime {
void getTimeFromTarget(etTime *t);
#endif /* _ETTIME_H_ */
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etTimer.h b/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etTimer.h
index 827c2a025..da9bdd228 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etTimer.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etTimer.h
@@ -17,6 +17,10 @@
*
* \author Thomas Jung
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifndef _ETTIMER_H_
#define _ETTIMER_H_
@@ -70,3 +74,7 @@ void etTimer_destruct(etTimer* self);
#endif /* __ETTIMER_H__ */
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/runtime/etRuntime.h b/runtime/org.eclipse.etrice.runtime.c/src/common/runtime/etRuntime.h
index a2bc7901e..d5b23e25c 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/runtime/etRuntime.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/runtime/etRuntime.h
@@ -10,6 +10,10 @@
*
*******************************************************************************/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifndef _ETRUNTIME_H_
#define _ETRUNTIME_H_
@@ -31,3 +35,7 @@
etSema* etRuntime_getTerminateSemaphore();
#endif /* _ETRUNTIME_H_ */
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW/etDatatypes.h b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW/etDatatypes.h
index 8adfcda08..057d23a06 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW/etDatatypes.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW/etDatatypes.h
@@ -10,6 +10,10 @@
*
*******************************************************************************/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifndef _ETDATATYPES_H_
#define _ETDATATYPES_H_
@@ -50,3 +54,7 @@ typedef DWORD etOSTimerId;
/*-----------------------------------------------------------*/
#endif /* _DATATYPES_H_ */
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/.cproject b/runtime/org.eclipse.etrice.runtime.cpp/.cproject
index 4f8cb2d71..30dee99a2 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/.cproject
+++ b/runtime/org.eclipse.etrice.runtime.cpp/.cproject
@@ -1,32 +1,39 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?fileVersion 4.0.0?>
-
-<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+<?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.lib.debug.878140176">
- <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.lib.debug.878140176" moduleId="org.eclipse.cdt.core.settings" name="Debug">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.lib.debug.878140176" moduleId="org.eclipse.cdt.core.settings" name="WindowsMinGW">
<externalSettings>
<externalSetting>
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/org.eclipse.etrice.runtime.cpp"/>
- <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.runtime.cpp/Debug"/>
+ <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>
<extensions>
- <extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
<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.PE" point="org.eclipse.cdt.core.BinaryParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" 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.staticLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.lib.debug.878140176" name="Debug" parent="cdt.managedbuild.config.gnu.mingw.lib.debug">
+ <configuration artifactExtension="a" artifactName="org.eclipse.etrice.runtime.cpp" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" 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.staticLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.lib.debug.878140176" name="WindowsMinGW" parent="cdt.managedbuild.config.gnu.mingw.lib.debug">
<folderInfo id="cdt.managedbuild.config.gnu.mingw.lib.debug.878140176." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.mingw.lib.debug.1964804313" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.lib.debug">
<targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.lib.debug.1363258846" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.lib.debug"/>
- <builder buildPath="${workspace_loc:/org.eclipse.etrice.runtime.cpp/Debug}" id="cdt.managedbuild.tool.gnu.builder.mingw.base.765054146" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="cdt.managedbuild.tool.gnu.builder.mingw.base"/>
+ <builder buildPath="${workspace_loc:/org.eclipse.etrice.runtime.cpp}/WindowsMinGW" id="cdt.managedbuild.tool.gnu.builder.mingw.base.1145162516" 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.lib.debug.778368249" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.lib.debug">
<option id="gnu.both.asm.option.include.paths.479529629" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.cpp/src/platforms/generic}&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/common}&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/platforms/MT_WIN_MinGW}&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.1431383431" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
@@ -35,86 +42,206 @@
<option id="gnu.cpp.compiler.mingw.lib.debug.option.optimization.level.143629884" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.lib.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
<option id="gnu.cpp.compiler.mingw.lib.debug.option.debugging.level.1636571561" name="Debug Level" superClass="gnu.cpp.compiler.mingw.lib.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.include.paths.371088988" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/platforms/generic}&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:/${ProjName}/src}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src-gen}&quot;"/>
</option>
+ <option id="gnu.cpp.compiler.option.dialect.std.1515882877" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" value="gnu.cpp.compiler.dialect.c++98" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.warnings.pedantic.1054188764" name="Pedantic (-pedantic)" superClass="gnu.cpp.compiler.option.warnings.pedantic" value="true" valueType="boolean"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.834970834" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.lib.debug.787652226" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.lib.debug">
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.mingw.lib.debug.option.optimization.level.1338147333" name="Optimization Level" superClass="gnu.c.compiler.mingw.lib.debug.option.optimization.level" valueType="enumerated"/>
<option id="gnu.c.compiler.mingw.lib.debug.option.debugging.level.1088652134" name="Debug Level" superClass="gnu.c.compiler.mingw.lib.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
- <option id="gnu.c.compiler.option.include.paths.181765143" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/platforms/generic}&quot;"/>
- </option>
+ <option id="gnu.c.compiler.option.include.paths.181765143" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths"/>
+ <option id="gnu.c.compiler.option.dialect.std.1365070354" 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.1322245631" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.base.833683108" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base.1619419934" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base"/>
</toolChain>
</folderInfo>
- <sourceEntries>
- <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
- </sourceEntries>
</configuration>
</storageModule>
- <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ <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>
+ </storageModule>
</cconfiguration>
- <cconfiguration id="cdt.managedbuild.config.gnu.mingw.lib.release.1265017536">
- <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.lib.release.1265017536" moduleId="org.eclipse.cdt.core.settings" name="Release">
+ <cconfiguration id="cdt.managedbuild.config.gnu.mingw.lib.debug.878140176.1748792605">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.lib.debug.878140176.1748792605" moduleId="org.eclipse.cdt.core.settings" name="ExternalMakefile">
<externalSettings>
<externalSetting>
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/org.eclipse.etrice.runtime.cpp"/>
- <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.runtime.cpp/Release"/>
+ <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>
<extensions>
- <extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
<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.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"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.lib.release.1265017536" name="Release" parent="cdt.managedbuild.config.gnu.mingw.lib.release">
- <folderInfo id="cdt.managedbuild.config.gnu.mingw.lib.release.1265017536." name="/" resourcePath="">
- <toolChain id="cdt.managedbuild.toolchain.gnu.mingw.lib.release.341416755" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.lib.release">
- <targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.lib.release.2033657787" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.lib.release"/>
- <builder buildPath="${workspace_loc:/org.eclipse.etrice.runtime.cpp/Release}" id="cdt.managedbuild.tool.gnu.builder.mingw.base.629737011" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="cdt.managedbuild.tool.gnu.builder.mingw.base"/>
- <tool id="cdt.managedbuild.tool.gnu.assembler.mingw.lib.release.1791075014" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.lib.release">
- <option id="gnu.both.asm.option.include.paths.227502240" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths"/>
- <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1768068662" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+ <configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" 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.staticLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.lib.debug.878140176.1748792605" name="ExternalMakefile" parent="cdt.managedbuild.config.gnu.mingw.lib.debug">
+ <folderInfo id="cdt.managedbuild.config.gnu.mingw.lib.debug.878140176.1748792605." name="/" resourcePath="">
+ <toolChain id="cdt.managedbuild.toolchain.gnu.mingw.lib.debug.735358268" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.lib.debug">
+ <targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.lib.debug.2132346692" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.lib.debug"/>
+ <builder id="cdt.managedbuild.target.gnu.builder.base.1131223063" 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.lib.debug.1357671675" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.lib.debug">
+ <option id="gnu.both.asm.option.include.paths.1612643425" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
+ <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/common}&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/platforms/MT_WIN_MinGW}&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.781438692" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.archiver.mingw.lib.debug.1704674283" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.lib.debug"/>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.lib.debug.1456609015" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.lib.debug">
+ <option id="gnu.cpp.compiler.mingw.lib.debug.option.optimization.level.1551264069" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.lib.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.mingw.lib.debug.option.debugging.level.1612652495" name="Debug Level" superClass="gnu.cpp.compiler.mingw.lib.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.include.paths.1116549066" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+ <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/common}&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/platforms/MT_WIN_MinGW}&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;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src}&quot;"/>
+ </option>
+ <option id="gnu.cpp.compiler.option.dialect.std.54663605" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" value="gnu.cpp.compiler.dialect.default" valueType="enumerated"/>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.773921974" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
- <tool id="cdt.managedbuild.tool.gnu.archiver.mingw.lib.release.633341399" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.lib.release"/>
- <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.lib.release.567360588" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.lib.release">
- <option id="gnu.cpp.compiler.mingw.lib.release.option.optimization.level.584961348" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.lib.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
- <option id="gnu.cpp.compiler.mingw.lib.release.option.debugging.level.1368123052" name="Debug Level" superClass="gnu.cpp.compiler.mingw.lib.release.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
- <option id="gnu.cpp.compiler.option.include.paths.763277987" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/platforms/generic}&quot;"/>
+ <tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.lib.debug.1803237789" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.lib.debug">
+ <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.mingw.lib.debug.option.optimization.level.1470653893" name="Optimization Level" superClass="gnu.c.compiler.mingw.lib.debug.option.optimization.level" valueType="enumerated"/>
+ <option id="gnu.c.compiler.mingw.lib.debug.option.debugging.level.1112819348" name="Debug Level" superClass="gnu.c.compiler.mingw.lib.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.include.paths.363472888" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
+ <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/common}&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/platforms/MT_WIN_MinGW}&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.1785503496" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.base.1808349437" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base.1692521571" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base"/>
+ </toolChain>
+ </folderInfo>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings">
+ <externalSettings containerId="org.eclipse.etrice.runtime.c;cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919.18376023" 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/ExternalMakefile"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.runtime.c"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.runtime.c/buildTools"/>
+ <entry flags="RESOLVED" kind="libraryFile" name="org.eclipse.etrice.runtime.c" srcPrefixMapping="" srcRootPath=""/>
+ </externalSetting>
+ </externalSettings>
+ </storageModule>
+ </cconfiguration>
+ <cconfiguration id="cdt.managedbuild.config.gnu.mingw.lib.debug.878140176.190433079">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.lib.debug.878140176.190433079" moduleId="org.eclipse.cdt.core.settings" name="LinuxPosix">
+ <externalSettings>
+ <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>
+ <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.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"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactExtension="a" artifactName="org.eclipse.etrice.runtime.cpp" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" 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.staticLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.lib.debug.878140176.190433079" name="LinuxPosix" parent="cdt.managedbuild.config.gnu.mingw.lib.debug">
+ <folderInfo id="cdt.managedbuild.config.gnu.mingw.lib.debug.878140176.190433079." name="/" resourcePath="">
+ <toolChain id="cdt.managedbuild.toolchain.gnu.base.1080791615" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.base">
+ <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.target.gnu.platform.base.1780203952" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/>
+ <builder buildPath="${workspace_loc:/org.eclipse.etrice.runtime.cpp}/LinuxPosix" id="cdt.managedbuild.target.gnu.builder.base.41376769" 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.300346113" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.920787132" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base">
+ <option id="gnu.cpp.compiler.option.include.paths.891996885" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+ <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_POSIX_GENERIC_GCC}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src-gen}&quot;"/>
</option>
- <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1712453980" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+ <option id="gnu.cpp.compiler.option.optimization.level.1821469380" 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.1846925677" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.dialect.std.1819612545" superClass="gnu.cpp.compiler.option.dialect.std" value="gnu.cpp.compiler.dialect.c++98" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.warnings.pedantic.791879755" superClass="gnu.cpp.compiler.option.warnings.pedantic" value="true" valueType="boolean"/>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.385161260" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
- <tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.lib.release.2143016498" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.lib.release">
- <option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.mingw.lib.release.option.optimization.level.180068255" name="Optimization Level" superClass="gnu.c.compiler.mingw.lib.release.option.optimization.level" valueType="enumerated"/>
- <option id="gnu.c.compiler.mingw.lib.release.option.debugging.level.1290753638" name="Debug Level" superClass="gnu.c.compiler.mingw.lib.release.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/>
- <option id="gnu.c.compiler.option.include.paths.1098867338" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/platforms/generic}&quot;"/>
+ <tool id="cdt.managedbuild.tool.gnu.c.compiler.base.466073081" 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.806058339" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.debugging.level.1967435041" 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.1517993666" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths"/>
+ <option id="gnu.c.compiler.option.dialect.std.1890958235" superClass="gnu.c.compiler.option.dialect.std" value="gnu.c.compiler.dialect.default" valueType="enumerated"/>
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1511381686" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.linker.base.634106669" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.linker.base.512982776" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.assembler.base.1329449959" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.base">
+ <option id="gnu.both.asm.option.include.paths.989539875" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
+ <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/common}&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/platforms/MT_POSIX_GENERIC_GCC}&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.1857566126" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ <inputType id="cdt.managedbuild.tool.gnu.assembler.input.322790476" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
- <tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.base.536323295" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.base"/>
- <tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base.2051974509" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base"/>
</toolChain>
</folderInfo>
- <sourceEntries>
- <entry excluding="src" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
- <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
- </sourceEntries>
</configuration>
</storageModule>
- <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ <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>
+ </storageModule>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
@@ -124,6 +251,10 @@
<configuration configurationName="Release">
<resource resourceType="PROJECT" workspacePath="/org.eclipse.etrice.runtime.cpp"/>
</configuration>
+ <configuration configurationName="ExternalMakefile">
+ <resource resourceType="PROJECT" workspacePath="/org.eclipse.etrice.runtime.cpp"/>
+ </configuration>
+ <configuration configurationName="WindowsMinGW"/>
<configuration configurationName="Debug">
<resource resourceType="PROJECT" workspacePath="/org.eclipse.etrice.runtime.cpp"/>
</configuration>
@@ -132,12 +263,24 @@
<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.lib.debug.878140176.190433079;cdt.managedbuild.config.gnu.mingw.lib.debug.878140176.190433079.;cdt.managedbuild.tool.gnu.cpp.compiler.base.920787132;cdt.managedbuild.tool.gnu.cpp.compiler.input.385161260">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.lib.debug.878140176.1748792605;cdt.managedbuild.config.gnu.mingw.lib.debug.878140176.1748792605.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.lib.debug.1456609015;cdt.managedbuild.tool.gnu.cpp.compiler.input.773921974">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.lib.debug.878140176.1748792605;cdt.managedbuild.config.gnu.mingw.lib.debug.878140176.1748792605.;cdt.managedbuild.tool.gnu.c.compiler.mingw.lib.debug.1803237789;cdt.managedbuild.tool.gnu.c.compiler.input.1785503496">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.lib.debug.878140176;cdt.managedbuild.config.gnu.mingw.lib.debug.878140176.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.lib.debug.1516705340;cdt.managedbuild.tool.gnu.cpp.compiler.input.834970834">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.lib.release.1265017536;cdt.managedbuild.config.gnu.mingw.lib.release.1265017536.;cdt.managedbuild.tool.gnu.c.compiler.mingw.lib.release.2143016498;cdt.managedbuild.tool.gnu.c.compiler.input.1857566126">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
</scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.lib.debug.878140176.190433079;cdt.managedbuild.config.gnu.mingw.lib.debug.878140176.190433079.;cdt.managedbuild.tool.gnu.c.compiler.base.466073081;cdt.managedbuild.tool.gnu.c.compiler.input.1511381686">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.lib.debug.878140176;cdt.managedbuild.config.gnu.mingw.lib.debug.878140176.;cdt.managedbuild.tool.gnu.c.compiler.mingw.lib.debug.787652226;cdt.managedbuild.tool.gnu.c.compiler.input.1322245631">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
</scannerConfigBuildInfo>
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/.gitignore b/runtime/org.eclipse.etrice.runtime.cpp/.gitignore
index 9904774eb..9f090e11d 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/.gitignore
+++ b/runtime/org.eclipse.etrice.runtime.cpp/.gitignore
@@ -1,2 +1,4 @@
+WindowsMinGW
+LinuxPosix
bin
-Debug
+src-gen-info
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/.project b/runtime/org.eclipse.etrice.runtime.cpp/.project
index 3dbf92d9e..7e25bb85d 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/.project
+++ b/runtime/org.eclipse.etrice.runtime.cpp/.project
@@ -3,6 +3,7 @@
<name>org.eclipse.etrice.runtime.cpp</name>
<comment></comment>
<projects>
+ <project>org.eclipse.etrice.runtime.c</project>
</projects>
<buildSpec>
<buildCommand>
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/.settings/org.eclipse.cdt.core.prefs b/runtime/org.eclipse.etrice.runtime.cpp/.settings/org.eclipse.cdt.core.prefs
new file mode 100644
index 000000000..eda368335
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.cpp/.settings/org.eclipse.cdt.core.prefs
@@ -0,0 +1,9 @@
+eclipse.preferences.version=1
+environment/project/cdt.managedbuild.config.gnu.mingw.lib.debug.878140176.1748792605/ECLIPSE_MODE/delimiter=;
+environment/project/cdt.managedbuild.config.gnu.mingw.lib.debug.878140176.1748792605/ECLIPSE_MODE/operation=append
+environment/project/cdt.managedbuild.config.gnu.mingw.lib.debug.878140176.1748792605/ECLIPSE_MODE/value=true
+environment/project/cdt.managedbuild.config.gnu.mingw.lib.debug.878140176.1748792605/RUNTIME_ROOTDIR/delimiter=;
+environment/project/cdt.managedbuild.config.gnu.mingw.lib.debug.878140176.1748792605/RUNTIME_ROOTDIR/operation=append
+environment/project/cdt.managedbuild.config.gnu.mingw.lib.debug.878140176.1748792605/RUNTIME_ROOTDIR/value=${workspace_loc\:org.eclipse.etrice.runtime.c}
+environment/project/cdt.managedbuild.config.gnu.mingw.lib.debug.878140176.1748792605/append=true
+environment/project/cdt.managedbuild.config.gnu.mingw.lib.debug.878140176.1748792605/appendContributed=true
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/Makefile b/runtime/org.eclipse.etrice.runtime.cpp/Makefile
new file mode 100644
index 000000000..3c22c6779
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.cpp/Makefile
@@ -0,0 +1,18 @@
+ifeq ($(strip ${RUNTIME_ROOTDIR}),)
+ RUNTIME_ROOTDIR := ../org.eclipse.etrice.runtime.c
+endif
+
+include ${RUNTIME_ROOTDIR}/buildTools/runtime.mk
+
+CPP_RUNTIME_INCDIRS := ./src ./src-gen
+
+IN_TARGET := lib$(notdir $(shell pwd)).a
+IN_INCDIRS += ${CPP_RUNTIME_INCDIRS}
+IN_SRCDIRS_REC := ${CPP_RUNTIME_INCDIRS}
+CC = ${CXX}
+IN_CFLAGS += -std=c++98 -O0 -g3 -pedantic -Wall
+
+include ${RUNTIME_ROOTDIR}/buildTools/Makefile.mk
+
+
+
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/buildTools/Makefile b/runtime/org.eclipse.etrice.runtime.cpp/buildTools/Makefile
new file mode 100644
index 000000000..f0610a164
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.cpp/buildTools/Makefile
@@ -0,0 +1,32 @@
+# environment variables: RUNTIME_ROOTDIR, MODELLIB_ROOTDIR, TARGET_PLATFORM, TARGET_BUILD_DIR, ECLIPSE_MODE
+# default is windows mingw
+
+# CDT Environment:
+# RUNTIME_ROOTDIR: ${workspace_loc:org.eclipse.etrice.runtime.c}
+# MODELLIB_ROOTDIR: ${workspace_loc:org.eclipse.etrice.modellib.c}
+# ECLIPSE_MODE (no value)
+
+ifeq ($(strip ${RUNTIME_ROOTDIR}),)
+ RUNTIME_ROOTDIR := ../org.eclipse.etrice.runtime.c
+endif
+ifeq ($(strip ${CPP_MODELLIB_ROOTDIR}),)
+ CPP_MODELLIB_ROOTDIR := ../org.eclipse.etrice.modellib.cpp
+endif
+ifeq ($(strip ${CPP_RUNTIME_ROOTDIR}),)
+ CPP_RUNTIME_ROOTDIR := ../org.eclipse.etrice.runtime.cpp
+endif
+
+include ${CPP_MODELLIB_ROOTDIR}/buildTools/modellib.mk
+include ${CPP_RUNTIME_ROOTDIR}/buildTools/runtime.mk
+
+# ---
+IN_TARGET := $(notdir $(shell pwd)).exe
+IN_INCDIRS += ./src-gen ./src
+IN_SRCDIRS_REC += ./src-gen ./src
+CC = ${CXX}
+IN_CFLAGS += -std=c++98 -O0 -g3 -pedantic -Wall
+#---
+
+
+# Create rules
+include ${RUNTIME_ROOTDIR}/buildTools/Makefile.mk
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/buildTools/runtime.mk b/runtime/org.eclipse.etrice.runtime.cpp/buildTools/runtime.mk
new file mode 100644
index 000000000..6a615e677
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.cpp/buildTools/runtime.mk
@@ -0,0 +1,30 @@
+include ${RUNTIME_ROOTDIR}/buildTools/defaults.mk
+
+# Includes
+CPP_RUNTIME_INCDIRS := ${CPP_RUNTIME_ROOTDIR}/src ${CPP_RUNTIME_ROOTDIR}/src-gen
+
+
+IN_INCDIRS += ${CPP_RUNTIME_INCDIRS}
+
+IN_LDFLAGS += -L${CPP_RUNTIME_ROOTDIR}/${TARGET_BUILD_DIR}
+IN_LDLIBS += -lorg.eclipse.etrice.runtime.cpp
+ifeq ($(strip ${ECLIPSE_MODE}),)
+ IN_PREREQS += liborg.eclipse.etrice.runtime.cpp.a
+endif
+
+liborg.eclipse.etrice.runtime.cpp.a:
+ ${MAKE} -C ${CPP_RUNTIME_ROOTDIR} build
+
+clean_liborg.eclipse.etrice.runtime.cpp.a:
+ ${MAKE} -C ${CPP_RUNTIME_ROOTDIR} clean
+
+include ${RUNTIME_ROOTDIR}/buildTools/runtime.mk
+
+
+
+
+
+
+
+
+
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/gen_runtime.launch b/runtime/org.eclipse.etrice.runtime.cpp/gen_runtime.launch
new file mode 100644
index 000000000..8c58d1f30
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.cpp/gen_runtime.launch
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.etrice.generator.launch.cpp.launchConfigurationType">
+<booleanAttribute key="DataLogging" value="false"/>
+<booleanAttribute key="Debug" value="false"/>
+<booleanAttribute key="GenDocumentation" value="false"/>
+<booleanAttribute key="GenInstanceDiagram" value="false"/>
+<stringAttribute key="GenModelPath" value=""/>
+<booleanAttribute key="Lib" value="true"/>
+<booleanAttribute key="MSC" value="true"/>
+<listAttribute key="ModelFiles">
+<listEntry value="${workspace_loc:/org.eclipse.etrice.runtime.cpp/model/SystemServices.room}"/>
+</listAttribute>
+<booleanAttribute key="OverrideDirectories" value="false"/>
+<booleanAttribute key="SaveGenModel" value="false"/>
+<booleanAttribute key="UseTranslation" value="true"/>
+<booleanAttribute key="Verbose" value="false"/>
+</launchConfiguration>
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/model/SystemServices.room b/runtime/org.eclipse.etrice.runtime.cpp/model/SystemServices.room
new file mode 100644
index 000000000..f6949ddef
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.cpp/model/SystemServices.room
@@ -0,0 +1,9 @@
+RoomModel common.modelbase {
+ ProtocolClass RTSystemServicesProtocol {
+ incoming {
+ Message executeInitialTransition()
+ Message startDebugging()
+ Message stopDebugging()
+ }
+ }
+} \ No newline at end of file
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src-gen/common/modelbase/RTSystemServicesProtocol.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src-gen/common/modelbase/RTSystemServicesProtocol.cpp
new file mode 100644
index 000000000..55276e76f
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src-gen/common/modelbase/RTSystemServicesProtocol.cpp
@@ -0,0 +1,161 @@
+/**
+ * @author generated by eTrice
+ *
+ * Source File of ProtocolClass RTSystemServicesProtocol
+ *
+ */
+
+#include "RTSystemServicesProtocol.h"
+
+#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>
+#include <iterator>
+#include <string>
+#include <vector>
+
+using namespace etRuntime;
+
+
+
+/* message names as strings for debugging (generate MSC) */
+const std::string RTSystemServicesProtocol::s_messageStrings[] = {"MIN", "executeInitialTransition","startDebugging","stopDebugging","MAX"};
+
+const std::string& RTSystemServicesProtocol::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;
+ }
+}
+
+//------------------------------------------------------------------------------------------------------------
+// port class
+//------------------------------------------------------------------------------------------------------------
+
+RTSystemServicesProtocolPort::RTSystemServicesProtocolPort(IInterfaceItemOwner* actor, const std::string& name, int localId) :
+ PortBase(actor, name, localId, 0)
+{
+ DebuggingService::getInstance().addPortInstance(*this);
+}
+
+RTSystemServicesProtocolPort::RTSystemServicesProtocolPort(IInterfaceItemOwner* actor, const std::string& name, int localId, int idx) :
+ PortBase(actor, name, localId, idx)
+{
+ DebuggingService::getInstance().addPortInstance(*this);
+}
+
+void RTSystemServicesProtocolPort::destroy() {
+ DebuggingService::getInstance().removePortInstance(*this);
+ PortBase::destroy();
+}
+
+void RTSystemServicesProtocolPort::receive(const Message* msg) {
+ // TODO JH further
+ if (! RTSystemServicesProtocol::isValidIncomingEvtID(msg->getEvtId())) {
+ std::cout << "unknown" << std::endl;
+ }
+
+ DebuggingService::getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), RTSystemServicesProtocol::getMessageString(msg->getEvtId()));
+
+ getActor()->receiveEvent(this, msg->getEvtId(), msg->getData());
+}
+
+
+// sent messages
+
+//------------------------------------------------------------------------------------------------------------
+// replicated port class
+//------------------------------------------------------------------------------------------------------------
+RTSystemServicesProtocolReplPort::RTSystemServicesProtocolReplPort(IInterfaceItemOwner* actor, const std::string& name, int localId) :
+ ReplicatedPortBase(actor, name, localId)
+{
+}
+
+// outgoing messages
+//------------------------------------------------------------------------------------------------------------
+// conjugated port class
+//------------------------------------------------------------------------------------------------------------
+
+RTSystemServicesProtocolConjPort::RTSystemServicesProtocolConjPort(IInterfaceItemOwner* actor, const std::string& name, int localId) :
+ PortBase(actor, name, localId, 0)
+{
+ DebuggingService::getInstance().addPortInstance(*this);
+}
+
+RTSystemServicesProtocolConjPort::RTSystemServicesProtocolConjPort(IInterfaceItemOwner* actor, const std::string& name, int localId, int idx) :
+ PortBase(actor, name, localId, idx)
+{
+ DebuggingService::getInstance().addPortInstance(*this);
+}
+
+void RTSystemServicesProtocolConjPort::destroy() {
+ DebuggingService::getInstance().removePortInstance(*this);
+ PortBase::destroy();
+}
+
+void RTSystemServicesProtocolConjPort::receive(const Message* msg) {
+ // TODO JH further
+ if (! RTSystemServicesProtocol::isValidOutgoingEvtID(msg->getEvtId())) {
+ std::cout << "unknown" << std::endl;
+ }
+
+ DebuggingService::getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), RTSystemServicesProtocol::getMessageString(msg->getEvtId()));
+
+ getActor()->receiveEvent(this, msg->getEvtId(), msg->getData());
+}
+
+
+// sent messages
+void RTSystemServicesProtocolConjPort::executeInitialTransition() {
+ DebuggingService::getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(),
+ RTSystemServicesProtocol::getMessageString(RTSystemServicesProtocol::IN_executeInitialTransition));
+ if (getPeerAddress().isValid()){
+ getPeerMsgReceiver()->receive(new Message(getPeerAddress(), RTSystemServicesProtocol::IN_executeInitialTransition));
+ }
+}
+void RTSystemServicesProtocolConjPort::startDebugging() {
+ DebuggingService::getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(),
+ RTSystemServicesProtocol::getMessageString(RTSystemServicesProtocol::IN_startDebugging));
+ if (getPeerAddress().isValid()){
+ getPeerMsgReceiver()->receive(new Message(getPeerAddress(), RTSystemServicesProtocol::IN_startDebugging));
+ }
+}
+void RTSystemServicesProtocolConjPort::stopDebugging() {
+ DebuggingService::getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(),
+ RTSystemServicesProtocol::getMessageString(RTSystemServicesProtocol::IN_stopDebugging));
+ if (getPeerAddress().isValid()){
+ getPeerMsgReceiver()->receive(new Message(getPeerAddress(), RTSystemServicesProtocol::IN_stopDebugging));
+ }
+}
+
+//------------------------------------------------------------------------------------------------------------
+// conjugated replicated port class
+//------------------------------------------------------------------------------------------------------------
+RTSystemServicesProtocolConjReplPort::RTSystemServicesProtocolConjReplPort(IInterfaceItemOwner* actor, const std::string& name, int localId) :
+ ReplicatedPortBase(actor, name, localId)
+{
+}
+
+// incoming messages
+void RTSystemServicesProtocolConjReplPort::executeInitialTransition(){
+ for (std::vector<etRuntime::InterfaceItemBase*>::iterator it = getItems().begin(); it != getItems().end(); ++it) {
+ (dynamic_cast<RTSystemServicesProtocolConjPort*>(*it))->executeInitialTransition();
+ }
+}
+void RTSystemServicesProtocolConjReplPort::startDebugging(){
+ for (std::vector<etRuntime::InterfaceItemBase*>::iterator it = getItems().begin(); it != getItems().end(); ++it) {
+ (dynamic_cast<RTSystemServicesProtocolConjPort*>(*it))->startDebugging();
+ }
+}
+void RTSystemServicesProtocolConjReplPort::stopDebugging(){
+ for (std::vector<etRuntime::InterfaceItemBase*>::iterator it = getItems().begin(); it != getItems().end(); ++it) {
+ (dynamic_cast<RTSystemServicesProtocolConjPort*>(*it))->stopDebugging();
+ }
+}
+
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src-gen/common/modelbase/RTSystemServicesProtocol.h b/runtime/org.eclipse.etrice.runtime.cpp/src-gen/common/modelbase/RTSystemServicesProtocol.h
new file mode 100644
index 000000000..69c914db8
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src-gen/common/modelbase/RTSystemServicesProtocol.h
@@ -0,0 +1,127 @@
+/**
+ * @author generated by eTrice
+ *
+ * Header File of ProtocolClass RTSystemServicesProtocol
+ *
+ */
+
+#ifndef _RTSYSTEMSERVICESPROTOCOL_H_
+#define _RTSYSTEMSERVICESPROTOCOL_H_
+
+#include <common/modelbase/InterfaceItemBase.h>
+#include <common/modelbase/PortBase.h>
+#include <common/modelbase/ReplicatedInterfaceItemBase.h>
+#include <common/modelbase/ReplicatedPortBase.h>
+#include <etDatatypes.h>
+#include <string>
+
+
+
+class RTSystemServicesProtocol {
+ public:
+ /* message IDs */
+ typedef enum {
+ MSG_MIN = 0,
+ IN_executeInitialTransition = 1,
+ IN_startDebugging = 2,
+ IN_stopDebugging = 3,
+ MSG_MAX = 4
+ } msg_ids;
+
+
+ static bool isValidEvtID(int evtId) {
+ return ((MSG_MIN < evtId) && (evtId < MSG_MAX));
+ }
+ static bool isValidOutgoingEvtID(int evtId) {
+ return ((MSG_MIN < evtId) && (evtId < IN_executeInitialTransition));
+ }
+ static bool isValidIncomingEvtID(int evtId) {
+ return ((IN_executeInitialTransition <= evtId) && (evtId < MSG_MAX));
+ }
+ static const std::string& getMessageString(int msg_id);
+
+ private:
+ static const std::string s_messageStrings[];
+
+
+};
+
+//------------------------------------------------------------------------------------------------------------
+// port class
+//------------------------------------------------------------------------------------------------------------
+class RTSystemServicesProtocolPort : public etRuntime::PortBase {
+ public:
+ RTSystemServicesProtocolPort(etRuntime::IInterfaceItemOwner* actor, const std::string& name, int localId);
+ RTSystemServicesProtocolPort(etRuntime::IInterfaceItemOwner* actor, const std::string& name, int localId, int idx);
+
+ virtual void destroy();
+
+ virtual void receive(const etRuntime::Message* m);
+
+
+ // sent messages
+};
+
+//------------------------------------------------------------------------------------------------------------
+// replicated port class
+//------------------------------------------------------------------------------------------------------------
+class RTSystemServicesProtocolReplPort : public etRuntime::ReplicatedPortBase {
+
+ public:
+ RTSystemServicesProtocolReplPort(etRuntime::IInterfaceItemOwner* actor, const std::string& name, int localId);
+
+ int getReplication() const { return getNInterfaceItems(); }
+ int getIndexOf(const etRuntime::InterfaceItemBase& ifitem) const { return ifitem.getIdx(); }
+ RTSystemServicesProtocolPort& get(int idx) const { return *dynamic_cast<RTSystemServicesProtocolPort*>(getInterfaceItem(idx)); }
+
+ // outgoing messages
+
+ protected:
+ virtual etRuntime::InterfaceItemBase* createInterfaceItem(etRuntime::IInterfaceItemOwner* rcv, const std::string& name, int lid, int idx) {
+ return new RTSystemServicesProtocolPort(rcv, name, lid, idx);
+ }
+
+};
+//------------------------------------------------------------------------------------------------------------
+// conjugated port class
+//------------------------------------------------------------------------------------------------------------
+class RTSystemServicesProtocolConjPort : public etRuntime::PortBase {
+ public:
+ RTSystemServicesProtocolConjPort(etRuntime::IInterfaceItemOwner* actor, const std::string& name, int localId);
+ RTSystemServicesProtocolConjPort(etRuntime::IInterfaceItemOwner* actor, const std::string& name, int localId, int idx);
+
+ virtual void destroy();
+
+ virtual void receive(const etRuntime::Message* m);
+
+
+ // sent messages
+ public: void executeInitialTransition();
+ public: void startDebugging();
+ public: void stopDebugging();
+};
+
+//------------------------------------------------------------------------------------------------------------
+// conjugated replicated port class
+//------------------------------------------------------------------------------------------------------------
+class RTSystemServicesProtocolConjReplPort : public etRuntime::ReplicatedPortBase {
+
+ public:
+ RTSystemServicesProtocolConjReplPort(etRuntime::IInterfaceItemOwner* actor, const std::string& name, int localId);
+
+ int getReplication() const { return getNInterfaceItems(); }
+ int getIndexOf(const etRuntime::InterfaceItemBase& ifitem) const { return ifitem.getIdx(); }
+ RTSystemServicesProtocolConjPort& get(int idx) const { return *dynamic_cast<RTSystemServicesProtocolConjPort*>(getInterfaceItem(idx)); }
+
+ // incoming messages
+ public: void executeInitialTransition();
+ public: void startDebugging();
+ public: void stopDebugging();
+
+ protected:
+ virtual etRuntime::InterfaceItemBase* createInterfaceItem(etRuntime::IInterfaceItemOwner* rcv, const std::string& name, int lid, int idx) {
+ return new RTSystemServicesProtocolConjPort(rcv, name, lid, idx);
+ }
+
+};
+#endif /* _RTSYSTEMSERVICESPROTOCOL_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src-gen/readme.txt b/runtime/org.eclipse.etrice.runtime.cpp/src-gen/readme.txt
new file mode 100644
index 000000000..1dc2b35ab
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.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/runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/DebuggingService.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/DebuggingService.cpp
index ed8c11e57..89a8bc6dd 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/DebuggingService.cpp
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/DebuggingService.cpp
@@ -10,67 +10,97 @@
*
*******************************************************************************/
-
#include "DebuggingService.h"
+
#include "common/modelbase/ActorClassBase.h"
+#include "common/modelbase/SubSystemClassBase.h"
+#include "common/modelbase/PortBase.h"
#include <iostream>
namespace etRuntime {
-DebuggingService* DebuggingService::s_instance = 0;
+DebuggingService& DebuggingService::getInstance() {
+ static DebuggingService instance;
+
+ return instance;
+}
+
+DebuggingService::DebuggingService() :
+ m_asyncLogger(),
+ m_syncLogger(),
+ m_portInstances() {
+}
+
+const PortBase* DebuggingService::getPort(const Address& address) const {
+ std::map<Address, const PortBase*>::const_iterator it = m_portInstances.find(address);
+ if (it != m_portInstances.end())
+ return it->second;
-DebuggingService::DebuggingService()
-: asyncLogger() ,
- syncLogger(),
- portInstances()
-{
+ return 0;
}
-DebuggingService::~DebuggingService() {
+void DebuggingService::addMessageAsyncOut(const Address& source, const Address& target, const std::string& msg) {
+ const PortBase* srcPort = getPort(source);
+ const PortBase* tgtPort = getPort(target);
+ if (srcPort != 0 && tgtPort != 0)
+ m_asyncLogger.addMessageAsyncOut(srcPort->getActor()->getInstancePath(), tgtPort->getActor()->getInstancePath(),
+ msg);
+
}
+void DebuggingService::addMessageAsyncIn(const Address& source, const Address& target, const std::string& msg) {
+ const PortBase* srcPort = getPort(source);
+ const PortBase* tgtPort = getPort(target);
+ if (srcPort != 0 && tgtPort != 0)
+ m_asyncLogger.addMessageAsyncIn(srcPort->getActor()->getInstancePath(), tgtPort->getActor()->getInstancePath(),
+ msg);
+}
-void DebuggingService::addMessageAsyncOut(Address source, Address target,
- const std::string& msg) {
- asyncLogger.addMessageAsyncOut(portInstances.at(source)->getActorPath(),
- portInstances.at(target)->getActorPath(), msg);
+void DebuggingService::addMessageSyncCall(const Address& source, const Address& target, const std::string& msg) {
+ const PortBase* srcPort = getPort(source);
+ const PortBase* tgtPort = getPort(target);
+ if (srcPort != 0 && tgtPort != 0)
+ m_asyncLogger.addMessageSyncCall(srcPort->getActor()->getInstancePath(), tgtPort->getActor()->getInstancePath(),
+ msg);
}
-void DebuggingService::addMessageAsyncIn(Address source, Address target,
- const std::string& msg) {
- asyncLogger.addMessageAsyncIn(portInstances.at(source)->getActorPath(),
- portInstances.at(target)->getActorPath(), msg);
+void DebuggingService::addMessageSyncReturn(const Address& source, const Address& target, const std::string& msg) {
+ const PortBase* srcPort = getPort(source);
+ const PortBase* tgtPort = getPort(target);
+ if (srcPort != 0 && tgtPort != 0)
+ m_asyncLogger.addMessageSyncReturn(srcPort->getActor()->getInstancePath(),
+ tgtPort->getActor()->getInstancePath(), msg);
}
-void DebuggingService::addMessageSyncCall(Address source, Address target,
- const std::string& msg) {
- asyncLogger.addMessageSyncCall(portInstances.at(source)->getActorPath(),
- portInstances.at(target)->getActorPath(), msg);
+void DebuggingService::addActorState(const ActorClassBase& actor, const std::string& state) {
+ m_asyncLogger.addActorState(actor.getInstancePath(), state);
}
-void DebuggingService::addMessageSyncReturn(Address source, Address target,
- const std::string& msg) {
- asyncLogger.addMessageSyncReturn(portInstances.at(source)->getActorPath(),
- portInstances.at(target)->getActorPath(), msg);
+void DebuggingService::addMessageActorCreate(const SubSystemClassBase& parent, const std::string& refName) {
+ m_asyncLogger.addMessageActorCreate(parent.getInstancePath(),
+ parent.getInstancePath() + IRTObject::PATH_DELIM + refName);
}
-void DebuggingService::addActorState(const ActorClassBase& actor,
- const std::string& state) {
- asyncLogger.addActorState(actor.getInstancePath(), state);
+void DebuggingService::addMessageActorCreate(const ActorClassBase& parent, const std::string& refName) {
+ m_asyncLogger.addMessageActorCreate(parent.getInstancePath(),
+ parent.getInstancePath() + IRTObject::PATH_DELIM + refName);
}
-void DebuggingService::addPortInstance(PortBase& port) {
- portInstances[port.getAddress()] = &port;
- std::cout << "adding " << port.getAddress().toID() << " " << &port << " " << port.getParent()->getInstancePathName()<< std::endl;
+void DebuggingService::addMessageActorDestroy(const ActorClassBase& inst) {
+ //if (!(inst.getParent() instanceof OptionalActorInterfaceBase))
+ m_asyncLogger.addMessageActorDestroy(inst.getParent()->getInstancePath(), inst.getInstancePath());
}
-MSCLogger& DebuggingService::getSyncLogger() {
- return syncLogger;
+void DebuggingService::addVisibleComment(const std::string& comment) {
+ m_asyncLogger.addVisibleComment(comment);
}
-MSCLogger& DebuggingService::getAsyncLogger() {
- return asyncLogger;
+void DebuggingService::addPortInstance(const PortBase& port) {
+ m_portInstances[port.getAddress()] = &port;
}
+void DebuggingService::removePortInstance(const PortBase& port) {
+ m_portInstances.erase(port.getAddress());
+}
} /* namespace etRuntime */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/DebuggingService.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/DebuggingService.h
index 872eabf6c..c7ef3e6fe 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/DebuggingService.h
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/DebuggingService.h
@@ -13,55 +13,54 @@
#ifndef DEBUGGINGSERVICE_H_
#define DEBUGGINGSERVICE_H_
-#include "common/messaging/Address.h"
#include "common/debugging/MSCLogger.h"
-#include "common/modelbase/PortBase.h"
+#include "common/messaging/Address.h"
+#include "etDatatypes.h"
#include <string>
#include <map>
namespace etRuntime {
- class ActorClassBase;
+class ActorClassBase;
+class SubSystemClassBase;
+class PortBase;
class DebuggingService {
-private:
- static DebuggingService* s_instance;
public:
- virtual ~DebuggingService();
-
- static DebuggingService& getInstance() {
- if (s_instance == 0) {
- s_instance = new DebuggingService();
- }
- return *s_instance;
- }
-
- void addMessageAsyncOut(Address source, Address target, const std::string& msg);
- void addMessageAsyncIn(Address source, Address target, const std::string& msg);
- void addMessageSyncCall(Address source, Address target, const std::string& msg);
- void addMessageSyncReturn(Address source, Address target, const std::string& msg);
+ virtual ~DebuggingService() {}
+
+ static DebuggingService& getInstance();
+
+ void addMessageAsyncOut(const Address& source, const Address& target, const std::string& msg);
+ void addMessageAsyncIn(const Address& source, const Address& target, const std::string& msg);
+ void addMessageSyncCall(const Address& source, const Address& target, const std::string& msg);
+ void addMessageSyncReturn(const Address& source, const Address& target, const std::string& msg);
void addActorState(const ActorClassBase& actor, const std::string& state);
- void addPortInstance(PortBase& port);
- MSCLogger& getSyncLogger();
- MSCLogger& getAsyncLogger();
+ void addMessageActorCreate(const SubSystemClassBase& parent, const std::string& refName);
+ void addMessageActorCreate(const ActorClassBase& parent, const std::string& refName);
+ void addMessageActorDestroy(const ActorClassBase& inst);
+ void addVisibleComment(const std::string& comment);
+ void addPortInstance(const PortBase& port);
+ void removePortInstance(const PortBase& port);
+
+ MSCLogger& getSyncLogger() { return m_syncLogger; }
+ MSCLogger& getAsyncLogger() { return m_asyncLogger; }
private:
- MSCLogger asyncLogger;
- MSCLogger syncLogger;
- std::map<Address, PortBase*> portInstances;
+ MSCLogger m_asyncLogger;
+ MSCLogger m_syncLogger;
+ std::map<Address, const PortBase*> m_portInstances;
+
+ const PortBase* getPort(const Address& address) const;
DebuggingService();
- DebuggingService(const DebuggingService& right);
- DebuggingService& operator=(const DebuggingService& right);
+ DebuggingService(DebuggingService const&);
+ DebuggingService& operator=(DebuggingService const&);
};
} /* namespace etRuntime */
#endif /* DEBUGGINGSERVICE_H_ */
-
-
-
-
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/MSCFilter.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/MSCFilter.cpp
index d720bbe5e..d38c20679 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/MSCFilter.cpp
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/MSCFilter.cpp
@@ -10,25 +10,26 @@
*
*******************************************************************************/
-#include "MSCFilter.h"
+#include "common/debugging/MSCFilter.h"
+#include "etStdDatatypes.h"
+#include <list>
+#include <string>
namespace etRuntime {
MSCFilter::MSCFilter() :
filterList() {
}
-MSCFilter::~MSCFilter() {
-}
void MSCFilter::addFilter(FilterItem filter) {
filterList.push_back(filter);
}
-bool MSCFilter::applyTo(const std::string& text) {
+etBool MSCFilter::applyTo(const std::string& text) {
if (filterList.empty())
return true; // no filters -> all messages will be logged
std::list<FilterItem>::iterator it = filterList.begin();
- for ( ; it != filterList.end(); ++it) {
+ for (; it != filterList.end(); ++it) {
if (text.compare((*it).filter) == 0)
return !(*it).exclude;
}
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/MSCFilter.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/MSCFilter.h
index 917feb460..52067ed0f 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/MSCFilter.h
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/MSCFilter.h
@@ -13,6 +13,7 @@
#ifndef MSCFILTER_H_
#define MSCFILTER_H_
+#include "etStdDatatypes.h"
#include <list>
#include <string>
@@ -20,23 +21,24 @@ namespace etRuntime {
class MSCFilter {
public:
- class FilterItem{
+ class FilterItem {
public:
- FilterItem(const std::string& filter_, bool exclude_)
- : exclude(exclude_),
- filter(filter_)
- {};
- bool exclude;
+ FilterItem(const std::string& filter_, etBool exclude_) :
+ exclude(exclude_),
+ filter(filter_) {
+ }
+ etBool exclude;
std::string filter;
private:
FilterItem();
};
MSCFilter();
- virtual ~MSCFilter();
+ virtual ~MSCFilter() {
+ }
void addFilter(FilterItem filter);
- bool applyTo(const std::string& text);
+ etBool applyTo(const std::string& text);
std::string reduceString(const std::string& string);
private:
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/MSCLogger.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/MSCLogger.cpp
index 5ecb0354d..60f853f22 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/MSCLogger.cpp
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/MSCLogger.cpp
@@ -10,95 +10,134 @@
*
*******************************************************************************/
-#include "MSCLogger.h"
+#include "common/debugging/MSCFilter.h"
+#include "common/debugging/MSCLogger.h"
+#include "debugging/etLogger.h"
+#include "etDatatypes.h"
+#include <list>
+#include <string>
namespace etRuntime {
-MSCLogger::MSCLogger()
-: commandList(),
- filter(0),
- path(),
- msc_name(),
-is_open(false)
-{
+MSCLogger::MSCLogger() :
+ m_commandList(),
+ m_filter(0),
+ m_path(),
+ m_msc_name(),
+ m_is_open(false) {
+ etMutex_construct(&m_mutex);
}
MSCLogger::~MSCLogger() {
- delete filter;
- filter = 0;
+ delete m_filter;
+ m_filter = 0;
+ etMutex_destruct(&m_mutex);
}
-void MSCLogger::setMSC(const std::string& msc_name_, const std::string& path_) {
- msc_name = msc_name_;
- path = path_;
- delete filter;
- filter = new MSCFilter();
+void MSCLogger::setMSC(const std::string& msc_name, const std::string& path) {
+ m_msc_name = msc_name;
+ m_path = path;
+ delete m_filter;
+ m_filter = new MSCFilter();
}
-void MSCLogger::addMessageAsyncOut(const std::string& source, const std::string& target,
- const std::string& message) {
+void MSCLogger::open() {
+ etMutex_enter(&m_mutex);
+ m_is_open = true;
+ etMutex_leave(&m_mutex);
+}
+
+void MSCLogger::addMessageAsyncOut(const std::string& source, const std::string& target, const std::string& message) {
+ etMutex_enter(&m_mutex);
createLine(source, " >-- ", target, message);
+ etMutex_leave(&m_mutex);
}
-void MSCLogger::addMessageAsyncIn(const std::string& source, const std::string& target,
- const std::string& message) {
+void MSCLogger::addMessageAsyncIn(const std::string& source, const std::string& target, const std::string& message) {
+ etMutex_enter(&m_mutex);
createLine(source, " --> ", target, message);
+ etMutex_leave(&m_mutex);
}
-void MSCLogger::addMessageSyncCall(const std::string& source, const std::string& target,
- const std::string& message) {
+void MSCLogger::addMessageSyncCall(const std::string& source, const std::string& target, const std::string& message) {
+ etMutex_enter(&m_mutex);
createLine(source, " ==> ", target, message);
+ etMutex_leave(&m_mutex);
}
-void MSCLogger::addMessageSyncReturn(const std::string& source, const std::string& target,
- const std::string& message) {
+void MSCLogger::addMessageSyncReturn(const std::string& source, const std::string& target, const std::string& message) {
+ etMutex_enter(&m_mutex);
createLine(source, " <== ", target, message);
+ etMutex_leave(&m_mutex);
+}
+
+void MSCLogger::addMessageActorCreate(const std::string& source, const std::string& target) {
+ etMutex_enter(&m_mutex);
+ createLine(source, " (!) ", target, "");
+ etMutex_leave(&m_mutex);
+}
+
+void MSCLogger::addMessageActorDestroy(const std::string& source, const std::string& target) {
+ etMutex_enter(&m_mutex);
+ createLine(source, " (X) ", target, "");
+ etMutex_leave(&m_mutex);
+}
+
+void MSCLogger::addNote(const std::string& actor, const std::string& note) {
+ etMutex_enter(&m_mutex);
+ //if (filter.applyTo(actor))
+ getCommandList().push_back("\t" + m_filter->reduceString(actor) + " note: " + note);
+ etMutex_leave(&m_mutex);
+}
+
+void MSCLogger::addMessageCreate(const std::string& source, const std::string& target) {
+ etMutex_enter(&m_mutex);
+ createLine(source, " (!) ", target, "");
+ etMutex_leave(&m_mutex);
}
void MSCLogger::addActorState(const std::string& actor, const std::string& state) {
- if (filter->applyTo(actor))
- commandList.push_back("\t" + filter->reduceString(actor) + " >>> " + state);
+ etMutex_enter(&m_mutex);
+ //if (filter->applyTo(actor))
+ getCommandList().push_back("\t" + m_filter->reduceString(actor) + " >>> " + state);
+ etMutex_leave(&m_mutex);
}
-void MSCLogger::createLine(const std::string& source, const std::string& mid, const std::string& target, const std::string& message) {
- if (filter->applyTo(source) && filter->applyTo(target)) {
- commandList.push_back( "\t"+filter->reduceString(source)+mid+filter->reduceString(target)+ " " + message);
- }
+void MSCLogger::addVisibleComment(const std::string& comment) {
+ etMutex_enter(&m_mutex);
+ getCommandList().push_back("# " + comment);
+ etMutex_leave(&m_mutex);
+}
+
+void MSCLogger::createLine(const std::string& source, const std::string& mid, const std::string& target,
+ const std::string& message) {
+ //if (filter->applyTo(source) && filter->applyTo(target)) {
+ getCommandList().push_back(
+ "\t" + m_filter->reduceString(source) + mid + m_filter->reduceString(target) + " " + message);
}
void MSCLogger::close() {
- if (is_open) {
-// try {
- //TODO: error handling
- // Create file
- std::ofstream myfile;
- //TODO: where to create the file
- // std::string dir = "tmp/log"; doesn't work on windows
- std::string dir = "";
- myfile.open (std::string(dir + path + msc_name + ".seq").c_str(), std::ios::out);
- if (myfile.is_open()) { /* ok, proceed with output */
- saveMSCforTrace2UML(myfile);
- myfile.close();
- }
-// };
+ if (m_is_open) {
+ std::string path = m_path + m_msc_name + ".seq";
+ etFileHandle handle = etLogger_fopen(path.c_str(), "w+");
+ etMutex_enter(&m_mutex);
+ if (handle != 0) {
+ saveMSCforTrace2UML(handle);
+ etLogger_fclose(handle);
+ }
}
- is_open = false;
+ m_is_open = false;
+ etMutex_leave(&m_mutex);
}
-void MSCLogger::saveMSCforTrace2UML(std::ofstream& out) {
- //try {
- //TODO: errorhandling
- out << "#generated MSC for Trace2UML";
- out << std::endl ;
- std::list<std::string>::iterator it = commandList.begin();
- for ( ; it != commandList.end(); ++it) {
- out << (*it) << std::endl;
- }
-// } catch (IOException e) {
-// System.err.println("Error: " + e.getMessage());
-// }
+void MSCLogger::saveMSCforTrace2UML(etFileHandle handle) {
+ etLogger_fprintf(handle, "; generated MSC for Trace2UML\n");
+ std::list<std::string>::iterator it = getCommandList().begin();
+ for (; it != getCommandList().end(); ++it){
+ etLogger_fprintf(handle, (*it).c_str());
+ etLogger_fprintf(handle, "\n");
+ }
}
-
}
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/MSCLogger.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/MSCLogger.h
index 01499863d..0074598d8 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/MSCLogger.h
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/debugging/MSCLogger.h
@@ -13,49 +13,53 @@
#ifndef MSCLOGGER_H_
#define MSCLOGGER_H_
-#include <string>
-#include <list>
+#include "osal/etMutex.h"
#include <iostream>
-#include <fstream>
-#include "MSCFilter.h"
+#include <list>
+#include <string>
namespace etRuntime {
+class MSCFilter;
+
class MSCLogger {
public:
MSCLogger();
virtual ~MSCLogger();
- void setMSC(const std::string& msc_name_, const std::string& path_);
+ void setMSC(const std::string& msc_name, const std::string& path);
- //TODO synchronized
- void open() {is_open = true; };
- //TODO synchronized
+ /* synchronized */
+ void open();
void addMessageAsyncOut(const std::string& source, const std::string& target, const std::string& message);
- //TODO synchronized
void addMessageAsyncIn(const std::string& source, const std::string& target, const std::string& message);
- //TODO synchronized
void addMessageSyncCall(const std::string& source, const std::string& target, const std::string& message);
- //TODO synchronized
void addMessageSyncReturn(const std::string& source, const std::string& target, const std::string& message);
- //TODO synchronized
+ void addMessageActorCreate(const std::string& source, const std::string& target);
+ void addMessageActorDestroy(const std::string& source, const std::string& target);
+ void addNote(const std::string& actor, const std::string& note);
+ void addMessageCreate(const std::string& source, const std::string& target);
void addActorState(const std::string& actor, const std::string& state);
- //TODO synchronized
+ void addVisibleComment(const std::string& comment);
void close();
+ /* --- */
- const std::list<std::string>& getCommandList() { return commandList; };
- MSCFilter* getMSCFilter(){ return filter; };
+ std::list<std::string>& getCommandList() { return m_commandList; };
+ MSCFilter* getMSCFilter(){ return m_filter; };
private:
+
void createLine(const std::string& source, const std::string& mid, const std::string& target, const std::string& message);
- void saveMSCforTrace2UML(std::ofstream& out);
+ void saveMSCforTrace2UML(etFileHandle handle);
+
+ std::list<std::string> m_commandList;
+ MSCFilter* m_filter;
- std::list<std::string> commandList;
- MSCFilter* filter;
+ std::string m_path;
+ std::string m_msc_name ;
+ etBool m_is_open;
- std::string path;
- std::string msc_name ;
- bool is_open;
+ etMutex m_mutex;
MSCLogger(const MSCLogger& right);
MSCLogger& operator=(const MSCLogger& right);
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/AbstractMessageReceiver.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/AbstractMessageReceiver.h
index 7086a8ac3..d4a8f7897 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/AbstractMessageReceiver.h
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/AbstractMessageReceiver.h
@@ -23,26 +23,38 @@ namespace etRuntime {
class AbstractMessageReceiver: public RTObject, public virtual IMessageReceiver {
public:
- Address getAddress() const {
+
+ virtual ~AbstractMessageReceiver() {}
+
+ virtual const Address& getAddress() const {
return m_address;
}
- virtual ~AbstractMessageReceiver() {};
protected:
- AbstractMessageReceiver(IRTObject* parent, Address address, std::string name)
- : IMessageReceiver(),
- RTObject(parent, name),
- m_address(address)
- {
+ AbstractMessageReceiver(IRTObject* parent, const std::string& name) :
+ RTObject(parent, name),
+ m_address(Address::EMPTY) {
+ }
+
+ AbstractMessageReceiver(IRTObject* parent, const Address& address, const std::string& name) :
+ RTObject(parent, name),
+ m_address(address) {
+ }
+
+ void setAddress(const Address& address) {
+ m_address = address;
+ }
+ virtual std::string toString() const {
+ return getName() + " " + m_address.toID();
}
private:
Address m_address;
- AbstractMessageReceiver();
+ AbstractMessageReceiver(AbstractMessageReceiver const&);
+ AbstractMessageReceiver& operator=(AbstractMessageReceiver const&);
};
-
}
#endif /* ABSTRACTMESSAGERECEIVER_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/AbstractMessageService.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/AbstractMessageService.cpp
new file mode 100644
index 000000000..a52351d1b
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/AbstractMessageService.cpp
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2013 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:
+ * Juergen Haug (initial contribution)
+ *
+ *******************************************************************************/
+
+#include "common/messaging/AbstractMessageService.h"
+#include <string>
+
+namespace etRuntime {
+
+AbstractMessageService::AbstractMessageService(IRTObject* parent, const std::string& name, int node, int thread) :
+ RTObject(parent, name),
+ m_address(node, thread, 0),
+ m_messageQueue(this, "Queue"),
+ m_messageDispatcher(this, m_address.createInc(), "Dispatcher") {
+}
+
+Address AbstractMessageService::getFreeAddress() {
+ return m_messageDispatcher.getFreeAddress();
+}
+
+void AbstractMessageService::freeAddress(const Address& addr) {
+ m_messageDispatcher.freeAddress(addr);
+}
+
+void AbstractMessageService::addMessageReceiver(IMessageReceiver& receiver) {
+ m_messageDispatcher.addMessageReceiver(receiver);
+}
+
+void AbstractMessageService::removeMessageReceiver(IMessageReceiver& receiver) {
+ m_messageDispatcher.removeMessageReceiver(receiver);
+}
+
+void AbstractMessageService::addPollingMessageReceiver(IMessageReceiver& receiver) {
+ m_messageDispatcher.addPollingMessageReceiver(receiver);
+}
+
+void AbstractMessageService::removePollingMessageReceiver(IMessageReceiver& receiver) {
+ m_messageDispatcher.removePollingMessageReceiver(receiver);
+}
+
+void AbstractMessageService::receive(const Message* msg) {
+ if (msg != 0) {
+ m_messageQueue.push(const_cast<Message*>(msg));
+ }
+}
+
+std::string AbstractMessageService::toString() const {
+ return getName() + " " + getAddress().toID();
+}
+
+}
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/AbstractMessageService.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/AbstractMessageService.h
new file mode 100644
index 000000000..08032faf6
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/AbstractMessageService.h
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2013 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:
+ * Juergen Haug (initial contribution)
+ *
+ *******************************************************************************/
+#ifndef SRC_COMMON_MESSAGING_ABSTRACTMESSAGESERVICE_H_
+#define SRC_COMMON_MESSAGING_ABSTRACTMESSAGESERVICE_H_
+
+#include "common/messaging/Address.h"
+#include "common/messaging/IMessageService.h"
+#include "common/messaging/MessageDispatcher.h"
+#include "common/messaging/MessageSeQueue.h"
+#include <string>
+
+namespace etRuntime {
+
+class AbstractMessageService: public RTObject, public IMessageService {
+
+public:
+ virtual ~AbstractMessageService() {}
+
+ virtual const Address& getAddress() const { return m_address; }
+
+ virtual Address getFreeAddress();
+
+ virtual void freeAddress(const Address& addr);
+
+ virtual void addMessageReceiver(IMessageReceiver& receiver);
+ virtual void removeMessageReceiver(IMessageReceiver& receiver);
+
+ virtual void addPollingMessageReceiver(IMessageReceiver& receiver);
+ virtual void removePollingMessageReceiver(IMessageReceiver& receiver);
+ virtual void receive(const Message* msg);
+
+protected:
+ AbstractMessageService(IRTObject* parent, const std::string& name, int node, int thread);
+
+ MessageSeQueue& getMessageQueue() {
+ return m_messageQueue;
+ }
+ MessageDispatcher& getMessageDispatcher() {
+ return m_messageDispatcher;
+ }
+
+ std::string toString() const;
+
+private:
+ // TODO: add internal message queue for less locks (faster thread internal
+ // messaging)
+ Address m_address;
+ MessageSeQueue m_messageQueue;
+ MessageDispatcher m_messageDispatcher;
+
+ AbstractMessageService();
+ AbstractMessageService(AbstractMessageService const&);
+ AbstractMessageService& operator=(AbstractMessageService const&);
+};
+
+}
+#endif /* SRC_COMMON_MESSAGING_ABSTRACTMESSAGESERVICE_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/Address.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/Address.cpp
index 4adbf895e..2f622f31f 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/Address.cpp
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/Address.cpp
@@ -10,34 +10,48 @@
*
*******************************************************************************/
-#include "Address.h"
-#include <sstream>
-#include <iostream>
+#include "common/messaging/Address.h"
+#include <string>
namespace etRuntime {
+const Address Address::EMPTY(0, 0, 0);
+
Address::Address(int nodeID, int threadID, int objectID) :
m_nodeID(nodeID),
m_threadID(threadID),
m_objectID(objectID) {
-};
+}
Address::Address(const Address & right) :
m_nodeID(right.m_nodeID),
m_threadID(right.m_threadID),
m_objectID(right.m_objectID) {
-};
+}
-Address & Address::operator = (const Address& right) {
+Address::~Address() {
+ *this = EMPTY;
+}
+
+Address& Address::operator=(const Address& right) {
if (this != &right) {
- m_nodeID = right.m_nodeID;
+ m_nodeID = right.m_nodeID;
m_threadID = right.m_threadID;
m_objectID = right.m_objectID;
}
- return *this;
+ return *this;
+}
+
+bool Address::operator==(const Address& right) const {
+ return m_nodeID == right.m_nodeID && m_threadID == right.m_threadID && m_objectID == right.m_objectID;
}
-bool Address::operator< (const Address& right) const {
+bool Address::operator!=(const Address& right) const {
+ return !(*this == right);
+}
+
+// needed for ordered containers e.g. std::map
+bool Address::operator<(const Address& right) const {
if (m_nodeID == right.m_nodeID) {
if (m_threadID == right.m_threadID) {
return (m_objectID < right.m_objectID);
@@ -51,37 +65,15 @@ bool Address::operator< (const Address& right) const {
}
}
-Address::~Address() {
-}
-
-std::string Address::toString() const{
- std::stringstream strm;
- strm << "Address(nodeID=" << m_nodeID
- << ",threadID=" << m_threadID << ",objectID=" << m_objectID+")";
- return strm.str();
-}
-std::string Address::toID() const{
- std::stringstream strm;
- strm << m_nodeID << "_" << m_threadID << "_" << m_objectID;
- return strm.str();
-}
+std::string Address::toID() const {
+ char buffer[50];
+ sprintf(buffer, "%i_%i_%i", m_nodeID, m_threadID, m_objectID);
-Address Address::createInc(int i) {
- return Address(m_nodeID, m_threadID, m_objectID+i);
+ return std::string(buffer);
}
-void Address::printAddrVector(const std::vector<std::vector<etRuntime::Address> >& addresses){
- std::vector<std::vector<etRuntime::Address> >::const_iterator outerIt = addresses.begin();
- std::cout << "{" ;
- for (int i=0; outerIt!= addresses.end(); ++outerIt,++i) {
- std::cout << "{" ;
- std::vector<etRuntime::Address>::const_iterator it = (*outerIt).begin();
- for (int j=0; it!=(*outerIt).end(); ++it,++j) {
- std::cout << (*it).toID() << ":" << addresses[i][j].toID() << ",";
- }
- std::cout << "}" << std::endl;
- }
- std::cout << "}" << std::endl;
+Address Address::createInc() const {
+ return Address(m_nodeID, m_threadID, m_objectID + 1);
}
} /* namespace etRuntime */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/Address.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/Address.h
index 870e25500..01c0e9d30 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/Address.h
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/Address.h
@@ -13,39 +13,43 @@
#ifndef ADDRESS_H_
#define ADDRESS_H_
+#include "etDatatypes.h"
#include <string>
-#include <vector>
namespace etRuntime {
class Address {
- public:
- explicit Address(int nodeID=0, int threadID=0, int objectID=0);
- Address(const Address & right);
- ~Address();
+public:
- Address & operator = (const Address& right);
- bool operator< (const Address& right) const;
+ static const Address EMPTY;
- std::string toString() const;
- std::string toID()const;
+ Address(int nodeID, int threadID, int objectID);
+ Address(const Address& right);
+ ~Address();
- Address createInc(int i);
- bool isValid() const {
- return (m_nodeID != 0) || (m_threadID != 0) || (m_objectID != 0);
- };
+ Address& operator =(const Address& right);
+ bool operator==(const Address& other) const;
+ bool operator!=(const Address& other) const;
+ bool operator< (const Address& right) const;
- int m_nodeID;
- int m_threadID;
- int m_objectID;
+ std::string toString() const;
+ std::string toID() const;
- //debug helper function
- static void printAddrVector(const std::vector<std::vector<etRuntime::Address> >& addresses);
+ Address createInc() const;
+
+ inline etBool isValid() const {
+ return *this != EMPTY;
+ }
+
+ int m_nodeID;
+ int m_threadID;
+ int m_objectID;
+
+private:
+ Address();
- private:
};
} /* namespace etRuntime */
#endif /* ADDRESS_H_ */
-
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/IMessageReceiver.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/IMessageReceiver.h
index a1136ab7a..289ad5e00 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/IMessageReceiver.h
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/IMessageReceiver.h
@@ -19,14 +19,12 @@
namespace etRuntime {
-class IMessageReceiver{
+class IMessageReceiver : public virtual IRTObject{
public:
- IMessageReceiver();
- virtual ~IMessageReceiver();
+ virtual ~IMessageReceiver() {}
- virtual void receive(Message* msg) = 0;
- virtual Address getAddress() const = 0;
- virtual bool isMsgService() const { return false;};
+ virtual void receive(const Message* msg) = 0;
+ virtual const Address& getAddress() const = 0;
};
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/IMessageService.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/IMessageService.h
new file mode 100644
index 000000000..145d767d7
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/IMessageService.h
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2013 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:
+ * Juergen Haug (initial contribution)
+ *
+ *******************************************************************************/
+#ifndef SRC_COMMON_MESSAGING_IMESSAGESERVICE_H_
+#define SRC_COMMON_MESSAGING_IMESSAGESERVICE_H_
+
+#include "common/messaging/IMessageReceiver.h"
+
+namespace etRuntime {
+
+class IMessageService: public virtual IRTObject, public virtual IMessageReceiver {
+
+public:
+
+ virtual ~IMessageService() {}
+
+ enum ExecMode {
+ POLLED, BLOCKED, MIXED
+ };
+
+ virtual void start() = 0;
+ virtual void terminate() = 0;
+
+ virtual Address getFreeAddress() = 0;
+
+ virtual void freeAddress(const Address& addr) = 0;
+
+ virtual void addMessageReceiver(IMessageReceiver& receiver) = 0;
+ virtual void removeMessageReceiver(IMessageReceiver& receiver) = 0;
+
+ virtual void addPollingMessageReceiver(IMessageReceiver& receiver) = 0;
+ virtual void removePollingMessageReceiver(IMessageReceiver& receiver) = 0;
+
+ // TODO Thread
+// void setThread(Thread thread);
+//
+// Thread getThread();
+
+};
+
+}
+
+#endif /* SRC_COMMON_MESSAGING_IMESSAGESERVICE_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/IRTObject.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/IRTObject.cpp
index edf5ee57d..af6adef7b 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/IRTObject.cpp
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/IRTObject.cpp
@@ -1,20 +1,20 @@
/*******************************************************************************
- * Copyright (c) 2012 Draeger Medical GmbH (http://www.draeger.com).
+ * Copyright (c) 2013 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:
- * Peter Karlitschek (initial contribution)
+ * Juergen Haug (initial contribution)
*
*******************************************************************************/
-#include "IRTObject.h"
+#include "common/messaging/IRTObject.h"
+#include <string>
namespace etRuntime {
const std::string IRTObject::NO_NAME = "<no name>";
}
-
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/IRTObject.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/IRTObject.h
index d10dd8022..4fd02181c 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/IRTObject.h
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/IRTObject.h
@@ -14,20 +14,35 @@
#define IRTOBJECT_H_
#include <string>
+#include <vector>
namespace etRuntime {
class IRTObject {
public:
- virtual ~IRTObject() {};
+ virtual ~IRTObject() {
+ }
static const char PATH_DELIM = '/';
static const char PATHNAME_DELIM = '_';
static const std::string NO_NAME;
+ virtual const std::string& getName() const = 0;
virtual const std::string& getInstancePath() const = 0;
virtual const std::string& getInstancePathName() const = 0;
+
+ virtual std::vector<IRTObject*>& getChildren() = 0;
+
+ virtual IRTObject* getParent() const = 0;
+
+ virtual IRTObject* getRoot() const = 0;
+
+ virtual IRTObject* getChild(const std::string& name) const = 0;
+
+ virtual IRTObject* getObject(const std::string& path) const = 0;
+
+ virtual int getThreadForPath(const std::string& path) const = 0;
};
}
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/Message.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/Message.cpp
index 0a4aa42bb..9f41aea52 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/Message.cpp
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/Message.cpp
@@ -1,33 +1,67 @@
-/*******************************************************************************
- * Copyright (c) 2012 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)
- *
- *******************************************************************************/
-
-#include "Message.h"
-
-#include <sstream>
-
-namespace etRuntime {
-
-
-Message::~Message() {
- m_next = 0;
-}
-
-std::string Message::toString(){
- std::stringstream strm;
- strm << "EventMessage(" << m_address.toString() << ", evt=" << m_evtId << ")";
- if (m_data) {
- strm << std::showbase << std::hex << m_data;
- }
- return strm.str();
-}
-
-} /* namespace etRuntime */
+/*******************************************************************************
+ * Copyright (c) 2012 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)
+ *
+ *******************************************************************************/
+
+#include "common/messaging/Message.h"
+#include <iostream>
+#include <string>
+#include <cstring>
+#include <cstdlib>
+
+namespace etRuntime {
+
+Message::Message(const Address& addr, int evtId, const void* dataToCopy, std::size_t dataSize) :
+ m_address(addr),
+ m_evtId(evtId),
+ m_next(0),
+ m_dataSize(0),
+ m_data(0){
+ if(dataToCopy != 0 && dataSize > 0){
+ m_data = std::malloc(dataSize);
+ if(m_data != 0){
+ m_dataSize = dataSize;
+ std::memcpy(m_data, dataToCopy, dataSize);
+ }
+ }
+}
+Message::Message(const Address& addr, int evtId, void* dataPtr) :
+ m_address(addr),
+ m_evtId(evtId),
+ m_next(0),
+ m_dataSize(0),
+ m_data(dataPtr) {
+}
+Message::Message(const Address& addr, int evtId) :
+ m_address(addr),
+ m_evtId(evtId),
+ m_next(0),
+ m_dataSize(0),
+ m_data(0) {
+}
+Message::~Message() {
+ m_evtId = 0;
+ m_next = 0;
+ if(m_dataSize > 0)
+ std::free(m_data);
+ m_data = 0;
+ m_dataSize = 0;
+}
+
+std::string Message::toString() const {
+ std::stringstream strm;
+ strm << "Message(" << m_address.toID() << ", evt=" << m_evtId << ")";
+ if (m_data) {
+ strm << std::showbase << std::hex << m_data;
+ }
+ return strm.str();
+}
+
+} /* namespace etRuntime */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/Message.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/Message.h
index 2307a1ead..ad1f064cc 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/Message.h
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/Message.h
@@ -1,62 +1,76 @@
-/*******************************************************************************
- * Copyright (c) 2012 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)
- *
- *******************************************************************************/
-
-#ifndef MESSAGE_H_
-#define MESSAGE_H_
-
-#include "common/messaging/Address.h"
-#include "etDatatypes.h"
-#include <string>
-
-namespace etRuntime {
-
-class Message {
-public:
- Message(Address addr, int evtId, void* data, size_t dataSize) :
- m_address(addr), m_evtId(evtId), m_next(0),
- m_dataSize(dataSize), m_data(data), m_logFlag(true)
- {}
- Message(Address addr, int evtId) :
- m_address(addr), m_evtId(evtId), m_next(0),
- m_dataSize(0), m_data(0), m_logFlag(true)
- {}
- virtual ~Message();
-
- void setNext(Message* msg){m_next = msg;}
- Message* getNext() const {return m_next;}
-
- void setAddress(Address address){m_address = address; }
- Address getAddress() const { return m_address; };
-
- int getEvtId() const { return m_evtId; }
- void* getData() const { return m_data; }
- bool hasDebugFlagSet() const { return m_logFlag; };
-
- std::string toString();
-
-private:
- Address m_address;
- int m_evtId;
-
- Message* m_next;
- size_t m_dataSize;
- void* m_data;
- bool m_logFlag;
-
- Message();
- Message(const Message & right);
- Message & operator = (const Message& right);
-
-};
-
-} /* namespace etRuntime */
-#endif /* MESSAGE_H_ */
+/*******************************************************************************
+ * Copyright (c) 2012 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)
+ *
+ *******************************************************************************/
+
+#ifndef MESSAGE_H_
+#define MESSAGE_H_
+
+#include "common/messaging/Address.h"
+#include "stddef.h"
+#include <iostream>
+#include <sstream>
+#include <string>
+
+namespace etRuntime {
+
+class Message {
+
+public:
+
+ // Messages with data TODO MessageBuffer
+ Message(const Address& addr, int evtId, const void* dataToCopy, std::size_t dataSize);
+ Message(const Address& addr, int evtId, void* dataPtr);
+
+ Message(const Address& addr, int evtId);
+ ~Message();
+
+ const Address& getAddress() const {
+ return m_address;
+ }
+
+ int getEvtId() const {
+ return m_evtId;
+ }
+
+ /** Pointer to data */
+ void* getData() const {
+ return m_data;
+ }
+
+ std::string toString() const;
+
+protected:
+ friend class MessageSeQueue;
+
+ void setNext(Message* msg) {
+ m_next = msg;
+ }
+
+ Message* getNext() const {
+ return m_next;
+ }
+
+private:
+ Address m_address;
+ int m_evtId;
+
+ Message* m_next;
+ size_t m_dataSize;
+ void* m_data;
+
+ Message();
+ Message(Message const&);
+ Message& operator =(Message const&);
+
+};
+
+} /* namespace etRuntime */
+#endif /* MESSAGE_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageDispatcher.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageDispatcher.cpp
index 9f5e2b759..e8035b12a 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageDispatcher.cpp
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageDispatcher.cpp
@@ -10,68 +10,85 @@
*
*******************************************************************************/
-#include "MessageDispatcher.h"
+#include "common/messaging/Message.h"
+#include "common/messaging/MessageDispatcher.h"
namespace etRuntime {
+MessageDispatcher::MessageDispatcher(IRTObject* parent, const Address& addr, const std::string& name) :
+ RTObject(parent, name),
+ m_local_map(),
+ m_freeAdresses(),
+ m_pollingMessageReceiver(),
+ m_address(addr),
+ m_nextFreeObjId(addr.m_objectID + 1) {
+ m_local_map[addr.m_objectID] = this;
+}
+
+Address MessageDispatcher::getFreeAddress() {
+ if (m_freeAdresses.empty()) {
+ return Address(getAddress().m_nodeID, getAddress().m_threadID, m_nextFreeObjId++);
+ } else {
+ Address address = m_freeAdresses.front();
+ m_freeAdresses.pop();
-MessageDispatcher::~MessageDispatcher() {
+ return address;
+ }
}
+void MessageDispatcher::freeAddress(const Address& addr) {
+ m_freeAdresses.push(addr);
+}
+void MessageDispatcher::addMessageReceiver(IMessageReceiver& receiver) {
+ if (!receiver.getAddress().isValid())
+ return;
+
+ if (receiver.getAddress().m_nodeID == m_address.m_nodeID
+ && receiver.getAddress().m_threadID == m_address.m_threadID) {
+
+ m_local_map[receiver.getAddress().m_objectID] = &receiver;
+ }
-MessageDispatcher::MessageDispatcher(IRTObject* parent, Address addr, std::string name)
-: RTObject(parent, name) ,
- IMessageReceiver(),
- m_local_map(),
- m_thread_map(),
- m_node_map(),
- m_address(addr)
-{};
-
-void MessageDispatcher::addMessageReceiver(IMessageReceiver& receiver){
-if (! receiver.getAddress().isValid() )
- return;
-
-// TODO: does only work same thread (else)
-if (receiver.getAddress().m_nodeID != m_address.m_nodeID){
- m_node_map[receiver.getAddress().m_objectID] = &receiver;
}
-else if(receiver.getAddress().m_threadID != m_address.m_threadID){
- m_thread_map[receiver.getAddress().m_threadID] = &receiver;
+
+void MessageDispatcher::removeMessageReceiver(IMessageReceiver& receiver) {
+ if (!receiver.getAddress().isValid())
+ return;
+
+ m_local_map.erase(receiver.getAddress().m_objectID);
}
-else {
- m_local_map[receiver.getAddress().m_objectID] = &receiver;
+
+void MessageDispatcher::addPollingMessageReceiver(IMessageReceiver& receiver) {
+ m_pollingMessageReceiver.insert(&receiver);
}
-};
-
-void MessageDispatcher::receive(Message* msg) {
-// TODO: does only work same thread (else)
- //TODO: assert msg != 0
-IMessageReceiver* receiver = 0;
-std::map<int, IMessageReceiver*>::iterator it;
-if (msg->getAddress().m_nodeID != m_address.m_nodeID){
- it = m_node_map.find(msg->getAddress().m_objectID);
- if (it != m_node_map.end() ) {
- receiver = (*it).second;
- }
+void MessageDispatcher::removePollingMessageReceiver(IMessageReceiver& receiver) {
+ m_pollingMessageReceiver.erase(&receiver);
}
-else if(msg->getAddress().m_threadID != m_address.m_threadID){
- it = m_thread_map.find(msg->getAddress().m_objectID);
- if (it != m_thread_map.end() ) {
- receiver = (*it).second;
+
+void MessageDispatcher::receive(const Message* msg) {
+
+ IMessageReceiver* receiver = 0;
+ if (msg->getAddress().m_nodeID == m_address.m_nodeID && msg->getAddress().m_threadID == m_address.m_threadID) {
+ std::map<int, IMessageReceiver*>::iterator it;
+ it = m_local_map.find(msg->getAddress().m_objectID);
+ if (it != m_local_map.end()) {
+ receiver = it->second;
+ }
}
-}
-else {
- // Same node, same thread -> local call Dispatch Map
- it = m_local_map.find(msg->getAddress().m_objectID);
- if (it != m_local_map.end() ) {
- receiver = (*it).second;
+ if (receiver == this) {
+ for (std::set<IMessageReceiver*>::iterator it = m_pollingMessageReceiver.begin();
+ it != m_pollingMessageReceiver.end(); ++it) {
+ (*it)->receive(msg);
+ }
+ } else if (receiver != 0) {
+ receiver->receive(msg);
+ // TODO: error handling for not found addresses
+
+ delete msg;
}
}
-if (receiver!=0)
-{
- receiver->receive(msg);
- // TODO: error handling for not found addresses
-}
+
+std::string MessageDispatcher::toString() const {
+ return getName() + " " + getAddress().toID();
}
} /* namespace etRuntime */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageDispatcher.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageDispatcher.h
index 57b50e5f6..359acff43 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageDispatcher.h
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageDispatcher.h
@@ -13,33 +13,46 @@
#ifndef MESSAGEDISPATCHER_H_
#define MESSAGEDISPATCHER_H_
+#include "common/messaging/Address.h"
#include "common/messaging/IMessageReceiver.h"
-#include "common/messaging/IRTObject.h"
#include "common/messaging/RTObject.h"
#include <map>
+#include <queue>
+#include <set>
#include <string>
+
+
namespace etRuntime {
-class MessageDispatcher : public RTObject, public IMessageReceiver {
+class MessageDispatcher : public RTObject, public virtual IMessageReceiver {
public:
- MessageDispatcher(IRTObject* parent, Address addr, std::string name);
- virtual ~MessageDispatcher();
+ MessageDispatcher(IRTObject* parent, const Address& addr, const std::string& name);
+ virtual ~MessageDispatcher() {}
+ Address getFreeAddress();
+ void freeAddress(const Address& addr);
void addMessageReceiver(IMessageReceiver& receiver);
- void receive(Message* msg);
+ void removeMessageReceiver(IMessageReceiver& receiver);
+ void addPollingMessageReceiver(IMessageReceiver& receiver);
+ void removePollingMessageReceiver(IMessageReceiver& receiver);
+ void receive(const Message* msg);
+
+ const Address& getAddress() const { return m_address; };
- Address getAddress() const { return m_address; };
+ protected:
+ std::string toString() const;
private:
std::map<int, IMessageReceiver*> m_local_map;
- std::map<int, IMessageReceiver*> m_thread_map;
- std::map<int, IMessageReceiver*> m_node_map;
+ std::queue<Address> m_freeAdresses;
+ std::set<IMessageReceiver*> m_pollingMessageReceiver;
Address m_address;
+ int m_nextFreeObjId;
MessageDispatcher();
- MessageDispatcher(const MessageDispatcher& right);
- MessageDispatcher& operator=(const MessageDispatcher& right);
+ MessageDispatcher(MessageDispatcher const&);
+ MessageDispatcher& operator=(MessageDispatcher const&);
};
} /* namespace etRuntime */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageSeQueue.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageSeQueue.cpp
index ab2f54a8b..05acc694d 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageSeQueue.cpp
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageSeQueue.cpp
@@ -14,13 +14,7 @@
namespace etRuntime {
-
-MessageSeQueue::~MessageSeQueue() {
- m_first = 0;
- m_last = 0;
-}
-
-MessageSeQueue::MessageSeQueue(IRTObject* parent, std::string name)
+MessageSeQueue::MessageSeQueue(IRTObject* parent, const std::string& name)
: RTObject(parent, name),
m_first(0),
m_last(0),
@@ -29,6 +23,11 @@ MessageSeQueue::MessageSeQueue(IRTObject* parent, std::string name)
{
}
+MessageSeQueue::~MessageSeQueue() {
+ m_first = 0;
+ m_last = 0;
+}
+
void MessageSeQueue::push(Message* msg) {
// TODO: optimize queue for concurrent push / pop
if (m_first == 0) {
@@ -42,7 +41,7 @@ void MessageSeQueue::push(Message* msg) {
}
-Message* MessageSeQueue::pop() {
+const Message* MessageSeQueue::pop() {
// TODO: optimize queue for concurrent push / pop
Message* pop_msg = m_first;
if (m_first == 0) {
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageSeQueue.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageSeQueue.h
index 1468cea16..e2b42e67f 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageSeQueue.h
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageSeQueue.h
@@ -14,34 +14,45 @@
#define MESSAGESEQUEUE_H_
#include "common/messaging/RTObject.h"
-#include <string>
#include "common/messaging/Message.h"
+#include "etDatatypes.h"
+#include <string>
namespace etRuntime {
class MessageSeQueue: public RTObject {
- public:
- MessageSeQueue(IRTObject* parent, std::string name);
- virtual ~MessageSeQueue();
-
- void push(Message* msg);
- Message* pop();
-
- long getSize() const {return m_size; }
- Message* getFirst() const {return m_first; }
- Message* getLast() const { return m_last; }
- bool isNotEmpty() const { return m_last != 0; }
- long getHightWaterMark() const { return m_highWaterMark; }
-
- private:
- Message* m_first;
- Message* m_last;
- long m_highWaterMark;
- long m_size;
-
- MessageSeQueue();
- MessageSeQueue(const MessageSeQueue& right);
- MessageSeQueue& operator=(const MessageSeQueue& right);
+public:
+ MessageSeQueue(IRTObject* parent, const std::string& name);
+ virtual ~MessageSeQueue();
+
+ void push(Message* msg);
+ const Message* pop();
+
+ long getSize() const {
+ return m_size;
+ }
+ Message* getFirst() const {
+ return m_first;
+ }
+ Message* getLast() const {
+ return m_last;
+ }
+ etBool isNotEmpty() const {
+ return m_last != 0;
+ }
+ long getHightWaterMark() const {
+ return m_highWaterMark;
+ }
+
+private:
+ Message* m_first;
+ Message* m_last;
+ long m_highWaterMark;
+ long m_size;
+
+ MessageSeQueue();
+ MessageSeQueue(MessageSeQueue const&);
+ void operator=(MessageSeQueue const&);
};
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageService.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageService.cpp
index 21153ce56..b6ef64a55 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageService.cpp
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageService.cpp
@@ -10,147 +10,158 @@
*
*******************************************************************************/
-#include "MessageService.h"
-#include <iostream>
-#include <stdlib.h>
-#include <unistd.h>
+#include "common/messaging/MessageDispatcher.h"
+#include "common/messaging/MessageSeQueue.h"
+#include "common/messaging/MessageService.h"
+#include "common/messaging/MessageServiceController.h"
+#include "common/messaging/RTServices.h"
+#include "osal/etTime.h"
+#include <string>
namespace etRuntime {
-extern "C" {
- void* threadStarter(void* arg) {
- MessageService* thisPtr = static_cast<MessageService*>(arg);
- std::cout << "Thread " << thisPtr->getName() << " is started." << std::endl;
- thisPtr->run();
- return arg;
- // pthread_exit(NULL);
- }
+
+MessageService::MessageService(IRTObject* parent, IMessageService::ExecMode mode, int node, int thread, const std::string& name, int priority) :
+ AbstractMessageService(parent, name, node, thread),
+ m_running(false),
+ m_execMode(mode),
+ m_lastMessageTimestamp(0),
+ m_pollingMessage(getMessageDispatcher().getAddress(), 0) {
+
+ etTime interval;
+ interval.sec = 0;
+ interval.nSec = 0;
+ MessageService_init(interval, priority);
}
-MessageService::MessageService(IRTObject* parent, Address addr, std::string name, int priority)
- : IMessageReceiver(),
- RTObject(parent, name),
+MessageService::MessageService(IRTObject* parent, IMessageService::ExecMode mode, etTime interval, int node, int thread,
+ const std::string& name, int priority) :
+ AbstractMessageService(parent, name, node, thread),
m_running(false),
- m_thread(),
- m_mutex(),
- m_mutexAttr(),
- m_conditionVar(),
- m_threadAttr(),
- m_messageQueue(this, "Queue"),
- m_messageDispatcher( this,
- Address(addr.m_nodeID, addr.m_threadID, addr.m_objectID + 1),
- "Dispatcher"),
- m_address(addr),
+ m_execMode(mode),
m_lastMessageTimestamp(0),
- m_asyncActors()
-{
- pthread_mutexattr_init(&m_mutexAttr);
- pthread_mutexattr_settype(&m_mutexAttr, PTHREAD_MUTEX_RECURSIVE);
- pthread_mutex_init(&m_mutex, &m_mutexAttr);
- pthread_cond_init (&m_conditionVar, NULL);
- pthread_attr_init(&m_threadAttr);
- pthread_attr_setdetachstate(&m_threadAttr, PTHREAD_CREATE_JOINABLE);
+ m_pollingMessage(getMessageDispatcher().getAddress(), 0) {
+
+ MessageService_init(interval, priority);
+}
+
+void MessageService::MessageService_init(etTime interval, int priority) {
+
+ /* init mutexes and semaphores */
+ etMutex_construct(&m_mutex);
+ etSema_construct(&m_executionSemaphore);
+
+ /* init thread */
+ etThread_construct(&m_thread, static_cast<etStacksize>(1024), static_cast<etPriority>(priority), (etThreadname)"MessageService",
+ MessageService::run, static_cast<void *>(this));
// check and set priority
// assert priority >= Thread.MIN_PRIORITY : ("priority smaller than Thread.MIN_PRIORITY (1)");
// assert priority <= Thread.MAX_PRIORITY : ("priority bigger than Thread.MAX_PRIORITY (10)");
// this.setPriority(priority);
+ if (m_execMode == IMessageService::POLLED || m_execMode == IMessageService::MIXED) {
+ /* init timer */
+ etTimer_construct(&m_timer, &interval, MessageService::pollingTask, static_cast<void *>(this));
+ }
}
MessageService::~MessageService() {
- pthread_attr_destroy(&m_threadAttr);
- pthread_mutex_destroy(&m_mutex);
- pthread_cond_destroy(&m_conditionVar);
- pthread_exit(NULL);
-
+ std::cout << "~MessageService" << std::endl;
+ etMutex_destruct(&m_mutex);
+ etSema_destruct(&m_executionSemaphore);
+ etThread_destruct(&m_thread);
+ if (m_execMode == IMessageService::POLLED || m_execMode == IMessageService::MIXED) {
+ etTimer_destruct(&m_timer);
+ }
}
-void MessageService::start(bool singlethreaded) {
- if (singlethreaded) {
- std::cout << "starting message service " << getName() << " singlethreaded" << std::endl;
- }
- else {
- std::cout << "starting message service " << getName() << " on own thread" << std::endl;
- int rc = pthread_create(&m_thread, &m_threadAttr, threadStarter, static_cast<void *>(this));
- if (rc){
- std::cout << "ERROR; return code from pthread_create() is " << rc << std::endl;
- exit(-1);
- }
+void MessageService::start() {
+ etThread_start(&m_thread);
+ if (m_execMode == IMessageService::POLLED || m_execMode == IMessageService::MIXED) {
+ etTimer_start(&m_timer);
}
}
-void MessageService::join() {
- void *status;
- int rc = pthread_join(m_thread, &status);
- if (rc){
- std::cout << "ERROR; return code from pthread_join() is " << rc << std::endl;
- exit(-1);
- }
-}
void MessageService::run() {
m_running = true;
while (m_running) {
- pollOneMessage();
- usleep(10000);
+ etMutex_enter(&m_mutex);
+ const Message* msg = getMessageQueue().pop(); // get next Message from Queue
+ etMutex_leave(&m_mutex);
+ if (msg == 0) {
+ // no message in queue -> wait till Thread is notified
+ etSema_waitForWakeup(&m_executionSemaphore);
+ } else {
+ //TODO: set timestamp
+ // m_lastMessageTimestamp = System.currentTimeMillis();
+ getMessageDispatcher().receive(msg);
+ }
}
- std::cout << "ending message service " << getName() << " on own thread" << std::endl;
+
+ RTServices::getInstance().getMsgSvcCtrl().setMsgSvcTerminated(*this);
}
-void MessageService::runOnce() {
- pollAsyncActors();
- while (m_messageQueue.isNotEmpty()){
- Message* msg = m_messageQueue.pop(); // get next Message from Queue
- if (msg != 0) {
- m_messageDispatcher.receive(msg);
- }
- }
+void MessageService::receive(const Message* msg) {
+ etMutex_enter(&m_mutex);
+ AbstractMessageService::receive(msg);
+ etSema_wakeup(&m_executionSemaphore);
+ etMutex_leave(&m_mutex);
}
-void MessageService::receive(Message* msg) {
- pthread_mutex_lock(&m_mutex);
- if (msg != 0) {
- m_messageQueue.push(msg);
- pthread_cond_signal(&m_conditionVar); // wake up thread to compute message
- }
- pthread_mutex_unlock(&m_mutex);
+Address MessageService::getFreeAddress() {
+ etMutex_enter(&m_mutex);
+ Address address = AbstractMessageService::getFreeAddress();
+ etMutex_leave(&m_mutex);
+
+ return address;
}
+void MessageService::freeAddress(const Address& addr) {
+ etMutex_enter(&m_mutex);
+ AbstractMessageService::freeAddress(addr);
+ etMutex_leave(&m_mutex);
+}
-// TODO: synchronized
-void MessageService::terminate() {
- pthread_mutex_lock(&m_mutex);
- if (m_running) {
- m_running = false;
- pthread_cond_signal(&m_conditionVar); // wake up thread to terminate
- }
- pthread_mutex_unlock(&m_mutex);
+void MessageService::addMessageReceiver(IMessageReceiver& receiver) {
+ etMutex_enter(&m_mutex);
+ AbstractMessageService::addMessageReceiver(receiver);
+ etMutex_leave(&m_mutex);
}
-void MessageService::pollOneMessage() {
- pthread_mutex_lock(&m_mutex);
- Message* msg = m_messageQueue.pop(); // get next Message from Queue
- if (msg == 0) {
- // no message in queue -> wait till Thread is notified
- pthread_cond_wait(&m_conditionVar, &m_mutex);
- } else {
- //TODO: set timestamp
- // m_lastMessageTimestamp = System.currentTimeMillis();
- m_messageDispatcher.receive(msg);
- }
- pthread_mutex_unlock(&m_mutex);
+void MessageService::removeMessageReceiver(IMessageReceiver& receiver) {
+ etMutex_enter(&m_mutex);
+ AbstractMessageService::removeMessageReceiver(receiver);
+ etMutex_leave(&m_mutex);
+}
+void MessageService::addPollingMessageReceiver(IMessageReceiver& receiver) {
+ etMutex_enter(&m_mutex);
+ AbstractMessageService::addPollingMessageReceiver(receiver);
+ etMutex_leave(&m_mutex);
}
-void MessageService::addAsyncActor(IEventReceiver& evtReceiver) {
- m_asyncActors.push_back(&evtReceiver);
+void MessageService::removePollingMessageReceiver(IMessageReceiver& receiver) {
+ etMutex_enter(&m_mutex);
+ AbstractMessageService::removePollingMessageReceiver(receiver);
+ etMutex_leave(&m_mutex);
}
-void MessageService::pollAsyncActors() {
- std::vector<IEventReceiver*>::iterator it = m_asyncActors.begin();
- for ( ; it != m_asyncActors.end(); ++it) {
- // polling event
- (*it)->receiveEvent(0,0,0);
+void MessageService::terminate() {
+ if (m_execMode == IMessageService::POLLED || m_execMode == IMessageService::MIXED) {
+ etTimer_stop(&m_timer);
+ }
+ if (m_running) {
+ m_running = false;
+ etSema_wakeup(&m_executionSemaphore);
+ }
+
+}
+
+// called by osal timer, thread ?
+void MessageService::pollingTask() {
+ if (m_running) {
+ receive(&m_pollingMessage);
}
}
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageService.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageService.h
index 3a9a91f61..f27ce2e93 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageService.h
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageService.h
@@ -13,70 +13,80 @@
#ifndef MESSAGESERVICE_H_
#define MESSAGESERVICE_H_
+#include "common/messaging/AbstractMessageService.h"
+
+#include "common/messaging/IMessageService.h"
+#include "common/messaging/Message.h"
+#include "etDatatypes.h"
+#include "osal/etMutex.h"
+#include "osal/etSema.h"
+#include "osal/etThread.h"
+#include "osal/etTimer.h"
#include <string>
-#include <vector>
-#include <pthread.h>
-#include "common/messaging/MessageDispatcher.h"
-#include "common/messaging/Address.h"
-#include "common/modelbase/IEventReceiver.h"
-#include "MessageSeQueue.h"
namespace etRuntime {
-//TODO: abstraction from posix threads missing
+class MessageService: public AbstractMessageService {
-class MessageService: public IMessageReceiver, public RTObject {
public:
- MessageService(IRTObject* parent, Address addr, std::string name, int priority = 0);
- virtual ~MessageService();
- Address getAddress() const { return m_address; } ;
+ enum ExecMode {
+ POLLED, BLOCKED, MIXED
+ };
+
+ MessageService(IRTObject* parent, IMessageService::ExecMode mode, int node, int thread, const std::string& name, int priority = 0);
+ MessageService(IRTObject* parent, IMessageService::ExecMode mode, etTime interval, int node, int thread, const std::string& name, int priority = 0);
+ virtual ~MessageService();
- void start(bool singlethreaded);
void run();
- // for single threaded configuration only
- void runOnce();
- void join();
- void terminate();
- void receive(Message* msg);
+ virtual void start();
+ virtual void terminate();
- virtual MessageDispatcher& getMessageDispatcher() { return m_messageDispatcher; }
- virtual bool isMsgService() const { return true;};
+ virtual Address getFreeAddress();
- void addAsyncActor(IEventReceiver& evtReceiver);
- void pollAsyncActors();
+ virtual void freeAddress(const Address& addr);
+ virtual void addMessageReceiver(IMessageReceiver& receiver);
+ virtual void removeMessageReceiver(IMessageReceiver& receiver);
+
+ virtual void addPollingMessageReceiver(IMessageReceiver& receiver);
+ virtual void removePollingMessageReceiver(IMessageReceiver& receiver);
+ virtual void receive(const Message* msg);
- // protected methods for sole use by test cases
protected:
- MessageSeQueue& getMessageQueue() { return m_messageQueue; }
- long getLastMessageTimestamp() const { return m_lastMessageTimestamp; }
+
+ long getLastMessageTimestamp() const {
+ return m_lastMessageTimestamp;
+ }
+
+ void pollingTask();
private:
- //TODO: synchronized
- void pollOneMessage();
-
- bool m_running;
- pthread_t m_thread;
- pthread_mutex_t m_mutex;
- pthread_mutexattr_t m_mutexAttr;
- pthread_cond_t m_conditionVar;
- pthread_attr_t m_threadAttr;
-
- // TODO: add internal message queue for less locks (faster thread internal
- // messaging)
- MessageSeQueue m_messageQueue;
- MessageDispatcher m_messageDispatcher;
- Address m_address;
+ // static functions for c calls
+ static void run(void* self) {
+ static_cast<MessageService*>(self)->run();
+ }
+
+ static void pollingTask(void* self) {
+ static_cast<MessageService*>(self)->pollingTask();
+ }
+
+ etBool m_running;
+ IMessageService::ExecMode m_execMode;
long m_lastMessageTimestamp;
+ Message m_pollingMessage;
- std::vector<IEventReceiver*> m_asyncActors;
+ etMutex m_mutex;
+ etSema m_executionSemaphore;
+ etThread m_thread;
+ etTimer m_timer;
- MessageService();
- MessageService(const MessageService& right);
- MessageService& operator=(const MessageService& right);
+ void MessageService_init(etTime interval, int priority); // common ctor
+ MessageService();
+ MessageService(MessageService const&);
+ MessageService& operator=(MessageService const&);
};
} /* namespace etRuntime */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageServiceController.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageServiceController.cpp
index 6a71f9a81..f6af90682 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageServiceController.cpp
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageServiceController.cpp
@@ -14,68 +14,85 @@
namespace etRuntime {
+MessageServiceController::MessageServiceController() :
+ m_messageServices(),
+ m_freeIDs(),
+ m_running(false),
+ m_nextFreeID(0),
+ m_terminateServices(){
+ etMutex_construct(&m_mutex);
+ etSema_construct(&m_terminateSema);
+}
+
+int MessageServiceController::getNewID() {
+ etMutex_enter(&m_mutex);
+ int newID;
+ if (m_freeIDs.empty())
+ newID = m_nextFreeID++;
+ else {
+ newID = m_freeIDs.back();
+ m_freeIDs.pop();
+ }
+ etMutex_leave(&m_mutex);
-MessageServiceController::~MessageServiceController() {
- // TODO Auto-generated destructor stub
+ return newID;
}
-MessageServiceController::MessageServiceController(/*IRTObject parent*/)
- : m_messageServiceList(),
- m_running(false) {
- // TODO: Who is parent of MessageServices and Controller?
- // this.parent = parent;
+void MessageServiceController::freeID(int id) {
+ etMutex_enter(&m_mutex);
+ m_freeIDs.push(id);
+ etMutex_leave(&m_mutex);
}
-void MessageServiceController::addMsgSvc(MessageService& msgSvc) {
- // TODO TS: Who is parent of MessageServices ?
- //TODO assert
- //assert(msgSvc.getAddress().m_threadID == m_messageServiceList.size());
- m_messageServiceList.push_back(&msgSvc);
+void MessageServiceController::addMsgSvc(IMessageService& msgSvc) {
+ etMutex_enter(&m_mutex);
+ if (m_nextFreeID <= msgSvc.getAddress().m_threadID)
+ m_nextFreeID = msgSvc.getAddress().m_threadID + 1;
+
+ m_messageServices[msgSvc.getAddress().m_threadID] = &msgSvc;
+ etMutex_leave(&m_mutex);
}
-MessageService* MessageServiceController::getMsgSvc(int threadID) {
- return m_messageServiceList.at(threadID);
+void MessageServiceController::removeMsgSvc(IMessageService& msgSvc) {
+ etMutex_enter(&m_mutex);
+ m_messageServices.erase(msgSvc.getAddress().m_threadID);
+ etMutex_leave(&m_mutex);
}
-void MessageServiceController::connectAll() {
- for (size_t i = 0; i < m_messageServiceList.size(); i++) {
- MessageDispatcher& dispatcher = getMsgSvc(i)->getMessageDispatcher();
- for (size_t j = 0; j < m_messageServiceList.size(); j++) {
- if (i != j) {
- dispatcher.addMessageReceiver(*RTServices::getInstance().getMsgSvcCtrl().getMsgSvc(j));
- }
- }
- }
+IMessageService* MessageServiceController::getMsgSvc(int id) {
+ IMessageService* msgSvc = 0;
+ etMutex_enter(&m_mutex);
+ std::map<int, IMessageService*>::iterator it = m_messageServices.find(id);
+ if(it != m_messageServices.end())
+ msgSvc = it->second;
+ etMutex_leave(&m_mutex);
+
+ return msgSvc;
}
-void MessageServiceController::start(bool singlethreaded) {
+void MessageServiceController::start() {
// start all message services
- for (std::vector<MessageService*>::iterator it = m_messageServiceList.begin();
- it != m_messageServiceList.end(); ++it) {
- (*it)->start(singlethreaded);
+ for (std::map<int, IMessageService*>::iterator it = m_messageServices.begin(); it != m_messageServices.end(); ++it) {
+ (it->second)->start();
// TODO TS: start in order of priorities
}
m_running = true;
}
-void MessageServiceController::stop(bool singlethreaded) {
+void MessageServiceController::stop() {
+ if (!m_running)
+ return;
+
//dumpThreads("org.eclipse.etrice.runtime.java.messaging.MessageServiceController.stop()");
- if (! singlethreaded) {
- terminate();
- waitTerminate();
- }
-}
+ terminate();
+ waitTerminate();
-void MessageServiceController::waitTerminate() {
- for (std::vector<MessageService*>::iterator it = m_messageServiceList.begin();
- it != m_messageServiceList.end(); ++it) {
- (*it)->join();
- }
+ m_running = false;
}
void MessageServiceController::dumpThreads(std::string msg) {
- std::cout << "<<< begin dump threads <<<" << std::endl;
- std::cout << "=== " << msg << std::endl;
+// std::cout << "<<< begin dump threads <<<" << std::endl;
+// std::cout << "=== " << msg << std::endl;
//TODO dump stack traces
// Map<Thread, StackTraceElement[]> traces = Thread.getAllStackTraces();
// for (Thread thread : traces.keySet()) {
@@ -88,32 +105,51 @@ void MessageServiceController::dumpThreads(std::string msg) {
// std::cout << " " << elements[i].toString() << std::endl;
// }
// }
- std::cout <<(">>> end dump threads >>>");
+// std::cout <<(">>> end dump threads >>>");
}
void MessageServiceController::terminate() {
- if (!m_running) {
- return;
- }
- m_running = false;
-
// terminate all message services
- for (std::vector<MessageService*>::iterator it = m_messageServiceList.begin();
- it != m_messageServiceList.end(); ++it) {
- (*it)->terminate();
+ etMutex_enter(&m_mutex);
+ m_terminateServices = m_messageServices;
+ etMutex_leave(&m_mutex);
+
+ std::map<int, IMessageService*>::iterator it = m_terminateServices.begin();
+ for (; it != m_terminateServices.end(); ++it) {
+ (it->second)->terminate();
//TODO TS: stop in order of priorities
}
}
-void MessageServiceController::runOnce() {
- if (!m_running) {
- return;
+void MessageServiceController::waitTerminate() {
+ etBool wait = true;
+
+ while(wait){
+ etMutex_enter(&m_mutex);
+ wait = !m_terminateServices.empty();
+ etMutex_leave(&m_mutex);
+
+ if(wait)
+ etSema_waitForWakeup(&m_terminateSema);
}
+}
- for (std::vector<MessageService*>::iterator it = m_messageServiceList.begin();
- it != m_messageServiceList.end(); ++it) {
- (*it)->runOnce();
+void MessageServiceController::resetAll() {
+ stop();
+ etMutex_enter(&m_mutex);
+ m_messageServices.clear();
+ while (!m_freeIDs.empty()) {
+ m_freeIDs.pop();
}
+ m_nextFreeID = 0;
+ etMutex_leave(&m_mutex);
+}
+
+void MessageServiceController::setMsgSvcTerminated(const IMessageService& msgSvc){
+ etMutex_enter(&m_mutex);
+ m_terminateServices.erase(msgSvc.getAddress().m_threadID);
+ etSema_wakeup(&m_terminateSema);
+ etMutex_leave(&m_mutex);
}
} /* namespace etRuntime */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageServiceController.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageServiceController.h
index 5f79bbea0..4771b38b9 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageServiceController.h
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/MessageServiceController.h
@@ -13,57 +13,54 @@
#ifndef MESSAGESERVICECONTROLLER_H_
#define MESSAGESERVICECONTROLLER_H_
-#include "common/messaging/MessageService.h"
-#include "common/messaging/RTServices.h"
-#include <vector>
+#include "common/messaging/IMessageService.h"
+#include "osal/etMutex.h"
+#include "osal/etSema.h"
+#include <map>
+#include <queue>
#include <string>
-#include <iostream>
-#include <algorithm>
namespace etRuntime {
class MessageServiceController {
public:
- MessageServiceController(/*IRTObject parent*/);
- virtual ~MessageServiceController();
-
- void addMsgSvc(MessageService& msgSvc);
- //raises an exception if the service does not exist for this threadID
- MessageService* getMsgSvc(int threadID);
-
- void addAsyncActor(IEventReceiver& evtReceiver);
- void pollAsyncActors();
-
- //the connectAll method connects all messageServices
- //it is included for test purposes
- //currently it is not called
- void connectAll();
- void start(bool singlethreaded);
- void stop(bool singlethreaded);
-
- //TODO: this is only for single threaded configurations
- void runOnce();
+ MessageServiceController();
+ virtual ~MessageServiceController() {}
+
+ int getNewID();
+ void freeID(int id);
+ void addMsgSvc(IMessageService& msgSvc);
+ void removeMsgSvc(IMessageService& msgSvc);
+ IMessageService* getMsgSvc(int threadID);
+ void start();
+ void stop();
+ void resetAll();
/**
* waitTerminate waits blocking for all MessageServices to terminate
- * ! not threadsafe !
+ * ! not thread safe !
*/
void waitTerminate();
+ void setMsgSvcTerminated(const IMessageService& msgSvc);
+
protected:
void dumpThreads(std::string msg);
private:
void terminate();
- MessageServiceController(const MessageServiceController& right);
- MessageServiceController& operator=(const MessageServiceController& right);
-
+ std::map<int, IMessageService*> m_messageServices;
+ std::queue<int> m_freeIDs;
+ etBool m_running;
+ int m_nextFreeID;
- std::vector<MessageService*> m_messageServiceList;
- // IRTObject parent = null;
- bool m_running;
+ etMutex m_mutex;
+ etSema m_terminateSema;
+ std::map<int, IMessageService*> m_terminateServices;
+ MessageServiceController(MessageServiceController const&);
+ MessageServiceController& operator=(MessageServiceController const&);
};
} /* namespace etRuntime */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/RTObject.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/RTObject.cpp
index 68ba311fa..19e146ab0 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/RTObject.cpp
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/RTObject.cpp
@@ -10,64 +10,128 @@
*
*******************************************************************************/
-#include "RTObject.h"
+#include "common/messaging/RTObject.h"
+#include "etDatatypes.h"
+#include <iterator>
+#include <string>
+#include <vector>
namespace etRuntime {
-RTObject::RTObject() :
- IRTObject(),
- m_parent(0),
- m_name(NO_NAME) ,
- m_instancePath(),
- m_instancePathName()
-{
- setPathNames();
+RTObject::RTObject(IRTObject* parent, const std::string& name) :
+ m_name(name),
+ m_parent(parent),
+ m_children() {
+
+ if (m_parent != 0) {
+ m_parent->getChildren().push_back(this);
+ m_instancePath = m_parent->getInstancePath() + PATH_DELIM + m_name;
+ m_instancePathName = m_parent->getInstancePathName() + PATHNAME_DELIM + m_name;
+ } else {
+ m_instancePath = PATH_DELIM + m_name;
+ m_instancePathName = PATHNAME_DELIM + m_name;
+ }
}
-RTObject::RTObject(IRTObject* parent, std::string name) :
- IRTObject(),
- m_parent(parent),
- m_name(name),
- m_instancePath(),
- m_instancePathName()
-{
- setPathNames();
+RTObject::~RTObject() {
+ for (std::vector<IRTObject*>::iterator it = m_children.begin(); it != m_children.end(); ++it) {
+ delete *it;
+ }
}
-RTObject::RTObject(const RTObject & right) :
- m_parent(right.m_parent),
- m_name(right.m_name),
- m_instancePath(right.m_instancePath),
- m_instancePathName(right.m_instancePathName)
-{
+void RTObject::destroy() {
+ for (std::vector<IRTObject*>::iterator it = m_children.begin(); it != m_children.end(); ++it) {
+ RTObject* child = dynamic_cast<RTObject*>(*it);
+ if (child != 0) {
+ child->destroy();
+ }
+ }
+
+ // no removal in parent to maintain reference for deletion
+ m_parent = 0;
}
-RTObject & RTObject::operator = (RTObject right) {
- std::swap(right, *this);
- return *this;
+IRTObject* RTObject::getRoot() const {
+ IRTObject* root = const_cast<RTObject*>(this);
+ while (root->getParent() != 0)
+ root = root->getParent();
+
+ return root;
}
-RTObject::~RTObject() {
- m_parent = 0;
+IRTObject* RTObject::getChild(const std::string& name) const {
+ for (std::vector<IRTObject*>::const_iterator it = m_children.begin(); it != m_children.end(); ++it) {
+ if (name == ((*it)->getName())) {
+ return *it;
+ }
+ }
+
+ return 0;
}
-void RTObject::setPathNames() {
- if (m_parent != 0) {
- m_instancePath = m_parent->getInstancePath() + PATH_DELIM + m_name;
- m_instancePathName = m_parent->getInstancePathName() + PATHNAME_DELIM + m_name;
+IRTObject* RTObject::getObject(const std::string& path) const {
+ etBool isAbsolute = (path[0] == PATH_DELIM);
+ if (isAbsolute && getParent() != 0)
+ return getParent()->getObject(path);
+
+ std::string segment;
+ std::size_t last = 0;
+ if (isAbsolute) {
+ last = 1;
+ size_t first = path.find(PATH_DELIM, last);
+ segment = path.substr(last, (first == std::string::npos) ? std::string::npos : first - 1);
+ if (segment != m_name)
+ return 0;
+
+ last = first;
}
- else {
- m_instancePath = PATH_DELIM + m_name;
- m_instancePathName = PATHNAME_DELIM + m_name;
+
+ IRTObject* current = const_cast<RTObject*>(this);
+ std::size_t next;
+ while ((next = path.find(PATH_DELIM, last)) != std::string::npos) {
+ if (next > last + 1) {
+ segment = path.substr(last, next - last);
+ current = current->getChild(segment);
+ if (current == 0)
+ return 0;
+ }
+ last = next + 1;
+ }
+ if (last < path.length() - 1) {
+ segment = path.substr(last);
+ current = current->getChild(segment);
}
+
+ return current;
+}
+
+int RTObject::getThreadForPath(const std::string& path) const {
+ if (m_parent != 0)
+ return m_parent->getThreadForPath(path);
+
+ return -1;
+}
+
+std::string RTObject::toStringRecursive(const std::string& indent) const {
+ std::string result(indent + toString() + "\n");
+
+ std::string indentInc(" " + indent);
+ std::vector<IRTObject*>::const_iterator it = m_children.begin();
+ for (; it != m_children.end(); ++it) {
+ RTObject* child = dynamic_cast<RTObject*>(*it);
+ if (child != 0)
+ result += child->toStringRecursive(indentInc);
+ }
+
+ return result;
}
-const std::string& RTObject::getInstancePath() const{
- return m_instancePath;
+std::string RTObject::toStringRecursive() const {
+ return toStringRecursive("");
}
-const std::string& RTObject::getInstancePathName() const{
- return m_instancePathName;
+std::string RTObject::toString() const {
+ return getName();
}
} /* namespace etRuntime */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/RTObject.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/RTObject.h
index e70059035..a4bb6cd66 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/RTObject.h
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/RTObject.h
@@ -13,36 +13,64 @@
#ifndef RTOBJECT_H_
#define RTOBJECT_H_
-#include <string>
#include "common/messaging/IRTObject.h"
+#include <string>
+#include <vector>
namespace etRuntime {
-class RTObject : public virtual IRTObject{
+class RTObject: public virtual IRTObject {
public:
- RTObject();
- RTObject(IRTObject* parent, std::string name);
- RTObject(const RTObject & right);
- RTObject & operator = (RTObject right);
+ RTObject(IRTObject* parent, const std::string& name);
virtual ~RTObject();
- IRTObject* getParent() const { return m_parent; };
- const std::string& getName() const { return m_name; };
+ virtual const std::string& getName() const {
+ return m_name;
+ }
+ virtual const std::string& getInstancePath() const {
+ return m_instancePath;
+ }
+ virtual const std::string& getInstancePathName() const {
+ return m_instancePathName;
+ }
+
+ virtual std::vector<IRTObject*>& getChildren() {
+ return m_children;
+ }
+
+ virtual IRTObject* getParent() const {
+ return m_parent;
+ }
+
+ virtual IRTObject* getRoot() const;
+
+ virtual IRTObject* getChild(const std::string& name) const;
- virtual const std::string& getInstancePath() const;
- virtual const std::string& getInstancePathName() const;
+ virtual IRTObject* getObject(const std::string& path) const;
+
+ virtual int getThreadForPath(const std::string& path) const;
+
+protected:
+ virtual void destroy();
+
+ std::string toStringRecursive(const std::string& indent) const;
+ std::string toStringRecursive() const;
+ virtual std::string toString() const;
private:
- void setPathNames();
- IRTObject* m_parent;
std::string m_name;
// for speed optimization the instance paths are created at instantiation
// and used as const ref parameters in the logging methods to avoid copying
std::string m_instancePath;
std::string m_instancePathName;
+ IRTObject* m_parent;
+ std::vector<IRTObject*> m_children;
+ RTObject();
+ RTObject(RTObject const&);
+ RTObject& operator=(RTObject const&);
};
} /* namespace etRuntime */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/RTServices.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/RTServices.cpp
deleted file mode 100644
index 6aa7b5656..000000000
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/RTServices.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 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)
- *
- *******************************************************************************/
-
-#include "RTServices.h"
-
-namespace etRuntime {
-
-RTServices* RTServices::s_instance = 0;
-
-RTServices::RTServices()
- : m_subSystem(0),
- m_messageServiceController( new MessageServiceController())
-{
-}
-
-RTServices::~RTServices() {
- // TODO Auto-generated destructor stub
-}
-
-void RTServices::destroy() {
- // TODO: also clean up all sub elements
- m_subSystem = 0;
- m_messageServiceController = 0;
- //TODO is delete necessary here??
- //delete s_instance;
- s_instance = 0;
-}
-
-MessageServiceController& RTServices::getMsgSvcCtrl() {
- //TODO
- //assert(m_messageServiceController != 0);
- return *m_messageServiceController;
-}
-
-} /* namespace etRuntime */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/RTServices.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/RTServices.h
index fe9c36395..3d71bd9cd 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/RTServices.h
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/RTServices.h
@@ -12,39 +12,48 @@
#ifndef RTSERVICES_H_
#define RTSERVICES_H_
+
#include "common/messaging/MessageServiceController.h"
namespace etRuntime {
class SubSystemClassBase;
-class MessageServiceController;
-
class RTServices {
public:
- virtual ~RTServices();
-
static RTServices& getInstance() {
- if (s_instance == 0) {
- s_instance = new RTServices();
- }
- return *s_instance;
+ static RTServices s_instance;
+
+ return s_instance;
}
- void destroy();
- MessageServiceController& getMsgSvcCtrl();
- SubSystemClassBase* getSubSystem() { return m_subSystem; };
- void setSubSystem(SubSystemClassBase* subSystem) { m_subSystem = subSystem; };
+ virtual ~RTServices() {
+ m_subSystem = 0;
+ }
-private:
- static RTServices* s_instance;
+ void destroy() {
+ }
+ MessageServiceController& getMsgSvcCtrl() {
+ return m_messageServiceController;
+ }
+ SubSystemClassBase* getSubSystem() const {
+ return m_subSystem;
+ }
+ void setSubSystem(SubSystemClassBase* subSystem) {
+ m_subSystem = subSystem;
+ }
+
+private:
SubSystemClassBase* m_subSystem;
- MessageServiceController* m_messageServiceController;
+ MessageServiceController m_messageServiceController;
- RTServices();
- RTServices(const RTServices & right);
- RTServices & operator = (const RTServices& right);
+ RTServices() :
+ m_subSystem(0),
+ m_messageServiceController() {
+ }
+ RTServices(RTServices const&);
+ void operator=(RTServices const&);
};
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/RTSystemServicesProtocol.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/RTSystemServicesProtocol.cpp
deleted file mode 100644
index 34ab12c46..000000000
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/RTSystemServicesProtocol.cpp
+++ /dev/null
@@ -1,219 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 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)
- *
- *******************************************************************************/
-
-#include "RTSystemServicesProtocol.h"
-#include "common/debugging/DebuggingService.h"
-
-namespace etRuntime {
-
-std::string RTSystemServicesProtocol::s_messageStrings[] =
- { "MIN",
- "dummy",
- "executeInitialTransition",
- "startDebugging",
- "stopDebugging",
- "MAX"};
-
-std::string RTSystemServicesProtocol::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";
- }
-}
-
-//------------------------------------------------------------------
-// RTSystemServicesProtocol: surrounding class
-//------------------------------------------------------------------
-
-
-RTSystemServicesProtocol::RTSystemServicesProtocol() {
-}
-
-RTSystemServicesProtocol::~RTSystemServicesProtocol() {
-}
-
-
-//------------------------------------------------------------------
-// RTSystemServicesProtocolPort
-//------------------------------------------------------------------
-
-RTSystemServicesProtocolPort::RTSystemServicesProtocolPort(IEventReceiver& actor, IRTObject* parent, std::string name,
- int localId, Address addr, Address peerAddress, bool doRegistration)
-:PortBase(actor, parent, name, localId, 0, addr, peerAddress)
-{
- if (doRegistration) {
- DebuggingService::getInstance().addPortInstance(*this);
- }
-};
-
-RTSystemServicesProtocolPort::RTSystemServicesProtocolPort(IEventReceiver& actor, IRTObject* parent, std::string name,
- int localId, int idx, Address addr, Address peerAddress, bool doRegistration)
-: PortBase(actor, parent, name, localId, idx, addr, peerAddress)
-{
- if (doRegistration) {
- DebuggingService::getInstance().addPortInstance(*this);
- }
-};
-
-void RTSystemServicesProtocolPort::receive(Message* msg) {
- if (! RTSystemServicesProtocol::isValidIncomingEvtID(msg->getEvtId())) {
- std::cout << "unknown" << std::endl;
- }
- else {
- if (msg->hasDebugFlagSet()) { // TODO: model switch for activation of this flag
- DebuggingService::getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), RTSystemServicesProtocol::getMessageString(msg->getEvtId()));
- }
- getEventReceiver().receiveEvent(this, msg->getEvtId(), msg->getData());
- }
-};
-
-// sent messages
-
-void RTSystemServicesProtocolPort::dummy() {
- DebuggingService::getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(),
- RTSystemServicesProtocol::getMessageString(RTSystemServicesProtocol::OUT_dummy));
- PortBase::send(RTSystemServicesProtocol::OUT_dummy);
-};
-
-//------------------------------------------------------------------
-// RTSystemServicesProtocolPortRepl
-//------------------------------------------------------------------
-
-
-RTSystemServicesProtocolPortRepl::
-RTSystemServicesProtocolPortRepl(IEventReceiver& actor, IRTObject* parent, std::string name, int localId, const std::vector<Address>& addr, const std::vector<Address> peerAddress)
-: m_replication(addr.size()),
- m_ports()
-{
- char numstr[10]; // enough to hold all numbers up to 32-bits
-
- //m_ports.reserve(m_replication);
- m_ports = reinterpret_cast<RTSystemServicesProtocolPort*> (new char[sizeof(RTSystemServicesProtocolPort) * addr.size()]);
-
- for (int i = 0; i < m_replication; ++i) {
- snprintf(numstr, sizeof(numstr), "%d", i);
- new (&m_ports[i]) RTSystemServicesProtocolPort(actor, parent, name + numstr, localId, i, addr[i], peerAddress[i]);
-
- //m_ports.push_back(std::auto_ptr_ref<RTSystemServicesProtocolPort>(new RTSystemServicesProtocolPort(actor, parent, name + numstr, localId, i, addr[i], peerAddress[i], false)));
- //m_ports[i] = std::auto_ptr<RTSystemServicesProtocolPort>(new RTSystemServicesProtocolPort(actor, parent, name + numstr, localId, i, addr[i], peerAddress[i]));
- }
-// for (int i = 0; i < m_replication; ++i) {
-// DebuggingService::getInstance().addPortInstance(m_ports.at(i));
-// }
-
-};
-
-// outgoing messages
-
-void RTSystemServicesProtocolPortRepl::dummy() {
- for (int i = 0; i < m_replication; ++i) {
- m_ports[i].dummy();
- }
-};
-
-//------------------------------------------------------------------
-// RTSystemServicesProtocolConjPort
-//------------------------------------------------------------------
-
-RTSystemServicesProtocolConjPort::RTSystemServicesProtocolConjPort(IEventReceiver& actor, IRTObject* parent,
- std::string name, int localId, Address addr, Address peerAddress, bool doRegistration)
- : PortBase(actor, parent, name, localId, 0, addr, peerAddress)
-{
- if (doRegistration) {
- DebuggingService::getInstance().addPortInstance(*this);
- }
-}
-RTSystemServicesProtocolConjPort::RTSystemServicesProtocolConjPort(IEventReceiver& actor, IRTObject* parent,
- std::string name, int localId, int idx, Address addr,
- Address peerAddress, bool doRegistration)
-: PortBase(actor, parent, name, localId, idx, addr, peerAddress)
-{
- if (doRegistration) {
- DebuggingService::getInstance().addPortInstance(*this);
- }
-}
-
-void RTSystemServicesProtocolConjPort::receive(Message* msg) {
- if (! RTSystemServicesProtocol::isValidOutgoingEvtID(msg->getEvtId())) { //conjugated port receives out-messages
- std::cout << "unknown" << std::endl;
- }
- else {
- if (msg->hasDebugFlagSet()) { // TODO: model switch for activation of this flag
- DebuggingService::getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), RTSystemServicesProtocol::getMessageString(msg->getEvtId()));
- }
- getEventReceiver().receiveEvent(this, msg->getEvtId(), msg->getData());
- }
-}
-
-// sent messages
-
-void RTSystemServicesProtocolConjPort::executeInitialTransition() {
- DebuggingService::getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(),
- RTSystemServicesProtocol::getMessageString(RTSystemServicesProtocol::IN_executeInitialTransition));
- PortBase::send(RTSystemServicesProtocol::IN_executeInitialTransition);
-}
-
-void RTSystemServicesProtocolConjPort::startDebugging() {
- DebuggingService::getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(),
- RTSystemServicesProtocol::getMessageString(RTSystemServicesProtocol::IN_startDebugging));
- PortBase::send(RTSystemServicesProtocol::IN_startDebugging);
-}
-
-void RTSystemServicesProtocolConjPort::stopDebugging() {
- DebuggingService::getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(),
- RTSystemServicesProtocol::getMessageString(RTSystemServicesProtocol::IN_stopDebugging));
- PortBase::send(RTSystemServicesProtocol::IN_stopDebugging);
-}
-
-//------------------------------------------------------------------
-// RTSystemServicesProtocolConjPortRepl
-//------------------------------------------------------------------
-
-RTSystemServicesProtocolConjPortRepl::
-RTSystemServicesProtocolConjPortRepl(IEventReceiver& actor, IRTObject* parent, std::string name, int localId, const std::vector<Address>& addr, const std::vector<Address>& peerAddress)
-: m_replication(addr.size()),
- m_ports()
-{
- char numstr[10]; // enough to hold all numbers up to 32-bits
- m_ports = reinterpret_cast<RTSystemServicesProtocolConjPort*> (new char[sizeof(RTSystemServicesProtocolConjPort) * 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]) RTSystemServicesProtocolConjPort(actor, parent, name + numstr, localId, i, addr[i], peerAddress[i]);
- }
-
-};
-
-// sent messages
-
-void RTSystemServicesProtocolConjPortRepl::executeInitialTransition() {
- for (int i = 0; i < m_replication; ++i) {
- m_ports[i].executeInitialTransition();
- }
-}
-
-void RTSystemServicesProtocolConjPortRepl::startDebugging() {
- for (int i = 0; i < m_replication; ++i) {
- m_ports[i].startDebugging();
- }
-}
-
-void RTSystemServicesProtocolConjPortRepl::stopDebugging() {
- for (int i = 0; i < m_replication; ++i) {
- m_ports[i].stopDebugging();
- }
-}
-
-
-} /* namespace etRuntime */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/RTSystemServicesProtocol.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/RTSystemServicesProtocol.h
deleted file mode 100644
index d2646df61..000000000
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/RTSystemServicesProtocol.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 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)
- *
- *******************************************************************************/
-
-#ifndef RTSYSTEMSERVICESPROTOCOL_H_
-#define RTSYSTEMSERVICESPROTOCOL_H_
-
-#include "common/modelbase/PortBase.h"
-#include "common/modelbase/IEventReceiver.h"
-#include "common/messaging/Address.h"
-#include <vector>
-#include <string>
-#include <memory>
-
-namespace etRuntime {
-
-//---------------------------------------------------
-// interface for port class
-//---------------------------------------------------
-class IRTSystemServicesProtocolPort {
-public:
- virtual ~IRTSystemServicesProtocolPort() {};
- virtual void dummy() = 0;
-};
-
-//---------------------------------------------------
-// interface for conjugated port class
-//---------------------------------------------------
-class IRTSystemServicesProtocolConjPort {
-public:
- virtual ~IRTSystemServicesProtocolConjPort() {};
- virtual void executeInitialTransition() = 0;
- virtual void startDebugging() = 0;
- virtual void stopDebugging() = 0;
-};
-
-
-class RTSystemServicesProtocol {
-public:
- enum eventIDs {
- MSG_MIN = 0,
- OUT_dummy = 1,
- MSG_SEP = 2,
- IN_executeInitialTransition = 2,
- IN_startDebugging = 3,
- IN_stopDebugging = 4,
- MSG_MAX = 5
- };
- static bool isValidEvtID(int evtId) {
- return ((MSG_MIN < evtId) && (evtId < MSG_MAX));
- };
- static bool isValidOutgoingEvtID(int evtId) {
- return ((MSG_MIN < evtId) && (evtId < MSG_SEP));
- };
- static bool isValidIncomingEvtID(int evtId) {
- return ((MSG_SEP <= evtId) && (evtId < MSG_MAX));
- };
- static std::string getMessageString(int msg_id);
-
- private:
- static std::string s_messageStrings[];
-
- RTSystemServicesProtocol();
- virtual ~RTSystemServicesProtocol();
-};
-
- //---------------------------------------------------
- // port class
- //---------------------------------------------------
- class RTSystemServicesProtocolPort : public PortBase , public IRTSystemServicesProtocolPort {
- public:
- RTSystemServicesProtocolPort(IEventReceiver& actor, IRTObject* parent, std::string name,
- int localId, Address addr, Address peerAddress, bool doRegistration = true);
-
- RTSystemServicesProtocolPort(IEventReceiver& actor, IRTObject* parent, std::string name,
- int localId, int idx, Address addr, Address peerAddress, bool doRegistration = true);
-
- virtual void receive(Message* m);
- // sent messages
- void dummy();
- };
-
- //---------------------------------------------------
- // replicated port class
- //---------------------------------------------------
- class RTSystemServicesProtocolPortRepl: public IRTSystemServicesProtocolPort {
- private:
- int m_replication;
- RTSystemServicesProtocolPort* m_ports;
-
- public:
- RTSystemServicesProtocolPortRepl(IEventReceiver& actor, IRTObject* parent, std::string name, int localId,
- const std::vector<Address>& addr, const std::vector<Address> peerAddress);
-
- int getReplication() const { return m_replication; } ;
- RTSystemServicesProtocolPort& get(int i) { return m_ports[i]; };
- // outgoing messages
- void dummy();
- };
-
-
- //---------------------------------------------------
- // conjugated port class
- //---------------------------------------------------
- class RTSystemServicesProtocolConjPort : public PortBase, public IRTSystemServicesProtocolConjPort{
- public:
- RTSystemServicesProtocolConjPort(IEventReceiver& actor, IRTObject* parent,
- std::string name, int localId, Address addr, Address peerAddress, bool doRegistration = true);
- RTSystemServicesProtocolConjPort(IEventReceiver& actor, IRTObject* parent,
- std::string name, int localId, int idx, Address addr,
- Address peerAddress, bool doRegistration = true);
-
- virtual void receive(Message* m);
- void executeInitialTransition();
- void startDebugging();
- void stopDebugging();
- };
-
- //---------------------------------------------------
- // replicated conjugated port class
- //---------------------------------------------------
- class RTSystemServicesProtocolConjPortRepl : public IRTSystemServicesProtocolConjPort{
- private:
- int m_replication;
- RTSystemServicesProtocolConjPort* m_ports; //dynamic array used instead of vector to avoid copy construction
-
- public:
- RTSystemServicesProtocolConjPortRepl(IEventReceiver& actor, IRTObject* parent, std::string name, int localId,
- const std::vector<Address>& addr, const std::vector<Address>& peerAddress);
-
- int getReplication() const { return m_replication; } ;
- RTSystemServicesProtocolConjPort& get(int i) { return m_ports[i]; };
-
- void executeInitialTransition();
- void startDebugging();
- void stopDebugging();
- };
-
-} /* namespace etRuntime */
-#endif /* RTSYSTEMSERVICESPROTOCOL_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/ActorClassBase.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/ActorClassBase.cpp
index 6cfc0cc92..931449b55 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/ActorClassBase.cpp
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/ActorClassBase.cpp
@@ -11,32 +11,68 @@
*******************************************************************************/
#include "ActorClassBase.h"
+#include "common/modelbase/InterfaceItemBase.h"
+#include "common/modelbase/RTSystemServicesProtocol.h"
+#include "common/modelbase/SystemPortOwner.h"
+#include "etDatatypes.h"
+#include <iterator>
+#include <string>
+#include <vector>
+
namespace etRuntime {
-ActorClassBase::ActorClassBase(IRTObject* parent, std::string name, Address ownAddr, Address systemPortPeerAddr)
- : EventReceiver(parent, name),
- IMessageReceiver(),
+ActorClassBase::ActorClassBase(IRTObject* parent, const std::string& name) :
+ SystemPortOwner(parent, name),
m_state(0),
- history(0), //to be instantiated by derived class
- m_RTSystemPort(0),
- m_className("noname"),
- m_ownAddr(ownAddr),
- m_ownMsgsvc(RTServices::getInstance().getMsgSvcCtrl().getMsgSvc(ownAddr.m_threadID)) {
-
- // own ports
- m_RTSystemPort = new RTSystemServicesProtocolPort(*this, this, "RTSystemPort", 0, 0, ownAddr,
- systemPortPeerAddr);
+ m_RTSystemPort(this, IFITEM_RTSystemPort),
+ m_className("noname") {
}
ActorClassBase::~ActorClassBase() {
- delete m_RTSystemPort;
- m_RTSystemPort = 0;
- delete history;
- history = 0;
+ m_state = 0;
+}
+
+//SubSystemClassBase* ActorClassBase::getSubSystem() const {
+// return 0; // TODO JH
+//}
+
+//--------------------- life cycle functions
+void ActorClassBase::init() {
+ ActorClassBase* child = 0;
+ for (std::vector<IRTObject*>::iterator it = getChildren().begin(); it != getChildren().end(); ++it) {
+ if ((child = dynamic_cast<ActorClassBase*>(*it)) != 0)
+ child->init();
+ }
+
+ initUser();
+}
+
+void ActorClassBase::start() {
+ ActorClassBase* child = 0;
+ for (std::vector<IRTObject*>::iterator it = getChildren().begin(); it != getChildren().end(); ++it) {
+ if ((child = dynamic_cast<ActorClassBase*>(*it)) != 0)
+ child->start();
+ }
+
+ startUser();
}
-bool ActorClassBase::handleSystemEvent(InterfaceItemBase* ifitem, int evt, void* generic_data) {
+void ActorClassBase::stop() {
+ stopUser();
+
+ ActorClassBase* child = 0;
+ for (std::vector<IRTObject*>::iterator it = getChildren().begin(); it != getChildren().end(); ++it) {
+ if ((child = dynamic_cast<ActorClassBase*>(*it)) != 0)
+ child->stop();
+ }
+}
+
+void ActorClassBase::destroy() {
+ SystemPortOwner::destroy();
+}
+
+etBool ActorClassBase::handleSystemEvent(InterfaceItemBase* ifitem, int evt, void* generic_data) {
if ((ifitem != 0) && (ifitem->getLocalId() != 0)) {
return false;
}
@@ -55,8 +91,12 @@ bool ActorClassBase::handleSystemEvent(InterfaceItemBase* ifitem, int evt, void*
return true;
}
-std::string ActorClassBase::toString() {
- return "ActorClass(className=" + m_className + ", instancePath=" + getInstancePath() + ")";
+std::string ActorClassBase::toString() const {
+ ActorClassBase* thisPtr = const_cast<ActorClassBase*>(this);
+ char buffer[10];
+ sprintf(buffer, "%i", thisPtr->getThread());
+
+ return getName() + " : " + getClassName() + " thread:" + buffer;
}
} /* namespace etRuntime */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/ActorClassBase.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/ActorClassBase.h
index 3efca3121..7bd002ca9 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/ActorClassBase.h
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/ActorClassBase.h
@@ -13,64 +13,86 @@
#ifndef ACTORCLASSBASE_H_
#define ACTORCLASSBASE_H_
-#include "common/modelbase/EventReceiver.h"
+#include "common/messaging/Address.h"
#include "common/messaging/IMessageReceiver.h"
-#include "common/messaging/RTServices.h"
-#include "common/messaging/RTSystemServicesProtocol.h"
+#include "common/modelbase/RTSystemProtocol.h"
+#include "common/modelbase/SystemPortOwner.h"
+#include "etDatatypes.h"
+#include <string>
namespace etRuntime {
-class ActorClassBase: public EventReceiver, public IMessageReceiver {
+
+
+class ActorClassBase: public SystemPortOwner, public virtual IMessageReceiver {
public:
- ActorClassBase(IRTObject* parent, std::string name, Address ownAddr, Address systemPortPeerAddr);
+
virtual ~ActorClassBase();
- std::string toString();
- std::string getClassName() const { return m_className; }
- void setClassName(std::string className) { m_className = className; }
- virtual Address getAddress() const {
+ const std::string& getClassName() const {
+ return m_className;
+ }
+
+ void setClassName(const std::string& className) {
+ m_className = className;
+ }
+
+ virtual const Address& getAddress() const {
// TODO: Actor should have its own address for services and debugging
- return Address(0,0,0);
+ return Address::EMPTY;
}
+ //SubSystemClassBase* getSubSystem() const;
+
//--------------------- lifecycle functions
// automatically generated lifecycle functions
- virtual void init() = 0;
- virtual void start() = 0;
- virtual void stop() = 0;
- virtual void destroy() = 0;
+ virtual void init();
+ virtual void start();
+ virtual void stop();
+ virtual void destroy();
virtual void executeInitTransition() = 0;
// not automatically generated lifecycle functions
// are called, but with empty implementation -> can be overridden by user
- void initUser() { }
- void startUser() { }
- void stopUser() { }
- void destroyUser() { }
- virtual void receive(Message* msg) { }
+ virtual void initUser() {
+ }
+ virtual void startUser() {
+ }
+ virtual void stopUser() {
+ }
+
+ virtual void receive(const Message* msg) {
+ }
- int getState() const { return m_state; }
- MessageService* getMsgsvc() const { return m_ownMsgsvc; }
+ int getState() const {
+ return m_state;
+ }
protected:
+
+ ActorClassBase(IRTObject* parent, const std::string&);
+
static const int EVT_SHIFT = 1000; // TODOHRR: use 256 or shift operation later
static const int NO_STATE = 0;
static const int STATE_TOP = 1;
static const int NOT_CAUGHT = 0;
+ static const int IFITEM_RTSystemPort = 0;
/**
* the current state
*/
int m_state;
- int* history; //Todo pka: name is not prefixed by m_ because generic generator uses this member
- RTSystemServicesProtocolPort* m_RTSystemPort;
+ RTSystemPort m_RTSystemPort;
- virtual bool handleSystemEvent(InterfaceItemBase* ifitem, int evt, void* generic_data);
+ virtual etBool handleSystemEvent(InterfaceItemBase* ifitem, int evt, void* generic_data);
+ std::string toString() const;
private:
std::string m_className;
- Address m_ownAddr;
- MessageService* m_ownMsgsvc;
+
+ ActorClassBase();
+ ActorClassBase(ActorClassBase const&);
+ ActorClassBase& operator=(ActorClassBase const&);
};
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/DataPort.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/DataPort.cpp
new file mode 100644
index 000000000..5726012ac
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/DataPort.cpp
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2013 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:
+ * Juergen Haug (initial contribution)
+ *
+ *******************************************************************************/
+
+#include "common/modelbase/DataPort.h"
+#include <string>
+
+namespace etRuntime {
+
+void DataPortBase::connect(IRTObject* obj, const std::string& path1, const std::string& path2) {
+ IRTObject* obj1 = obj->getObject(path1);
+ IRTObject* obj2 = obj->getObject(path2);
+
+ DataReceivePort* recvPort = dynamic_cast<DataReceivePort*>(obj1);
+ DataSendPort* sendPort = dynamic_cast<DataSendPort*>(obj2);
+ if (recvPort == 0 || sendPort == 0) {
+ recvPort = dynamic_cast<DataReceivePort*>(obj2);
+ sendPort = dynamic_cast<DataSendPort*>(obj1);
+ }
+
+ if (recvPort != 0 && sendPort != 0)
+ recvPort->connect(sendPort);
+}
+
+}
+
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/DataPort.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/DataPort.h
new file mode 100644
index 000000000..eac2b6b21
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/DataPort.h
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2013 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:
+ * Juergen Haug (initial contribution)
+ *
+ *******************************************************************************/
+#ifndef SRC_COMMON_MODELBASE_DATAPORT_H_
+#define SRC_COMMON_MODELBASE_DATAPORT_H_
+
+#include "common/messaging/RTObject.h"
+#include <string>
+
+namespace etRuntime {
+
+class DataPortBase: public RTObject {
+public:
+ static void connect(IRTObject* obj, const std::string& path1, const std::string& path2);
+
+ DataPortBase(IRTObject* parent, const std::string& name, int localId) :
+ RTObject(parent, name),
+ m_localId(localId) {
+ }
+
+ int getLocalId() const {
+ return m_localId;
+ }
+
+private:
+ int m_localId;
+
+ DataPortBase();
+ DataPortBase(DataPortBase const&);
+ DataPortBase& operator=(DataPortBase const&);
+};
+
+class DataSendPort: public DataPortBase {
+public:
+ DataSendPort(IRTObject* parent, const std::string& name, int localId) :
+ DataPortBase(parent, name, localId) {
+ }
+
+private:
+
+ DataSendPort(DataSendPort const&);
+ DataSendPort& operator=(DataSendPort const&);
+};
+
+class DataReceivePort: public DataPortBase {
+ friend class DataPortBase;
+public:
+ DataReceivePort(IRTObject* parent, const std::string& name, int localId) :
+ DataPortBase(parent, name, localId) {
+ }
+
+ virtual void connect(DataSendPort* dataSendPort) = 0;
+private:
+
+ DataReceivePort(DataReceivePort const&);
+ DataReceivePort& operator=(DataReceivePort const&);
+};
+
+} /* namespace etRuntime */
+
+#endif /* SRC_COMMON_MODELBASE_DATAPORT_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/EventReceiver.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/EventReceiver.cpp
index 818229e9f..9ca651026 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/EventReceiver.cpp
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/EventReceiver.cpp
@@ -10,12 +10,29 @@
*
*******************************************************************************/
-#include "EventReceiver.h"
+#include "common/modelbase/EventReceiver.h"
+#include <string>
namespace etRuntime {
+EventReceiver::EventReceiver(IRTObject* parent, const std::string& name) :
+ RTObject(parent, name),
+ m_thread(-1) {
+}
+
+int EventReceiver::getThread() {
+ if (m_thread < 0) {
+ m_thread = getThreadForPath(getInstancePath());
+ if (m_thread < 0) {
+ IEventReceiver* parent = dynamic_cast<IEventReceiver*>(getParent());
+ if (parent != 0)
+ m_thread = parent->getThread();
+ else
+ m_thread = 0;
+ }
+ }
-EventReceiver::~EventReceiver() {
+ return m_thread;
}
} /* namespace etRuntime */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/EventReceiver.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/EventReceiver.h
index 6a2dfae38..e67df44b9 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/EventReceiver.h
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/EventReceiver.h
@@ -19,18 +19,22 @@
namespace etRuntime {
-class EventReceiver : public RTObject, public IEventReceiver{
+class EventReceiver : public RTObject, public virtual IEventReceiver{
public:
- EventReceiver(IRTObject* parent, std::string name)
- : RTObject(parent, name),
- IEventReceiver()
- {};
- virtual ~EventReceiver();
+
+ virtual ~EventReceiver() {}
+
+ virtual int getThread();
+
+protected:
+ EventReceiver(IRTObject* parent, const std::string& name);
private:
- EventReceiver();
- EventReceiver(const EventReceiver& right);
- EventReceiver& operator=(const EventReceiver& right);
+
+ int m_thread;
+
+ EventReceiver(EventReceiver const&);
+ EventReceiver& operator=(EventReceiver const&);
};
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/IEventReceiver.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/IEventReceiver.cpp
deleted file mode 100644
index c0051f968..000000000
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/IEventReceiver.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 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)
- *
- *******************************************************************************/
-
-#include "IEventReceiver.h"
-
-namespace etRuntime {
-
-IEventReceiver::IEventReceiver() {
-}
-
-IEventReceiver::~IEventReceiver() {
-}
-
-} /* namespace etRuntime */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/IEventReceiver.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/IEventReceiver.h
index 627195838..5edcc8754 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/IEventReceiver.h
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/IEventReceiver.h
@@ -16,15 +16,15 @@
#include "common/messaging/IRTObject.h"
namespace etRuntime {
- class InterfaceItemBase;
-class IEventReceiver {
+class InterfaceItemBase;
+
+class IEventReceiver: public virtual IRTObject {
public:
- IEventReceiver();
- virtual ~IEventReceiver();
+ virtual ~IEventReceiver() {}
virtual void receiveEvent(InterfaceItemBase* ifitem, int evt, void* data) = 0;
-
+ virtual int getThread() = 0;
};
} /* namespace etRuntime */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/IMessageReceiver.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/IInterfaceItem.h
index 40e97cf86..6796a3ff4 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/IMessageReceiver.cpp
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/IInterfaceItem.h
@@ -1,23 +1,27 @@
/*******************************************************************************
- * Copyright (c) 2012 Draeger Medical GmbH (http://www.draeger.com).
+ * Copyright (c) 2013 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:
- * Peter Karlitschek (initial contribution)
+ * Juergen Haug (initial contribution)
*
*******************************************************************************/
+#ifndef SRC_COMMON_MODELBASE_IINTERFACEITEM_H_
+#define SRC_COMMON_MODELBASE_IINTERFACEITEM_H_
-#include "IMessageReceiver.h"
+#include "common/messaging/IRTObject.h"
namespace etRuntime {
-IMessageReceiver::IMessageReceiver() {
-}
-
-IMessageReceiver::~IMessageReceiver() {
-}
+class IInterfaceItem : public virtual IRTObject {
+public:
+ virtual ~IInterfaceItem() {}
+ virtual IInterfaceItem* connectWith(IInterfaceItem* peer) = 0;
+};
} /* namespace etRuntime */
+
+#endif /* SRC_COMMON_MODELBASE_IINTERFACEITEM_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/IInterfaceItemOwner.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/IInterfaceItemOwner.h
new file mode 100644
index 000000000..0c705419d
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/IInterfaceItemOwner.h
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2013 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:
+ * Juergen Haug (initial contribution)
+ *
+ *******************************************************************************/
+#ifndef SRC_COMMON_MODELBASE_IINTERFACEITEMOWNER_H_
+#define SRC_COMMON_MODELBASE_IINTERFACEITEMOWNER_H_
+
+#include "common/messaging/IRTObject.h"
+
+namespace etRuntime {
+
+class IReplicatedInterfaceItem;
+class IEventReceiver;
+
+class IInterfaceItemOwner: public virtual IRTObject {
+public:
+ virtual ~IInterfaceItemOwner() {}
+ virtual IEventReceiver* getEventReceiver() const = 0;
+ virtual IReplicatedInterfaceItem* getSystemPort() const = 0;
+};
+
+} /* namespace etRuntime */
+#endif /* SRC_COMMON_MODELBASE_IINTERFACEITEMOWNER_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/IReplicatedInterfaceItem.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/IReplicatedInterfaceItem.h
new file mode 100644
index 000000000..0713ee808
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/IReplicatedInterfaceItem.h
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2013 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:
+ * Juergen Haug (initial contribution)
+ *
+ *******************************************************************************/
+#ifndef SRC_COMMON_MODELBASE_IREPLICATEDINTERFACEITEM_H_
+#define SRC_COMMON_MODELBASE_IREPLICATEDINTERFACEITEM_H_
+
+#include "common/modelbase/IInterfaceItem.h"
+
+namespace etRuntime {
+
+class InterfaceItemBase;
+
+class IReplicatedInterfaceItem: public virtual IInterfaceItem {
+public:
+ virtual ~IReplicatedInterfaceItem() {}
+
+ virtual InterfaceItemBase* createSubInterfaceItem() = 0;
+ virtual void removeItem(InterfaceItemBase& item) = 0;
+};
+} /* namespace etRuntime */
+
+#endif /* SRC_COMMON_MODELBASE_IREPLICATEDINTERFACEITEM_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/InterfaceItemBase.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/InterfaceItemBase.cpp
index c689f5feb..2834ff487 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/InterfaceItemBase.cpp
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/InterfaceItemBase.cpp
@@ -10,51 +10,137 @@
*
*******************************************************************************/
-#include "InterfaceItemBase.h"
-#include "common/messaging/AbstractMessageReceiver.h"
+#include "common/messaging/MessageServiceController.h"
+#include "common/messaging/RTObject.h"
#include "common/messaging/RTServices.h"
+#include "common/modelbase/IEventReceiver.h"
+#include "common/modelbase/IInterfaceItemOwner.h"
+#include "common/modelbase/InterfaceItemBase.h"
+#include "common/modelbase/IReplicatedInterfaceItem.h"
+#include <string>
namespace etRuntime {
-InterfaceItemBase::InterfaceItemBase (IEventReceiver& evtReceiver, IRTObject* parent, std::string name, int localId, int idx, Address ownAddress, Address peerAddress)
-: AbstractMessageReceiver(parent, ownAddress, name),
- m_idx(idx),
- m_localId(localId),
- m_actorPath(name),
- m_peerAddress(peerAddress),
- m_ownMsgReceiver(RTServices::getInstance().getMsgSvcCtrl().getMsgSvc(ownAddress.m_threadID)),
- m_peerMsgReceiver(peerAddress.isValid()? RTServices::getInstance().getMsgSvcCtrl().getMsgSvc(peerAddress.m_threadID): 0),
- m_eventReceiver(&evtReceiver)
-{
- if (getAddress().isValid() && m_ownMsgReceiver->isMsgService()) {
- MessageService* ms = static_cast<MessageService*>(m_ownMsgReceiver);
- // register at the own dispatcher to receive messages
- ms->getMessageDispatcher().addMessageReceiver(*this);
- }
- if (parent) {
- m_actorPath = parent->getInstancePath();
+void InterfaceItemBase::connect(IRTObject* obj, const std::string& path1, const std::string& path2) {
+ IRTObject* obj1 = obj->getObject(path1);
+ IRTObject* obj2 = obj->getObject(path2);
+
+ IInterfaceItem* ifItem1 = dynamic_cast<IInterfaceItem*>(obj1);
+ IInterfaceItem* ifItem2 = dynamic_cast<IInterfaceItem*>(obj2);
+
+ if (ifItem1 != 0 && ifItem2 != 0) {
+ ifItem1->connectWith(ifItem2);
}
}
-InterfaceItemBase::InterfaceItemBase(const InterfaceItemBase & right)
-: AbstractMessageReceiver(right),
- m_idx(right.m_idx),
- m_localId(right.m_localId),
- m_actorPath(right.m_actorPath),
- m_peerAddress(right.m_peerAddress),
- m_ownMsgReceiver(right.m_ownMsgReceiver),
- m_peerMsgReceiver(right.m_peerMsgReceiver),
- m_eventReceiver(right.m_eventReceiver)
-{
+InterfaceItemBase::InterfaceItemBase(IInterfaceItemOwner* owner, const std::string& name, int localId, int idx) :
+ AbstractMessageReceiver(owner->getEventReceiver(), name),
+ m_localId(localId),
+ m_idx(idx),
+ m_peerAddress(Address::EMPTY),
+ m_peer(0),
+ m_ownMsgReceiver(0),
+ m_peerMsgReceiver(0),
+ m_replicator(0) {
-}
+ m_replicator = dynamic_cast<IReplicatedInterfaceItem*>(owner);
+ int thread = owner->getEventReceiver()->getThread();
+ if (thread >= 0) {
+ IMessageService* msgSvc = RTServices::getInstance().getMsgSvcCtrl().getMsgSvc(thread);
+ Address addr = msgSvc->getFreeAddress();
+ setAddress(addr);
+ msgSvc->addMessageReceiver(*this);
+
+ m_ownMsgReceiver = msgSvc;
+ }
+}
InterfaceItemBase::~InterfaceItemBase() {
+ m_peerAddress = Address::EMPTY;
m_ownMsgReceiver = 0;
m_peerMsgReceiver = 0;
- m_eventReceiver = 0;
+}
+
+IInterfaceItem* InterfaceItemBase::connectWith(IInterfaceItem* peer) {
+ if (peer != 0) {
+ m_peer = peer;
+
+// if (peer instanceof IInterfaceItemBroker) {
+// this.peer = peer.connectWith(this);
+// return this.peer;
+// }
+
+ IReplicatedInterfaceItem* replPeer = dynamic_cast<IReplicatedInterfaceItem*>(m_peer);
+ if (replPeer != 0) {
+ m_peer = replPeer->createSubInterfaceItem();
+ }
+
+ InterfaceItemBase* ifItemPeer = dynamic_cast<InterfaceItemBase*>(m_peer);
+ if (ifItemPeer != 0) {
+ // connect with each other
+ m_peerAddress = ifItemPeer->getAddress();
+ ifItemPeer->m_peerAddress = getAddress();
+ m_peerMsgReceiver = ifItemPeer->m_ownMsgReceiver;
+ ifItemPeer->m_peerMsgReceiver = m_ownMsgReceiver;
+ }
+
+ }
+
+ return peer;
+}
+
+void InterfaceItemBase::disconnect() {
+ disconnectInternal();
+ if (m_peer != 0) {
+ InterfaceItemBase* peer = dynamic_cast<InterfaceItemBase*>(m_peer);
+ if (peer != 0)
+ peer->disconnectInternal();
+ m_peer = 0;
+ }
+}
+
+void InterfaceItemBase::disconnectInternal() {
+ m_peerAddress = Address::EMPTY;
+ m_peerMsgReceiver = 0;
+
+ if (m_replicator != 0)
+ destroy();
+}
+
+IEventReceiver* InterfaceItemBase::getActor() const {
+ return dynamic_cast<IEventReceiver*>(getParent());
+}
+
+void InterfaceItemBase::destroy() {
+ if (m_peerAddress.isValid()) {
+ disconnect();
+ }
+
+ if (m_replicator != 0) {
+ m_replicator->removeItem(*this);
+ }
+
+ m_ownMsgReceiver->removeMessageReceiver(*this);
+ m_ownMsgReceiver->freeAddress(getAddress());
+
+ AbstractMessageReceiver::destroy();
+}
+
+std::string InterfaceItemBase::toString() const {
+ std::stringstream result;
+
+ result << ((m_replicator != 0) ? "sub " : "");
+ result << "port " + getName() << " " << getAddress().toID() << " ";
+ if(m_peerMsgReceiver == 0)
+ result << "UNCONNECTED";
+ else {
+ result << " -> ";
+ result << ((m_peer != 0) ? m_peer->getName() : "?");
+ result << " " << m_peerAddress.toID();
+ }
+ return result.str();
}
} /* namespace etRuntime */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/InterfaceItemBase.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/InterfaceItemBase.h
index 70187be3e..0cc5de218 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/InterfaceItemBase.h
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/InterfaceItemBase.h
@@ -13,48 +13,72 @@
#ifndef INTERFACEITEMBASE_H_
#define INTERFACEITEMBASE_H_
-#include "common/messaging/Address.h"
-#include "common/messaging/IMessageReceiver.h"
-#include "common/modelbase/IEventReceiver.h"
#include "common/messaging/AbstractMessageReceiver.h"
+#include "common/messaging/Address.h"
+#include "common/messaging/IMessageService.h"
+#include "common/modelbase/IInterfaceItem.h"
#include <string>
namespace etRuntime {
-class IEventReceiver;
+class IReplicatedInterfaceItem;
+class IInterfaceItemOwner;
+class IEventReceiver;
+class IMessageService;
-class InterfaceItemBase : public AbstractMessageReceiver{
+class InterfaceItemBase: public AbstractMessageReceiver, public virtual IInterfaceItem {
public:
- InterfaceItemBase (IEventReceiver& evtReceiver, IRTObject* parentActor, std::string name, int localId, int idx, Address ownAddress, Address peerAddress);
- InterfaceItemBase(const InterfaceItemBase & right);
+ static void connect(IRTObject* obj, const std::string& path1, const std::string& path2);
+
virtual ~InterfaceItemBase();
- int getIdx() const { return m_idx; } ;
- IEventReceiver& getEventReceiver() { return *m_eventReceiver; };
- std::string& getActorPath() { return m_actorPath; };
- int getLocalId() const {return m_localId; };
+ // TODO JH sync on several member functions needed
+ IInterfaceItem* connectWith(IInterfaceItem* peer);
+ void disconnect();
+ int getLocalId() const {
+ return m_localId;
+ }
+
+ int getIdx() const {
+ return m_idx;
+ }
- void setMsgReceiver(IMessageReceiver& msgReceiver) { m_ownMsgReceiver = &msgReceiver; };
+ IEventReceiver* getActor() const;
+ virtual std::string toString() const;
protected:
- IMessageReceiver* getMsgReceiver() const{ return m_ownMsgReceiver; };
- IMessageReceiver* getPeerMsgReceiver() const { return m_peerMsgReceiver; };
- Address getPeerAddress() const { return m_peerAddress; };
+ InterfaceItemBase(IInterfaceItemOwner* owner, const std::string& name, int localId, int idx);
-private:
+ IMessageReceiver* getMsgReceiver() const {
+ return m_ownMsgReceiver;
+ }
- int m_idx;
- int m_localId;
+ const Address& getPeerAddress() const {
+ return m_peerAddress;
+ }
+
+ IMessageReceiver* getPeerMsgReceiver() const {
+ return m_peerMsgReceiver;
+ }
- std::string m_actorPath;
+ virtual void destroy();
+
+private:
+ int m_localId;
+ int m_idx;
Address m_peerAddress;
- IMessageReceiver* m_ownMsgReceiver;
+ IInterfaceItem* m_peer;
+ IMessageService* m_ownMsgReceiver;
IMessageReceiver* m_peerMsgReceiver;
- IEventReceiver* m_eventReceiver;
+
+ IReplicatedInterfaceItem* m_replicator;
+
+ void disconnectInternal();
InterfaceItemBase();
- InterfaceItemBase & operator = (const InterfaceItemBase& right);
+ InterfaceItemBase(InterfaceItemBase const&);
+ InterfaceItemBase& operator =(InterfaceItemBase const&);
};
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/PortBase.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/PortBase.cpp
deleted file mode 100644
index ad880933d..000000000
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/PortBase.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 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)
- *
- *******************************************************************************/
-
-#include "PortBase.h"
-
-namespace etRuntime {
-
-
-PortBase::~PortBase() {
-}
-
-void PortBase::send(int evtID) {
-
- //TODO: how to avoid logging timerTicks
- //if (s_messageStrings[IRTSystemServicesProtocolPort::OUT_dummy] != "timerTick") {
- // TODOTS: model switch for activation
- if (getPeerAddress().isValid())
- getPeerMsgReceiver()->receive(
- new Message(getPeerAddress(), evtID)); //TODO: placement new mit message pool verwenden
-
-};
-
-} /* namespace etRuntime */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/PortBase.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/PortBase.h
index 9b0e6f04a..9fbb2c1be 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/PortBase.h
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/PortBase.h
@@ -13,29 +13,30 @@
#ifndef PORTBASE_H_
#define PORTBASE_H_
+#include "common/modelbase/IInterfaceItemOwner.h"
#include "common/modelbase/InterfaceItemBase.h"
-#include "common/messaging/Address.h"
#include <string>
namespace etRuntime {
-class IEventReceiver;
-
-class PortBase : public InterfaceItemBase{
-public:
- PortBase (IEventReceiver& actor, IRTObject* parent, std::string name, int localId, int idx, Address address, Address peerAddress)
- : InterfaceItemBase(actor, parent, name, localId, idx, address, peerAddress){};
- PortBase(const PortBase & right)
- : InterfaceItemBase(right) {};
+class PortBase: public InterfaceItemBase {
- virtual ~PortBase();
+public:
+ virtual ~PortBase() {}
- virtual void send(int evtID);
+protected:
+ PortBase(IInterfaceItemOwner* owner, const std::string& name, int localId) :
+ InterfaceItemBase(owner, name, localId, 0) {
+ }
+ PortBase(IInterfaceItemOwner* owner, const std::string& name, int localId, int idx) :
+ InterfaceItemBase(owner, name, localId, idx) {
+ }
private:
- PortBase();
- PortBase & operator = (const PortBase& right);
+
+ PortBase(PortBase const&);
+ PortBase & operator =(PortBase const&);
};
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/RTSystem.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/RTSystem.h
new file mode 100644
index 000000000..4dbae420c
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/RTSystem.h
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2013 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:
+ * Juergen Haug (initial contribution)
+ *
+ *******************************************************************************/
+#ifndef SRC_COMMON_MODELBASE_RTSYSTEM_H_
+#define SRC_COMMON_MODELBASE_RTSYSTEM_H_
+
+#include "common/messaging/RTObject.h"
+#include <string>
+
+namespace etRuntime {
+
+class RTSystem: public RTObject {
+
+public:
+ explicit RTSystem(std::string name) :
+ RTObject(0, name) {
+ }
+ virtual ~RTSystem() {}
+
+private:
+ RTSystem();
+ RTSystem(RTSystem const&);
+ RTSystem& operator=(RTSystem const&);
+
+};
+
+} // namespace etRuntime
+
+#endif /* SRC_COMMON_MODELBASE_RTSYSTEM_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/RTSystemProtocol.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/RTSystemProtocol.cpp
new file mode 100644
index 000000000..91eb0e865
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/RTSystemProtocol.cpp
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2013 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:
+ * Juergen Haug (initial contribution)
+ *
+ *******************************************************************************/
+
+#include "common/modelbase/IEventReceiver.h"
+#include "common/modelbase/RTSystemProtocol.h"
+#include <string>
+
+namespace etRuntime {
+
+const std::string RTSystemProtocol::RT_SYSTEM_PORT_NAME = "RTSystemPort";
+
+RTSystemPort::RTSystemPort(IInterfaceItemOwner* actor, int localId) :
+ RTSystemServicesProtocolPort(actor, RTSystemProtocol::RT_SYSTEM_PORT_NAME, localId) {
+
+ // since we have no mapping for the system ports we connect them directly here
+ IReplicatedInterfaceItem* systemPort = actor->getSystemPort();
+ if (systemPort != 0) {
+ InterfaceItemBase* peer = systemPort->createSubInterfaceItem();
+ connectWith(peer);
+ }
+}
+
+RTSystemConjPort::RTSystemConjPort(IInterfaceItemOwner* actor, int localId) :
+ RTSystemServicesProtocolConjReplPort(actor, RTSystemProtocol::RT_SYSTEM_PORT_NAME, localId) {
+}
+
+InterfaceItemBase* RTSystemConjPort::createInterfaceItem(IInterfaceItemOwner* rcv, const std::string& name, int lid, int idx) {
+ return new RTSystemConjSubPort(rcv, name, lid, idx);
+}
+
+RTSystemConjSubPort::RTSystemConjSubPort(IInterfaceItemOwner* actor, const std::string& name, int localId, int idx) :
+ RTSystemServicesProtocolConjPort(actor, name, localId, idx) {
+}
+
+} // namespace etRuntime
+
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/RTSystemProtocol.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/RTSystemProtocol.h
new file mode 100644
index 000000000..61f0b8665
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/RTSystemProtocol.h
@@ -0,0 +1,62 @@
+/*
+ * RTSystemProtocol.h
+ *
+ * Created on: 09.12.2015
+ * Author: Juergen
+ */
+
+#ifndef SRC_COMMON_MESSAGING_RTSYSTEMPROTOCOL_H_
+#define SRC_COMMON_MESSAGING_RTSYSTEMPROTOCOL_H_
+
+#include "common/modelbase/RTSystemServicesProtocol.h"
+#include <string>
+
+namespace etRuntime {
+
+class RTSystemProtocol {
+public:
+ static const std::string RT_SYSTEM_PORT_NAME;
+};
+
+
+class RTSystemPort: public RTSystemServicesProtocolPort {
+
+public:
+ RTSystemPort(IInterfaceItemOwner* actor, int localId);
+
+private:
+ RTSystemPort();
+ RTSystemPort(RTSystemPort const&);
+ RTSystemPort& operator=(RTSystemPort const&);
+
+};
+
+class RTSystemConjPort: public RTSystemServicesProtocolConjReplPort {
+public:
+ RTSystemConjPort(IInterfaceItemOwner* actor, int localId);
+ virtual ~RTSystemConjPort() {}
+
+protected:
+ virtual InterfaceItemBase* createInterfaceItem(IInterfaceItemOwner* rcv, const std::string& name, int lid, int idx);
+
+private:
+ RTSystemConjPort();
+ RTSystemConjPort(RTSystemConjPort const&);
+ RTSystemConjPort& operator=(RTSystemConjPort const&);
+};
+
+class RTSystemConjSubPort: public RTSystemServicesProtocolConjPort {
+public:
+ RTSystemConjSubPort(IInterfaceItemOwner* actor, const std::string& name, int localId, int idx);
+ virtual ~RTSystemConjSubPort() {}
+
+private:
+ RTSystemConjSubPort();
+ RTSystemConjSubPort(RTSystemConjSubPort const&);
+ RTSystemConjSubPort& operator=(RTSystemConjSubPort const&);
+
+};
+
+} /* namespace etRuntime */
+
+#endif /* SRC_COMMON_MESSAGING_RTSYSTEMPROTOCOL_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/ReplicatedInterfaceItemBase.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/ReplicatedInterfaceItemBase.cpp
new file mode 100644
index 000000000..9b716f9c4
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/ReplicatedInterfaceItemBase.cpp
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2013 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:
+ * Juergen Haug (initial contribution)
+ *
+ *******************************************************************************/
+
+#include "common/messaging/RTObject.h"
+#include "common/modelbase/IEventReceiver.h"
+#include "common/modelbase/ReplicatedInterfaceItemBase.h"
+#include <iterator>
+#include <queue>
+#include <string>
+#include <vector>
+
+namespace etRuntime {
+
+ReplicatedInterfaceItemBase::ReplicatedInterfaceItemBase(IInterfaceItemOwner* owner, const std::string& name, int localId) :
+ RTObject(owner, name),
+ m_localId(localId),
+ m_items(),
+ m_releasedIndices() {
+
+}
+
+InterfaceItemBase* ReplicatedInterfaceItemBase::createSubInterfaceItem() {
+ int newIndex = getFreeIndex();
+ std::stringstream itemName;
+ itemName << getName() << SEP << newIndex;
+
+ InterfaceItemBase* item = createInterfaceItem(this, itemName.str(), m_localId, newIndex);
+ m_items.push_back(item);
+ return item;
+}
+
+void ReplicatedInterfaceItemBase::removeItem(InterfaceItemBase& item) {
+ std::vector<InterfaceItemBase*>::iterator it = m_items.begin();
+ while (it != m_items.end() && *it != &item) {
+ ++it;
+ }
+ if (it != m_items.end()) {
+ m_items.erase(it);
+ m_releasedIndices.push(item.getIdx());
+ }
+}
+
+int ReplicatedInterfaceItemBase::getFreeIndex() {
+ if (m_releasedIndices.empty())
+ return m_items.size();
+ else {
+ int idx = m_releasedIndices.front();
+ m_releasedIndices.pop();
+
+ return idx;
+ }
+}
+
+InterfaceItemBase* ReplicatedInterfaceItemBase::getInterfaceItem(int idx) const {
+ for (std::vector<InterfaceItemBase*>::const_iterator it = m_items.begin(); it != m_items.end(); ++it) {
+ if ((*it)->getIdx() == idx)
+ return *it;
+ }
+
+ return 0;
+}
+
+IEventReceiver* ReplicatedInterfaceItemBase::getEventReceiver() const {
+ return dynamic_cast<IEventReceiver*>(getParent());
+}
+
+IReplicatedInterfaceItem* ReplicatedInterfaceItemBase::getSystemPort() const {
+ return dynamic_cast<IInterfaceItemOwner*>(getParent())->getSystemPort();
+}
+
+std::string ReplicatedInterfaceItemBase::toString() const {
+ return "replicated port " + getName();
+}
+
+IInterfaceItem* ReplicatedInterfaceItemBase::connectWith(IInterfaceItem* peer) {
+ // TODO JH dynamic
+// if (peer instanceof InterfaceItemBroker)
+// return peer.connectWith(this);
+// else
+ return peer->connectWith(createSubInterfaceItem());
+}
+
+} // namespace etRuntime
+
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/ReplicatedInterfaceItemBase.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/ReplicatedInterfaceItemBase.h
new file mode 100644
index 000000000..e1460d13e
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/ReplicatedInterfaceItemBase.h
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2013 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:
+ * Juergen Haug (initial contribution)
+ *
+ *******************************************************************************/
+#ifndef SRC_COMMON_MODELBASE_REPLICATEDINTERFACEITEMBASE_H_
+#define SRC_COMMON_MODELBASE_REPLICATEDINTERFACEITEMBASE_H_
+
+#include "common/modelbase/IInterfaceItemOwner.h"
+#include "common/modelbase/InterfaceItemBase.h"
+#include "common/modelbase/IReplicatedInterfaceItem.h"
+#include <queue>
+#include <string>
+#include <vector>
+
+namespace etRuntime {
+
+class ReplicatedInterfaceItemBase: public RTObject,
+ public virtual IReplicatedInterfaceItem,
+ public virtual IInterfaceItemOwner {
+
+public:
+ static const char SEP = ':';
+
+ virtual ~ReplicatedInterfaceItemBase(){}
+
+ virtual InterfaceItemBase* createSubInterfaceItem();
+ virtual void removeItem(InterfaceItemBase& item);
+
+ InterfaceItemBase* getInterfaceItem(int idx) const;
+ int getNInterfaceItems() const {
+ return m_items.size();
+ }
+
+ int getLocalId() const {
+ return m_localId;
+ }
+
+ virtual IEventReceiver* getEventReceiver() const;
+ virtual IReplicatedInterfaceItem* getSystemPort() const;
+
+ std::string toString() const;
+
+ virtual IInterfaceItem* connectWith(IInterfaceItem* peer);
+
+protected:
+
+ ReplicatedInterfaceItemBase(IInterfaceItemOwner* owner, const std::string& name, int localId);
+
+ std::vector<InterfaceItemBase*>& getItems() {
+ return m_items;
+ }
+
+ virtual InterfaceItemBase* createInterfaceItem(IInterfaceItemOwner* rcv, const std::string& name, int lid, int idx) = 0;
+private:
+ int m_localId;
+ std::vector<InterfaceItemBase*> m_items;
+ std::queue<int> m_releasedIndices;
+
+ int getFreeIndex();
+
+ ReplicatedInterfaceItemBase();
+ ReplicatedInterfaceItemBase(ReplicatedInterfaceItemBase const&);
+ ReplicatedInterfaceItemBase& operator=(ReplicatedInterfaceItemBase const&);
+};
+
+} // namespace etRuntime
+
+#endif /* SRC_COMMON_MODELBASE_REPLICATEDINTERFACEITEMBASE_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/ReplicatedPortBase.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/ReplicatedPortBase.h
new file mode 100644
index 000000000..a3975093a
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/ReplicatedPortBase.h
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2013 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:
+ * Juergen Haug (initial contribution)
+ *
+ *******************************************************************************/
+#ifndef SRC_COMMON_MODELBASE_REPLICATEDPORTBASE_H_
+#define SRC_COMMON_MODELBASE_REPLICATEDPORTBASE_H_
+
+#include "common/modelbase/ReplicatedInterfaceItemBase.h"
+#include <string>
+
+namespace etRuntime {
+
+class ReplicatedPortBase: public ReplicatedInterfaceItemBase {
+public:
+ virtual ~ReplicatedPortBase() {}
+
+protected:
+ ReplicatedPortBase(IInterfaceItemOwner* owner, const std::string& name, int localId) :
+ ReplicatedInterfaceItemBase(owner, name, localId) {
+ }
+
+private:
+
+ ReplicatedPortBase();
+ ReplicatedPortBase(ReplicatedPortBase const&);
+ ReplicatedPortBase& operator=(ReplicatedPortBase const&);
+};
+
+} // namespace etRuntime
+
+#endif /* SRC_COMMON_MODELBASE_REPLICATEDPORTBASE_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/SubSystemClassBase.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/SubSystemClassBase.cpp
index 550dba3dc..d627a2fac 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/SubSystemClassBase.cpp
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/SubSystemClassBase.cpp
@@ -10,31 +10,28 @@
*
*******************************************************************************/
-#include "SubSystemClassBase.h"
-#include "common/messaging/MessageService.h"
-#include "common/messaging/RTServices.h"
-#include "ActorClassBase.h"
+#include "common/modelbase/SubSystemClassBase.h"
#include "common/debugging/DebuggingService.h"
+#include "common/debugging/MSCLogger.h"
+#include "common/messaging/MessageServiceController.h"
+#include "common/messaging/RTServices.h"
+#include "common/modelbase/ActorClassBase.h"
+#include <iostream>
+#include <iterator>
+#include <map>
+#include <string>
+#include <vector>
-namespace etRuntime {
-SubSystemClassBase::~SubSystemClassBase() {
- m_testSem = 0;
- m_RTSystemPort = 0;
-}
+namespace etRuntime {
-SubSystemClassBase::SubSystemClassBase(IRTObject* parent, std::string name)
- : RTObject(parent, name),
- IEventReceiver(),
- m_RTSystemPort(0),
- m_instances(),
- m_testSem(0),
- m_testErrorCode(0)
-{
- DebuggingService::getInstance().getAsyncLogger().setMSC(name + "_Async", "");
+SubSystemClassBase::SubSystemClassBase(IRTObject* parent, std::string name) :
+ RTObject(parent, name),
+ m_RTSystemPort(this, IFITEM_RTSystemPort) {
+ DebuggingService::getInstance().getAsyncLogger().setMSC(name + "_Async", "log/");
DebuggingService::getInstance().getAsyncLogger().open();
- DebuggingService::getInstance().getSyncLogger().setMSC(name + "_Sync", "");
+ DebuggingService::getInstance().getSyncLogger().setMSC(name + "_Sync", "log/");
DebuggingService::getInstance().getSyncLogger().open();
RTServices::getInstance().setSubSystem(this);
@@ -53,46 +50,44 @@ void SubSystemClassBase::init() {
// RTServices::getInstance().getMsgSvcCtrl().connectAll();
instantiateActors();
+ std::cout << toStringRecursive() << std::endl;
- // initialize all actor m_instances
- for (unsigned int i = 0; i < m_instances.size(); i++) {
- m_instances[i]->init();
+ // initialize all actor instances
+ for (std::vector<IRTObject*>::iterator it = getChildren().begin(); it != getChildren().end(); ++it) {
+ ActorClassBase* child = dynamic_cast<ActorClassBase*>(*it);
+ if (child != 0)
+ child->init();
}
}
-void SubSystemClassBase::start(bool singlethreaded) {
+void SubSystemClassBase::start() {
// start all actors instances
- m_RTSystemPort->executeInitialTransition();
+ m_RTSystemPort.executeInitialTransition();
// start all message services
- RTServices::getInstance().getMsgSvcCtrl().start(singlethreaded);
+ RTServices::getInstance().getMsgSvcCtrl().start();
}
-void SubSystemClassBase::stop(bool singlethreaded) {
- std::cout << "*** MainComponent " << this->getInstancePath() << "::stop ***" << std::endl;
+void SubSystemClassBase::stop() {
+ std::cout << "*** MainComponent " << getInstancePath() << "::stop ***" << std::endl;
- RTServices::getInstance().getMsgSvcCtrl().stop(singlethreaded);
+ RTServices::getInstance().getMsgSvcCtrl().stop();
std::cout << "=== done stop MsgSvcCtrl" << std::endl;
// stop all actor instances
- for (unsigned int i = 0; i < m_instances.size(); i++) {
- m_instances[i]->stop();
+ for (std::vector<IRTObject*>::iterator it = getChildren().begin(); it != getChildren().end(); ++it) {
+ ActorClassBase* child = dynamic_cast<ActorClassBase*>(*it);
+ if (child != 0)
+ child->stop();
}
std::cout << "=== done stop actor instances" << std::endl;
}
-void SubSystemClassBase::runOnce() {
- // run all message services one time
- RTServices::getInstance().getMsgSvcCtrl().runOnce();
-
-}
-
void SubSystemClassBase::destroy() {
std::cout << "*** MainComponent " << this->getInstancePath() << "::destroy ***" << std::endl;
- for (unsigned int i = 0; i < m_instances.size(); i++) {
- m_instances[i]->destroy();
- }
+ RTObject::destroy();
+ std::cout << toStringRecursive() << std::endl;
std::cout << "=== done destroy actor instances" << std::endl;
DebuggingService::getInstance().getAsyncLogger().close();
@@ -103,57 +98,31 @@ void SubSystemClassBase::destroy() {
std::cout << "=== done destroy RTServices\n\n\n" << std::endl;
}
-MessageService* SubSystemClassBase::getMsgService(int idx) const {
+IMessageService* SubSystemClassBase::getMsgService(int idx) const {
return RTServices::getInstance().getMsgSvcCtrl().getMsgSvc(idx);
}
-ActorClassBase* SubSystemClassBase::getInstance(unsigned int i) {
- if (i < 0 || i >= m_instances.size())
- return 0;
+ActorClassBase* SubSystemClassBase::getInstance(const std::string& path) const {
+ IRTObject* object = getObject(path);
- return m_instances[i];
+ return dynamic_cast<ActorClassBase*>(object);
}
-ActorClassBase* SubSystemClassBase::getInstance(std::string path) {
- for (unsigned int i = 0; i < m_instances.size(); i++) {
- if (m_instances[i]->getInstancePath() == path)
- return m_instances[i];
- }
-
- return 0;
+void SubSystemClassBase::addPathToThread(const std::string& path, int thread) {
+ m_path2thread[path] = thread;
}
-// this is to run integration tests
-// TODO synchronized
-void SubSystemClassBase::setTestSemaphore(TestSemaphore& sem) {
- m_testErrorCode = -1;
- m_testSem = &sem;
-}
+int SubSystemClassBase::getThreadForPath(const std::string& path) const {
+ std::map<std::string, int> ::const_iterator it = m_path2thread.find(path);
+ if (it == m_path2thread.end())
+ return -1;
-//TODO synchronized
-int SubSystemClassBase::getTestErrorCode() const {
- return m_testErrorCode;
+ return it->second;
}
-void SubSystemClassBase::testFinished(int errorCode) {
- if (m_testSem != 0) {
- std::cout
- << "org.eclipse.etrice.runtime.cpp.modelbase.SubSystemClassBase.testFinished(int): before releasing semaphore"
- << std::endl;
- //m_testSem.printWaitingThreads();
- //TODO synchronized (this) {
- m_testErrorCode = errorCode;
- m_testSem->give();
- //}
- std::cout
- << "org.eclipse.etrice.runtime.cpp.modelbase.SubSystemClassBase.testFinished(int): semaphore released"
- << std::endl;
- //m_testSem.printWaitingThreads();
- //TODO
- //Thread.yield();
- }
+void SubSystemClassBase::resetAll() {
+ m_path2thread.clear();
}
-
} /* namespace etRuntime */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/SubSystemClassBase.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/SubSystemClassBase.h
index ed5c8522b..bc80bede3 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/SubSystemClassBase.h
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/SubSystemClassBase.h
@@ -13,60 +13,74 @@
#ifndef SUBSYSTEMCLASSBASE_H_
#define SUBSYSTEMCLASSBASE_H_
-#include "common/messaging/RTSystemServicesProtocol.h"
-#include "common/messaging/IRTObject.h"
-#include "common/debugging/MSCLogger.h"
-#include "common/modelbase/TestSemaphore.h"
+#include "common/modelbase/IEventReceiver.h"
+#include "common/modelbase/IInterfaceItemOwner.h"
+#include "common/modelbase/IReplicatedInterfaceItem.h"
+#include "common/modelbase/RTSystemProtocol.h"
+#include "etDatatypes.h"
+#include <map>
#include <string>
-#include <vector>
-#include <iostream>
+
namespace etRuntime {
-class MessageService;
class ActorClassBase;
-class SubSystemClassBase: public RTObject, public IEventReceiver {
+class SubSystemClassBase: public RTObject, public virtual IEventReceiver, public virtual IInterfaceItemOwner {
public:
- SubSystemClassBase(IRTObject* parent, std::string name);
- virtual ~SubSystemClassBase();
+ virtual ~SubSystemClassBase() {}
- void init();
+ virtual void init();
virtual void instantiateMessageServices() = 0;
virtual void instantiateActors() = 0;
- void start(bool singlethreaded);
- void stop(bool singlethreaded);
- void runOnce();
+ void start();
+ void stop();
+ virtual void destroy();
+
+ IMessageService* getMsgService(int idx) const;
+ Address getFreeAddress(int msgSvcId) const;
+
+ ActorClassBase* getInstance(const std::string& path) const;
+
+ void addPathToThread(const std::string& path, int thread);
+ int getThreadForPath(const std::string& path) const;
+
+ void resetAll();
- void destroy();
+ virtual IEventReceiver* getEventReceiver() const {
+ return const_cast<SubSystemClassBase*>(this);
+ }
- MessageService* getMsgService(int idx) const;
+ virtual int getThread() {
+ return 0;
+ }
- ActorClassBase* getInstance(unsigned int i);
- ActorClassBase* getInstance(std::string path);
+ virtual IReplicatedInterfaceItem* getSystemPort() const {
+ return const_cast<RTSystemConjPort*>(&m_RTSystemPort);
+ }
- //---------------------------------------------
- // this is to run integration tests
- //---------------------------------------------
- // TODO synchronized
- void setTestSemaphore(TestSemaphore& sem);
- //TODO synchronized
- int getTestErrorCode() const;
- void testFinished(int errorCode);
+ virtual etBool hasGeneratedMSCInstrumentation() const {
+ return false;
+ }
protected:
- RTSystemServicesProtocolConjPortRepl* m_RTSystemPort;
+
+ SubSystemClassBase(IRTObject* parent, std::string name);
+
+ //--------------------- ports
+ RTSystemConjPort m_RTSystemPort;
+
//--------------------- interface item IDs
static const int IFITEM_RTSystemPort = 0;
- std::vector<ActorClassBase*> m_instances;
+
private:
- TestSemaphore* m_testSem;
- int m_testErrorCode;
+
+ std::map<std::string, int> m_path2thread;
SubSystemClassBase();
- SubSystemClassBase(const SubSystemClassBase& right);
- SubSystemClassBase& operator=(const SubSystemClassBase& right);
+ SubSystemClassBase(SubSystemClassBase const&);
+ SubSystemClassBase& operator=(SubSystemClassBase const&);
};
} /* namespace etRuntime */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/SubSystemRunnerBase.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/SubSystemRunnerBase.cpp
index 9348c0d84..931527644 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/SubSystemRunnerBase.cpp
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/SubSystemRunnerBase.cpp
@@ -10,114 +10,82 @@
*
*******************************************************************************/
-#include "common/modelbase/SubSystemRunnerBase.h"
+#include "SubSystemRunnerBase.h"
+
#include "common/modelbase/SubSystemClassBase.h"
-#include "common/platform/etTimer.h"
-#include <unistd.h>
+#include "runtime/etRuntime.h"
+#include "etUnit/etUnit.h"
#include <iostream>
#include <sstream>
+#include <cstring>
namespace etRuntime {
const std::string SubSystemRunnerBase::OPTION_RUN_AS_TEST = "-run_as_test";
-const std::string SubSystemRunnerBase::OPTION_RUN_AS_TEST_SINGLETHREADED = "-run_as_test_single_threaded";
-const std::string SubSystemRunnerBase::OPTION_RUN_SINGLETHREADED = "-run_single_threaded";
-
-TestSemaphore SubSystemRunnerBase::s_testSem;
-
-SubSystemRunnerBase::SubSystemRunnerBase() {
-}
-
-SubSystemRunnerBase::~SubSystemRunnerBase() {
-}
+const std::string SubSystemRunnerBase::OPTION_RUN_HEADLESS = "-headless";
-void SubSystemRunnerBase::run(SubSystemClassBase& mainComponent, int argc, char* argv[] ) {
-
- //etUserEntry(); /* platform specific */
+void SubSystemRunnerBase::run(SubSystemClassBase& main_component, int argc, char* argv[]) {
std::cout << "*** T H E B E G I N ***" << std::endl;
- bool test = false;
- bool singleThreaded = false;
- int cycles = 100;
-
- for (int i=1; i<argc; ++i) { // omit first argument, which is the program name
- if (SubSystemRunnerBase::OPTION_RUN_AS_TEST.compare(argv[i]) == 0) {
+ etBool headless = false;
+ for (int i = 1; i < argc; ++i) { // omit first argument, which is the program name
+ if (OPTION_RUN_AS_TEST.compare(argv[i]) == 0) {
std::cout << "*** running as test" << std::endl;
- test = true;
- }
- else if (SubSystemRunnerBase::OPTION_RUN_AS_TEST_SINGLETHREADED.compare(argv[i]) == 0) {
-
- singleThreaded = true;
- i++;
- if (i < argc) {
- std::stringstream sstr(argv[i]);
- sstr >> cycles;
- }
- std::cout << "*** running as test singlethreaded " << cycles << " cycles" << std::endl;
- }
- else if (SubSystemRunnerBase::OPTION_RUN_SINGLETHREADED.compare(argv[i]) == 0) {
-
- singleThreaded = true;
- i++;
- if (i < argc) {
- std::stringstream sstr(argv[i]);
- sstr >> cycles;
- }
- std::cout << "*** running singlethreaded " << cycles << " cycles" << std::endl;
- }
- else {
- std::cout << "*** running multithreaded" << std::endl;
+ headless = true;
+ } else if (OPTION_RUN_HEADLESS.compare(argv[i]) == 0) {
+ std::cout << "*** running headless" << std::endl;
+ headless = true;
}
}
- if (test)
- mainComponent.setTestSemaphore(s_testSem);
-
- mainComponent.init(); // lifecycle init
- mainComponent.start(singleThreaded); // lifecycle start
+ main_component.init(); // lifecycle init
+ main_component.start(); // lifecycle start
// application runs until quit
- if (test) {
- waitForTestcase();
- }
- else if (singleThreaded){
- waitAndPollSingleThreaded(mainComponent, cycles);
- }
- else {
- waitForQuitMultiThreaded();
- }
+ if (headless)
+ waitForTerminate();
+ else
+ waitForQuit();
+
// end the lifecycle
- mainComponent.stop(singleThreaded); // lifecycle stop
- mainComponent.destroy(); // lifecycle destroy
+ main_component.stop(); // lifecycle stop
+ main_component.destroy(); // lifecycle destroy
std::cout << "*** T H E E N D ***" << std::endl;
- //etUserExit(); /* platform specific */
-}
-
-void SubSystemRunnerBase::waitForTestcase() {
- //std::cout << "=== waitForTestcase: before acq. semaphore, thread " << Thread.currentThread().getName() << std::endl;
- s_testSem.take();
- //std::cout << "=== waitForTestcase: after acq. semaphore, thread " << Thread.currentThread().getName() << std::endl;
}
-void SubSystemRunnerBase::waitForQuitMultiThreaded() {
+void SubSystemRunnerBase::waitForQuit() {
// waiting for command line input
- std::string token = "";
- std::cout << "type 'quit' to exit" << std::endl;
- while (token != "quit") {
- std::getline(std::cin, token);
- std::cout << "echo: " << token << std::endl;
+// std::cout << "waitForQuit 30sec" << std::endl;
+// Sleep(30000);
+// std::cout << "return from waitForQuit" << std::endl;
+
+ printf("type quit to exit\n");
+ fflush(stdout);
+ while (ET_TRUE) {
+ char line[64];
+
+ if (fgets(line, 64, stdin) != NULL) {
+ if (strncmp(line, "quit", 4)==0)
+ break;
+ }
}
+
+ // not thread safe ??
+// std::string token;
+// std::cout << "type 'quit' to exit" << std::endl;
+// while (token != "quit") {
+// std::getline(std::cin, token);
+// //std::cout << "echo: " << token << std::endl;
+// }
}
-void SubSystemRunnerBase::waitAndPollSingleThreaded(SubSystemClassBase& mainComponent, int cycles) {
- for (int i=0; i< cycles; ++i) {
- if (etTimer_executeNeeded()) {
- mainComponent.runOnce();
- }
- usleep(100000);
- }
+void SubSystemRunnerBase::waitForTerminate() {
+ std::cout << "=== waitForTestcase: before acq. semaphore" << std::endl;
+ etSema_waitForWakeup(etRuntime_getTerminateSemaphore());
+ std::cout << "=== waitForTestcase: after acq. semaphore" << std::endl;
}
+
} /* namespace etRuntime */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/SubSystemRunnerBase.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/SubSystemRunnerBase.h
index 971c38cdf..156f1d096 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/SubSystemRunnerBase.h
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/SubSystemRunnerBase.h
@@ -13,9 +13,7 @@
#ifndef SUBSYSTEMRUNNERBASE_H_
#define SUBSYSTEMRUNNERBASE_H_
-#include <iostream>
#include <string>
-#include "common/modelbase/TestSemaphore.h"
namespace etRuntime {
@@ -24,22 +22,22 @@ class SubSystemClassBase;
class SubSystemRunnerBase {
public:
SubSystemRunnerBase();
- ~SubSystemRunnerBase();
- static void run(SubSystemClassBase& mainComponent, int argc, char* argv[] );
+ virtual ~SubSystemRunnerBase() {}
+ static void run(SubSystemClassBase& mainComponent, int argc, char* argv[]);
+ static void waitForTerminate();
protected:
/**
* blocks until the String "quit" is entered on the console
*/
- static void waitForTestcase();
- static TestSemaphore s_testSem;
+ static void waitForQuit();
private:
static const std::string OPTION_RUN_AS_TEST;
- static const std::string OPTION_RUN_AS_TEST_SINGLETHREADED;
- static const std::string OPTION_RUN_SINGLETHREADED;
- static void waitForQuitMultiThreaded();
- static void waitAndPollSingleThreaded(SubSystemClassBase& mainComponent, int cycles);
+ static const std::string OPTION_RUN_HEADLESS;
+
+ SubSystemRunnerBase(SubSystemRunnerBase const&);
+ SubSystemRunnerBase& operator=(SubSystemRunnerBase const&);
};
} /* namespace etRuntime */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/SystemPortOwner.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/SystemPortOwner.h
new file mode 100644
index 000000000..4cd43f9a6
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/SystemPortOwner.h
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2013 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:
+ * Juergen Haug (initial contribution)
+ *
+ *******************************************************************************/
+#ifndef SRC_COMMON_MODELBASE_SYSTEMPORTOWNER_H_
+#define SRC_COMMON_MODELBASE_SYSTEMPORTOWNER_H_
+
+#include "common/messaging/RTObject.h"
+#include "common/modelbase/EventReceiver.h"
+#include "common/modelbase/IInterfaceItemOwner.h"
+#include <string>
+
+namespace etRuntime {
+
+class IReplicatedInterfaceItem;
+
+class SystemPortOwner: public EventReceiver, public virtual IInterfaceItemOwner {
+public:
+ virtual ~SystemPortOwner() {}
+
+ virtual IEventReceiver* getEventReceiver() const {
+ return const_cast<SystemPortOwner*>(this);
+ }
+
+ virtual IReplicatedInterfaceItem* getSystemPort() const {
+ IInterfaceItemOwner* parent = dynamic_cast<IInterfaceItemOwner*>(getParent());
+ if (parent != 0) {
+ return parent->getSystemPort();
+ }
+
+ return 0;
+ }
+
+protected:
+ SystemPortOwner(IRTObject* parent, const std::string& name) :
+ EventReceiver(parent, name) {
+ }
+
+private:
+ SystemPortOwner();
+ SystemPortOwner(SystemPortOwner const&);
+ SystemPortOwner& operator=(SystemPortOwner const&);
+
+};
+
+} /* namespace etRuntime */
+#endif /* SRC_COMMON_MODELBASE_SYSTEMPORTOWNER_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/TestSemaphore.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/TestSemaphore.cpp
deleted file mode 100644
index 99a43383f..000000000
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/TestSemaphore.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 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)
- *
- *******************************************************************************/
-
-#include "TestSemaphore.h"
-
-namespace etRuntime {
-
-
-TestSemaphore::~TestSemaphore() {
- sem_destroy(&m_sem);
-}
-
-void TestSemaphore::printWaitingThreads() {
- std::cout << ">>> begin semaphore info >>>" << std::endl;
- int value;
- sem_getvalue(&m_sem, &value);
- std::cout << "value of the semaphore:" << value << std::endl;
-// std::cout << "current thread is " + Thread.currentThread().getName() << std::endl;
-// Collection < Thread > threads = getQueuedThreads();
-// if (threads.isEmpty())
-// std::cout << " no waiting threads" << std::endl;
-// else
-// for (Thread thread : threads) {
-// std::cout << " blocked: " << thread.getName() << std::endl;
-// }
- std::cout << "<<< end semaphore info <<<" << std::endl;
-}
-
-} /* namespace etRuntime */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/TestSemaphore.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/TestSemaphore.h
deleted file mode 100644
index b65ba9dee..000000000
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/modelbase/TestSemaphore.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 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)
- *
- *******************************************************************************/
-
-#ifndef TESTSEMAPHORE_H_
-#define TESTSEMAPHORE_H_
-
-#include <iostream>
-#include <semaphore.h>
-
-namespace etRuntime {
-
-class TestSemaphore { //extends Semaphore
-public:
- TestSemaphore(int permits = 1)
- : m_sem()
- {
- sem_init(&m_sem, 0, permits);
- }
-
- virtual ~TestSemaphore();
-
- void give() { sem_post(&m_sem); };
- void take() { sem_wait(&m_sem); };
-
- void printWaitingThreads();
-
-private:
- sem_t m_sem;
-
- TestSemaphore(const TestSemaphore& right);
- TestSemaphore& operator=(const TestSemaphore& right);
-
-};
-
-} /* namespace etRuntime */
-#endif /* TESTSEMAPHORE_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/platform/etTimer.h b/runtime/org.eclipse.etrice.runtime.cpp/src/common/platform/etTimer.h
deleted file mode 100644
index 449c5588a..000000000
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/platform/etTimer.h
+++ /dev/null
@@ -1,46 +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:
- * Thomas Jung (initial contribution)
- *
- *******************************************************************************/
-
-#ifndef _ETTIMER_H_
-#define _ETTIMER_H_
-
-#include "etDatatypes.h"
-
-typedef struct etTargetTime {
- unsigned long nSec;
- unsigned long sec;
-} etTargetTime_t;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-void etTimer_init(void);
-
-uint32 getNSecFromTarget(void);
-uint32 getSecFromTarget(void);
-
-void getTimeFromTarget(etTargetTime_t *t);
-
-int isTimeGreaterThanActualTime(const etTargetTime_t *t);
-
-etBool etTimer_executeNeeded(void);
-
-uint32 getTimeBaseNS(void);
-
-uint32 getTimeBaseUS(void);
-
-uint32 getTimeBaseMS(void);
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __ETTIMER_H__ */
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/platforms/generic/etDatatypes.h b/runtime/org.eclipse.etrice.runtime.cpp/src/platforms/generic/etDatatypes.h
deleted file mode 100644
index 5501bce8f..000000000
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/platforms/generic/etDatatypes.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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:
- * Thomas Schuetz (initial contribution)
- *
- *******************************************************************************/
-
-#ifndef _ETDATATYPES_H_
-#define _ETDATATYPES_H_
-
-/*
- * typedefs for platform specific datatypes
- * generic Version for most bigger 32 and 64 bit platforms like Linux an Windows
- *
- * */
-
-#include <stdio.h>
-
-/* unsigned integer datatypes */
-typedef unsigned char uint8;
-typedef unsigned short int uint16;
-typedef unsigned long uint32;
-typedef unsigned long long uint64;
-
-/* signed integer datatypes */
-typedef char int8;
-typedef short int int16;
-typedef long int32;
-typedef long long int64;
-
-
-/* float datatypes */
-typedef float float32;
-typedef double float64;
-
-/* boolean datatypes and values */
-
-#ifndef __cplusplus
-typedef char bool; /* TODO: bool, Bool, Boolean, and boolean are already defined in some platforms*/
-#endif /* __cplusplus */
-
-//typedef bool boolean;
-#ifndef ET_TRUE
- #define ET_TRUE 1
-#endif
-#ifndef ET_FALSE
- #define ET_FALSE 0
-#endif
-
-/*
- * typedefs for eTrice Runtime and Testing
- *
- * */
-
-typedef int8 etInt8;
-typedef int16 etInt16;
-typedef int32 etInt32;
-
-typedef uint8 etUInt8;
-typedef uint16 etUInt16;
-typedef uint32 etUInt32;
-
-typedef bool etBool;
-
-typedef float32 etFloat32;
-typedef float64 etFloat64;
-
-typedef FILE* etFileHandle;
-
-typedef int8 etAddressId;
-
-#endif /* _DATATYPES_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.java/gen_runtime.launch b/runtime/org.eclipse.etrice.runtime.java/gen_runtime.launch
new file mode 100644
index 000000000..df42cc548
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.java/gen_runtime.launch
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.etrice.generator.launch.java.launchConfigurationType">
+<booleanAttribute key="DataLogging" value="false"/>
+<booleanAttribute key="Debug" value="false"/>
+<booleanAttribute key="GenDocumentation" value="false"/>
+<booleanAttribute key="GenInstanceDiagram" value="false"/>
+<stringAttribute key="GenModelPath" value=""/>
+<booleanAttribute key="Lib" value="true"/>
+<booleanAttribute key="MSC" value="true"/>
+<listAttribute key="ModelFiles">
+<listEntry value="${workspace_loc:/org.eclipse.etrice.runtime.java/models/SystemServices.room}"/>
+</listAttribute>
+<booleanAttribute key="OverrideDirectories" value="false"/>
+<booleanAttribute key="SaveGenModel" value="false"/>
+<booleanAttribute key="UseTranslation" value="true"/>
+<booleanAttribute key="Verbose" value="false"/>
+<booleanAttribute key="etUnit" value="false"/>
+</launchConfiguration>
diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/MessageService.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/MessageService.java
index dedc9b461..72d119378 100644
--- a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/MessageService.java
+++ b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/MessageService.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:
* Thomas Schuetz and Henrik Rentz-Reichert (initial contribution)
- *
+ *
*******************************************************************************/
@@ -22,7 +22,7 @@ import java.util.concurrent.TimeUnit;
/**
* The MessageService is the backbone of the asynchronous communication inside a SubSystem
* It usually contains a thread a message queue and a dispatcher
- *
+ *
* @author Thomas Schuetz (initial contribution)
* @author Henrik Rentz-Reichert (extending RTObject, implementing Runnable)
*
@@ -30,22 +30,22 @@ import java.util.concurrent.TimeUnit;
public class MessageService extends AbstractMessageService {
private boolean running = false;
-
+
private Thread thread;
private int priority;
private long lastMessageTimestamp;
-
+
private long pollingInterval = -1;
private ScheduledExecutorService pollingScheduler = null;
public MessageService(IRTObject parent, ExecMode mode, int node, int thread, String name) {
this(parent, mode, 0, node, thread, name, Thread.NORM_PRIORITY);
}
-
+
public MessageService(IRTObject parent, ExecMode mode, long nsec, int node, int thread, String name) {
this(parent, mode, nsec, node, thread, name, Thread.NORM_PRIORITY);
}
-
+
public MessageService(IRTObject parent, ExecMode mode, long nsec, int node, int thread, String name, int priority) {
super(parent, "MessageService_"+name, node, thread);
@@ -54,31 +54,31 @@ public class MessageService extends AbstractMessageService {
// priority = Thread.NORM_PRIORITY generated fixed
this.priority = priority;
- assert priority >= Thread.MIN_PRIORITY : ("priority smaller than Thread.MIN_PRIORITY (" + "Thread.MIN_PRIORITY" + ")");
- assert priority <= Thread.MAX_PRIORITY : ("priority bigger than Thread.MAX_PRIORITY (" + "Thread.MAX_PRIORITY" + ")");
-
+ assert priority >= Thread.MIN_PRIORITY : ("priority smaller than Thread.MIN_PRIORITY (" + "Thread.MIN_PRIORITY" + ")");
+ assert priority <= Thread.MAX_PRIORITY : ("priority bigger than Thread.MAX_PRIORITY (" + "Thread.MAX_PRIORITY" + ")");
+
if(mode == ExecMode.MIXED || mode == ExecMode.POLLED){
pollingInterval = nsec;
pollingScheduler = Executors.newScheduledThreadPool(1, new PollingThreadFactory());
-
+
assert pollingInterval > 0 : ("polling interval is 0 or negative");
}
}
public void run() {
running = true;
-
+
if(pollingScheduler != null)
pollingScheduler.scheduleAtFixedRate(new PollingTask(), pollingInterval, pollingInterval, TimeUnit.NANOSECONDS);
-
+
while (running) {
Message msg = null;
-
+
// get next Message from Queue
synchronized(this) {
msg = getMessageQueue().pop();
}
-
+
if (msg == null) {
// no message in queue -> wait until Thread is notified
try {
@@ -105,11 +105,11 @@ public class MessageService extends AbstractMessageService {
@Override
public synchronized void receive(Message msg) {
super.receive(msg);
-
+
// wake up thread to process message
notifyAll();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.etrice.runtime.java.messaging.AbstractMessageService#getFreeAddress()
*/
@@ -117,7 +117,7 @@ public class MessageService extends AbstractMessageService {
public synchronized Address getFreeAddress() {
return super.getFreeAddress();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.etrice.runtime.java.messaging.AbstractMessageService#addMessageReceiver(org.eclipse.etrice.runtime.java.messaging.IMessageReceiver)
*/
@@ -133,17 +133,17 @@ public class MessageService extends AbstractMessageService {
public synchronized void removeMessageReceiver(IMessageReceiver receiver) {
super.removeMessageReceiver(receiver);
}
-
+
@Override
public synchronized void addPollingMessageReceiver(IMessageReceiver receiver) {
super.addPollingMessageReceiver(receiver);
}
-
+
@Override
public synchronized void removePollingMessageReceiver(IMessageReceiver receiver) {
super.removePollingMessageReceiver(receiver);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.etrice.runtime.java.messaging.AbstractMessageService#freeAddress(org.eclipse.etrice.runtime.java.messaging.Address)
*/
@@ -151,15 +151,15 @@ public class MessageService extends AbstractMessageService {
public synchronized void freeAddress(Address addr) {
super.freeAddress(addr);
}
-
+
public synchronized void terminate() {
+ if(pollingScheduler != null)
+ pollingScheduler.shutdown();
+
if (running) {
running = false;
notifyAll();
}
-
- if(pollingScheduler != null)
- pollingScheduler.shutdown();
}
/* (non-Javadoc)
@@ -167,7 +167,7 @@ public class MessageService extends AbstractMessageService {
*/
public void setThread(Thread thread) {
this.thread = thread;
-
+
thread.setPriority(priority);
}
@@ -181,29 +181,29 @@ public class MessageService extends AbstractMessageService {
protected long getLastMessageTimestamp() {
return lastMessageTimestamp;
}
-
+
private class PollingTask implements Runnable{
-
+
@Override
public void run() {
if(running){
Message msg = new Message(getMessageDispatcher().getAddress());
receive(msg);
- }
+ }
}
-
+
}
-
+
private class PollingThreadFactory implements ThreadFactory{
@Override
public Thread newThread(Runnable arg0) {
Thread thread = new Thread(arg0, getName()+"_PollingThread");
thread.setPriority(priority);
-
+
return thread;
}
-
+
}
}
diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/RTObject.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/RTObject.java
index 39705aeb1..d68ca3e1c 100644
--- a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/RTObject.java
+++ b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/messaging/RTObject.java
@@ -13,7 +13,7 @@ import java.util.ArrayList;
/**
* An implementation of the IRTObject interface using a hierarchical structure
* to assemble paths.
- *
+ *
* @author Henrik Rentz-Reichert
*
*/
@@ -22,23 +22,26 @@ public class RTObject implements IRTObject {
private String name = NO_NAME;
private IRTObject parent = null;
ArrayList<IRTObject> children = new ArrayList<IRTObject>();
-
+
protected RTObject(IRTObject parent, String name){
this.parent = parent;
this.name = name;
-
+
if (parent!=null)
parent.getChildren().add(this);
}
+ @Override
public String getName() {
return name;
}
-
+
+ @Override
public IRTObject getParent() {
return parent;
}
+ @Override
public ArrayList<IRTObject> getChildren() {
return children;
}
@@ -55,37 +58,40 @@ public class RTObject implements IRTObject {
parent = null;
}
}
-
+
+ @Override
public IRTObject getRoot() {
IRTObject root = this;
while (root.getParent()!=null)
root = root.getParent();
-
+
return root;
}
-
+
+ @Override
public IRTObject getChild(String name) {
for (IRTObject child : children) {
if (child.getName().equals(name))
return child;
}
-
+
return null;
}
-
+
+ @Override
public IRTObject getObject(String path) {
boolean isAbsolute = path.charAt(0)==PATH_DELIM;
if (isAbsolute && getParent()!=null)
return getParent().getObject(path);
-
+
if (isAbsolute)
path = path.substring(1);
-
+
String[] segments = path.split(Character.toString(PATH_DELIM));
if (segments.length>0) {
IRTObject current = this;
-
+
String first = segments[0];
for (String segment : segments) {
if (isAbsolute && segment==first) {
@@ -100,23 +106,26 @@ public class RTObject implements IRTObject {
}
return current;
}
-
+
return null;
}
-
+
+ @Override
public String getInstancePath(char delim) {
String path = delim + name;
-
+
if (parent!=null)
path = parent.getInstancePath(delim)+path;
-
+
return path;
}
-
+
+ @Override
public String getInstancePath() {
return getInstancePath(PATH_DELIM);
}
+ @Override
public String getInstancePathName() {
return getInstancePath(PATHNAME_DELIM);
}
@@ -130,10 +139,10 @@ public class RTObject implements IRTObject {
return parent.getThreadForPath(path);
return -1;
}
-
+
private String toStringRecursive(String indent) {
StringBuilder result = new StringBuilder(indent+toString()+"\n");
-
+
indent = " "+indent;
for (IRTObject child : getChildren()) {
if (child instanceof RTObject)
@@ -143,11 +152,11 @@ public class RTObject implements IRTObject {
}
return result.toString();
}
-
+
public String toStringRecursive() {
return toStringRecursive("");
}
-
+
@Override
public String toString() {
return getName();
diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/InterfaceItemBase.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/InterfaceItemBase.java
index df4441621..89d03c66d 100644
--- a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/InterfaceItemBase.java
+++ b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/InterfaceItemBase.java
@@ -18,11 +18,11 @@ import org.eclipse.etrice.runtime.java.messaging.RTServices;
/**
* The abstract base class for actor class interface items like {@link PortBase}
* and {@link InterfaceItemBroker}s.
- *
+ *
* @author Henrik Rentz-Reichert
*/
public abstract class InterfaceItemBase extends AbstractMessageReceiver implements IInterfaceItem {
-
+
/**
* If this is part of an {@link IReplicatedInterfaceItem} then the
* owner of this item is stored in this field.
@@ -30,18 +30,18 @@ public abstract class InterfaceItemBase extends AbstractMessageReceiver implemen
* disconnected then it is also removed from its parent and destroyed.
*/
private IReplicatedInterfaceItem replicator = null;
-
- protected IMessageService ownMsgReceiver;
- protected IMessageReceiver peerMsgReceiver;
+
+ private IMessageService ownMsgReceiver;
+ private IMessageReceiver peerMsgReceiver;
private int localId;
private int idx;
- protected Address peerAddress = null;
+ private Address peerAddress = null;
private IInterfaceItem peer;
/**
* The constructor determines the thread of its {@link IEventReceiver}
- *
+ *
* @param owner
* @param name
* @param localId
@@ -49,20 +49,20 @@ public abstract class InterfaceItemBase extends AbstractMessageReceiver implemen
*/
public InterfaceItemBase (IInterfaceItemOwner owner, String name, int localId, int idx) {
super(owner.getEventReceiver(), name);
-
+
this.localId = localId;
this.idx = idx;
-
+
if (owner instanceof IReplicatedInterfaceItem)
replicator = (IReplicatedInterfaceItem) owner;
-
+
int thread = owner.getEventReceiver().getThread();
if (thread>=0) {
IMessageService msgSvc = RTServices.getInstance().getMsgSvcCtrl().getMsgSvc(thread);
Address addr = msgSvc.getFreeAddress();
setAddress(addr);
msgSvc.addMessageReceiver(this);
-
+
this.ownMsgReceiver = msgSvc;
}
}
@@ -70,30 +70,30 @@ public abstract class InterfaceItemBase extends AbstractMessageReceiver implemen
public synchronized IInterfaceItem connectWith(IInterfaceItem peer) {
if (peer!=null) {
this.peer = peer;
-
+
if (peer instanceof IInterfaceItemBroker) {
this.peer = peer.connectWith(this);
return this.peer;
}
-
+
if (peer instanceof IReplicatedInterfaceItem)
peer = ((IReplicatedInterfaceItem) peer).createSubInterfaceItem();
-
+
if (peer instanceof InterfaceItemBase) {
InterfaceItemBase thePeer = (InterfaceItemBase) peer;
-
+
// connect with each other
peerAddress = thePeer.getAddress();
thePeer.peerAddress = getAddress();
this.peerMsgReceiver = thePeer.ownMsgReceiver;
thePeer.peerMsgReceiver = ownMsgReceiver;
}
-
+
}
-
+
return peer;
}
-
+
protected synchronized void disconnect() {
disconnectInternal();
if (peer!=null) {
@@ -106,11 +106,12 @@ public abstract class InterfaceItemBase extends AbstractMessageReceiver implemen
private void disconnectInternal() {
peerAddress = null;
peerMsgReceiver = null;
-
+
if (replicator!=null)
destroy();
}
-
+
+
protected IMessageReceiver getMsgReceiver() {
return ownMsgReceiver;
}
@@ -122,7 +123,7 @@ public abstract class InterfaceItemBase extends AbstractMessageReceiver implemen
protected synchronized IMessageReceiver getPeerMsgReceiver() {
return peerMsgReceiver;
}
-
+
public IEventReceiver getActor() {
return (IEventReceiver) getParent();
}
@@ -134,7 +135,7 @@ public abstract class InterfaceItemBase extends AbstractMessageReceiver implemen
public int getIdx() {
return idx;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.etrice.runtime.java.messaging.RTObject#destroy()
*/
@@ -143,26 +144,26 @@ public abstract class InterfaceItemBase extends AbstractMessageReceiver implemen
if (peerAddress!=null) {
disconnect();
}
-
+
if (replicator!=null) {
replicator.removeItem(this);
}
-
+
ownMsgReceiver.removeMessageReceiver(this);
ownMsgReceiver.freeAddress(getAddress());
-
+
super.destroy();
}
-
+
@Override
public String toString() {
return ((replicator!=null)?"sub ":"")+"port "+getName()+" "+getAddress()+" <-> "+getPeerAddress();
}
-
+
public static void connect(IRTObject obj, String path1, String path2) {
IRTObject obj1 = obj.getObject(path1);
IRTObject obj2 = obj.getObject(path2);
-
+
if (obj1 instanceof IInterfaceItem && obj2 instanceof IInterfaceItem) {
((IInterfaceItem)obj1).connectWith((IInterfaceItem) obj2);
}
diff --git a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/RTSystemProtocol.java b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/RTSystemProtocol.java
index dcd2973c6..f4ccd974e 100644
--- a/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/RTSystemProtocol.java
+++ b/runtime/org.eclipse.etrice.runtime.java/src/org/eclipse/etrice/runtime/java/modelbase/RTSystemProtocol.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.runtime.java.modelbase;
@@ -21,14 +21,14 @@ import org.eclipse.etrice.runtime.java.modelbase.RTSystemServicesProtocol.RTSyst
*
*/
public class RTSystemProtocol {
-
+
private static final String RT_SYSTEM_PORT_NAME = "RTSystemPort";
-
+
public static class RTSystemPort extends RTSystemServicesProtocolPort {
-
+
public RTSystemPort(IInterfaceItemOwner actor, int localId) {
super(actor, RT_SYSTEM_PORT_NAME, localId);
-
+
// since we have no mapping for the system ports we connect them directly here
IReplicatedInterfaceItem systemPort = actor.getSystemPort();
if (systemPort!=null) {
@@ -36,17 +36,17 @@ public class RTSystemProtocol {
connectWith(peer);
}
}
-
+
protected void connectWithPeer() {
}
-
+
@Override
- protected void destroy() {
+ public void destroy() {
super.destroy();
}
-
+
}
-
+
public static class RTSystemConjPort extends RTSystemServicesProtocolConjReplPort {
public RTSystemConjPort(IInterfaceItemOwner actor, int localId) {
@@ -57,17 +57,17 @@ public class RTSystemProtocol {
protected InterfaceItemBase createInterfaceItem(IInterfaceItemOwner rcv, String name, int lid, int idx) {
return new RTSystemConjSubPort(rcv, name, lid, idx);
}
-
+
}
-
+
public static class RTSystemConjSubPort extends RTSystemServicesProtocolConjPort {
public RTSystemConjSubPort(IInterfaceItemOwner actor, String name, int localId, int idx) {
super(actor, name, localId, idx);
}
-
+
protected void connectWithPeer() {
}
-
+
}
}

Back to the top