SourceForge Project Site
Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

FSM::CFSMSimpleTransition Class Reference

Simple transition. More...

#include <FSMTransition.h>

Inheritance diagram for FSM::CFSMSimpleTransition::

FSM::CFSMTransition FSM::CFSMObject FSM::CFSMPushTransition List of all members.

Public Methods

CFSMStateGetToState () const
void SetToState (const char *stateName)
virtual bool SetParameter (const char *paramName, const char *paramValue)
CFSMActionAddAction (const char *className)
CFSMActionGetAction (int index) const
bool DeleteAction (CFSMAction *action)
Action_List::const_iterator GetActionsBegin () const
 Use (*iterator) to get the pointer to the action. More...

Action_List::const_iterator GetActionsEnd () const
CFSMConditionAddCondition (const char *className="TestVariable")
CFSMConditionGetCondition (int index) const
bool DeleteCondition (CFSMCondition *condition)
Condition_List::const_iterator GetConditionsBegin () const
 Use (*iterator) to get the pointer to the condition. More...

Condition_List::const_iterator GetConditionsEnd () const
CFSMStateGetFromState () const
const char * GetOnEvent () const
void SetOnEvent (const char *event="ANY")
CFiniteStateMachineGetFSM () const
const char * GetNameOfClass () const
 The class name is set by FiniteStateMachine::Create(). More...


Protected Methods

virtual void DeleteThis ()
 "Destructor" Simple call delete this. More...

virtual bool SaveParameters (CFSMSaver *out) const
 overloaded CFSMObject::SaveParameters. More...

virtual bool Execute (const char *event, void *a, void *b)
 Called if the transition match. More...

 CFSMSimpleTransition ()
virtual ~CFSMSimpleTransition ()
void SetFromState (const char *stateName)
virtual bool Check (bool &result, const char *event, void *a, void *b)
 the answer is in result!!! More...

virtual bool Activate ()
 Called when the state is activated. More...

virtual bool Deactivate ()
 Called when the state is deactivated Calls Deactivate() of conditions (e.g. More...

void SetFSM (CFiniteStateMachine *ptr)
void SetClassName (const char *name)

Static Protected Methods

CFSMObjectCreate ()

Private Attributes

string m_ToState

Friends

class CFSMState
class CFiniteStateMachine

Detailed Description

Simple transition.

Definition at line 169 of file FSMTransition.h.


Constructor & Destructor Documentation

FSM::CFSMSimpleTransition::CFSMSimpleTransition   [protected]
 

Definition at line 322 of file FSMTransition.cpp.

FSM::CFSMSimpleTransition::~CFSMSimpleTransition   [protected, virtual]
 

Definition at line 327 of file FSMTransition.cpp.

References m_ToState.


Member Function Documentation

bool FSM::CFSMTransition::Activate   [protected, virtual, inherited]
 

Called when the state is activated.

Calls Activate() of conditions (e.g. to start a timer)

Definition at line 286 of file FSMTransition.cpp.

References iRethrow.

CFSMAction * FSM::CFSMTransition::AddAction const char *    className [inherited]
 

Definition at line 64 of file FSMTransition.cpp.

References iRethrow.

CFSMCondition * FSM::CFSMTransition::AddCondition const char *    className = "TestVariable" [inherited]
 

Definition at line 135 of file FSMTransition.cpp.

References iRethrow.

bool FSM::CFSMTransition::Check bool &    retval,
const char *    event,
void *    a,
void *    b
[protected, virtual, inherited]
 

the answer is in result!!!

Returns:
is false if there where errors. Do not execute actions here, just check.

Definition at line 236 of file FSMTransition.cpp.

References iThrow(), and WARNING.

CFSMObject * FSM::CFSMSimpleTransition::Create   [static, protected]
 

Reimplemented in FSM::CFSMPushTransition.

Definition at line 416 of file FSMTransition.cpp.

bool FSM::CFSMTransition::Deactivate   [protected, virtual, inherited]
 

Called when the state is deactivated Calls Deactivate() of conditions (e.g.

to stop a timer)

Definition at line 301 of file FSMTransition.cpp.

References iRethrow, and FSM::CFSMTransition::m_Conditions.

bool FSM::CFSMTransition::DeleteAction CFSMAction   action [inherited]
 

Definition at line 100 of file FSMTransition.cpp.

References CRITICAL, iThrow(), and FSM::CFSMTransition::m_Actions.

bool FSM::CFSMTransition::DeleteCondition CFSMCondition   condition [inherited]
 

Definition at line 171 of file FSMTransition.cpp.

References CRITICAL, iThrow(), and FSM::CFSMTransition::m_Conditions.

void FSM::CFSMSimpleTransition::DeleteThis   [protected, virtual]
 

"Destructor" Simple call delete this.

This is needed because of the memory management in shared libraries. Provide a static method "Create" in derived classes that returns a new instance of that class and use DeleteThis to destroy it. The constructor and destructor shuld be protected.

Reimplemented from FSM::CFSMObject.

Reimplemented in FSM::CFSMPushTransition.

Definition at line 421 of file FSMTransition.cpp.

bool FSM::CFSMSimpleTransition::Execute const char *    event,
void *    a,
void *    b
[protected, virtual]
 

Called if the transition match.

Execute actions and switch to a new state.

Reimplemented from FSM::CFSMTransition.

Reimplemented in FSM::CFSMPushTransition.

Definition at line 388 of file FSMTransition.cpp.

References CFSMState, FSM::CFSMObject::GetFSM(), GetToState(), and iRethrow.

CFSMAction * FSM::CFSMTransition::GetAction int    index const [inherited]
 

Returns:
the index-th action. index==0 -> first action. NULL if out of range

Definition at line 79 of file FSMTransition.cpp.

References CRITICAL, iThrow(), and FSM::CFSMTransition::m_Actions.

Action_List::const_iterator FSM::CFSMTransition::GetActionsBegin   const [inherited]
 

Use (*iterator) to get the pointer to the action.

Use ++iterator to get the next iterator.

Returns:
the begin-iterator of the actions container

Definition at line 122 of file FSMTransition.cpp.

References FSM::CFSMTransition::m_Actions.

Action_List::const_iterator FSM::CFSMTransition::GetActionsEnd   const [inherited]
 

Returns:
the end-iterator of the actions container

Definition at line 127 of file FSMTransition.cpp.

References FSM::CFSMTransition::m_Actions.

CFSMCondition * FSM::CFSMTransition::GetCondition int    index const [inherited]
 

Returns:
the index-th condition. index==0 -> first condition. NULL if out of range

Definition at line 150 of file FSMTransition.cpp.

References CRITICAL, iThrow(), and FSM::CFSMTransition::m_Conditions.

Condition_List::const_iterator FSM::CFSMTransition::GetConditionsBegin   const [inherited]
 

Use (*iterator) to get the pointer to the condition.

Use ++iterator to get the next iterator.

Returns:
the begin-iterator of the conditions container

Definition at line 193 of file FSMTransition.cpp.

References FSM::CFSMTransition::m_Conditions.

Condition_List::const_iterator FSM::CFSMTransition::GetConditionsEnd   const [inherited]
 

Returns:
the end-iterator of the conditions container

Definition at line 198 of file FSMTransition.cpp.

References FSM::CFSMTransition::m_Conditions.

CFSMState * FSM::CFSMTransition::GetFromState   const [inherited]
 

Definition at line 216 of file FSMTransition.cpp.

References FSM::CFSMTransition::CFSMState, FSM::CFSMObject::GetFSM(), iRethrow, and FSM::CFSMTransition::m_FromState.

Referenced by GetToState().

CFiniteStateMachine * FSM::CFSMObject::GetFSM   const [inherited]
 

Definition at line 56 of file FSMObject.cpp.

References FSM::CFSMObject::myStateMachine.

Referenced by FSM::CFSMState::AddLeaveAction(), FSM::CFSMState::AddSimpleTransition(), FSM::CFSMConditionTestVariable::CheckCondition(), FSM::CFSMPopTransition::Execute(), FSM::CFSMPushTransition::Execute(), Execute(), FSM::CFSMTransition::GetFromState(), and GetToState().

const char * FSM::CFSMObject::GetNameOfClass   const [inherited]
 

The class name is set by FiniteStateMachine::Create().

So do not make Create methods public.

Definition at line 66 of file FSMObject.cpp.

References FSM::CFSMObject::ClassName.

Referenced by FSM::CFSMState::Activate(), FSM::CFSMConditionTestVariable::CheckCondition(), FSM::CFSMState::Deactivate(), SetParameter(), FSM::CFSMConditionTestVariable::SetParameter(), FSM::CFSMActionIncrVariable::SetParameter(), and FSM::CFSMActionSetVariable::SetParameter().

const char * FSM::CFSMTransition::GetOnEvent   const [inherited]
 

Definition at line 227 of file FSMTransition.cpp.

References FSM::CFSMTransition::m_Event.

CFSMState * FSM::CFSMSimpleTransition::GetToState   const
 

Definition at line 342 of file FSMTransition.cpp.

References CFSMState, FSM::CFSMTransition::GetFromState(), FSM::CFSMObject::GetFSM(), iRethrow, and m_ToState.

Referenced by FSM::CFSMPushTransition::Execute(), and Execute().

bool FSM::CFSMSimpleTransition::SaveParameters CFSMSaver   out const [protected, virtual]
 

overloaded CFSMObject::SaveParameters.

Reimplemented from FSM::CFSMObject.

Definition at line 363 of file FSMTransition.cpp.

References iRethrow.

void FSM::CFSMObject::SetClassName const char *    name [protected, inherited]
 

Definition at line 61 of file FSMObject.cpp.

References FSM::CFSMObject::ClassName.

void FSM::CFSMTransition::SetFromState const char *    stateName [protected, inherited]
 

Definition at line 206 of file FSMTransition.cpp.

void FSM::CFSMObject::SetFSM CFiniteStateMachine   ptr [protected, inherited]
 

Definition at line 51 of file FSMObject.cpp.

void FSM::CFSMTransition::SetOnEvent const char *    event = "ANY" [inherited]
 

Definition at line 211 of file FSMTransition.cpp.

References FSM::CFSMTransition::m_Event.

bool FSM::CFSMSimpleTransition::SetParameter const char *    paramName,
const char *    paramValue
[virtual]
 

Reimplemented from FSM::CFSMObject.

Definition at line 369 of file FSMTransition.cpp.

References CRITICAL, FSM::CFSMObject::GetNameOfClass(), iThrow(), and SetToState().

void FSM::CFSMSimpleTransition::SetToState const char *    stateName
 

Definition at line 336 of file FSMTransition.cpp.

References m_ToState.

Referenced by SetParameter().


Friends And Related Function Documentation

friend class CFiniteStateMachine [friend]
 

Reimplemented from FSM::CFSMTransition.

Reimplemented in FSM::CFSMPushTransition.

Definition at line 173 of file FSMTransition.h.

friend class CFSMState [friend]
 

Reimplemented from FSM::CFSMTransition.

Reimplemented in FSM::CFSMPushTransition.

Definition at line 172 of file FSMTransition.h.

Referenced by Execute(), and GetToState().


Member Data Documentation

string FSM::CFSMSimpleTransition::m_ToState [private]
 

Reimplemented from FSM::CFSMTransition.

Definition at line 204 of file FSMTransition.h.

Referenced by GetToState(), SetToState(), and ~CFSMSimpleTransition().


The documentation for this class was generated from the following files:
© 2002 by C-LAB
generated by doxygen