XFTGenerator/templates/file.c

62 lines
1.1 KiB
C

/**
* @author ${author}
* @version 1.0.0
* @date ${date}
* @file ${filename_lc}.c
*/
#include "${filename_lc}.h"
void ${filename}_init(${filename}* me){
me->state = ST${fn}_INIT;
${VARS_INIT}
}
void ${filename}_startBehaviour(${filename}* me){
POST(me, &${filename}_processEvent, ev${fn}init, 0, 0);
}
bool ${filename}_processEvent(Event* ev) {
bool processed = false;
${filename}* me = (${filename}*)Event_getTarget(ev);
switch (me->state) { // onState
case ST${fn}_INIT:
if (ev->id == ev${fn}init) {
}
break;
${STATES_CASES}
}
if(oldState != me->state){
switch (oldState) { // onExit
case ST${fn}_INIT:
break;
${STATES_CASES}
}
switch (me->state) { // onEntry
case ST${fn}_INIT:
break;
${STATES_CASES}
}
processed = true;
}
return processed;
}
/************
* EMITTERS *
************/
${EVENTS_EMITS_DEF}
/***********
* SETTERS *
***********/
${VARS_SETTERS_DEF}