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

FSM::CFSMActionSetVariable Class Reference

Action, that sets a variable to the specified value. More...

#include <FSMAction.h>

Inheritance diagram for FSM::CFSMActionSetVariable::

FSM::CFSMAction FSM::CFSMObject List of all members.

Public Methods

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

void SetVariable (const char *varName)
void SetValue (int val)
const char * GetVariable () const
int GetValue () const
virtual bool Execute (const char *event, void *a, void *b)
virtual bool SetParameter (const char *paramName, const char *paramValue)
CFiniteStateMachine * GetFSM () const
const char * GetNameOfClass () const
 The class name is set by FiniteStateMachine::Create(). More...


Static Public Methods

CFSMObject * Create ()

Protected Methods

virtual bool SaveParameters (CFSMSaver *out) const
 Called by the saver. More...

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

Private Methods

 CFSMActionSetVariable ()
virtual ~CFSMActionSetVariable ()

Private Attributes

string variableName
int value

Friends

class CFSMState
class CFSMTransition
class CFiniteStateMachine

Detailed Description

Action, that sets a variable to the specified value.

Definition at line 95 of file FSMAction.h.


Constructor & Destructor Documentation

FSM::CFSMActionSetVariable::CFSMActionSetVariable (    )  [private]
 

Definition at line 135 of file FSMAction.cpp.

FSM::CFSMActionSetVariable::~CFSMActionSetVariable (    )  [private, virtual]
 

Definition at line 140 of file FSMAction.cpp.


Member Function Documentation

CFSMObject * FSM::CFSMActionSetVariable::Create (    )  [static]
 

Definition at line 109 of file FSMAction.cpp.

void FSM::CFSMActionSetVariable::DeleteThis (    )  [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.

Definition at line 115 of file FSMAction.cpp.

bool FSM::CFSMActionSetVariable::Execute (  const char *    event,
void *    a,
void *    b
)  [virtual]
 

Reimplemented from FSM::CFSMAction.

Definition at line 75 of file FSMAction.cpp.

References iRethrow.

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(), FSM::CFSMSimpleTransition::Execute(), FSM::CFSMTransition::GetFromState(), and FSM::CFSMSimpleTransition::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(), FSM::CFSMSimpleTransition::SetParameter(), FSM::CFSMConditionTestVariable::SetParameter(), FSM::CFSMActionIncrVariable::SetParameter(), and SetParameter().

int FSM::CFSMActionSetVariable::GetValue (    )  const
 

Definition at line 67 of file FSMAction.cpp.

References value.

const char * FSM::CFSMActionSetVariable::GetVariable (    )  const
 

Definition at line 62 of file FSMAction.cpp.

References variableName.

bool FSM::CFSMActionSetVariable::SaveParameters (  CFSMSaver *    out )  const [protected, virtual]
 

Called by the saver.

Do not call directly. Overload and call out->SaveParameter() for each parameter.

Reimplemented from FSM::CFSMObject.

Definition at line 123 of file FSMAction.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::CFSMObject::SetFSM (  CFiniteStateMachine *    ptr )  [protected, inherited]
 

Definition at line 51 of file FSMObject.cpp.

bool FSM::CFSMActionSetVariable::SetParameter (  const char *    paramName,
const char *    paramValue
)  [virtual]
 

Reimplemented from FSM::CFSMObject.

Definition at line 85 of file FSMAction.cpp.

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

void FSM::CFSMActionSetVariable::SetValue (  int    val ) 
 

Definition at line 57 of file FSMAction.cpp.

References value.

void FSM::CFSMActionSetVariable::SetVariable (  const char *    varName ) 
 

Definition at line 52 of file FSMAction.cpp.


Friends And Related Function Documentation

friend class CFiniteStateMachine [friend]
 

Reimplemented from FSM::CFSMObject.

Definition at line 100 of file FSMAction.h.

friend class CFSMState [friend]
 

Reimplemented from FSM::CFSMAction.

Definition at line 98 of file FSMAction.h.

friend class CFSMTransition [friend]
 

Reimplemented from FSM::CFSMAction.

Definition at line 99 of file FSMAction.h.


Member Data Documentation

int FSM::CFSMActionSetVariable::value [private]
 

Definition at line 127 of file FSMAction.h.

Referenced by GetValue(), SetParameter(), and SetValue().

string FSM::CFSMActionSetVariable::variableName [private]
 

Definition at line 126 of file FSMAction.h.

Referenced by GetVariable(), and SetParameter().


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