From e61795c40c6eccb55c4abea5875f9c4356834e02 Mon Sep 17 00:00:00 2001 From: Thomas Schuetz Date: Fri, 22 Jul 2016 11:27:39 +0200 Subject: [reference.cpp] added reference project for development of cpp generator Change-Id: I048c9d50ef1ef106be583c80d5c8496a2974ff88 --- .../.cproject | 382 ++++++++++++++++++ .../.gitignore | 8 + .../.project | 36 ++ .../.settings/org.eclipse.cdt.core.prefs | 37 ++ .../org.eclipse.cdt.managedbuilder.core.prefs | 13 + .../generate_Reference.launch | 18 + .../log/readme.txt | 1 + .../model/Mapping.etmap | 17 + .../model/Physical.etphys | 43 ++ .../model/ReferenceCPP_ActorClasses.room | 132 +++++++ .../model/ReferenceCPP_DataClasses.room | 39 ++ .../model/ReferenceCPP_Main.room | 27 ++ .../model/ReferenceCPP_ProtocolClasses.room | 23 ++ ...ceCPP_ActorClasses.ActorAllDataClasses.behavior | 135 +++++++ ...eCPP_ActorClasses.ActorAllDataClasses.structure | 37 ++ ...ActorClasses.ActorAllDataClassesMirror.behavior | 135 +++++++ ...ctorClasses.ActorAllDataClassesMirror.structure | 37 ++ ...ferenceCPP_ActorClasses.ActorToplevel.structure | 434 +++++++++++++++++++++ ...lasses.ActorWithImplementationSubclass.behavior | 135 +++++++ .../ReferenceCPP_Main.SubSysClass.structure | 291 ++++++++++++++ .../run_Template_Linux_.launch | 34 ++ .../run_Template_Windows_.launch | 34 ++ .../src-gen-info/readme.txt | 4 + .../src-gen/readme.txt | 4 + .../src/ActorWithImplementationSubclass_Impl.cpp | 45 +++ .../src/ActorWithImplementationSubclass_Impl.h | 33 ++ 26 files changed, 2134 insertions(+) create mode 100644 examples/org.eclipse.etrice.generator.cpp.reference/.cproject create mode 100644 examples/org.eclipse.etrice.generator.cpp.reference/.gitignore create mode 100644 examples/org.eclipse.etrice.generator.cpp.reference/.project create mode 100644 examples/org.eclipse.etrice.generator.cpp.reference/.settings/org.eclipse.cdt.core.prefs create mode 100644 examples/org.eclipse.etrice.generator.cpp.reference/.settings/org.eclipse.cdt.managedbuilder.core.prefs create mode 100644 examples/org.eclipse.etrice.generator.cpp.reference/generate_Reference.launch create mode 100644 examples/org.eclipse.etrice.generator.cpp.reference/log/readme.txt create mode 100644 examples/org.eclipse.etrice.generator.cpp.reference/model/Mapping.etmap create mode 100644 examples/org.eclipse.etrice.generator.cpp.reference/model/Physical.etphys create mode 100644 examples/org.eclipse.etrice.generator.cpp.reference/model/ReferenceCPP_ActorClasses.room create mode 100644 examples/org.eclipse.etrice.generator.cpp.reference/model/ReferenceCPP_DataClasses.room create mode 100644 examples/org.eclipse.etrice.generator.cpp.reference/model/ReferenceCPP_Main.room create mode 100644 examples/org.eclipse.etrice.generator.cpp.reference/model/ReferenceCPP_ProtocolClasses.room create mode 100644 examples/org.eclipse.etrice.generator.cpp.reference/model/diagrams/ReferenceCPP_ActorClasses.ActorAllDataClasses.behavior create mode 100644 examples/org.eclipse.etrice.generator.cpp.reference/model/diagrams/ReferenceCPP_ActorClasses.ActorAllDataClasses.structure create mode 100644 examples/org.eclipse.etrice.generator.cpp.reference/model/diagrams/ReferenceCPP_ActorClasses.ActorAllDataClassesMirror.behavior create mode 100644 examples/org.eclipse.etrice.generator.cpp.reference/model/diagrams/ReferenceCPP_ActorClasses.ActorAllDataClassesMirror.structure create mode 100644 examples/org.eclipse.etrice.generator.cpp.reference/model/diagrams/ReferenceCPP_ActorClasses.ActorToplevel.structure create mode 100644 examples/org.eclipse.etrice.generator.cpp.reference/model/diagrams/ReferenceCPP_ActorClasses.ActorWithImplementationSubclass.behavior create mode 100644 examples/org.eclipse.etrice.generator.cpp.reference/model/diagrams/ReferenceCPP_Main.SubSysClass.structure create mode 100644 examples/org.eclipse.etrice.generator.cpp.reference/run_Template_Linux_.launch create mode 100644 examples/org.eclipse.etrice.generator.cpp.reference/run_Template_Windows_.launch create mode 100644 examples/org.eclipse.etrice.generator.cpp.reference/src-gen-info/readme.txt create mode 100644 examples/org.eclipse.etrice.generator.cpp.reference/src-gen/readme.txt create mode 100644 examples/org.eclipse.etrice.generator.cpp.reference/src/ActorWithImplementationSubclass_Impl.cpp create mode 100644 examples/org.eclipse.etrice.generator.cpp.reference/src/ActorWithImplementationSubclass_Impl.h diff --git a/examples/org.eclipse.etrice.generator.cpp.reference/.cproject b/examples/org.eclipse.etrice.generator.cpp.reference/.cproject new file mode 100644 index 000000000..216ccd871 --- /dev/null +++ b/examples/org.eclipse.etrice.generator.cpp.reference/.cproject @@ -0,0 +1,382 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/org.eclipse.etrice.generator.cpp.reference/.gitignore b/examples/org.eclipse.etrice.generator.cpp.reference/.gitignore new file mode 100644 index 000000000..d2a6ec005 --- /dev/null +++ b/examples/org.eclipse.etrice.generator.cpp.reference/.gitignore @@ -0,0 +1,8 @@ +WindowsMinGW +LinuxPosix +src-gen/* +!src-gen/readme.txt +src-gen-info/* +!src-gen-info/readme.txt +log/* +!log/readme.txt diff --git a/examples/org.eclipse.etrice.generator.cpp.reference/.project b/examples/org.eclipse.etrice.generator.cpp.reference/.project new file mode 100644 index 000000000..5e0965ddb --- /dev/null +++ b/examples/org.eclipse.etrice.generator.cpp.reference/.project @@ -0,0 +1,36 @@ + + + org.eclipse.etrice.generator.cpp.reference + + + org.eclipse.etrice.runtime.cpp + org.eclipse.etrice.modellib.cpp + org.eclipse.etrice.runtime.c + + + + org.eclipse.xtext.ui.shared.xtextBuilder + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + org.eclipse.xtext.ui.shared.xtextNature + + diff --git a/examples/org.eclipse.etrice.generator.cpp.reference/.settings/org.eclipse.cdt.core.prefs b/examples/org.eclipse.etrice.generator.cpp.reference/.settings/org.eclipse.cdt.core.prefs new file mode 100644 index 000000000..ba50e9cec --- /dev/null +++ b/examples/org.eclipse.etrice.generator.cpp.reference/.settings/org.eclipse.cdt.core.prefs @@ -0,0 +1,37 @@ +eclipse.preferences.version=1 +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675/CPP_MODELLIB_ROOTDIR/delimiter=; +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675/CPP_MODELLIB_ROOTDIR/operation=append +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675/CPP_MODELLIB_ROOTDIR/value=${workspace_loc\:org.eclipse.etrice.modellib.cpp} +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675/CPP_RUNTIME_ROOTDIR/delimiter=; +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675/CPP_RUNTIME_ROOTDIR/operation=append +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675/CPP_RUNTIME_ROOTDIR/value=${workspace_loc\:org.eclipse.etrice.runtime.cpp} +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675/RUNTIME_ROOTDIR/delimiter=; +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675/RUNTIME_ROOTDIR/operation=append +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675/RUNTIME_ROOTDIR/value=${workspace_loc\:org.eclipse.etrice.runtime.c} +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675/append=true +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1242072675/appendContributed=true +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309/CPP_MODELLIB_ROOTDIR/delimiter=; +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309/CPP_MODELLIB_ROOTDIR/operation=append +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309/CPP_MODELLIB_ROOTDIR/value=${workspace_loc\:org.eclipse.etrice.modellib.cpp} +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309/CPP_RUNTIME_ROOTDIR/delimiter=; +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309/CPP_RUNTIME_ROOTDIR/operation=append +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309/CPP_RUNTIME_ROOTDIR/value=${workspace_loc\:org.eclipse.etrice.runtime.cpp} +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309/ECLIPSE_MODE/delimiter=; +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309/ECLIPSE_MODE/operation=append +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309/ECLIPSE_MODE/value=true +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309/RUNTIME_ROOTDIR/delimiter=; +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309/RUNTIME_ROOTDIR/operation=append +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309/RUNTIME_ROOTDIR/value=${workspace_loc\:org.eclipse.etrice.runtime.c} +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309/append=true +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372.1674764309/appendContributed=true +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/CPP_MODELLIB_ROOTDIR/delimiter=; +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/CPP_MODELLIB_ROOTDIR/operation=append +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/CPP_MODELLIB_ROOTDIR/value=${workspace_loc\:org.eclipse.etrice.modellib.cpp} +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/CPP_RUNTIME_ROOTDIR/delimiter=; +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/CPP_RUNTIME_ROOTDIR/operation=append +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/CPP_RUNTIME_ROOTDIR/value=${workspace_loc\:org.eclipse.etrice.runtime.cpp} +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/RUNTIME_ROOTDIR/delimiter=; +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/RUNTIME_ROOTDIR/operation=append +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/RUNTIME_ROOTDIR/value=${workspace_loc\:org.eclipse.etrice.runtime.c} +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/append=true +environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/appendContributed=true diff --git a/examples/org.eclipse.etrice.generator.cpp.reference/.settings/org.eclipse.cdt.managedbuilder.core.prefs b/examples/org.eclipse.etrice.generator.cpp.reference/.settings/org.eclipse.cdt.managedbuilder.core.prefs new file mode 100644 index 000000000..99e96a40b --- /dev/null +++ b/examples/org.eclipse.etrice.generator.cpp.reference/.settings/org.eclipse.cdt.managedbuilder.core.prefs @@ -0,0 +1,13 @@ +eclipse.preferences.version=1 +environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/CPATH/delimiter=; +environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/CPATH/operation=remove +environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/CPLUS_INCLUDE_PATH/delimiter=; +environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/CPLUS_INCLUDE_PATH/operation=remove +environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/C_INCLUDE_PATH/delimiter=; +environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/C_INCLUDE_PATH/operation=remove +environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/append=true +environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/appendContributed=true +environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/LIBRARY_PATH/delimiter=; +environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/LIBRARY_PATH/operation=remove +environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/append=true +environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.1749013372/appendContributed=true diff --git a/examples/org.eclipse.etrice.generator.cpp.reference/generate_Reference.launch b/examples/org.eclipse.etrice.generator.cpp.reference/generate_Reference.launch new file mode 100644 index 000000000..cb341528c --- /dev/null +++ b/examples/org.eclipse.etrice.generator.cpp.reference/generate_Reference.launch @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/examples/org.eclipse.etrice.generator.cpp.reference/log/readme.txt b/examples/org.eclipse.etrice.generator.cpp.reference/log/readme.txt new file mode 100644 index 000000000..dadbdcfe8 --- /dev/null +++ b/examples/org.eclipse.etrice.generator.cpp.reference/log/readme.txt @@ -0,0 +1 @@ +This directory is an eTrice directory used for logging e.g. MSC. \ No newline at end of file diff --git a/examples/org.eclipse.etrice.generator.cpp.reference/model/Mapping.etmap b/examples/org.eclipse.etrice.generator.cpp.reference/model/Mapping.etmap new file mode 100644 index 000000000..f45138175 --- /dev/null +++ b/examples/org.eclipse.etrice.generator.cpp.reference/model/Mapping.etmap @@ -0,0 +1,17 @@ +/* + * This model defines a mapping between a logical ROOM model and a physical model (nodes and threads). + * + *

Hint: Press F3 to open declaration of selected element or import

+ */ +MappingModel ReferenceModelCPP_Mapping { + + import TemplatePhysical.* from "Physical.etphys" + import TemplateModel.* from "ReferenceCPP_Main.room" + + Mapping ReferenceCPP_Main.LogSys -> TemplatePhysicalSystem { + SubSystemMapping subSystemRef -> node { + ThreadMapping defaultThread -> DefaultPhysicalThread + } + } + +} \ No newline at end of file diff --git a/examples/org.eclipse.etrice.generator.cpp.reference/model/Physical.etphys b/examples/org.eclipse.etrice.generator.cpp.reference/model/Physical.etphys new file mode 100644 index 000000000..2bf93c456 --- /dev/null +++ b/examples/org.eclipse.etrice.generator.cpp.reference/model/Physical.etphys @@ -0,0 +1,43 @@ +PhysicalModel TemplatePhysical { + + PhysicalSystem TemplatePhysicalSystem { + NodeRef node : DefaultNodeClass + } + + NodeClass DefaultNodeClass { + runtime = DefaultRuntimeClass + priomin = -10 + priomax = 10 + + DefaultThread DefaultPhysicalThread { + execmode = mixed + interval = 100ms + prio = 0 + stacksize = 1024 + msgblocksize = 64 + msgpoolsize = 100 + } + + Thread BlockedThread { + execmode = blocked + prio = 0 + stacksize = 1024 + msgblocksize = 64 + msgpoolsize = 100 + } + + Thread PolledThread { + execmode = polled + interval = 100ms + prio = 0 + stacksize = 1024 + msgblocksize = 64 + msgpoolsize = 100 + } + } + + RuntimeClass DefaultRuntimeClass { + model = multiThreaded + } + +} \ No newline at end of file diff --git a/examples/org.eclipse.etrice.generator.cpp.reference/model/ReferenceCPP_ActorClasses.room b/examples/org.eclipse.etrice.generator.cpp.reference/model/ReferenceCPP_ActorClasses.room new file mode 100644 index 000000000..aa2aa447f --- /dev/null +++ b/examples/org.eclipse.etrice.generator.cpp.reference/model/ReferenceCPP_ActorClasses.room @@ -0,0 +1,132 @@ +RoomModel ReferenceCPP_ActorClasses { + + import ReferenceCPP_DataClasses.* from "ReferenceCPP_DataClasses.room" + + import ReferenceCPP_ProtocolClasses.* from "ReferenceCPP_ProtocolClasses.room" + + import room.basic.annotations.* from "../../org.eclipse.etrice.modellib.cpp/model/Annotations.room" + import room.basic.types.* from "../../org.eclipse.etrice.modellib.cpp/model/Types.room" + + ActorClass ActorToplevel [ "instantiate all element to enforce code generation" ] { + Structure { + ActorRef allDataClasses: ActorAllDataClasses + ActorRef actorWithImplementationSubclass: ActorWithImplementationSubclass + Binding mirrorDataClasses.portMirror and allDataClasses.portSend + ActorRef mirrorDataClasses: ActorAllDataClassesMirror + } + } + + ActorClass ActorAllDataClasses { + Interface { + conjugated Port portSend: PAllDatatypes + } + Structure { + Attribute allDatatypes: DAllDatatypes + Attribute char1: char + Attribute char2: char + Attribute charArray[100]: char + external Port portSend + } + Behavior { + StateMachine { + State state0 { + entry + + { + "sprintf(charArray, \"Hallo eTrice\");" + "DAllDatatypes data(-1, -2, -3, -4, 1,2,3,4, 123.456, -123.456, false, \'A\', charArray);" + "portSend.sendAllDatatypes(data);" + } + } + Transition init: initial -> state0 + State state1 + Transition tr0: state0 -> state1 { + triggers { + + } + action + + { + "//printf(\"%d, %ld, %f, %d, %c, %s\\n\", data.attribute_int8, data.attribute_uint64, data.attribute_float64, data.attribute_boolean, data.attribute_char, data.attribute_charPtr);" + } + } + } + } + } + + ActorClass ActorAllDataClassesMirror { + Interface { + Port portMirror: PAllDatatypes + } + Structure { + Attribute allDatatypes: DAllDatatypes + external Port portMirror + } + Behavior { + StateMachine { State state0 + State state1 + Transition init: initial -> state0 + Transition tr0: state0 -> state1 { + triggers { + + } + action { + "allDatatypes = data;" + "portMirror.mirrorAllDatatypes(allDatatypes);" + } + } + } + } + } + + ProtocolClass PStartStop { + incoming { + Message start() + Message stop() + } + outgoing { + Message started() + Message stopped() + } + } + + datadriven ActorClass ActorWithImplementationSubclass { + @ImplementationSubclass(fqnClassName = "ActorWithImplementationSubclass_Impl") + Behavior { + StateMachine { + State State1 { + entry { + "//" + } + exit { + "//" + } + } + State State2 { + entry { + "//" + } + exit { + "//" + } do { + "//" + } + } + Transition init: initial -> State1 { + action { + "//" + } + } + Transition tr0: State1 -> State2 { + guard { + "true" + } + action { + "//" + } + } + } + } + } + +} \ No newline at end of file diff --git a/examples/org.eclipse.etrice.generator.cpp.reference/model/ReferenceCPP_DataClasses.room b/examples/org.eclipse.etrice.generator.cpp.reference/model/ReferenceCPP_DataClasses.room new file mode 100644 index 000000000..0eb0ad4f2 --- /dev/null +++ b/examples/org.eclipse.etrice.generator.cpp.reference/model/ReferenceCPP_DataClasses.room @@ -0,0 +1,39 @@ +// + +RoomModel ReferenceCPP_DataClasses { + import room.basic.types.* from "../../org.eclipse.etrice.modellib.cpp/model/Types.room" + import room.basic.annotations.* from "../../org.eclipse.etrice.modellib.cpp/model/Annotations.room" + + DataClass DAllDatatypes { + // int + Attribute attribute_int8 : int8 + Attribute attribute_int16 : int16 + Attribute attribute_int32 : int32 + Attribute attribute_int64 : int64 + + // uint + Attribute attribute_uint8 : uint8 + Attribute attribute_uint16 : uint16 + Attribute attribute_uint32 : uint32 + Attribute attribute_uint64 : uint64 + + // float + Attribute attribute_float32 : float32 + Attribute attribute_float64 : float64 + + // others + Attribute attribute_boolean : boolean + Attribute attribute_char : char + Attribute attribute_charPtr : charPtr +// TODO: string does not compile +// Attribute attribute_string : string +// Attribute attribute_voidTypeRef : voidType ref + + // arrays + // TODO: arrays for attributes do not compile +// Attribute attribute_char_array[4] : char +// Attribute attribute_int32_array[4] : int32 + + + } +} \ No newline at end of file diff --git a/examples/org.eclipse.etrice.generator.cpp.reference/model/ReferenceCPP_Main.room b/examples/org.eclipse.etrice.generator.cpp.reference/model/ReferenceCPP_Main.room new file mode 100644 index 000000000..22bdd94d2 --- /dev/null +++ b/examples/org.eclipse.etrice.generator.cpp.reference/model/ReferenceCPP_Main.room @@ -0,0 +1,27 @@ +/* + * Shortkeys: + * Ctrl+Space - content assist + * F3 - open declaration of selected element + * Alt+S - open structure diagram + * Alt+B - open behavior diagram + * Alt+M - open textual editor (in diagrams) + */ +RoomModel ReferenceCPP_Main { + + import room.basic.types.* from "../../org.eclipse.etrice.modellib.cpp/model/Types.room" + import room.basic.service.timing.* from "../../org.eclipse.etrice.modellib.cpp/model/TimingService.room" + + import ReferenceCPP_ActorClasses.* from "ReferenceCPP_ActorClasses.room" + + + LogicalSystem LogSys { + SubSystemRef subSystemRef: SubSysClass + } + + SubSystemClass SubSysClass { + ActorRef topActor: ActorToplevel + ActorRef timingService: ATimingService + LayerConnection ref topActor satisfied_by timingService.timer + LogicalThread defaultThread + } +} \ No newline at end of file diff --git a/examples/org.eclipse.etrice.generator.cpp.reference/model/ReferenceCPP_ProtocolClasses.room b/examples/org.eclipse.etrice.generator.cpp.reference/model/ReferenceCPP_ProtocolClasses.room new file mode 100644 index 000000000..c104aa010 --- /dev/null +++ b/examples/org.eclipse.etrice.generator.cpp.reference/model/ReferenceCPP_ProtocolClasses.room @@ -0,0 +1,23 @@ +RoomModel ReferenceCPP_ProtocolClasses { + + import room.basic.types.* from "../../org.eclipse.etrice.modellib.cpp/model/Types.room" + + import ReferenceCPP_DataClasses.* from "ReferenceCPP_DataClasses.room" + + ProtocolClass PAllDatatypes { + incoming { + Message sendAllDatatypes(data: DAllDatatypes) + Message sendInt16(data: int16) + Message sendFloat(data: float32) + Message sendBoolean(data: boolean) + Message sendCharPtr(data: charPtr) + } + outgoing { + Message mirrorAllDatatypes(data: DAllDatatypes) + Message mirrorInt16(data: int16) + Message mirrorFloat(data: float64) + Message mirrorBoolean(data: boolean) + Message mirrorCharPtr(data: charPtr) + } + } +} \ No newline at end of file diff --git a/examples/org.eclipse.etrice.generator.cpp.reference/model/diagrams/ReferenceCPP_ActorClasses.ActorAllDataClasses.behavior b/examples/org.eclipse.etrice.generator.cpp.reference/model/diagrams/ReferenceCPP_ActorClasses.ActorAllDataClasses.behavior new file mode 100644 index 000000000..459d0605a --- /dev/null +++ b/examples/org.eclipse.etrice.generator.cpp.reference/model/diagrams/ReferenceCPP_ActorClasses.ActorAllDataClasses.behavior @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/org.eclipse.etrice.generator.cpp.reference/model/diagrams/ReferenceCPP_ActorClasses.ActorAllDataClasses.structure b/examples/org.eclipse.etrice.generator.cpp.reference/model/diagrams/ReferenceCPP_ActorClasses.ActorAllDataClasses.structure new file mode 100644 index 000000000..d4328b4ea --- /dev/null +++ b/examples/org.eclipse.etrice.generator.cpp.reference/model/diagrams/ReferenceCPP_ActorClasses.ActorAllDataClasses.structure @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/org.eclipse.etrice.generator.cpp.reference/model/diagrams/ReferenceCPP_ActorClasses.ActorAllDataClassesMirror.behavior b/examples/org.eclipse.etrice.generator.cpp.reference/model/diagrams/ReferenceCPP_ActorClasses.ActorAllDataClassesMirror.behavior new file mode 100644 index 000000000..d7e06270d --- /dev/null +++ b/examples/org.eclipse.etrice.generator.cpp.reference/model/diagrams/ReferenceCPP_ActorClasses.ActorAllDataClassesMirror.behavior @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/org.eclipse.etrice.generator.cpp.reference/model/diagrams/ReferenceCPP_ActorClasses.ActorAllDataClassesMirror.structure b/examples/org.eclipse.etrice.generator.cpp.reference/model/diagrams/ReferenceCPP_ActorClasses.ActorAllDataClassesMirror.structure new file mode 100644 index 000000000..ebe948db2 --- /dev/null +++ b/examples/org.eclipse.etrice.generator.cpp.reference/model/diagrams/ReferenceCPP_ActorClasses.ActorAllDataClassesMirror.structure @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/org.eclipse.etrice.generator.cpp.reference/model/diagrams/ReferenceCPP_ActorClasses.ActorToplevel.structure b/examples/org.eclipse.etrice.generator.cpp.reference/model/diagrams/ReferenceCPP_ActorClasses.ActorToplevel.structure new file mode 100644 index 000000000..46129332c --- /dev/null +++ b/examples/org.eclipse.etrice.generator.cpp.reference/model/diagrams/ReferenceCPP_ActorClasses.ActorToplevel.structure @@ -0,0 +1,434 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/org.eclipse.etrice.generator.cpp.reference/model/diagrams/ReferenceCPP_ActorClasses.ActorWithImplementationSubclass.behavior b/examples/org.eclipse.etrice.generator.cpp.reference/model/diagrams/ReferenceCPP_ActorClasses.ActorWithImplementationSubclass.behavior new file mode 100644 index 000000000..4ce31746b --- /dev/null +++ b/examples/org.eclipse.etrice.generator.cpp.reference/model/diagrams/ReferenceCPP_ActorClasses.ActorWithImplementationSubclass.behavior @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/org.eclipse.etrice.generator.cpp.reference/model/diagrams/ReferenceCPP_Main.SubSysClass.structure b/examples/org.eclipse.etrice.generator.cpp.reference/model/diagrams/ReferenceCPP_Main.SubSysClass.structure new file mode 100644 index 000000000..84331c56d --- /dev/null +++ b/examples/org.eclipse.etrice.generator.cpp.reference/model/diagrams/ReferenceCPP_Main.SubSysClass.structure @@ -0,0 +1,291 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/org.eclipse.etrice.generator.cpp.reference/run_Template_Linux_.launch b/examples/org.eclipse.etrice.generator.cpp.reference/run_Template_Linux_.launch new file mode 100644 index 000000000..d4a17a7bc --- /dev/null +++ b/examples/org.eclipse.etrice.generator.cpp.reference/run_Template_Linux_.launch @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/org.eclipse.etrice.generator.cpp.reference/run_Template_Windows_.launch b/examples/org.eclipse.etrice.generator.cpp.reference/run_Template_Windows_.launch new file mode 100644 index 000000000..99991a9b5 --- /dev/null +++ b/examples/org.eclipse.etrice.generator.cpp.reference/run_Template_Windows_.launch @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/org.eclipse.etrice.generator.cpp.reference/src-gen-info/readme.txt b/examples/org.eclipse.etrice.generator.cpp.reference/src-gen-info/readme.txt new file mode 100644 index 000000000..1dc2b35ab --- /dev/null +++ b/examples/org.eclipse.etrice.generator.cpp.reference/src-gen-info/readme.txt @@ -0,0 +1,4 @@ +This directory is an eTrice code generation target. +It will be erased every time the generator is executed. + +DO NOT PLACE OTHER FILES HERE! diff --git a/examples/org.eclipse.etrice.generator.cpp.reference/src-gen/readme.txt b/examples/org.eclipse.etrice.generator.cpp.reference/src-gen/readme.txt new file mode 100644 index 000000000..1dc2b35ab --- /dev/null +++ b/examples/org.eclipse.etrice.generator.cpp.reference/src-gen/readme.txt @@ -0,0 +1,4 @@ +This directory is an eTrice code generation target. +It will be erased every time the generator is executed. + +DO NOT PLACE OTHER FILES HERE! diff --git a/examples/org.eclipse.etrice.generator.cpp.reference/src/ActorWithImplementationSubclass_Impl.cpp b/examples/org.eclipse.etrice.generator.cpp.reference/src/ActorWithImplementationSubclass_Impl.cpp new file mode 100644 index 000000000..efe253c5f --- /dev/null +++ b/examples/org.eclipse.etrice.generator.cpp.reference/src/ActorWithImplementationSubclass_Impl.cpp @@ -0,0 +1,45 @@ +/* + * ActorWithImplementationSubclassImpl.cpp + * + * Created on: 13.07.2016 + * Author: tschuetz + */ + +#include + +ActorWithImplementationSubclass_Impl::ActorWithImplementationSubclass_Impl( + etRuntime::IRTObject* parent, const std::string& name) : + ActorWithImplementationSubclass(parent, name) { +} + +ActorWithImplementationSubclass_Impl::~ActorWithImplementationSubclass_Impl() { +} + +void ActorWithImplementationSubclass_Impl::entry_State1() { + printf("\n2-entry_State1"); +} + +void ActorWithImplementationSubclass_Impl::exit_State1() { + printf("\n3-entry_State1"); +} +void ActorWithImplementationSubclass_Impl::entry_State2() { + printf("\n5-entry_State2"); +} +void ActorWithImplementationSubclass_Impl::exit_State2() { + printf("\n7-exit_State2 - should never happen"); + +} + +void ActorWithImplementationSubclass_Impl::do_State2() { + printf("\n6-do_State2"); + +} + +/* Action Codes */ +void ActorWithImplementationSubclass_Impl::action_TRANS_INITIAL_TO__State1() { + printf("\n1-Initial"); +} +void ActorWithImplementationSubclass_Impl::action_TRANS_tr0_FROM_State1_TO_State2_GUARD_tr0() { + printf("\n4-action_State1_to_State2"); +} + diff --git a/examples/org.eclipse.etrice.generator.cpp.reference/src/ActorWithImplementationSubclass_Impl.h b/examples/org.eclipse.etrice.generator.cpp.reference/src/ActorWithImplementationSubclass_Impl.h new file mode 100644 index 000000000..6ee0e2108 --- /dev/null +++ b/examples/org.eclipse.etrice.generator.cpp.reference/src/ActorWithImplementationSubclass_Impl.h @@ -0,0 +1,33 @@ +/* + * ActorWithImplementationSubclassImpl.h + * + * Created on: 13.07.2016 + * Author: tschuetz + */ + +#ifndef ACTORWITHIMPLEMENTATIONSUBCLASS_IMPL_H_ +#define ACTORWITHIMPLEMENTATIONSUBCLASS_IMPL_H_ + +#include + +class ActorWithImplementationSubclass_Impl: public ActorWithImplementationSubclass { +public: + ActorWithImplementationSubclass_Impl(etRuntime::IRTObject* parent, const std::string& name); + + virtual ~ActorWithImplementationSubclass_Impl(); + + // Overrides + /* Entry and Exit Codes */ + virtual void entry_State1(); + virtual void exit_State1(); + virtual void entry_State2(); + virtual void exit_State2(); + virtual void do_State2(); + + /* Action Codes */ + virtual void action_TRANS_INITIAL_TO__State1(); + virtual void action_TRANS_tr0_FROM_State1_TO_State2_GUARD_tr0(); + +}; + +#endif /* ACTORWITHIMPLEMENTATIONSUBCLASS_IMPL_H_ */ -- cgit v1.2.3