Simplified XF 1.1.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
XFCustomEvent Class Reference

Base class for project related events. More...

#include <customevent.h>

Inheritance diagram for XFCustomEvent:
Inheritance graph
Collaboration diagram for XFCustomEvent:
Collaboration graph

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...
 
- Public Member Functions inherited from XFEvent
 XFEvent (XFEventType eventType, int id=0)
 Standard constructor. More...
 
virtual ~XFEvent ()
 Class destructor.
 
XFEventType getEventType () const
 Returns the type of the event. More...
 
interface::XFBehaviorgetBehavior () 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.
 
- Protected Attributes inherited from XFEvent
const XFEventType eventType_
 Holds the type of the event.
 
int id_
 Event id to identify event in state-machine.
 
interface::XFBehaviorpBehavior_
 Pointer to behavioral class (ex. state-machine) processing the event.
 

Additional Inherited Members

- Public Types inherited from XFEvent
enum  XFEventType {
  Unknown = 0 , Initial = 1 , DefaultTransition = 2 , Event = 3 ,
  Timeout = 4
}
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ XFCustomEvent()

XFCustomEvent::XFCustomEvent ( int  id,
interface::XFBehavior pBehavior = nullptr 
)

Constructor for the class

Parameters
idEvent identifier to identify the custom event (in the context of the behavior).
pBehaviorThe behavior for which the event was constructed (will consume the event).

Member Function Documentation

◆ deleteAfterConsume()

bool XFCustomEvent::deleteAfterConsume ( ) const
inlineoverridevirtual

Tells the XF if the event should be deleted after processing.

Returns
True if the event should be deleted.

Reimplemented from XFEvent.

◆ setDeleteAfterConsume()

void XFCustomEvent::setDeleteAfterConsume ( bool  bDeleteAfterConsume = true)
inlineprotected

Setter for bDeleteAfterConsume_ attribute.

Parameters
bDeleteAfterConsumeParameter to be assigned. Default: true.

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