Store the state of an FSM. More...
#include <cfsm.h>
Public Member Functions | |
Constructors, destructor, assignment. | |
cFSM (const char *name=NULL) | |
cFSM (const cFSM &other) | |
cFSM & | operator= (const cFSM &vs) |
Redefined cObject member functions. | |
virtual cFSM * | dup () const |
virtual std::string | info () const |
virtual void | parsimPack (cCommBuffer *buffer) |
virtual void | parsimUnpack (cCommBuffer *buffer) |
FSM functions. | |
int | getState () const |
const char * | getStateName () const |
int | isInTransientState () const |
void | setState (int state, const char *stn=NULL) |
Store the state of an FSM.
This class is used in conjunction with the FSM_Switch() and other FSM_ macros.
virtual cFSM* cFSM::dup | ( | ) | const [inline, virtual] |
virtual std::string cFSM::info | ( | ) | const [virtual] |
Assignment operator.
The name member is not copied; see cOwnedObject's operator=() for more details.
virtual void cFSM::parsimPack | ( | cCommBuffer * | buffer | ) | [virtual] |
Serializes the object into an MPI send buffer.
Used by the simulation kernel for parallel execution. See cObject for more details.
Reimplemented from cOwnedObject.
virtual void cFSM::parsimUnpack | ( | cCommBuffer * | buffer | ) | [virtual] |
Deserializes the object from an MPI receive buffer Used by the simulation kernel for parallel execution.
See cObject for more details.
Reimplemented from cOwnedObject.
void cFSM::setState | ( | int | state, | |
const char * | stn = NULL | |||
) | [inline] |
Sets the state of the FSM.
This method is usually invoked through the FSM_Goto() macro.
The first arg is the state code. The second arg is the name of the state. setState() assumes this is pointer to a string literal (the string is not copied, only the pointer is stored).