# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NLLOGIC::CLogicStateMachine Class Reference

CLogicStateMachine. More...

#include <logic_state_machine.h>

List of all members.

Public Methods

const std::map< std::string,
CLogicVariable > & 
getVariables ()
const std::map< std::string,
CLogicCounter > & 
getCounters ()
const std::map< std::string,
CLogicCondition > & 
getConditions ()
const std::map< std::string,
CLogicState > & 
getStates ()
 CLogicStateMachine ()
 Default constructor. More...

void setName (const std::string &name)
 Set the state machine name. More...

std::string getName () const
 Get the state machine name. More...

void setCurrentState (std::string stateName)
 Set the current state. More...

void addSIdMap (const TSIdMap &sIdMap)
 call the addSIdMap() method for each sate machines. More...

void processLogic ()
 call the processLogic method for each sate machines. More...

void getSelfAddressedMessages (std::list< NLNET::CMessage > &msgs)
 Get the self-addressed message. More...

void addVariable (CLogicVariable var)
 Add a variable in the state machine. More...

bool getVariable (std::string &varName, CLogicVariable &var)
 Get the variable. More...

void addCounter (CLogicCounter counter)
 Add a counter in the state machine. More...

void addCondition (CLogicCondition condition)
 Add a condition in the state machine. More...

bool getCondition (const std::string &condName, CLogicCondition &cond)
 Get the condition. More...

void getMessagesToSend (std::multimap< NLMISC::CEntityId, NLNET::CMessage > &msgs)
 Get the messages to send. More...

void addState (CLogicState logicState)
 Add a state to the state machine. More...

void modifyVariable (std::string varName, std::string modifOperator, sint64 value)
 modify a variable. More...

void displayVariables ()
 Display the variables. More...

void displayStates ()
 Display the states. More...

void setVerbose (std::string varName, bool b)
 Set the verbose mode for a variable. More...

void write (xmlDocPtr doc) const
void read (xmlNodePtr node)

Private Attributes

std::map< std::string, CLogicVariable_Variables
 variables. More...

std::map< std::string, CLogicCounter_Counters
 counters. More...

std::map< std::string, CLogicCondition_Conditions
 conditions used in this state machine. More...

std::map< std::string, CLogicState_States
 states. More...

std::string _CurrentState
 name of the current state. More...

std::string _Name
 name of this sate machine. More...


Detailed Description

CLogicStateMachine.

Author:
Stephane Coutelas , Nevrax France
Date:
2001

Definition at line 56 of file logic_state_machine.h.


Constructor & Destructor Documentation

NLLOGIC::CLogicStateMachine::CLogicStateMachine   [inline]
 

Default constructor.

Definition at line 87 of file logic_state_machine.h.

References _Name.


Member Function Documentation

void NLLOGIC::CLogicStateMachine::addCondition CLogicCondition    condition
 

Add a condition in the state machine.

Parameters:
condition  is the new condition to add in this state machine

Definition at line 123 of file logic_state_machine.cpp.

References _Conditions, and condition.

void NLLOGIC::CLogicStateMachine::addCounter CLogicCounter    counter [inline]
 

Add a counter in the state machine.

Parameters:
counter  is the new counter to add in this state machine

Definition at line 150 of file logic_state_machine.h.

References _Counters.

void NLLOGIC::CLogicStateMachine::addSIdMap const TSIdMap   sIdMap
 

call the addSIdMap() method for each sate machines.

Parameters:
sIdMap  is the map associating destination name with a destination id

Definition at line 150 of file logic_state_machine.cpp.

References _States, and NLLOGIC::TSIdMap.

void NLLOGIC::CLogicStateMachine::addState CLogicState    logicState
 

Add a state to the state machine.

Parameters:
state  is the new state to add in this state machine

Definition at line 136 of file logic_state_machine.cpp.

References _States.

void NLLOGIC::CLogicStateMachine::addVariable CLogicVariable    var [inline]
 

Add a variable in the state machine.

Parameters:
var  is the new variable to add in this state machine

Definition at line 134 of file logic_state_machine.h.

References _Variables.

void NLLOGIC::CLogicStateMachine::displayStates  
 

Display the states.

Definition at line 380 of file logic_state_machine.cpp.

References _CurrentState, _Name, _States, and nlinfo.

void NLLOGIC::CLogicStateMachine::displayVariables  
 

Display the variables.

Definition at line 315 of file logic_state_machine.cpp.

References _Name, _States, _Variables, and nlinfo.

bool NLLOGIC::CLogicStateMachine::getCondition const std::string &    condName,
CLogicCondition   cond
 

Get the condition.

Parameters:
condName  is the name of the condition to get
cond  is the condition to get
Returns:
true if the condition has been found, false if not

Definition at line 232 of file logic_state_machine.cpp.

References _Conditions.

const std::map<std::string, CLogicCondition>& NLLOGIC::CLogicStateMachine::getConditions   [inline]
 

Definition at line 80 of file logic_state_machine.h.

References _Conditions.

const std::map<std::string, CLogicCounter>& NLLOGIC::CLogicStateMachine::getCounters   [inline]
 

Definition at line 79 of file logic_state_machine.h.

References _Counters.

void NLLOGIC::CLogicStateMachine::getMessagesToSend std::multimap< NLMISC::CEntityId, NLNET::CMessage > &    msgs
 

Get the messages to send.

Parameters:
msgs  is the list used to store the messages to send

std::string NLLOGIC::CLogicStateMachine::getName   const [inline]
 

Get the state machine name.

Returns:
the name of this state machine

Definition at line 101 of file logic_state_machine.h.

References _Name.

void NLLOGIC::CLogicStateMachine::getSelfAddressedMessages std::list< NLNET::CMessage > &    msgs
 

Get the self-addressed message.

Parameters:
msgs  is the list used to store the self-addressed messages

const std::map<std::string, CLogicState>& NLLOGIC::CLogicStateMachine::getStates   [inline]
 

Definition at line 81 of file logic_state_machine.h.

References _States.

bool NLLOGIC::CLogicStateMachine::getVariable std::string &    varName,
CLogicVariable   var
 

Get the variable.

Parameters:
varName  is the name of the variable to get
var  is the variable to get
Returns:
true if the variable has been found, false if not

Definition at line 206 of file logic_state_machine.cpp.

References _Counters, and _Variables.

const std::map<std::string, CLogicVariable>& NLLOGIC::CLogicStateMachine::getVariables   [inline]
 

Definition at line 78 of file logic_state_machine.h.

References _Variables.

void NLLOGIC::CLogicStateMachine::modifyVariable std::string    varName,
std::string    modifOperator,
sint64    value
 

modify a variable.

Parameters:
varName  is the name of the variable to modify
modifOperator  can be one of these operators :"SET"("set"),"ADD"("add"),"SUB"("sub"),"MUL"("mul"),"DIV"("div")
value  is the value to use along with the modificator

Definition at line 252 of file logic_state_machine.cpp.

References _Counters, _Name, _Variables, nlwarning, and value.

void NLLOGIC::CLogicStateMachine::processLogic  
 

call the processLogic method for each sate machines.

Definition at line 167 of file logic_state_machine.cpp.

References _Counters, _CurrentState, _States, and nlassert.

void NLLOGIC::CLogicStateMachine::read xmlNodePtr    node
 

Definition at line 570 of file logic_state_machine.cpp.

References _Conditions, _Counters, _States, _Variables, NLLOGIC::getXMLProp, setCurrentState, setName, v, and NLLOGIC::xmlCheckNodeName.

void NLLOGIC::CLogicStateMachine::setCurrentState std::string    stateName
 

Set the current state.

Parameters:
stateName  is the name of the state to give focus to

Definition at line 97 of file logic_state_machine.cpp.

References _CurrentState, _Name, _States, nlinfo, and nlwarning.

Referenced by read.

void NLLOGIC::CLogicStateMachine::setName const std::string &    name [inline]
 

Set the state machine name.

Parameters:
name  is the name of state machine

Definition at line 94 of file logic_state_machine.h.

References _Name.

Referenced by read.

void NLLOGIC::CLogicStateMachine::setVerbose std::string    varName,
bool    b
 

Set the verbose mode for a variable.

Parameters:
varName  is the name of the variable
b  is true to activate the verbose mode, false else

Definition at line 397 of file logic_state_machine.cpp.

References _Counters, _Variables, nlinfo, and NLLOGIC::testNameWithFilter.

void NLLOGIC::CLogicStateMachine::write xmlDocPtr    doc const
 

Definition at line 541 of file logic_state_machine.cpp.

References _Conditions, _Counters, _CurrentState, _Name, _States, and _Variables.


Member Data Documentation

std::map<std::string, CLogicCondition> NLLOGIC::CLogicStateMachine::_Conditions [private]
 

conditions used in this state machine.

Definition at line 65 of file logic_state_machine.h.

Referenced by addCondition, getCondition, getConditions, read, and write.

std::map<std::string, CLogicCounter> NLLOGIC::CLogicStateMachine::_Counters [private]
 

counters.

Definition at line 62 of file logic_state_machine.h.

Referenced by addCounter, getCounters, getVariable, modifyVariable, processLogic, read, setVerbose, and write.

std::string NLLOGIC::CLogicStateMachine::_CurrentState [private]
 

name of the current state.

Definition at line 71 of file logic_state_machine.h.

Referenced by displayStates, processLogic, setCurrentState, and write.

std::string NLLOGIC::CLogicStateMachine::_Name [private]
 

name of this sate machine.

Definition at line 74 of file logic_state_machine.h.

Referenced by CLogicStateMachine, displayStates, displayVariables, getName, modifyVariable, setCurrentState, setName, and write.

std::map<std::string, CLogicState> NLLOGIC::CLogicStateMachine::_States [private]
 

states.

Definition at line 68 of file logic_state_machine.h.

Referenced by addSIdMap, addState, displayStates, displayVariables, getStates, processLogic, read, setCurrentState, and write.

std::map<std::string, CLogicVariable> NLLOGIC::CLogicStateMachine::_Variables [private]
 

variables.

Definition at line 59 of file logic_state_machine.h.

Referenced by addVariable, displayVariables, getVariable, getVariables, modifyVariable, read, setVerbose, and write.


The documentation for this class was generated from the following files: