Main Page Modules Class Hierarchy Compound List File List Compound Members

# cFSM Class Reference

`#include <cfsm.h>`

Inheritance diagram for cFSM::

List of all members.

## Public Methods
Constructors, destructor, assignment.
| cFSM (const char *name=NULL)
| cFSM (const cFSM &vs)
cFSM& | operator= (const cFSM &vs)
Redefined cObject member functions.
virtual cObject* | dup () const
virtual void | info (char *buf)
virtual void | writeContents (ostream &os)
virtual int | netPack ()
virtual int | netUnpack ()
FSM functions.
int | state () const
const char* | stateName () const
int | inTransientState () const
void | setState (int state, const char *stn=NULL)

## Detailed 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

## Constructor & Destructor Documentation

cFSM::cFSM ( | const char * name = NULL )`[explicit]`

| Constructor.

cFSM::cFSM ( | const cFSM & vs )`[inline]`

| Copy constructor.

## Member Function Documentation

cObject * cFSM::dup ( | ) const`[inline, virtual]`

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

int cFSM::inTransientState ( | ) const`[inline]`

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

void cFSM::info ( | char * buf )`[virtual]`

| Produces a one-line description of object contents into the buffer passed as argument. See cObject for more details. Reimplemented from cObject.

int cFSM::netPack ( | )`[virtual]`

| Serializes the object into a PVM or MPI send buffer. Used by the simulation kernel for parallel execution. See cObject for more details. Reimplemented from cObject.

int cFSM::netUnpack ( | )`[virtual]`

| Deserializes the object from a PVM or MPI receive buffer Used by the simulation kernel for parallel execution. See cObject for more details. Reimplemented from cObject.

cFSM & cFSM::operator= ( | const cFSM & vs )

| Assignment operator. The name member doesn't get copied; see cObject's operator=() for more details.

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). See also: FSM_Goto

int cFSM::state ( | ) const`[inline]`

| Returns the state the FSM is currently in.

const char * cFSM::stateName ( | ) const`[inline]`

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

void cFSM::writeContents ( | ostream & os )`[virtual]`

| Writes textual information about this object to the stream. See cObject for more details. Reimplemented from cObject.

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

- cfsm.h