Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Haug2019-02-16 11:15:15 -0500
committerJuergen Haug2019-02-25 06:31:01 -0500
commit621741b7bf2b94027b69accbc57f8f520532a5d2 (patch)
treea57704e7b3bd5b9c3e362402f131291db4b3ab8d /plugins/org.eclipse.etrice.generator.cpp
parenta7b0badaed395687bf9e9cc6fe13b38b7e8ef50e (diff)
downloadorg.eclipse.etrice-621741b7bf2b94027b69accbc57f8f520532a5d2.tar.gz
org.eclipse.etrice-621741b7bf2b94027b69accbc57f8f520532a5d2.tar.xz
org.eclipse.etrice-621741b7bf2b94027b69accbc57f8f520532a5d2.zip
Bug 544723 - [room] Add annotation for deprecated elements
Diffstat (limited to 'plugins/org.eclipse.etrice.generator.cpp')
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ActorClassGen.xtend4
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/DataClassGen.xtend5
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ProtocolClassGen.xtend15
3 files changed, 10 insertions, 14 deletions
diff --git a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ActorClassGen.xtend b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ActorClassGen.xtend
index 626746a6b..d73cd7c06 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ActorClassGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ActorClassGen.xtend
@@ -47,14 +47,14 @@ class ActorClassGen extends GenericActorClassGenerator {
def doGenerate(Root root) {
val Map<ActorClass, WiredActorClass> ac2wired = newHashMap
root.wiredInstances.filter(typeof(WiredActorClass)).forEach[ac2wired.put(actorClass, it)]
- for (xpac: root.actorClasses.filter[isValidGenerationLocation].map[root.getExpandedActorClass(it)]) {
+ root.actorClasses.filter[!isDeprecatedGeneration].map[root.getExpandedActorClass(it)].forEach[xpac |
val wired = ac2wired.get(xpac.actorClass)
val manualBehavior = xpac.actorClass.isBehaviorAnnotationPresent("BehaviorManual")
val path = xpac.actorClass.getPath
var file = if (manualBehavior) 'Abstract' else ''
fileIO.generateFile("generating ActorClass declaration", path + file + xpac.actorClass.getCppHeaderFileName, root.generateHeaderFile(xpac, wired, manualBehavior))
fileIO.generateFile("generating ActorClass implementation", path + file + xpac.actorClass.getCppSourceFileName, root.generateSourceFile(xpac, wired, manualBehavior))
- }
+ ]
}
def protected generateHeaderFile(Root root, ExpandedActorClass xpac, WiredActorClass wired, boolean manualBehavior) {
diff --git a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/DataClassGen.xtend b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/DataClassGen.xtend
index 1cb380830..17f204fd0 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/DataClassGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/DataClassGen.xtend
@@ -37,7 +37,7 @@ class DataClassGen {
@Inject extension RoomHelpers
def doGenerate(Root root) {
- for (dc: root.dataClasses) {
+ root.dataClasses.filter[!isDeprecatedGeneration].forEach[dc |
var path = dc.getPath
// header file
@@ -46,8 +46,7 @@ class DataClassGen {
// source file
fileIO.generateFile("generating DataClass source", path + dc.getCppSourceFileName, root.generateSourceFile(dc))
- }
-
+ ]
}
def generateHeaderFile(Root root, DataClass dc) {
diff --git a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ProtocolClassGen.xtend b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ProtocolClassGen.xtend
index 4f98c8cbb..569b62f59 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ProtocolClassGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ProtocolClassGen.xtend
@@ -18,6 +18,7 @@ import com.google.inject.Inject
import com.google.inject.Singleton
import java.util.List
import org.eclipse.etrice.core.genmodel.etricegen.Root
+import org.eclipse.etrice.core.genmodel.fsm.IDiagnostician
import org.eclipse.etrice.core.room.CommunicationType
import org.eclipse.etrice.core.room.InterfaceItem
import org.eclipse.etrice.core.room.Message
@@ -26,16 +27,14 @@ import org.eclipse.etrice.core.room.PortClass
import org.eclipse.etrice.core.room.ProtocolClass
import org.eclipse.etrice.core.room.SAP
import org.eclipse.etrice.core.room.SPP
-import org.eclipse.etrice.generator.cpp.Main
-import org.eclipse.etrice.generator.fsm.base.FileSystemHelpers
import org.eclipse.etrice.generator.base.io.IGeneratorFileIO
+import org.eclipse.etrice.generator.cpp.Main
+import org.eclipse.etrice.generator.cpp.setup.GeneratorOptionsHelper
import org.eclipse.etrice.generator.generic.GenericProtocolClassGenerator
+import org.eclipse.etrice.generator.generic.ILanguageExtension
import org.eclipse.etrice.generator.generic.ProcedureHelpers
import org.eclipse.etrice.generator.generic.RoomExtensions
import org.eclipse.etrice.generator.generic.TypeHelpers
-import org.eclipse.etrice.generator.generic.ILanguageExtension
-import org.eclipse.etrice.core.genmodel.fsm.IDiagnostician
-import org.eclipse.etrice.generator.cpp.setup.GeneratorOptionsHelper
@Singleton
class ProtocolClassGen extends GenericProtocolClassGenerator {
@@ -45,14 +44,12 @@ class ProtocolClassGen extends GenericProtocolClassGenerator {
@Inject extension RoomExtensions roomExt
@Inject extension ProcedureHelpers helpers
@Inject extension TypeHelpers
- @Inject extension FileSystemHelpers
@Inject extension GeneratorOptionsHelper
@Inject Initialization initHelper
@Inject IDiagnostician diagnostician
def doGenerate(Root root) {
-
- for (pc: root.protocolClasses.filter(cl|cl.isValidGenerationLocation)) {
+ root.protocolClasses.filter[!isDeprecatedGeneration].forEach[pc |
val path = pc.getPath
switch (pc.commType) {
case CommunicationType::EVENT_DRIVEN:{
@@ -66,7 +63,7 @@ class ProtocolClassGen extends GenericProtocolClassGenerator {
case CommunicationType::SYNCHRONOUS:
diagnostician.error("synchronous protocols not supported yet", pc, null)
}
- }
+ ]
}

Back to the top