Ocean
Ocean::Event Class Reference

This class implements the base class for all event classes. More...

Inheritance diagram for Ocean::Event:

Public Member Functions

virtual ~Event ()
 Destructs an event object. More...
 
unsigned int type () const
 Returns the type of this event. More...
 
unsigned int subtype () const
 Returns the sub-type of this event. More...
 
template<typename T >
const T & cast () const
 Casts this event to an event with specified type. More...
 
template<typename T >
T & cast ()
 Casts this event to an event with specified type. More...
 

Protected Member Functions

 Event (const unsigned int type, const unsigned int subtype)
 Creates a new event object. More...
 

Protected Attributes

unsigned int eventType
 The type of the event. More...
 
unsigned int eventSubtype
 The sub-type of the event. More...
 

Detailed Description

This class implements the base class for all event classes.

Events can be used to share, to forward or to distribute arbitrary information from one component to another component while dependencies can be avoided.
Further, events may be used to synchronize asynchronous tasks.

See also
EventRef, EventManager.

Constructor & Destructor Documentation

◆ ~Event()

virtual Ocean::Event::~Event ( )
virtual

Destructs an event object.

◆ Event()

Ocean::Event::Event ( const unsigned int  type,
const unsigned int  subtype 
)
inlineprotected

Creates a new event object.

Parameters
typeThe type of the event
subtypeThe subtype of the event

Member Function Documentation

◆ cast() [1/2]

template<typename T >
T & Ocean::Event::cast

Casts this event to an event with specified type.

Returns
Casted event object
Template Parameters
TData type of the resulting event

◆ cast() [2/2]

template<typename T >
const T & Ocean::Event::cast

Casts this event to an event with specified type.

Returns
Casted event object
Template Parameters
TData type of the resulting event

◆ subtype()

unsigned int Ocean::Event::subtype ( ) const
inline

Returns the sub-type of this event.

Returns
Event sub-type

◆ type()

unsigned int Ocean::Event::type ( ) const
inline

Returns the type of this event.

Returns
Event type

Field Documentation

◆ eventSubtype

unsigned int Ocean::Event::eventSubtype
protected

The sub-type of the event.

◆ eventType

unsigned int Ocean::Event::eventType
protected

The type of the event.


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