INET Framework for OMNeT++/OMNEST
FSMA.h File Reference

Namespaces

 inet
 Copyright (c) 2005 Jan Ringo�, www.ringos.cz.
 

Macros

#define FSMA_Switch(fsm)
 
#define FSMA_SetLogging(enabled)   ___logging = enabled;
 
#define FSMA_Print(exiting)   if (___logging) EV_DEBUG << "FSM " << ___fsm.getName() << ((exiting) ? ": leaving state " : ": entering state ") << ___fsm.getStateName() << endl
 
#define FSMA_State(s)   if (___transition_seen = false, ___exit = true, ___fsm.getState() == (s))
 
#define FSMA_Enter(action)
 
#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_Ignore_Event(condition)
 
#define FSMA_Fail_On_Unhandled_Event()
 

Macro Definition Documentation

#define FSMA_Enter (   action)
Value:
if (!___is_event) \
{ \
if (___transition_seen) \
throw cRuntimeError(&___fsm, "FSMA_Enter() must precede all FSMA_*_Transition()'s in the code"); \
action; \
}
if(!(yy_init))
Definition: lexer.cc:1644

Referenced by inet::ieee80211::Contention::handleWithFSM(), and inet::CsmaCaMac::handleWithFsm().

#define FSMA_Event_Transition (   transition,
  condition,
  target,
  action 
)
Value:
___transition_seen = true; if ((condition) && ___is_event) \
{ \
___is_event = false; \
FSMA_Transition(transition, (condition), target, action)
#define FSMA_Transition(transition, condition, target, action)
Definition: FSMA.h:138

Referenced by inet::ieee80211::Contention::handleWithFSM(), and inet::CsmaCaMac::handleWithFsm().

#define FSMA_Fail_On_Unhandled_Event ( )
Value:
___transition_seen = true; if (___is_event) \
{ \
throw cRuntimeError(&___fsm, "Unhandled event"); \
}

Referenced by inet::ieee80211::Contention::handleWithFSM().

#define FSMA_Ignore_Event (   condition)
Value:
___transition_seen = true; if ((condition) && ___is_event) \
{ \
if (___logging) EV_DEBUG << "FSM " << ___fsm.getName() << ": condition \"" << #condition << "\" holds, staying in current state"<< endl; \
___is_event = false; \
}
if(!(yy_init))
Definition: lexer.cc:1644

Referenced by inet::ieee80211::Contention::handleWithFSM().

#define FSMA_No_Event_Transition (   transition,
  condition,
  target,
  action 
)
Value:
___transition_seen = true; if ((condition) && !___is_event) \
{ \
FSMA_Transition(transition, (condition), target, action)
#define FSMA_Transition(transition, condition, target, action)
Definition: FSMA.h:138
#define FSMA_Print (   exiting)    if (___logging) EV_DEBUG << "FSM " << ___fsm.getName() << ((exiting) ? ": leaving state " : ": entering state ") << ___fsm.getStateName() << endl
#define FSMA_SetLogging (   enabled)    ___logging = enabled;
#define FSMA_State (   s)    if (___transition_seen = false, ___exit = true, ___fsm.getState() == (s))
#define FSMA_Switch (   fsm)
Value:
bool ___is_event = true; \
bool ___exit = false; \
bool ___transition_seen = false; \
int ___c = 0; \
cFSM& ___fsm = (fsm); \
bool ___logging = true; \
if (___logging) EV_DEBUG << "FSM " << ___fsm.getName() << ": processing event in state " << ___fsm.getStateName() << "\n"; \
while (!___exit && (___c++ < FSM_MAXT || (throw cRuntimeError(E_INFLOOP, ___fsm.getStateName()), 0)))
if(!(yy_init))
Definition: lexer.cc:1644

Referenced by inet::ieee80211::Contention::handleWithFSM(), and inet::CsmaCaMac::handleWithFsm().

#define FSMA_Transition (   transition,
  condition,
  target,
  action 
)
Value:
FSMA_Print(true); \
if (___logging) EV_DEBUG << "FSM " << ___fsm.getName() << ": condition \"" << #condition << "\" holds, taking transition \"" << #transition << "\" to state " << #target << endl; \
action; \
___fsm.setState(target, #target); \
if (___logging) EV_DEBUG << "FSM " << ___fsm.getName() << ": done processing associated actions\n"; \
FSMA_Print(false); \
___exit = false; \
continue; \
}
#define FSMA_Print(exiting)
Definition: FSMA.h:114
if(!(yy_init))
Definition: lexer.cc:1644