ETL
0.04.19
|
State class. More...
#include <_smach.h>
Public Types | |
typedef event_def_internal< T > | event_def |
typedef T | state_context_type |
Public Member Functions | |
state (const char *n, smach *nest=0) | |
Default handler for unknown key. | |
virtual | ~state () |
void | set_nested_machine (smach *sm) |
Setup a nested state machine. | |
void | set_default_handler (const typename event_def::funcptr &x) |
Sets the default handler. | |
virtual const char * | get_name () const |
Returns given the name of the state. | |
void | insert (const event_def &x) |
Adds an event_def onto the list and then make sure it is sorted correctly. | |
std::vector< event_def >::iterator | find (const event_key &x) |
std::vector< event_def > ::const_iterator | find (const event_key &x) const |
Public Member Functions inherited from smach< CON, K, M >::state_base | |
virtual | ~state_base () |
Protected Member Functions | |
virtual void * | enter_state (context_type *machine_context) const |
virtual bool | leave_state (void *x) const |
virtual event_result | process_event (void *x, const event &id) const |
Private Attributes | |
std::vector< event_def > | event_list |
smach * | nested |
event_key | low |
Nested machine. | |
event_key | high |
const char * | name |
Lowest and Highest event values. | |
event_def::funcptr | default_handler |
Name of the state. |
Friends | |
class | smach |
State class.
typedef event_def_internal<T> smach< CON, K, M >::state< T >::event_def |
typedef T smach< CON, K, M >::state< T >::state_context_type |
|
inline |
Setup a nested state machine.
A more detailed explanation needs to be written
Definition at line 196 of file _smach.h.
References smach< CON, K, M >::state< T >::nested.
|
inline |
Sets the default handler.
Definition at line 199 of file _smach.h.
References smach< CON, K, M >::state< T >::default_handler.
|
inlinevirtual |
Returns given the name of the state.
Implements smach< CON, K, M >::state_base.
Definition at line 202 of file _smach.h.
References smach< CON, K, M >::state< T >::name.
|
inline |
Adds an event_def onto the list and then make sure it is sorted correctly.
Definition at line 206 of file _smach.h.
References smach< CON, K, M >::state< T >::event_list, smach< CON, K, M >::state< T >::high, smach< CON, K, M >::event_def_internal< T >::id, and smach< CON, K, M >::state< T >::low.
|
inline |
Definition at line 224 of file _smach.h.
References binary_find(), and smach< CON, K, M >::state< T >::event_list.
Referenced by smach< CON, K, M >::state< T >::process_event().
|
inline |
Definition at line 225 of file _smach.h.
References binary_find(), and smach< CON, K, M >::state< T >::event_list.
|
inlineprotectedvirtual |
Implements smach< CON, K, M >::state_base.
|
inlineprotectedvirtual |
Implements smach< CON, K, M >::state_base.
Definition at line 234 of file _smach.h.
References smach< CON, K, M >::state_context.
|
inlineprotectedvirtual |
Implements smach< CON, K, M >::state_base.
Definition at line 242 of file _smach.h.
References smach< CON, K, M >::state< T >::default_handler, smach< CON, K, M >::state< T >::find(), smach< CON, K, M >::state< T >::high, smach< CON, K, M >::state< T >::low, smach< CON, K, M >::state< T >::nested, smach< CON, K, M >::process_event(), smach< CON, K, M >::RESULT_OK, and smach< CON, K, M >::state_context.
|
friend |
|
private |
Definition at line 178 of file _smach.h.
Referenced by smach< CON, K, M >::state< T >::find(), and smach< CON, K, M >::state< T >::insert().
|
private |
Definition at line 180 of file _smach.h.
Referenced by smach< CON, K, M >::state< T >::process_event(), and smach< CON, K, M >::state< T >::set_nested_machine().
|
private |
Nested machine.
Definition at line 181 of file _smach.h.
Referenced by smach< CON, K, M >::state< T >::insert(), and smach< CON, K, M >::state< T >::process_event().
|
private |
Definition at line 181 of file _smach.h.
Referenced by smach< CON, K, M >::state< T >::insert(), and smach< CON, K, M >::state< T >::process_event().
|
private |
Lowest and Highest event values.
Definition at line 182 of file _smach.h.
Referenced by smach< CON, K, M >::state< T >::get_name().
|
private |
Name of the state.
Definition at line 183 of file _smach.h.
Referenced by smach< CON, K, M >::state< T >::process_event(), and smach< CON, K, M >::state< T >::set_default_handler().