OMNeT++ Simulation Library  5.4.1
cFSM Class Reference

#include <cfsm.h>

Description

Store the state of an FSM. This class is used in conjunction with the FSM_Switch() and other FSM_ macros.

See also
FSM_Switch, FSM_Transient, FSM_Steady, FSM_Enter, FSM_Exit, FSM_Goto
Inheritance diagram for cFSM:
cOwnedObject cNamedObject cObject

Public Member Functions

Constructors, destructor, assignment.
 cFSM (const char *name=nullptr)
 
 cFSM (const cFSM &other)
 
cFSMoperator= (const cFSM &vs)
 
Redefined cObject member functions.
virtual cFSMdup () const override
 
virtual std::string str () const override
 
virtual void parsimPack (cCommBuffer *buffer) const override
 
virtual void parsimUnpack (cCommBuffer *buffer) override
 
FSM functions.
int getState () const
 
const char * getStateName () const
 
int isInTransientState () const
 
void setState (int state, const char *stateName=nullptr)
 
- Public Member Functions inherited from cOwnedObject
 cOwnedObject ()
 
 cOwnedObject (const char *name, bool namepooling=true)
 
 cOwnedObject (const cOwnedObject &obj)
 
virtual ~cOwnedObject ()
 
cOwnedObjectoperator= (const cOwnedObject &o)
 
virtual cObjectgetOwner () const override
 
virtual bool isOwnedObject () const override
 
virtual bool isSoftOwner () const
 
- Public Member Functions inherited from cNamedObject
 cNamedObject ()
 
 cNamedObject (const char *name, bool namepooling=true)
 
 cNamedObject (const cNamedObject &obj)
 
virtual ~cNamedObject ()
 
cNamedObjectoperator= (const cNamedObject &o)
 
virtual void setName (const char *s)
 
virtual const char * getName () const override
 
virtual void setNamePooling (bool b)
 
virtual bool getNamePooling ()
 
- Public Member Functions inherited from cObject
 cObject ()
 
 cObject (const cObject &other)
 
virtual ~cObject ()
 
virtual const char * getClassName () const
 
bool isName (const char *s) const
 
virtual const char * getFullName () const
 
virtual std::string getFullPath () const
 
const cObjectgetThisPtr () const
 
virtual _OPPDEPRECATED std::string info () const
 
virtual _OPPDEPRECATED std::string detailedInfo () const
 
virtual void forEachChild (cVisitor *v)
 
cObjectfindObject (const char *name, bool deep=true)
 
void copyNotSupported () const
 

Additional Inherited Members

- Static Public Member Functions inherited from cOwnedObject
static long getTotalObjectCount ()
 
static long getLiveObjectCount ()
 
static void resetObjectCounters ()
 
static cDefaultListgetDefaultOwner ()
 
- Protected Member Functions inherited from cObject
virtual void take (cOwnedObject *obj)
 
virtual void drop (cOwnedObject *obj)
 
void dropAndDelete (cOwnedObject *obj)
 

Constructor & Destructor Documentation

cFSM ( const char *  name = nullptr)
explicit

Constructor.

cFSM ( const cFSM other)
inline

Copy constructor.

Member Function Documentation

cFSM& operator= ( const cFSM vs)

Assignment operator. The name member is not copied; see cOwnedObject's operator=() for more details.

virtual cFSM* dup ( ) const
inlineoverridevirtual

Creates and returns an exact copy of this object. See cObject for more details.

Reimplemented from cObject.

virtual std::string str ( ) const
overridevirtual

Produces a one-line description of the object's contents. See cObject for more details.

Reimplemented from cObject.

virtual void parsimPack ( cCommBuffer buffer) const
overridevirtual

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 parsimUnpack ( cCommBuffer buffer)
overridevirtual

Deserializes the object from an MPI receive buffer Used by the simulation kernel for parallel execution. See cObject for more details.

Reimplemented from cOwnedObject.

int getState ( ) const
inline

Returns the state the FSM is currently in.

const char* getStateName ( ) const
inline

Returns the name of the state the FSM is currently in.

int isInTransientState ( ) const
inline

Returns true if the FSM is currently in a transient state.

void setState ( int  state,
const char *  stateName = nullptr 
)
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).

See also
FSM_Goto

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