Simplified XF 1.1.0

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
XFBehavior Class Referenceabstract
XF Core Classes

Base class for state machines, activities, process and data flows. More...

`#include <behavior.h>`

Inheritance diagram for XFBehavior:
Collaboration diagram for XFBehavior:

## 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
Public Types inherited from interface::XFBehavior
using | TerminateBehavior = bool
| Type returned by the process() method.

## Detailed Description

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.

## Constructor & Destructor Documentation

## ◆ ~XFBehavior()

XFBehavior::~XFBehavior | ( |  | ) |
| override virtual

Reimplemented from interface::XFBehavior.

## Member Function Documentation

## ◆ deleteOnTerminate()

bool XFBehavior::deleteOnTerminate | ( |  | ) | const
| override virtual

Tells XF to delete behavior when receiving terminate event.

Implements interface::XFBehavior.

## ◆ getCurrentTimeout()

const XFTimeout * XFBehavior::getCurrentTimeout | ( |  | ) |
| protected

Returns a reference to the actually processed timeout.

Will work only if the current event is of type IXFEvent::Timeout.

## ◆ processEvent()

virtual XFEventStatus XFBehavior::processEvent | ( |  | ) |
| protected pure virtual

Executes the current event in its implemented behavior. This method needs to be overridden to implement the behavior (i.e. state machine) needed.

## ◆ pushEvent()

void XFBehavior::pushEvent | ( | XFEvent * | pEvent | ) |
| override virtual

Injects an event into the class.

Implements interface::XFBehavior.

## ◆ setDeleteOnTerminate()

void XFBehavior::setDeleteOnTerminate | ( | bool | deleteBehaviour | ) |
| override virtual

Sets/Clears the 'delete on terminate' property.

Implements interface::XFBehavior.

## ◆ startBehavior()

void XFBehavior::startBehavior | ( |  | ) |
| override virtual

Starts the behavior, resp. the state machine.

Implements interface::XFBehavior.

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

- C:/Users/thomas.sterren/Desktop/PTR_XF_Release/03-release/work/src/simplified/xf/include/xf/behavior.h