CHSM  4.4.1
Public Member Functions | List of all members
CHSM::set Class Reference

A set is-a CHSM::parent that has either all or no child-states active. More...

#include <chsm.h>

Inheritance diagram for CHSM::set:
CHSM::parent CHSM::state

Public Member Functions

virtual bool enter (event const &trigger, state *from_child=0)
 Enters a set via a transition and also enter all of its child states. More...
 
virtual bool exit (event const &trigger, state *to=0)
 Exits a set via a transition, but first exit all of its child states. More...
 
 set (CHSM_SET_ARGS)
 Constructs a set. More...
 
- Public Member Functions inherited from CHSM::parent
iterator begin ()
 Returns a parent::iterator positioned at the first child state of a parent. More...
 
const_iterator begin () const
 Returns a parent::const_iterator positioned at the first child state of a parent. More...
 
virtual void deep_clear ()
 Clears this parent's history. More...
 
bool empty () const
 Returns whether this parent has any child states. More...
 
iterator end ()
 Returns a parent::iterator positioned at one past the last child state of a parent. More...
 
const_iterator end () const
 Returns a parent::const_iterator positioned at one past the last child state of a parent. More...
 
reference front ()
 Returns a parent::reference to the first child state. More...
 
const_reference front () const
 Returns a parent::const_reference to the first child state. More...
 
- Public Member Functions inherited from CHSM::state
bool active () const
 Returns whether this state is active. More...
 
char const * name () const
 Return the name of the state. More...
 
parentparent_of () const
 Return the parent cluster or set. More...
 
 state (CHSM_STATE_ARGS)
 Construct a state. More...
 
 ~state ()
 Destroy a state. More...
 

Additional Inherited Members

- Public Types inherited from CHSM::parent
typedef value_type const * const_pointer
 A pointer to a const value_type. More...
 
typedef value_type const & const_reference
 A reference to a const value_type. More...
 
typedef value_typepointer
 A pointer to a value_type. More...
 
typedef value_typereference
 A reference to a value_type. More...
 
typedef state value_type
 The type of the value returned by iterator and const_iterator. More...
 

Detailed Description

A set is-a CHSM::parent that has either all or no child-states active.

All child-states are entered after and exited before their parent-state. The order that child-states are entered and exited is undefined.

The % set class can be extended either to add additional data members and member functions, or to alter its behavior upon being entered or exited.

Author
Paul J. Lucas

Constructor & Destructor Documentation

CHSM::set::set ( CHSM_SET_ARGS  )
inline

Constructs a set.

When deriving a class from set, the macros CHSM_SET_ARGS and CHSM_SET_INIT can be used to avoid having to deal with the many constructor arguments. See CHSM::state for an example.

Member Function Documentation

bool CHSM::set::enter ( event const &  trigger,
state from_child = 0 
)
virtual

Enters a set via a transition and also enter all of its child states.

Parameters
triggerThe event that triggered the transition.
from_childNot used here.
Returns
Returns true only if the set was actually entered, i.e., it wasn't already active.

Reimplemented from CHSM::state.

bool CHSM::set::exit ( event const &  trigger,
state to = 0 
)
virtual

Exits a set via a transition, but first exit all of its child states.

Parameters
triggerThe event that triggered the transition.
toThe state we are transitioning to.
Returns
Returns true only if the set actually exited, i.e., it was active.

Reimplemented from CHSM::state.


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