Simplified XF 1.1.0
|
Base class for state machines, activities, process and data flows. More...
#include <behavior.h>
Public Member Functions | |
XFBehavior () | |
Default constructor for the behavior. | |
void | startBehavior () override |
Starts the behavior, resp. the state machine. More... | |
void | pushEvent (XFEvent *pEvent) override |
Injects an event into the class. More... | |
bool | deleteOnTerminate () const override |
Tells XF to delete behavior when receiving terminate event. More... | |
void | setDeleteOnTerminate (bool deleteBehaviour) override |
Sets/Clears the 'delete on terminate' property. More... | |
Protected Member Functions | |
virtual XFEventStatus | processEvent ()=0 |
const XFEvent * | getCurrentEvent () const |
Returns the current event to be processed in processEvent(). | |
interface::XFDispatcher * | getDispatcher () |
Returns reference to actual dispatcher. | |
const XFTimeout * | getCurrentTimeout () |
Returns a reference to the actually processed timeout. More... | |
void | scheduleTimeout (int timeoutId, int interval) |
Schedules a timeout for this state machine. | |
void | unscheduleTimeout (int timeoutId) |
Unschedules a timeout for this state machine. | |
Protected Attributes | |
bool | deleteOnTerminate_ |
Indicates if the behavior can be deleted after reception of a 'terminate event'. | |
const XFEvent * | pCurrentEvent_ |
Reference to actually processed event. | |
Additional Inherited Members | |
![]() | |
using | TerminateBehavior = bool |
Type returned by the process() method. | |
Base class for state machines, activities, process and data flows.
Reactive class implementing a behavior. This class can be used to implement a state machine behavior or an activity behavior.
Override the processEvent() operation in the inherited class to implement your state machine behavior. The processEvent() method gets automatically called every time an event or timeout arrives. The event (or timeout) can be accessed via the getCurrentEvent() method.
|
overridevirtual |
Reimplemented from interface::XFBehavior.
|
overridevirtual |
Tells XF to delete behavior when receiving terminate event.
Implements interface::XFBehavior.
|
protected |
Returns a reference to the actually processed timeout.
Will work only if the current event is of type IXFEvent::Timeout.
|
protectedpure virtual |
Executes the current event in its implemented behavior. This method needs to be overridden to implement the behavior (i.e. state machine) needed.
|
overridevirtual |
Injects an event into the class.
Implements interface::XFBehavior.
|
overridevirtual |
Sets/Clears the 'delete on terminate' property.
Implements interface::XFBehavior.
|
overridevirtual |
Starts the behavior, resp. the state machine.
Implements interface::XFBehavior.