Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

DC_FromFsmEvent Class Reference

#include <DC_FromFsmEvent.h>

Inheritance diagram for DC_FromFsmEvent:

DC_FsmEvent PunctualAction CC_RootObject List of all members.

Detailed Description

Default component encapsulating an FsmEvent that requests a transition in the target FSM between two states.

The two states across which the transition is attempted are the starting state and the target state. Both are configuration parameters for the FsmEvent. When the FsmEvent is fired, it checks whether the target FSM is in the starting state and, if it is, it makes a request for a transition to the target state. If the target FSM is not in the starting state, no action is taken.

Author:
Alessandro Pasetti (P&P Software GmbH)
Version:
1.0

Definition at line 32 of file DC_FromFsmEvent.h.

Public Member Functions

 DC_FromFsmEvent (void)
 Instantiate an FromFsmEvent object.

void setStartingState (TD_FsmStateIndex startingState)
 Setter method for the starting state.

TD_FsmStateIndex getStartingState (void) const
 Getter method for the starting state.

virtual bool isObjectConfigured (void)
 Perform a class-specific configuration check on a repository object: verify that the starting state has been loaded and that it 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 from the starting state to the target state.


Constructor & Destructor Documentation

DC_FromFsmEvent::DC_FromFsmEvent void   ) 
 

Instantiate an FromFsmEvent object.

Set the class identifier and initialize the starting state. The starting state is initialized to an illegal values to signify that the FromFsmEvent is not yet configured.

Definition at line 18 of file DC_FromFsmEvent.cpp.


Member Function Documentation

TD_ActionOutcome DC_FromFsmEvent::doAction void   )  [protected, virtual]
 

Execute the FsmEvent: lodge a request to the target FSM to perform a state transition from the starting state to the target state.

The request is only lodged if the FSM is in the starting state. A pseudo-code implementation for this method is as follows:

   if (targetFsm.getCurrentState() eq startingState)
       targetFsm.makeTransitionRequest(targetState);
       return ACTION_SUCCESS;
   else
       return ACTION_FAILURE; 

Returns:
the ACTION_SUCCESS code if the transition request was lodged, the ACTION_FAILURE code if it was not

Reimplemented from DC_FsmEvent.

Definition at line 38 of file DC_FromFsmEvent.cpp.

TD_FsmStateIndex DC_FromFsmEvent::getStartingState void   )  const
 

Getter method for the starting state.

Returns:
the starting state

Definition at line 28 of file DC_FromFsmEvent.cpp.

bool DC_FromFsmEvent::isObjectConfigured void   )  [virtual]
 

Perform a class-specific configuration check on a repository object: verify that the starting state has been loaded and that it has a legal value.

The legality of the starting 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 DC_FsmEvent.

Definition at line 33 of file DC_FromFsmEvent.cpp.

void DC_FromFsmEvent::setStartingState TD_FsmStateIndex  startingState  ) 
 

Setter method for the starting state.

The starting state is expressed as an integer that should be in the range [0,N-1] where N is the total number of states in the target FSM. This is an initialization method.

Parameters:
startingState the starting state

Definition at line 23 of file DC_FromFsmEvent.cpp.


The documentation for this class was generated from the following files:
Copyright 2003 P&P Software GmbH - All Rights Reserved