Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2014-08-07 06:27:00 +0000
committerHenrik Rentz-Reichert2014-08-07 06:27:00 +0000
commit9dc11665f7c463e8e5b039a373295dc352183d44 (patch)
tree181b16348dc426e8a5a734476f94f15b229f2c49
parent66deab8978e18915b81af4238d3d2abb6a060efb (diff)
downloadorg.eclipse.etrice-9dc11665f7c463e8e5b039a373295dc352183d44.tar.gz
org.eclipse.etrice-9dc11665f7c463e8e5b039a373295dc352183d44.tar.xz
org.eclipse.etrice-9dc11665f7c463e8e5b039a373295dc352183d44.zip
[generator.cpp] using instance of RoomHelpers
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ConfigGenAddon.xtend6
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/DataClassGen.xtend4
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/ActorClassGen.java15
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/ConfigGenAddon.java10
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/DataClassGen.java8
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/ProtocolClassGen.java13
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/StateMachineGen.java3
7 files changed, 32 insertions, 27 deletions
diff --git a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ConfigGenAddon.xtend b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ConfigGenAddon.xtend
index b7ae0d347..8b39d7bbc 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ConfigGenAddon.xtend
+++ b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ConfigGenAddon.xtend
@@ -21,6 +21,7 @@ import org.eclipse.etrice.core.genmodel.etricegen.InstanceBase
import org.eclipse.etrice.core.room.ActorClass
import org.eclipse.etrice.core.room.Attribute
import org.eclipse.etrice.core.room.DataClass
+import org.eclipse.etrice.core.room.EnumerationType
import org.eclipse.etrice.core.room.ExternalType
import org.eclipse.etrice.core.room.PrimitiveType
import org.eclipse.etrice.core.room.util.RoomHelpers
@@ -28,8 +29,6 @@ import org.eclipse.etrice.generator.base.IDataConfiguration
import org.eclipse.etrice.generator.generic.ProcedureHelpers
import org.eclipse.etrice.generator.generic.RoomExtensions
import org.eclipse.etrice.generator.generic.TypeHelpers
-import static extension org.eclipse.etrice.core.room.util.RoomHelpers.*
-import org.eclipse.etrice.core.room.EnumerationType
class ConfigGenAddon {
@@ -37,6 +36,7 @@ class ConfigGenAddon {
@Inject extension TypeHelpers typeHelpers
@Inject extension ProcedureHelpers helpers
@Inject IDataConfiguration dataConfigExt
+ @Inject extension RoomHelpers
@Inject extension RoomExtensions
// For SubSystemClassGen
@@ -46,7 +46,7 @@ class ConfigGenAddon {
«applyInstanceConfig(ai, aiVariableName, new ArrayList<Attribute>().union(a))»
«ENDFOR»
«FOR pi : ai.orderedIfItemInstances»
- «var attribs = RoomHelpers::getPortClass(pi.interfaceItem)?.attributes»
+ «var attribs = getPortClass(pi.interfaceItem)?.attributes»
«IF attribs != null»
«FOR a : attribs»
«applyInstanceConfig(pi, aiVariableName+"."+invokeGetter(pi.name, null), new ArrayList<Attribute>().union(a))»
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 1ff4c13ae..71a93d078 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
@@ -25,8 +25,7 @@ import org.eclipse.etrice.generator.generic.RoomExtensions
import org.eclipse.etrice.generator.generic.TypeHelpers
import org.eclipse.etrice.generator.cpp.gen.Initialization
import org.eclipse.xtext.generator.JavaIoFileSystemAccess
-
-import static extension org.eclipse.etrice.core.room.util.RoomHelpers.*
+import org.eclipse.etrice.core.room.util.RoomHelpers
import org.eclipse.etrice.generator.cpp.Main
/**
@@ -42,6 +41,7 @@ class DataClassGen {
@Inject extension ProcedureHelpers helpers
@Inject extension TypeHelpers typeHelpers
@Inject extension Initialization
+ @Inject extension RoomHelpers
@Inject ILogger logger
def doGenerate(Root root) {
diff --git a/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/ActorClassGen.java b/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/ActorClassGen.java
index 62caae1cb..3f7e7da06 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/ActorClassGen.java
+++ b/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/ActorClassGen.java
@@ -31,7 +31,6 @@ import org.eclipse.etrice.core.room.SAP;
import org.eclipse.etrice.core.room.SPP;
import org.eclipse.etrice.core.room.ServiceImplementation;
import org.eclipse.etrice.core.room.StandardOperation;
-import org.eclipse.etrice.core.room.util.RoomHelpers;
import org.eclipse.etrice.generator.base.AbstractGenerator;
import org.eclipse.etrice.generator.cpp.Main;
import org.eclipse.etrice.generator.cpp.gen.CppExtensions;
@@ -272,7 +271,7 @@ public class ActorClassGen extends GenericActorClassGenerator {
_builder.append("//--------------------- ports");
_builder.newLine();
_builder.append("\t\t\t");
- List<Port> _endPorts = RoomHelpers.getEndPorts(ac);
+ List<Port> _endPorts = this._roomHelpers.getEndPorts(ac);
final Function1<Port, String> _function = new Function1<Port, String>() {
public String apply(final Port port) {
StringConcatenation _builder = new StringConcatenation();
@@ -374,7 +373,7 @@ public class ActorClassGen extends GenericActorClassGenerator {
_builder.append("//--------------------- port getters");
_builder.newLine();
{
- List<Port> _endPorts_1 = RoomHelpers.getEndPorts(ac);
+ List<Port> _endPorts_1 = this._roomHelpers.getEndPorts(ac);
for(final Port ep : _endPorts_1) {
_builder.append("\t\t");
String _portClassName = this._roomExtensions.getPortClassName(ep);
@@ -434,7 +433,7 @@ public class ActorClassGen extends GenericActorClassGenerator {
_builder.append("virtual void destroy();\t\t\t");
_builder.newLine();
{
- boolean _hasNonEmptyStateMachine = RoomHelpers.hasNonEmptyStateMachine(ac);
+ boolean _hasNonEmptyStateMachine = this._roomHelpers.hasNonEmptyStateMachine(ac);
if (_hasNonEmptyStateMachine) {
_builder.append("\t\t");
CharSequence _genStateMachineMethodDeclarations = this._stateMachineGen.genStateMachineMethodDeclarations(xpac);
@@ -499,7 +498,7 @@ public class ActorClassGen extends GenericActorClassGenerator {
_builder_1.append("(*this, parent, name, port_addr, peer_addr)");
initializerList.add(_builder_1);
}
- List<Port> _endPorts = RoomHelpers.getEndPorts(ac);
+ List<Port> _endPorts = this._roomHelpers.getEndPorts(ac);
for (final Port ep : _endPorts) {
StringConcatenation _builder_2 = new StringConcatenation();
String _name_1 = ep.getName();
@@ -606,7 +605,7 @@ public class ActorClassGen extends GenericActorClassGenerator {
EList<StandardOperation> _operations = ac.getOperations();
final Function1<StandardOperation, Boolean> _function = new Function1<StandardOperation, Boolean>() {
public Boolean apply(final StandardOperation op) {
- return Boolean.valueOf(RoomHelpers.isConstructor(op));
+ return Boolean.valueOf(ActorClassGen.this._roomHelpers.isConstructor(op));
}
};
Iterable<StandardOperation> _filter = IterableExtensions.<StandardOperation>filter(_operations, _function);
@@ -674,7 +673,7 @@ public class ActorClassGen extends GenericActorClassGenerator {
_builder.append("{");
_builder.newLine();
{
- boolean _hasNonEmptyStateMachine = RoomHelpers.hasNonEmptyStateMachine(ac);
+ boolean _hasNonEmptyStateMachine = this._roomHelpers.hasNonEmptyStateMachine(ac);
if (_hasNonEmptyStateMachine) {
_builder.append("\t");
_builder.append("history = new int[s_numberOfStates];");
@@ -793,7 +792,7 @@ public class ActorClassGen extends GenericActorClassGenerator {
_builder.newLine();
_builder.newLine();
{
- boolean _hasNonEmptyStateMachine_1 = RoomHelpers.hasNonEmptyStateMachine(ac);
+ boolean _hasNonEmptyStateMachine_1 = this._roomHelpers.hasNonEmptyStateMachine(ac);
if (_hasNonEmptyStateMachine_1) {
CharSequence _genStateMachine = this._stateMachineGen.genStateMachine(xpac, false);
_builder.append(_genStateMachine, "");
diff --git a/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/ConfigGenAddon.java b/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/ConfigGenAddon.java
index ed16359e3..bbbf6c7d6 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/ConfigGenAddon.java
+++ b/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/ConfigGenAddon.java
@@ -60,13 +60,17 @@ public class ConfigGenAddon {
@Inject
@Extension
+ private RoomHelpers _roomHelpers;
+
+ @Inject
+ @Extension
private RoomExtensions _roomExtensions;
public CharSequence genActorInstanceConfig(final ActorInstance ai, final String aiVariableName) {
StringConcatenation _builder = new StringConcatenation();
{
ActorClass _actorClass = ai.getActorClass();
- List<Attribute> _allAttributes = RoomHelpers.getAllAttributes(_actorClass);
+ List<Attribute> _allAttributes = this._roomHelpers.getAllAttributes(_actorClass);
for(final Attribute a : _allAttributes) {
ArrayList<Attribute> _arrayList = new ArrayList<Attribute>();
List<Attribute> _union = this._roomExtensions.<Attribute>union(_arrayList, a);
@@ -79,7 +83,7 @@ public class ConfigGenAddon {
EList<InterfaceItemInstance> _orderedIfItemInstances = ai.getOrderedIfItemInstances();
for(final InterfaceItemInstance pi : _orderedIfItemInstances) {
InterfaceItem _interfaceItem = pi.getInterfaceItem();
- PortClass _portClass = RoomHelpers.getPortClass(_interfaceItem);
+ PortClass _portClass = this._roomHelpers.getPortClass(_interfaceItem);
EList<Attribute> _attributes = null;
if (_portClass!=null) {
_attributes=_portClass.getAttributes();
@@ -473,7 +477,7 @@ public class ConfigGenAddon {
Attribute _last_1 = IterableExtensions.<Attribute>last(path);
RefableType _type_2 = _last_1.getType();
DataType _type_3 = _type_2.getType();
- List<Attribute> _allAttributes = RoomHelpers.getAllAttributes(((DataClass) _type_3));
+ List<Attribute> _allAttributes = this._roomHelpers.getAllAttributes(((DataClass) _type_3));
for(final Attribute e : _allAttributes) {
String _name = e.getName();
String _plus = ((varNamePath + "_") + _name);
diff --git a/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/DataClassGen.java b/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/DataClassGen.java
index dd88a3d98..6332956dc 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/DataClassGen.java
+++ b/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/DataClassGen.java
@@ -70,6 +70,10 @@ public class DataClassGen {
private Initialization _initialization;
@Inject
+ @Extension
+ private RoomHelpers _roomHelpers;
+
+ @Inject
private ILogger logger;
public void doGenerate(final Root root) {
@@ -110,7 +114,7 @@ public class DataClassGen {
EList<StandardOperation> _operations = dc.getOperations();
final Function1<StandardOperation, Boolean> _function = new Function1<StandardOperation, Boolean>() {
public Boolean apply(final StandardOperation op) {
- return Boolean.valueOf(RoomHelpers.isConstructor(op));
+ return Boolean.valueOf(DataClassGen.this._roomHelpers.isConstructor(op));
}
};
Iterable<StandardOperation> _filter = IterableExtensions.<StandardOperation>filter(_operations, _function);
@@ -315,7 +319,7 @@ public class DataClassGen {
EList<StandardOperation> _operations = dc.getOperations();
final Function1<StandardOperation, Boolean> _function = new Function1<StandardOperation, Boolean>() {
public Boolean apply(final StandardOperation op) {
- return Boolean.valueOf(RoomHelpers.isConstructor(op));
+ return Boolean.valueOf(DataClassGen.this._roomHelpers.isConstructor(op));
}
};
Iterable<StandardOperation> _filter = IterableExtensions.<StandardOperation>filter(_operations, _function);
diff --git a/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/ProtocolClassGen.java b/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/ProtocolClassGen.java
index 96ac21c65..17dfd4295 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/ProtocolClassGen.java
+++ b/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/ProtocolClassGen.java
@@ -36,7 +36,6 @@ import org.eclipse.etrice.core.room.RefableType;
import org.eclipse.etrice.core.room.SAP;
import org.eclipse.etrice.core.room.SPP;
import org.eclipse.etrice.core.room.VarDecl;
-import org.eclipse.etrice.core.room.util.RoomHelpers;
import org.eclipse.etrice.generator.cpp.Main;
import org.eclipse.etrice.generator.cpp.gen.CppExtensions;
import org.eclipse.etrice.generator.cpp.gen.GeneratorSettings;
@@ -368,7 +367,7 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.append("// outgoing messages");
_builder.newLine();
{
- List<Message> _allMessages = RoomHelpers.getAllMessages(pc, (conj).booleanValue());
+ List<Message> _allMessages = this._roomHelpers.getAllMessages(pc, (conj).booleanValue());
for(final Message m : _allMessages) {
_builder.append("\t");
CharSequence _sendMessageDeclaration = this.sendMessageDeclaration(m, (conj).booleanValue());
@@ -441,7 +440,7 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.append("// outgoing messages");
_builder.newLine();
{
- List<Message> _allMessages_1 = RoomHelpers.getAllMessages(pc, (conj).booleanValue());
+ List<Message> _allMessages_1 = this._roomHelpers.getAllMessages(pc, (conj).booleanValue());
for(final Message m_1 : _allMessages_1) {
_builder.append("\t\t");
CharSequence _sendMessageDeclaration_1 = this.sendMessageDeclaration(m_1, (conj).booleanValue());
@@ -779,7 +778,7 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.append("// sent messages");
_builder.newLine();
{
- List<Message> _allMessages = RoomHelpers.getAllMessages(pc, (conj).booleanValue());
+ List<Message> _allMessages = this._roomHelpers.getAllMessages(pc, (conj).booleanValue());
for(final Message m : _allMessages) {
String _name_3 = pc.getName();
CharSequence _sendMessage = this.sendMessage(m, _name_3, portClassName, (conj).booleanValue());
@@ -850,7 +849,7 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.append("// outgoing messages");
_builder.newLine();
{
- List<Message> _allMessages_1 = RoomHelpers.getAllMessages(pc, (conj).booleanValue());
+ List<Message> _allMessages_1 = this._roomHelpers.getAllMessages(pc, (conj).booleanValue());
for(final Message m_1 : _allMessages_1) {
CharSequence _messageSignatureDefinition = this.messageSignatureDefinition(m_1, replPortClassName);
_builder.append(_messageSignatureDefinition, "");
@@ -932,7 +931,7 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.append("= {\"MIN\", ");
_builder.newLine();
{
- List<Message> _allOutgoingMessages = RoomHelpers.getAllOutgoingMessages(pc);
+ List<Message> _allOutgoingMessages = this._roomHelpers.getAllOutgoingMessages(pc);
for(final Message m : _allOutgoingMessages) {
_builder.append("\t\t ");
_builder.append("\"");
@@ -943,7 +942,7 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
}
}
{
- List<Message> _allIncomingMessages = RoomHelpers.getAllIncomingMessages(pc);
+ List<Message> _allIncomingMessages = this._roomHelpers.getAllIncomingMessages(pc);
for(final Message m_1 : _allIncomingMessages) {
_builder.append("\t\t ");
_builder.append("\"");
diff --git a/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/StateMachineGen.java b/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/StateMachineGen.java
index 8f3ec5c37..5b9c38a51 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/StateMachineGen.java
+++ b/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/StateMachineGen.java
@@ -21,7 +21,6 @@ import org.eclipse.etrice.core.room.ActorClass;
import org.eclipse.etrice.core.room.InterfaceItem;
import org.eclipse.etrice.core.room.MessageFromIf;
import org.eclipse.etrice.core.room.State;
-import org.eclipse.etrice.generator.base.CodegenHelpers;
import org.eclipse.etrice.generator.cpp.gen.ProtocolClassGen;
import org.eclipse.etrice.generator.generic.GenericStateMachineGenerator;
import org.eclipse.etrice.generator.generic.RoomExtensions;
@@ -81,7 +80,7 @@ public class StateMachineGen extends GenericStateMachineGenerator {
_builder.appendImmediate(",", "");
}
_builder.append("\"");
- String _genStatePathName = CodegenHelpers.getGenStatePathName(state);
+ String _genStatePathName = this._codegenHelpers.getGenStatePathName(state);
_builder.append(_genStatePathName, "");
_builder.append("\"");
_builder.newLineIfNotEmpty();

Back to the top