INET Framework for OMNeT++/OMNEST
|
#include "INETDefs.h"
Defines | |
#define | FSMA_Switch(fsm) |
#define | FSMA_Print(exiting) |
#define | FSMA_State(s) if (___condition_seen = false, ___exit = true, ___fsm->getState() == (s)) |
#define | FSMA_Event_Transition(transition, condition, target, action) |
#define | FSMA_No_Event_Transition(transition, condition, target, action) |
#define | FSMA_Transition(transition, condition, target, action) |
#define | FSMA_Enter(action) |
#define FSMA_Enter | ( | action | ) |
if (!___is_event) \ { \ if (___condition_seen) \ error("FSMA_Enter() must precede all FSMA_*_Transition()'s in the code"); \ action; \ }
Referenced by Ieee80211Mac::handleWithFSM().
#define FSMA_Event_Transition | ( | transition, | |
condition, | |||
target, | |||
action | |||
) |
___condition_seen = true; if ((condition) && ___is_event) \ { \ ___is_event = false; \ FSMA_Transition(transition, (condition), target, action)
Referenced by Ieee80211Mac::handleWithFSM().
#define FSMA_No_Event_Transition | ( | transition, | |
condition, | |||
target, | |||
action | |||
) |
___condition_seen = true; if ((condition) && !___is_event) \ { \ FSMA_Transition(transition, (condition), target, action)
Referenced by Ieee80211Mac::handleWithFSM().
#define FSMA_Print | ( | exiting | ) |
(ev << "FSM " << ___fsm->getName() \ << ((exiting) ? ": leaving state " : ": entering state ") \ << ___fsm->getStateName() << endl)
#define FSMA_State | ( | s | ) | if (___condition_seen = false, ___exit = true, ___fsm->getState() == (s)) |
Referenced by Ieee80211Mac::handleWithFSM().
#define FSMA_Switch | ( | fsm | ) |
bool ___is_event = true; \ bool ___exit = false; \ bool ___condition_seen = false; \ int ___c = 0; \ cFSM *___fsm = &fsm; \ EV << "processing event in state machine " << (fsm).getName() << endl; \ while (!___exit && (___c++ < FSM_MAXT || (opp_error(eINFLOOP, (fsm).getStateName()), 0)))
Referenced by Ieee80211Mac::handleWithFSM().
#define FSMA_Transition | ( | transition, | |
condition, | |||
target, | |||
action | |||
) |
FSMA_Print(true); \ EV << "firing " << #transition << " transition for " << ___fsm->getName() << endl; \ action; \ ___fsm->setState(target, #target); \ FSMA_Print(false); \ ___exit = false; \ continue; \ }