Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.etrice.generator.java/src/templates/SubSystemClass.xpt')
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/templates/SubSystemClass.xpt122
1 files changed, 0 insertions, 122 deletions
diff --git a/plugins/org.eclipse.etrice.generator.java/src/templates/SubSystemClass.xpt b/plugins/org.eclipse.etrice.generator.java/src/templates/SubSystemClass.xpt
deleted file mode 100644
index dc0b9cd94..000000000
--- a/plugins/org.eclipse.etrice.generator.java/src/templates/SubSystemClass.xpt
+++ /dev/null
@@ -1,122 +0,0 @@
-«REM»
-/*******************************************************************************
- * Copyright (c) 2010 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 and Henrik Rentz-Reichert (initial contribution)
- *
- *******************************************************************************/
-«ENDREM»
-«IMPORT room»;
-«IMPORT etricegen»;
-
-«EXTENSION org::eclipse::etrice::generator::extensions::Extensions»
-«EXTENSION extensions::Extensions»
-«EXTENSION org::eclipse::xtend::util::stdlib::io»
-
-«DEFINE subSystemClass FOR Root»
-
-«FOREACH this.subSystemInstances AS comp»
-
-«LET comp.subSystemClass AS cc»
-
-«("generating "+getPath(cc)+cc.name+"_controller.java").info()»
-«FILE getPath(cc)+cc.name+".java"»
-package «getPackage(cc)»;
-
-import org.eclipse.etrice.runtime.java.messaging.MessageService;
-import org.eclipse.etrice.runtime.java.messaging.RTServices;
-import org.eclipse.etrice.runtime.java.messaging.Address;
-import org.eclipse.etrice.runtime.java.messaging.IRTObject;
-import org.eclipse.etrice.runtime.java.messaging.RTSystemServicesProtocol.*;
-import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
-import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
-import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
-
-«LET this.getReferencedModels(cc) AS models»
-«FOREACH models AS model»import «model.name».*;«ENDFOREACH»
-«ENDLET»
-
-
-«EXPAND ProcedureHelpers::UserCode FOR cc.userCode1»
-
-public class «comp.name» extends SubSystemClassBase{
-
- «EXPAND ProcedureHelpers::UserCode FOR cc.userCode2»
-
- public «comp.name»(IRTObject parent, String name) {
- super(parent, name);
- }
-
- @Override
- public void receiveEvent(InterfaceItemBase ifitem, int evt, Object data){
- }
-
- @Override
- public void instantiateMessageServices(){
-
- RTServices.getInstance().getMsgSvcCtrl().addMsgSvc(new MessageService(this, new Address(0, 0, 0),"MessageService_Main"));
- «FOREACH comp.subSystemClass.threads AS thread ITERATOR tid»
- RTServices.getInstance().getMsgSvcCtrl().addMsgSvc(new MessageService(this, new Address(0, «tid.counter1», 0),"MessageService_«thread.name»", «thread.prio»));
- «ENDFOREACH»
- }
-
- @Override
- public void instantiateActors(){
- // all addresses
- // Addresses for the Subsystem Systemport
- «FOREACH comp.allContainedInstances AS ai ITERATOR i»Address addr_item_SystemPort_«i.counter0»=new Address(0,0,«comp.objCounter.getAndIncrementCount()»);
- «ENDFOREACH»
-
- «FOREACH comp.allContainedInstances AS ai»
- // actor instance «ai.path» itself => Systemport Address
- // TODOTJ: For each Actor, multiple addresses should be generated (actor?, systemport, debugport)
- Address addr_item_«ai.path.getPathName()»= new Address(0,«ai.threadId»,«ai.objId»);
- // interface items of «ai.path»«FOREACH ai.orderedIfItemInstances AS pi»
- «IF ServiceImplInstance.isInstance(pi) || pi.peers.size>1»«FOREACH pi.peers AS peer ITERATOR i»Address addr_item_«pi.path.getPathName()»_«i.counter0» = new Address(0,«pi.threadId»,«pi.objId+i.counter0»);
- «ENDFOREACH»
- «ELSE»Address addr_item_«pi.path.getPathName()» = new Address(0,«ai.threadId»,«pi.objId»);
- «ENDIF»
- «ENDFOREACH»
- «ENDFOREACH»
-
- // instantiate all actor instances
- instances = new ActorClassBase[«comp.allContainedInstances.size»];
- «FOREACH comp.allContainedInstances AS ai ITERATOR k»instances[«comp.allContainedInstances.indexOf(ai)»] = new «ai.actorClass.name»(
- «IF SubSystemInstance.isInstance(ai.eContainer)»this«ELSE»instances[«comp.allContainedInstances.indexOf(ai.eContainer)»]«ENDIF»,
- "«ai.name»",
- // own interface item addresses
- new Address[][] {{addr_item_«ai.path.getPathName()»},«FOREACH ai.orderedIfItemInstances AS pi SEPARATOR ","»{«IF ServiceImplInstance.isInstance(pi) || pi.peers.size>1»«FOREACH pi.peers AS peer ITERATOR i SEPARATOR ","»addr_item_«pi.path.getPathName()»_«i.counter0»«ENDFOREACH»
- «ELSE»addr_item_«pi.path.getPathName()»
- «ENDIF»}
- «ENDFOREACH»},
- // peer interface item addresses
- new Address[][] {{addr_item_SystemPort_«k.counter0»},«FOREACH ai.orderedIfItemInstances AS pi SEPARATOR ","»{«IF !ServiceImplInstance.isInstance(pi) && pi.peers.isEmpty»null«ELSE»«FOREACH pi.peers AS pp SEPARATOR ","»«IF ServiceImplInstance.isInstance(pp) || pp.peers.size>1»addr_item_«pp.path.getPathName()»_«pp.peers.indexOf(pi)»
- «ELSE»addr_item_«pp.path.getPathName()»
- «ENDIF»
- «ENDFOREACH»«ENDIF»}
- «ENDFOREACH»}
- );
- «ENDFOREACH»
-
- // create the subsystem system port
- RTSystemPort = new RTSystemServicesProtocolConjPortRepl(this, "RTSystemPort",
- 0, //local ID
- new Address[]{ // own addresses
- «FOREACH comp.allContainedInstances AS ai ITERATOR i SEPARATOR ","»addr_item_SystemPort_«i.counter0»
- «ENDFOREACH»},
- new Address[]{ // peer addresses
- «FOREACH comp.allContainedInstances AS ai SEPARATOR ","»addr_item_«ai.path.getPathName()»
- «ENDFOREACH»});
-
- }
-};
-«ENDFILE»
-
-«ENDLET»
-«ENDFOREACH»
-«ENDDEFINE»

Back to the top