#include <DC_FsmEvent.h>
Inheritance diagram for DC_FsmEvent:
An FsmEvent is a punctual action that, when it is executed, causes an FSM to attempt a state transition. The FSM upon which the FsmEvent acts is called the target FSM. The FSM state to which the transition is commanded is called the target state. Both the target FSM and target state are encapsulated in the FsmEvent object as configuration parameters. This class encapsulate the following FsmEvent execution logic: when the event is executed, a state transition request to the target state is made to the target FSM. Other FsmEvent execution logic would in principle be possible. For instance, the state transition request might be not just to a certain target state but from a given starting state to a given target state. Alternative execution logic can be implemented by subclassing this class and overriding its doAction
method.
Definition at line 38 of file DC_FsmEvent.h.
Public Member Functions | |
DC_FsmEvent (void) | |
Instantiate an FsmEvent object. | |
void | setTargetFsm (CC_FSM *pTargetFsm) |
Setter method for the target FSM. | |
void | setTargetState (TD_FsmStateIndex targetState) |
Setter method for the target state. | |
CC_FSM * | getTargetFsm (void) const |
Getter method for the target FSM. | |
TD_FsmStateIndex | getTargetState (void) const |
Getter method for the target state. | |
virtual bool | isObjectConfigured (void) |
Perform a class-specific configuration check on a FsmEvent object: verify that the target FSM has been loaded, that the target state has been loaded, and that the loaded target state has a legal value. | |
Protected Member Functions | |
virtual TD_ActionOutcome | doAction (void) |
Execute the FsmEvent: lodge a request to the target FSM to perform a state transition to the target state. |
|
Instantiate an FsmEvent object. Set the class identifier and initialize the target FSM and the target state. The target FSM and the target state are initialized to illegal values to signify that the FsmEvent is not yet configured. Definition at line 18 of file DC_FsmEvent.cpp. |
|
Execute the FsmEvent: lodge a request to the target FSM to perform a state transition to the target state. A pseudo-code implementation for this method is as follows: targetFsm.makeTransitionRequest(targetState); return ACTION_SUCCESS;The method assumes that the FsmEvent is correctly configured and that a target FSM and target state have been loaded. No check is made about the current state of the FSM. Applications that wish to implement a more complex execution logic should override this method. Only one return value can be returned by this implementation signifiying a successful outcome to execution of the puncutal action.
Implements PunctualAction. Reimplemented in DC_FromFsmEvent. Definition at line 49 of file DC_FsmEvent.cpp. |
|
Getter method for the target FSM.
Definition at line 34 of file DC_FsmEvent.cpp. |
|
Getter method for the target state.
Definition at line 39 of file DC_FsmEvent.cpp. |
|
Perform a class-specific configuration check on a FsmEvent object: verify that the target FSM has been loaded, that the target state has been loaded, and that the loaded target state has a legal value. The legality of the target state is checked by verifying that its value lies in the range [0,N-1] where N is the total number of states in the target FSM. Reimplemented from CC_RootObject. Reimplemented in DC_FromFsmEvent. Definition at line 44 of file DC_FsmEvent.cpp. |
|
Setter method for the target FSM. This is an initialization method.
Definition at line 24 of file DC_FsmEvent.cpp. |
|
Setter method for the target state. The target state is specified as an index that must lie in the range [0,N-1] where N is the total number of states in the target FSM. This is an initialization method.
Definition at line 29 of file DC_FsmEvent.cpp. |