Simplified XF 1.1.0
|
Base class for project related events. More...
#include <customevent.h>
Public Member Functions | |
XFCustomEvent (int id, interface::XFBehavior *pBehavior=nullptr) | |
bool | deleteAfterConsume () const override |
Tells the XF if the event should be deleted after processing. More... | |
![]() | |
XFEvent (XFEventType eventType, int id=0) | |
Standard constructor. More... | |
virtual | ~XFEvent () |
Class destructor. | |
XFEventType | getEventType () const |
Returns the type of the event. More... | |
interface::XFBehavior * | getBehavior () const |
Returns pointer to behavioral class. More... | |
void | setBehavior (interface::XFBehavior *pBehavior) |
Sets pointer to behavioral class (see pBehavior_). Sets the behavior in which the event should be executed. | |
int | getId () const |
Returns id_ identifying the event in the behaviors context. | |
Protected Member Functions | |
void | setDeleteAfterConsume (bool bDeleteAfterConsume=true) |
Setter for bDeleteAfterConsume_ attribute. More... | |
Protected Attributes | |
bool | bDeleteAfterConsume_ |
True if the XF should delete event after consumption/dispatching. | |
![]() | |
const XFEventType | eventType_ |
Holds the type of the event. | |
int | id_ |
Event id to identify event in state-machine. | |
interface::XFBehavior * | pBehavior_ |
Pointer to behavioral class (ex. state-machine) processing the event. | |
Additional Inherited Members | |
![]() | |
enum | XFEventType { Unknown = 0 , Initial = 1 , DefaultTransition = 2 , Event = 3 , Timeout = 4 } |
Base class for project related events.
It is possible to create custom events by deriving new classes/events from this class. All custom events have #Event
as event type. In the state machine the event can be uniquely identified with getEventType() == Event
and the event id getId()
given to the object at construction time.
It is up to the devoper to handle the different event ids.
XFCustomEvent::XFCustomEvent | ( | int | id, |
interface::XFBehavior * | pBehavior = nullptr |
||
) |
Constructor for the class
id | Event identifier to identify the custom event (in the context of the behavior). |
pBehavior | The behavior for which the event was constructed (will consume the event). |
|
inlineoverridevirtual |
|
inlineprotected |
Setter for bDeleteAfterConsume_ attribute.
bDeleteAfterConsume | Parameter to be assigned. Default: true. |