XFEvent Class Reference
XF Core Classes

Base class for all types of events and timeouts. More...

`#include <event.h>`

Inheritance diagram for XFEvent:
Collaboration diagram for XFEvent:

## Public Types

enum | XFEventType { Unknown = 0 , Initial = 1 , DefaultTransition = 2 , Event = 3 , Timeout = 4 }

## Public Member Functions

| 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.
virtual bool | deleteAfterConsume () const
| Tells the dispatcher if the event must be deleted or not. More...

## Protected Attributes

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.

## Detailed Description

Base class for all types of events and timeouts.

Requirements:

- Needs to hold a property which allows to distinguish between different types of events (eventType_).
- Use an enumeration to define the type for the event type property (XFEventType).
- The event type property needs to be set at initialization time and cannot be changed afterwards.

## Member Enumeration Documentation

## XFEventType

enum XFEvent::XFEventType

Defines the types of events

Enumerator
Unknown | Unknown state (not initialized).
Initial | Initial pseudostate.
DefaultTransition | Event generated by the state machine to define a default transition.
Event | Custom event.
Timeout | Defines a timeout event.

## Constructor & Destructor Documentation

## XFEvent()

XFEvent::XFEvent | ( | XFEventType | eventType,
|  | int | id = `0`
| ) |  |

inline

Standard constructor.

Parameters

  eventType | The event type to be represented by the event.
  id | State-machine specific id to identify event.

## Member Function Documentation

## deleteAfterConsume()

virtual bool XFEvent::deleteAfterConsume | ( |  | ) | const

inlinevirtual

Tells the dispatcher if the event must be deleted or not.

Reimplemented in XFCustomEvent, XFDefaultTransition, XFInitialEvent, and XFTimeout.

## getBehavior()

interface::XFBehavior * XFEvent::getBehavior | ( |  | ) | const

inline

Returns pointer to behavioral class.

Returns a pointer to the behavioral class processing the event (see pBehavior_).

## getEventType()

XFEventType XFEvent::getEventType | ( |  | ) | const

inline

Returns the type of the event.

Can be used to distinguish between an event or a timeout.

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/event.h