Whether and how to wait for new work items when the internal work
queue runs empty

Whether and what type of locking is used to ensure thread-safety

For a FifoWorker type F, an object f of that
type, a const object cf of that type, a
parameterless function object w of arbitrary type and an
unsigned long value n the following
expressions/statements must be well-formed and have the indicated
results:

Expression/Statement

Type

Effects/Result

F::work_item

boost::function0< void >

F() or F( false )

F

Constructs a non-blocking (see below) object of
the FifoWorker type. In single-threaded builds the second expression is
not well-formed

F( true )

F

Constructs a blocking (see below) object of the
FifoWorker type. Not well-formed in single-threaded builds

f.queue_work_item( w );

Constructs and queues an object of type
F::work_item, passing w as the only
argument

f.terminate();

Creates and queues an object of type
F::work_item that, when later executed in
operator()(), leads to a modification of internal state so
that terminated() henceforth returns
true

cf.terminated();

bool

true if terminate() has been
called and the resulting work item has been executed in
operator()(). Returns false otherwise

Must only be called from the thread that also calls
operator()()

f( n );

unsigned long

Enters a loop that, with each cycle, dequeues and calls
operator()() on the oldest work item in the queue.

The loop is left and the number of executed work items returned if
one or more of the following conditions are met:

f.terminated() == true

The application is single-threaded and the internal queue is
empty

The application is multi-threaded and the internal queue is
empty and the worker was created as non-blocking

n != 0 and the number of work items that have been
processed since operator()() was called equals
n

If the queue is empty and none of the above conditions are met
then the thread calling operator()() is put into a wait
state until f.queue_work_item() is called from another
thread.

An ExceptionTranslator type defines how C++ exceptions occurring during
state machine operation are translated to exception events.

For an ExceptionTranslator object et, a parameterless
function object a of arbitrary type returning result and a function object eh of
arbitrary type taking a const event_base & parameter and returning
result the following expression
must be well-formed and have the indicated results:

A StateBase type is the common base of all states of a given state
machine type. state_machine<>::state_base_type is a
model of the StateBase concept.

For a StateBase type S and a const object
cs of that type the following expressions must be well-formed
and have the indicated results:

Expression

Type

Result

cs.outer_state_ptr()

const S *

0 if cs is an outermost state, a pointer to the
direct outer state of cs otherwise

cs.dynamic_type()

S::id_type

A value unambiguously identifying the most-derived type
of cs. S::id_type values are comparable with
operator==() and operator!=(). An unspecified
collating order can be established with std::less< S::id_type
>. In contrast to typeid( cs ), this function is
available even on platforms that do not support C++ RTTI (or have been
configured to not support it)

cs.custom_dynamic_type_ptr<
Type >()

const Type *

A pointer to the custom type identifier or
0. If != 0, Type must match the
type of the previously set pointer. This function is only available if
BOOST_STATECHART_USE_NATIVE_RTTI
is not defined

simple_state< S, C, I, h > must be
an unambiguous public base of S. See simple_state<>
documentation for the requirements and semantics of C,
I and h

new S()

S *

Enters the state S. Certain functions must
not be called from S::S(), see simple_state<>
documentation for more information

pS->exit();

Exits the state S (first stage). The
definition of an exit member function within models of the
SimpleState concept is optional since simple_state<>
already defines the following public member: void exit()
{}. exit() is not called when a state is exited
while an exception is pending, see simple_state<>::terminate()
for more information

A State is a refinement of SimpleState
(that is, except for the default constructor a State type must also satisfy
SimpleState requirements). For a State type S, a pointer
pS of type S * pointing to an object of type
S allocated with new, and an object
mc of type state< S, C, I, h
>::my_context the following expressions/statements
must be well-formed:

state< S, C, I, h > must be an
unambiguous public base of S. See state<> documentation for the
requirements and semantics of C, I and
h

new S( mc )

S *

Enters the state S. No restrictions exist
regarding the functions that can be called from S::S() (in
contrast to the constructors of models of the SimpleState concept).
mc must be forwarded to state< S, C, I, h
>::state()

A Event type defines an event for which state machines can define
reactions.

For a Event type E and a pointer pCE of type
const E * pointing to an object of type E
allocated with new the following expressions/statements must
be well-formed and have the indicated effects/results:

Class template state_machine constructor and
destructor

Effects: Destructs the currently active outermost state and all
its direct and indirect inner states. Innermost states are destructed
first. Other states are destructed as soon as all their direct and indirect
inner states have been destructed. The inner states of each state are
destructed according to the number of their orthogonal region. The state in
the orthogonal region with the highest number is always destructed first,
then the state in the region with the second-highest number and so onNote: Does not attempt to call any exit member
functions

Class template state_machine modifier functions

Constructs a function object action with a
parameter-less operator()() returning result that

enters (constructs) the state specified with the
InitialState template parameter

enters the tree formed by the direct and indirect inner initial
states of InitialState depth first. The inner states of
each state are entered according to the number of their orthogonal
region. The state in orthogonal region 0 is always entered first,
then the state in region 1 and so on

Constructs a function object exceptionEventHandler with
an operator()() returning result and accepting
an exception event parameter that processes the passed exception event,
with the following differences to the processing of normal events:

From the moment when the exception has been thrown until right
after the execution of the exception event reaction, states that need
to be exited are only destructed but no exit member
functions are called

As for normal events, reaction search moves outward when the
current state cannot handle the event. However, if there is no outer
state (an outermost
state has been reached) the reaction search is considered
unsuccessful. That is, exception events will never be dispatched to
orthogonal regions other than the one that caused the exception
event

Should an exception be thrown during exception event reaction
search or reaction execution then the exception is propagated out of
the exceptionEventHandler function object (that is,
ExceptionTranslator is not used to translate
exceptions thrown while processing an exception event)

If no reaction could be found for the exception event or if the
state machine is not stable after processing the exception event, the
original exception is rethrown. Otherwise, a result object is returned equal to the one
returned by simple_state<>::discard_event()

Passes action and exceptionEventHandler to
ExceptionTranslator::operator()(). If
ExceptionTranslator::operator()() throws an exception, the
exception is propagated to the caller. If the caller catches the
exception, the currently active outermost state and all its direct and
indirect inner states are destructed. Innermost states are destructed
first. Other states are destructed as soon as all their direct and
indirect inner states have been destructed. The inner states of each
state are destructed according to the number of their orthogonal region.
The state in the orthogonal region with the highest number is always
destructed first, then the state in the region with the second-highest
number and so on. Continues with step 5 otherwise (the return value is
discarded)

Processes all posted events (see process_event()).
Returns to the caller if there are no more posted events

Throws: Any exceptions propagated from
ExceptionTranslator::operator()(). Exceptions never originate
in the library itself but only in code supplied through template
parameters:

Constructs a function object action with a
parameter-less operator()() returning result that terminates the currently active outermost
state, discards all remaining events and clears all history
information

Constructs a function object exceptionEventHandler with
an operator()() returning result and accepting an exception event
parameter that processes the passed exception event, with the following
differences to the processing of normal events:

From the moment when the exception has been thrown until right
after the execution of the exception event reaction, states that need
to be exited are only destructed but no exit member
functions are called

As for normal events, reaction search moves outward when the
current state cannot handle the event. However, if there is no outer
state (an outermost
state has been reached) the reaction search is considered
unsuccessful. That is, exception events will never be dispatched to
orthogonal regions other than the one that caused the exception
event

Should an exception be thrown during exception event reaction
search or reaction execution then the exception is propagated out of
the exceptionEventHandler function object (that is,
ExceptionTranslator is not used to translate
exceptions thrown while processing an exception event)

If no reaction could be found for the exception event or if the
state machine is not stable after processing the exception event, the
original exception is rethrown. Otherwise, a result object is returned equal to the one
returned by simple_state<>::discard_event()

Passes action and exceptionEventHandler to
ExceptionTranslator::operator()(). If
ExceptionTranslator::operator()() throws an exception, the
exception is propagated to the caller. If the caller catches the
exception, the currently active outermost state and all its direct and
indirect inner states are destructed. Innermost states are destructed
first. Other states are destructed as soon as all their direct and
indirect inner states have been destructed. The inner states of each
state are destructed according to the number of their orthogonal region.
The state in the orthogonal region with the highest number is always
destructed first, then the state in the region with the second-highest
number and so on. Otherwise, returns to the caller

Throws: Any exceptions propagated from
ExceptionTranslator::operator(). Exceptions never originate in
the library itself but only in code supplied through template
parameters:

Selects an arbitrary but in this reaction search not yet visited
state from all the currently active innermost states. If no such state
exists then continues with step 10

Constructs a function object action with a
parameter-less operator()() returning result that does the following:

Searches a reaction suitable for currentEvent,
starting with the current innermost state and moving outward until a
state defining a reaction for the event is found. Returns
simple_state<>::forward_event() if no reaction has
been found

Executes the found reaction. If the reaction result is equal to
the return value of
simple_state<>::forward_event() then resumes the
reaction search (step a). Returns the reaction result otherwise

Constructs a function object exceptionEventHandler
returning result and accepting an
exception event parameter that processes the passed exception event, with
the following differences to the processing of normal events:

From the moment when the exception has been thrown until right
after the execution of the exception event reaction, states that need
to be exited are only destructed but no exit member
functions are called

If the state machine is stable when the exception event is
processed then exception event reaction search starts with the
innermost state that was last visited during the last normal event
reaction search (the exception event was generated as a result of
this normal reaction search)

If the state machine is unstable when the
exception event is processed then exception event reaction search
starts with the outermost unstable state

As for normal events, reaction search moves outward when the
current state cannot handle the event. However, if there is no outer
state (an outermost
state has been reached) the reaction search is considered
unsuccessful. That is, exception events will never be dispatched to
orthogonal regions other than the one that caused the exception
event

Should an exception be thrown during exception event reaction
search or reaction execution then the exception is propagated out of
the exceptionEventHandler function object (that is,
ExceptionTranslator is not used to translate
exceptions thrown while processing an exception event)

If no reaction could be found for the exception event or if the
state machine is not stable after processing the exception event, the
original exception is rethrown. Otherwise, a result object is returned equal to the one
returned by simple_state<>::discard_event()

Passes action and exceptionEventHandler to
ExceptionTranslator::operator()(). If
ExceptionTranslator::operator()() throws an exception, the
exception is propagated to the caller. If the caller catches the
exception, the currently active outermost state and all its direct and
indirect inner states are destructed. Innermost states are destructed
first. Other states are destructed as soon as all their direct and
indirect inner states have been destructed. The inner states of each
state are destructed according to the number of their orthogonal region.
The state in the orthogonal region with the highest number is always
destructed first, then the state in the region with the second-highest
number and so on. Otherwise continues with step 7

If the return value of ExceptionTranslator::operator()()
is equal to the one of simple_state<>::forward_event()
then continues with step 3

If the return value of ExceptionTranslator::operator()()
is equal to the one of simple_state<>::defer_event()
then the return value of currentEvent.intrusive_from_this() is stored in the
deferred events queue. Continues with step 11

If the return value of ExceptionTranslator::operator()()
is equal to the one of simple_state<>::discard_event()
then continues with step 11

Calls static_cast< MostDerived * >( this
)->unconsumed_event( currentEvent ). If
unconsumed_event() throws an exception, the exception is
propagated to the caller. Such an exception never leads to the
destruction of any states (in contrast to exceptions propagated from
ExceptionTranslator::operator()())

If the posted events queue is non-empty then dequeues the first
event, selects it as currentEvent and continues with step 2.
Returns to the caller otherwise

Throws: Any exceptions propagated from
MostDerived::unconsumed_event() or
ExceptionTranslator::operator(). Exceptions never originate in
the library itself but only in code supplied through template
parameters:

Effects: NoneNote: This function (or, if present, the equally named derived class
member function) is called by process_event()
whenever a dispatched event did not trigger a reaction, see process_event() effects, point 10 for more
information.

Class template state_machine observer functions

Returns: Depending on the form of Target either a
reference or a pointer to const if at least one of the
currently active states can successfully be dynamic_cast to
Target. Returns 0 for pointer targets and throws
std::bad_cast for reference targets otherwise.
Target can take either of the following forms: const
Class * or const Class &Throws: std::bad_cast if Target is a
reference type and none of the active states can be
dynamic_cast to TargetNote: The search sequence is the same as for process_event()

Requires: For reference targets the compiler must support partial
specialization of class templates, otherwise a compile-time error will
result. The type denoted by Target must be a model of the
SimpleState or State
conceptsReturns: Depending on the form of Target either a
reference or a pointer to const if Target is
equal to the most-derived type of a currently active state. Returns
0 for pointer targets and throws std::bad_cast
for reference targets otherwise. Target can take either of the
following forms: const Class * or const Class
&Throws: std::bad_cast if Target is a
reference type and none of the active states has a most derived type equal
to TargetNote: The search sequence is the same as for process_event()

Return: Iterator objects, the range [state_begin(),
state_end()) refers to all currently active innermost states. For an object
i of type state_iterator, *i returns
a const state_base_type & and
i.operator->() returns a const state_base_type
*Note: The position of a given innermost state in the range is
arbitrary. It may change with each call to a modifier function. Moreover,
all iterators are invalidated whenever a modifier function is called

Returns: A pointer to the event that triggered the reaction that is currently
being executed. Returns 0 if no reaction is being executed or if the current
reaction was triggered by either initiate() or
terminate()

Class template asynchronous_state_machine constructor and
destructor

Effects: Constructs a non-running asynchronous state machineNote: Users cannot create
asynchronous_state_machine<> subtype objects directly.
This can only be done through an object of the Scheduler
class

~asynchronous_state_machine();

Effects: Destructs the state machineNote: Users cannot destruct
asynchronous_state_machine<> subtype objects directly.
This can only be done through an object of the Scheduler
class

Class template event_processor constructor and
destructor

Effects: Constructs an event processor object and stores copies
of the reference returned by myContext.my_scheduler() and the
object returned by myContext.my_handle()Note: Users cannot create event_processor<>
subtype objects directly. This can only be done through an object of the
Scheduler class

Class template fifo_scheduler constructor

Effects: Constructs a fifo_scheduler<> object.
In multi-threaded builds, waitOnEmptyQueue is forwarded to the
constructor of a data member of type FifoWorker. In
single-threaded builds, the FifoWorker data member is
default-constructedNote: In single-threaded builds the
fifo_scheduler<> constructor does not accept any
parameters and operator()() thus always returns to the caller
when the event queue is empty

Class template fifo_scheduler modifier functions

Requires: The Processor type must be a direct or
indirect subtype of the event_processor class
templateEffects: Creates and passes to
FifoWorker::queue_work_item() an object of type
FifoWorker::work_item that, when later executed in
FifoWorker::operator()(), leads to a call to the constructor
of Processor, passing an appropriate
processor_context object as the only argumentReturns: A processor_handle object that henceforth
identifies the created event processor objectThrows: Any exceptions propagated from
FifoWorker::work_item() and
FifoWorker::queue_work_item()Caution: The current implementation of this function makes an
(indirect) call to global operator new(). Unless global
operator new() is replaced, care must be taken when to call
this function in applications with hard real-time requirements

Requires: The Processor type must be a direct or
indirect subtype of the event_processor class
templateEffects: Creates and passes to
FifoWorker::queue_work_item() an object of type
FifoWorker::work_item that, when later executed in
FifoWorker::operator()(), leads to a call to the constructor
of Processor, passing an appropriate
processor_context object and param1 as
argumentsReturns: A processor_handle object that henceforth
identifies the created event processor objectThrows: Any exceptions propagated from
FifoWorker::work_item() and
FifoWorker::queue_work_item()
Note: boost::ref() and boost::cref() can be
used to pass arguments by reference rather than by copy.
fifo_scheduler<> has 5 additional
create_processor<> overloads, allowing to pass up to 6
custom arguments to the constructors of event processorsCaution: The current implementation of this and all other overloads
make (indirect) calls to global operator new(). Unless global
operator new() is replaced, care must be taken when to call
these overloads in applications with hard real-time requirements

Requires: processor was obtained from a call to one
of the create_processor<>() overloads on the same
fifo_scheduler<> objectEffects: Creates and passes to
FifoWorker::queue_work_item() an object of type
FifoWorker::work_item that, when later executed in
FifoWorker::operator()(), leads to a call to the destructor of
the event processor object associated with processor. The
object is silently discarded if the event processor object has been
destructed beforeThrows: Any exceptions propagated from
FifoWorker::work_item() and
FifoWorker::queue_work_item()Caution: The current implementation of this function leads to an
(indirect) call to global operator delete() (the call is made
when the last processor_handle object associated with the
event processor object is destructed). Unless global operator
delete() is replaced, care must be taken when to call this function
in applications with hard real-time requirements

Requires: processor was obtained from a call to one
of the create_processor() overloads on the same
fifo_scheduler<> objectEffects: Creates and passes to
FifoWorker::queue_work_item() an object of type
FifoWorker::work_item that, when later executed in
FifoWorker::operator()(), leads to a call to initiate() on the event processor
object associated with processor. The object is silently
discarded if the event processor object has been destructed beforeThrows: Any exceptions propagated from
FifoWorker::work_item() and
FifoWorker::queue_work_item()

Requires: processor was obtained from a call to one
of the create_processor<>() overloads on the same
fifo_scheduler<> objectEffects: Creates and passes to
FifoWorker::queue_work_item() an object of type
FifoWorker::work_item that, when later executed in
FifoWorker::operator()(), leads to a call to terminate() on the event processor
object associated with processor. The object is silently
discarded if the event processor object has been destructed beforeThrows: Any exceptions propagated from
FifoWorker::work_item() and
FifoWorker::queue_work_item()

Requires: pEvent.get() != 0 and
processor was obtained from a call to one of the
create_processor<>() overloads on the same
fifo_scheduler<> objectEffects: Creates and passes to
FifoWorker::queue_work_item() an object of type
FifoWorker::work_item that, when later executed in
FifoWorker::operator()(), leads to a call to process_event( *pEvent ) on
the event processor object associated with processor. The
object is silently discarded if the event processor object has been
destructed beforeThrows: Any exceptions propagated from
FifoWorker::work_item() and
FifoWorker::queue_work_item()

An mpl::list<> containing models of
the SimpleState or State concepts or instantiations of the shallow_history or
deep_history
class templates. If there is only a single inner initial state that is
not a template instantiation then it can also be passed directly,
without wrapping it into an mpl::list<>. The
Context argument passed to the simple_state<> or
state<> base
of each state in the list must correspond to the orthogonal region
it belongs to. That is, the first state in the list must pass
MostDerived::orthogonal< 0 >, the second
MostDerived::orthogonal< 1 > and so forth.
MostDerived::orthogonal< 0 > and
MostDerived are synonymous

Defines the inner initial state for each orthogonal
region. By default, a state does not have inner states

Class template simple_state constructor and
destructor

Effects: If the state has deferral reactions of which at least
one has been triggered during the lifetime of the state then the contents
of the deferred events queue is moved to the front of the posted events
queue.

Class template simple_state modifier functions

Requires: If called from a constructor of a direct or indirect
subtype then the most-derived type must directly or indirectly derive from
the state class template. All direct and indirect
callers must be exception-neutral
Effects: outermost_context().post_event( pEvt );Throws: Whatever the above call throws

Requires: If called from a constructor of a direct or indirect
subtype then the most-derived type must directly or indirectly derive from
the state class template. All direct and indirect
callers must be exception-neutral
Effects: outermost_context().post_event( evt );Throws: Whatever the above call throws

Requires: Must only be called from within react
member functions, which are called by custom_reaction<>
instantiations. All direct and indirect callers must be
exception-neutralEffects: Instructs the state machine to discard the current event
and to continue with the processing of the remaining events (see
state_machine<>::process_event() for
details)Returns: A result object.
The user-supplied react member function must return this
object to its caller

Requires: Must only be called from within react
member functions, which are called by custom_reaction<>
instantiations. All direct and indirect callers must be
exception-neutralEffects: Instructs the state machine to forward the current event to
the next state (see state_machine<>::process_event() for
details)Returns: A result object.
The user-supplied react member function must return this
object to its caller

Requires: Must only be called from within react
member functions, which are called by custom_reaction<>
instantiations. All direct and indirect callers must be
exception-neutralEffects: Instructs the state machine to defer the current event and
to continue with the processing of the remaining events (see state_machine<>::process_event() for
details)Returns: A result object.
The user-supplied react member function must return this
object to its callerThrows: Any exceptions propagated from
Allocator::rebind<>::other::allocate() (the template
parameter passed to the base class of
outermost_context_type)

Requires: Must only be called from within react
member functions, which are called by custom_reaction<>
instantiations. All direct and indirect callers must be
exception-neutralEffects:

Exits all currently active direct and indirect inner states of the
innermost common context of this state and DestinationState.
Innermost states are exited first. Other states are exited as soon as all
their direct and indirect inner states have been exited. The inner states
of each state are exited according to the number of their orthogonal
region. The state in the orthogonal region with the highest number is
always exited first, then the state in the region with the second-highest
number and so on.
The process of exiting a state consists of the following steps:

If there is an exception pending that has not yet been handled
successfully then only step 5 is executed

Calls the exit member function (see synopsis) of the most-derived state
object. If exit() throws then steps 3 and 4 are not
executed

If the state has shallow history then shallow history information
is saved

If the state is an innermost state then deep history information
is saved for all direct and indirect outer states that have deep
history

The state object is destructed

Enters (constructs) the state that is both a direct inner state of
the innermost common context and either the DestinationState
itself or a direct or indirect outer state of
DestinationState

Enters (constructs) the tree formed by the direct and indirect inner
states of the previously entered state down to the
DestinationState and beyond depth first. The inner states of
each state are entered according to the number of their orthogonal
region. The state in orthogonal region 0 is always entered first, then
the state in region 1 and so on

Instructs the state machine to discard the current event and to
continue with the processing of the remaining events (see state_machine<>::process_event() for
details)

Returns: A result object.
The user-supplied react member function must return this
object to its callerThrows: Any exceptions propagated from:

Allocator::rebind<>::other::allocate() (the
template parameter passed to the base class of
outermost_context_type)

state constructors

exit member functions

Caution: Inevitably destructs this state before returning to the
calling react member function, which must therefore not
attempt to access anything except stack objects before returning to its
caller

Requires: Must only be called from within react
member functions, which are called by custom_reaction<>
instantiations. All direct and indirect callers must be
exception-neutralEffects:

Exits all currently active direct and indirect inner states of the
innermost common context of this state and DestinationState.
Innermost states are exited first. Other states are exited as soon as all
their direct and indirect inner states have been exited. The inner states
of each state are exited according to the number of their orthogonal
region. The state in the orthogonal region with the highest number is
always exited first, then the state in the region with the second-highest
number and so on.
The process of exiting a state consists of the following steps:

If there is an exception pending that has not yet been handled
successfully then only step 5 is executed

Calls the exit member function (see synopsis) of the most-derived state
object. If exit() throws then steps 3 and 4 are not
executed

If the state has shallow history then shallow history information
is saved

If the state is an innermost state then deep history information
is saved for all direct and indirect outer states that have deep
history

The state object is destructed

Executes the passed transition action, forwarding the passed
event

Enters (constructs) the state that is both a direct inner state of
the innermost common context and either the DestinationState
itself or a direct or indirect outer state of
DestinationState

Enters (constructs) the tree formed by the direct and indirect inner
states of the previously entered state down to the
DestinationState and beyond depth first. The inner states of
each state are entered according to the number of their orthogonal
region. The state in orthogonal region 0 is always entered first, then
the state in region 1 and so on

Instructs the state machine to discard the current event and to
continue with the processing of the remaining events (see state_machine<>::process_event() for
details)

Returns: A result object.
The user-supplied react member function must return this
object to its callerThrows: Any exceptions propagated from:

Allocator::rebind<>::other::allocate() (the
template parameter passed to the base class of
outermost_context_type)

state constructors

exit member functions

the transition action

Caution: Inevitably destructs this state before returning to the
calling react member function, which must therefore not
attempt to access anything except stack objects before returning to its
caller

Requires: Must only be called from within react
member functions, which are called by custom_reaction<>
instantiations. All direct and indirect callers must be
exception-neutralEffects: Exits this state and all its direct and indirect inner
states. Innermost states are exited first. Other states are exited as soon
as all their direct and indirect inner states have been exited. The inner
states of each state are exited according to the number of their orthogonal
region. The state in the orthogonal region with the highest number is
always exited first, then the state in the region with the second-highest
number and so on.
The process of exiting a state consists of the following steps:

If there is an exception pending that has not yet been handled
successfully then only step 5 is executed

Calls the exit member function (see synopsis) of the most-derived state
object. If exit() throws then steps 3 and 4 are not
executed

If the state has shallow history then shallow history information is
saved

If the state is an innermost state then deep history information is
saved for all direct and indirect outer states that have deep
history

The state object is destructed

Also instructs the state machine to discard the current event and to
continue with the processing of the remaining events (see state_machine<>::process_event() for
details)Returns: A result object.
The user-supplied react member function must return this
object to its callerThrows: Any exceptions propagated from:

Allocator::rebind<>::other::allocate() (the
template parameter passed to the base class of
outermost_context_type, used to allocate space to save
history)

exit member functions

Note: If this state is the only currently active inner state of
its direct outer state then the direct outer state is terminated also. The
same applies recursively for all indirect outer statesCaution: Inevitably destructs this state before returning to the
calling react member function, which must therefore not
attempt to access anything except stack objects before returning to its
caller

Requires: If called from a constructor of a direct or indirect
subtype then the most-derived type must directly or indirectly derive from
the state class template. The historyMode
argument passed to the simple_state<> or
state<> base
of HistoryContext must be equal to
has_shallow_history or has_full_historyEffects: Clears the shallow history of the orthogonal region
specified by orthogonalPosition of the state specified by
HistoryContextThrows: Any exceptions propagated from
Allocator::rebind<>::other::allocate() (the template
parameter passed to the base class of
outermost_context_type)

Requires: If called from a constructor of a direct or indirect
subtype then the most-derived type must directly or indirectly derive from
the state class template. The historyMode
argument passed to the simple_state<> or
state<> base
of HistoryContext must be equal to
has_deep_history or has_full_historyEffects: Clears the deep history of the orthogonal region specified
by orthogonalPosition of the state specified by
HistoryContextThrows: Any exceptions propagated from
Allocator::rebind<>::other::allocate() (the template
parameter passed to the base class of
outermost_context_type)

Class template simple_state observer functions

Requires: If called from a constructor of a direct or indirect
subtype then the most-derived type must directly or indirectly derive from
the state class template. If called from a destructor of a
direct or indirect subtype then the state_machine<> subclass
portion must still existReturns: A reference to the outermost context, which is always the
state machine this state belongs to

Requires: If called from a constructor of a direct or indirect
subtype then the most-derived type must directly or indirectly derive from
the state class template. If called from a destructor of a
direct or indirect subtype then the state_machine<> subclass
portion must still existReturns: A reference to the const outermost context, which is always
the state machine this state belongs to

Requires: If called from a constructor of a direct or indirect
subtype then the most-derived type must directly or indirectly derive from
the state class template. If called from a destructor of a
direct or indirect subtype with a state_machine<> subtype as
argument then the state_machine<> subclass portion must still
existReturns: A reference to a direct or indirect context or any public base
type of the contexts

Requires: If called from a constructor of a direct or indirect
subtype then the most-derived type must directly or indirectly derive from
the state class template. If called from a destructor of a
direct or indirect subtype with a state_machine<> subtype as
argument then the state_machine<> subclass portion must still
existReturns: A reference to a const direct or indirect context or any public
base type of the contexts

Requires: If called from a constructor of a direct or indirect
subtype then the most-derived type must directly or indirectly derive from
the state class template
Returns: Has exactly the same semantics as state_machine<>::state_cast<>()Throws: Has exactly the same semantics as state_machine<>::state_cast<>()
Note: The result is unspecified if this function is called when
the machine is unstable

Require: If called from a constructor of a direct or indirect
subtype then the most-derived type must directly or indirectly derive from
the state class template
Return: Have exactly the same semantics as state_machine<>::state_begin() and
state_machine<>::state_end()Note: The result is unspecified if these functions are called
when the machine is unstable

Class template simple_state static functions

Returns: A value unambiguously identifying the type of
MostDerivedNote: id_type values are comparable with
operator==() and operator!=(). An unspecified
collating order can be established with std::less< id_type
>

Requires: If a custom type identifier has been set then
CustomId must match the type of the previously set
pointer
Returns: The pointer to the custom type identifier for
MostDerived or 0Note: This function is not available if BOOST_STATECHART_USE_NATIVE_RTTI
is defined

States that do not need to call any of these member functions from their
constructors should rather derive from the simple_state class template, what
saves the implementation of the forwarding constructor.

Returns: A value unambiguously identifying the most-derived
typeNote: id_type values are comparable with
operator==() and operator!=(). An unspecified
collating order can be established with std::less< id_type
>. In contrast to typeid( cs ), this function is
available even on platforms that do not support C++ RTTI (or have been
configured to not support it)

Requires: If a custom type identifier has been set then
CustomId must match the type of the previously set
pointer
Returns: A pointer to the custom type identifier or 0Note: This function is not available if BOOST_STATECHART_USE_NATIVE_RTTI
is defined

Returns: A value unambiguously identifying the type of
MostDerivedNote: id_type values are comparable with
operator==() and operator!=(). An unspecified
collating order can be established with std::less< id_type
>

Requires: If a custom type identifier has been set then
CustomId must match the type of the previously set
pointer
Returns: The pointer to the custom type identifier for
MostDerived or 0Note: This function is not available if BOOST_STATECHART_USE_NATIVE_RTTI
is defined

Class template transition parameters

The event triggering the transition. If event_base is specified, the transition
is triggered by all models of the Event
concept

Destination

A model of the SimpleState
or State concepts, any of their public base types or an instantiation of the
shallow_history or
deep_history
class templates. The source state (the state for which this transition
is defined) and Destination must have a common direct or
indirect context

The destination state to make a transition to

TransitionContext

A common context of the source and
Destination state

The state of which the transition action is a
member

unspecified

pTransitionAction

A pointer to a member function of
TransitionContext. The member function must accept a
const Event & parameter and return
void

The transition action that is executed during the
transition. By default no transition action is executed

Defines the nature of the reaction taken in a user-supplied
react member function (called when a custom_reaction is executed).
Objects of this type are always obtained by calling one of the reaction
functions and must be returned from the react member function
immediately.