Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.etrice.generator.java/src/templates/ActorClass.xpt')
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/templates/ActorClass.xpt149
1 files changed, 0 insertions, 149 deletions
diff --git a/plugins/org.eclipse.etrice.generator.java/src/templates/ActorClass.xpt b/plugins/org.eclipse.etrice.generator.java/src/templates/ActorClass.xpt
deleted file mode 100644
index f34a7537b..000000000
--- a/plugins/org.eclipse.etrice.generator.java/src/templates/ActorClass.xpt
+++ /dev/null
@@ -1,149 +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 actorClass FOR Root»
-
-«FOREACH this.xpActorClasses AS xpac»
-«LET xpac.actorClass AS ac»
-
-«("generating "+getPath(ac)+ac.name+".java").info()»
-
-«FILE getPath(ac)+ac.name+".java"»
-package «getPackage(ac)»;
-
-import org.eclipse.etrice.runtime.java.messaging.Address;
-import org.eclipse.etrice.runtime.java.messaging.IRTObject;
-import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;
-import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase;
-import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;
-import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
-import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
-
-«LET this.getReferencedModels(ac) AS models»
-«FOREACH models AS model»import «model.name».*;
-«ENDFOREACH»
-«ENDLET»
-
-«LET this.getReferencedProtocols(ac) AS protocols»
-«FOREACH protocols AS pc»import «getPackage(pc)».«pc.name».*;
-«ENDFOREACH»
-«ENDLET»
-
-«EXPAND ProcedureHelpers::UserCode FOR ac.userCode1»
-
-
-public «IF ac.abstract»abstract «ENDIF»class «ac.name» extends «IF ac.base!=null»«ac.base.name»«ELSE»ActorClassBase«ENDIF» {
-
- «EXPAND ProcedureHelpers::UserCode FOR ac.userCode2»
-
- //--------------------- ports
- «FOREACH ac.getEndPorts() AS ep»protected «ep.getPortClassName()» «ep.name» = null;
- «ENDFOREACH»
- //--------------------- saps
- «FOREACH ac.strSAPs AS sap»protected «sap.getPortClassName()» «sap.name» = null;
- «ENDFOREACH»
- //--------------------- services
- «FOREACH ac.serviceImplementations AS svc»protected «svc.getPortClassName()» «svc.spp.name» = null;
- «ENDFOREACH»
-
- //--------------------- interface item IDs
- «FOREACH ac.getEndPorts() AS ep»protected static final int IFITEM_«ep.name» = «xpac.getInterfaceItemLocalId(ep)+1»;
- «ENDFOREACH»
- «FOREACH ac.strSAPs AS sap»protected static final int IFITEM_«sap.name» = «xpac.getInterfaceItemLocalId(sap)+1»;
- «ENDFOREACH»
- «FOREACH ac.serviceImplementations AS svc»protected static final int IFITEM_«svc.spp.name» = «xpac.getInterfaceItemLocalId(svc.spp)+1»;
- «ENDFOREACH»
-
- «EXPAND ProcedureHelpers::Attributes FOR ac.attributes»
- «EXPAND ProcedureHelpers::Operations FOR ac.operations»
-
- //--------------------- construction
- public «ac.name»(IRTObject parent, String name, Address[][] port_addr, Address[][] peer_addr){
- «IF ac.base==null»
- super(parent, name, port_addr[0][0], peer_addr[0][0]);
- «ELSE»
- super(parent, name, port_addr, peer_addr);
- «ENDIF»
- setClassName("«ac.name»");
-
- // initialize attributes
- «FOREACH ac.attributes AS a-»
- «IF a.defaultValueLiteral!=null-»
- «a.name» = «a.defaultValueLiteral»;
- «ELSEIF a.type.type!=null-»
- «a.name» = new «a.type.type.name»();
- «ENDIF-»
- «ENDFOREACH-»
-
- // own ports«FOREACH ac.getEndPorts() AS ep»
- «ep.name» = new «ep.getPortClassName()»(this, "«ep.name»", IFITEM_«ep.name», «IF ep.multiplicity==1»0, «ENDIF»port_addr[IFITEM_«ep.name»]«IF ep.multiplicity==1»[0]«ENDIF», peer_addr[IFITEM_«ep.name»]«IF ep.multiplicity==1»[0]«ENDIF»);
- «ENDFOREACH»
- // own saps«FOREACH ac.strSAPs AS sap»
- «sap.name» = new «sap.getPortClassName()»(this, "«sap.name»", IFITEM_«sap.name», 0, port_addr[IFITEM_«sap.name»][0], peer_addr[IFITEM_«sap.name»][0]);
- «ENDFOREACH»
- // own service implementations«FOREACH ac.serviceImplementations AS svc»
- «svc.spp.name» = new «svc.getPortClassName()»(this, "«svc.spp.name»", IFITEM_«svc.spp.name», port_addr[IFITEM_«svc.spp.name»], peer_addr[IFITEM_«svc.spp.name»]);
- «ENDFOREACH»
- }
-
-
- //--------------------- lifecycle functions
- public void init(){
- initUser();
- }
-
- public void start(){
- startUser();
- }
-
- «IF !ac.overridesStop()»
- public void stop(){
- stopUser();
- }
- «ENDIF»
-
- public void destroy(){
- destroyUser();
- }
-
- «IF ac.stateMachine != null»
- «EXPAND StateMachine::stateMachine FOR xpac»
- «ELSEIF !xpac.hasStateMachine()»
- //--------------------- no state machine
- @Override
- public void receiveEvent(InterfaceItemBase ifitem, int evt, Object data) {
- handleSystemEvent(ifitem, evt, data);
- }
-
- @Override
- public void executeInitTransition(){
- }
-
- «ENDIF»
-};
-«ENDFILE»
-«ENDLET»
-«ENDFOREACH»
-«ENDDEFINE»
-
-«DEFINE msgArgs FOR Message»
-«IF this.data!=null»«this.data.defaultValue()»«ENDIF»
-«ENDDEFINE»

Back to the top