Ocean
|
This class implements a scoped event. More...
Public Types | |
typedef Callback< void, const T & > | EventCallback |
Definition of a callback function providing the event as single parameter. More... | |
typedef Callbacks< EventCallback > | EventCallbacks |
Definition of a list of callback functions. More... | |
Public Member Functions | |
ScopedEvent (const T &enterEvent, T &breakEvent, T &leaveEvent, const EventCallbacks &callbacks) | |
Creates a new scoped event object. More... | |
~ScopedEvent () | |
Destructs this scoped event object. More... | |
void | leave () const |
Activates the leave event of this object. More... | |
const T & | breakEvent () const |
Returns the break-event of this object, nothing else will be done. More... | |
T & | breakEvent () |
Returns the break-event of this object, nothing else will be done. More... | |
const T & | leaveEvent () const |
Returns the leave-event of this object, nothing else will be done. More... | |
T & | leaveEvent () |
Returns the leave-event of this object, nothing else will be done. More... | |
Protected Attributes | |
T & | scopedBreakEvent |
Break event which will be invoked if the leave() function has not been called before this object is disposed. More... | |
T & | scopedLeaveEvent |
Leave event which will be invoked if the leave() function has been called before this object is disposed. More... | |
const EventCallbacks & | scopedCallbacks |
A list of callback functions to those the events will be sent. More... | |
bool | scopedEventLeave |
Leave statement of this object. More... | |
This class implements a scoped event.
A scoped event stores three individual events.
One event is invoked when the scope is entered.
One event is invoked when the scope is left.
One optional event is invoked when the scope is paused.
T | Event type that will be handled |
typedef Callback<void, const T&> Ocean::ScopedEvent< T >::EventCallback |
Definition of a callback function providing the event as single parameter.
typedef Callbacks<EventCallback> Ocean::ScopedEvent< T >::EventCallbacks |
Definition of a list of callback functions.
|
inline |
Creates a new scoped event object.
enterEvent | Event that will be invoked during the creation of this event |
breakEvent | Event that will be invoked when this object is disposed as long as the leave() function hasn't been called |
leaveEvent | Event that will be invoked when this object is disposed as long as the leave() function has been called |
callbacks | List of callback functions to those the events will be sent |
|
inline |
Destructs this scoped event object.
|
inline |
Returns the break-event of this object, nothing else will be done.
|
inline |
Returns the break-event of this object, nothing else will be done.
|
inline |
Activates the leave event of this object.
If the leave event is activated, the leave event will be invoked instead of the break event in the moment this object is disposed.
|
inline |
Returns the leave-event of this object, nothing else will be done.
|
inline |
Returns the leave-event of this object, nothing else will be done.
|
protected |
Break event which will be invoked if the leave() function has not been called before this object is disposed.
|
protected |
A list of callback functions to those the events will be sent.
|
mutableprotected |
Leave statement of this object.
|
protected |
Leave event which will be invoked if the leave() function has been called before this object is disposed.