CHSM  4.4.1
Classes | Public Types | Public Member Functions | List of all members
CHSM::parent Class Reference

A parent is-an abstract state that has child states. More...

#include <chsm.h>

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

Classes

class  const_iterator
 This is an iterator in "STL style" to iterate over the child states of a parent state. More...
 
class  iterator
 This is an iterator in "STL style" to iterate over the child states of a parent state. More...
 

Public Types

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...
 
- Public Types inherited from CHSM::state
typedef void(machine::* action )(state const &s, event const &trigger)
 An action is a function (machine member function) that is optionally called upon enter/exit of a state. More...
 
typedef int id
 The identification number of a state. More...
 

Public Member Functions

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

- Protected Member Functions inherited from CHSM::state
virtual bool enter (event const &trigger, state *from_child=0)
 Enter a state. More...
 
virtual bool exit (event const &trigger, state *to=0)
 Exit a state. More...
 

Detailed Description

A parent is-an abstract state that has child states.

It is an implementation detail to factor common data members and member functions for the CHSM::cluster and CHSM::set classes.

Author
Paul J. Lucas

Member Typedef Documentation

A pointer to a const value_type.

A reference to a const value_type.

A pointer to a value_type.

A reference to a value_type.

The type of the value returned by iterator and const_iterator.

Member Function Documentation

iterator CHSM::parent::begin ( )
inline

Returns a parent::iterator positioned at the first child state of a parent.

Returns
Returns said iterator.

Referenced by deep_clear().

const_iterator CHSM::parent::begin ( ) const
inline

Returns a parent::const_iterator positioned at the first child state of a parent.

Returns
Returns said iterator.
void CHSM::parent::deep_clear ( )
virtual

Clears this parent's history.

However, since parents don't have a history, there is nothing to do for them; however, call deep_clear() for all child states.

Reimplemented from CHSM::state.

Reimplemented in CHSM::cluster.

References begin(), and end().

Referenced by CHSM::cluster::deep_clear().

bool CHSM::parent::empty ( ) const
inline

Returns whether this parent has any child states.

Returns
Returns true only if this parent has any child states.

Referenced by CHSM::cluster::enter().

iterator CHSM::parent::end ( )
inline

Returns a parent::iterator positioned at one past the last child state of a parent.

Returns
Returns said iterator.

Referenced by deep_clear().

const_iterator CHSM::parent::end ( ) const
inline

Returns a parent::const_iterator positioned at one past the last child state of a parent.

Returns
Returns said iterator.
reference CHSM::parent::front ( )
inline

Returns a parent::reference to the first child state.

Returns
Returns said reference.

Referenced by CHSM::cluster::enter().

const_reference CHSM::parent::front ( ) const
inline

Returns a parent::const_reference to the first child state.

Returns
Returns said reference.

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