Event implementation base class. More...
#include <senf/PPI/Events.hh>
Public Types | |
typedef EventType | Event |
typedef detail::EventArgType< EventType >::type | EventArg |
Public Member Functions | |
module::Module & | module () const |
Module in which the event is registered. More... | |
EventManager & | manager () const |
EventManager of the event. More... | |
Public Member Functions inherited from senf::ppi::EventDescriptor | |
virtual | ~EventDescriptor () |
bool | enabled () const |
Check, whether the event is currently enabled. More... | |
void | enabled (bool v) |
Enable or disable the event. More... | |
Protected Member Functions | |
EventImplementation () | |
Protected Member Functions inherited from senf::ppi::EventDescriptor | |
EventDescriptor () | |
Protected Member Functions inherited from senf::ppi::EventImplementationHelper< EventType, EventImplementation< EventType > > | |
void | callback (EventArg event, ClockService::clock_type time) |
Forward event to user callback. More... | |
void | callback (EventArg event) |
Forward event to user callback. More... | |
Additional Inherited Members | |
Protected Types inherited from senf::ppi::EventImplementationHelper< EventType, EventImplementation< EventType > > | |
typedef detail::EventArgType< EventType >::type | EventArg |
Event implementation base class.
EventImplementation provides the base-class for all Event implementations.
Every event needs to implement v_enable() and v_disable(). v_enable() should register some member (in the example \c cb() ) to be called whenever the event occurs, while v_disable() should unregister it. The \a EventType argument to EventImplementation defines the type of argument passed to the user callback. It defaults to \c void. . This user callback is called from within the registered member (e.g. \c cb() ) by calling the inherited callback() member. This member takes an \a EventType reference as argument which will be forwarded to the user callback. If available, you should also provide the \e expected event time as a second argument.
typedef EventType senf::ppi::EventImplementation< EventType >::Event |
typedef detail::EventArgType<EventType>::type senf::ppi::EventImplementation< EventType >::EventArg |
|
protected |
EventManager& senf::ppi::EventImplementation< EventType >::manager | ( | ) | const |
EventManager of the event.
module::Module& senf::ppi::EventImplementation< EventType >::module | ( | ) | const |
Module in which the event is registered.