#include <event.h>
Classes | |
struct | _EventData |
Public Member Functions | |
Event (const char *name, void(*func)(T &data)=NULL) throw (Exception) | |
~Event () | |
void | clear (void) |
bool | enqueueEvent (const T data, nodeId target=everybodyId, unsigned int len=1) |
T | getEvent (nodeId id=everybodyId, unsigned int *used=0) throw (EmptyException) |
bool | isEmpty (void) |
bool | setHandler (void(*func)(T &data)) |
unsigned int | queueSize (void) |
Protected Member Functions | |
bool | pushEvent (chain &c, nodeId sender) |
Definition at line 160 of file event.h.
libglass::Event< T, T, T >::Event | ( | const char * | name, | |
void(*)(T &data) | func = NULL | |||
) | throw (Exception) [inline] |
libglass::Event< T, T, T >::~Event | ( | ) | [inline] |
void libglass::Event< T, T, T >::clear | ( | void | ) | [inline] |
bool libglass::Event< T, T, T >::enqueueEvent | ( | const T | data, | |
nodeId | target = everybodyId , |
|||
unsigned int | len = 1 | |||
) | [inline] |
Enqueues data.
data | The data to enqueue. | |
target | The target node. | |
size | Length of the data, if appliable. If you are transferring arrays, set this to the array length. |
true | if successfully sent. | |
false | if an error occurred. |
Definition at line 227 of file event.h.
References libglass::_Event::_enqueueEvent().
T libglass::Event< T, T, T >::getEvent | ( | nodeId | id = everybodyId , |
|
unsigned int * | used = 0 | |||
) | throw (EmptyException) [inline] |
Returns first event in queue.
Definition at line 254 of file event.h.
References libglass::everybodyId.
bool libglass::Event< T, T, T >::isEmpty | ( | void | ) | [inline] |
bool libglass::Event< T, T, T >::pushEvent | ( | chain & | c, | |
nodeId | sender | |||
) | [inline, protected, virtual] |
Pushes
c | The serialized event data. |
True | if successfully pushed to the stack. | |
False | otherwise. |
Implements libglass::_Event.
unsigned int libglass::Event< T, T, T >::queueSize | ( | void | ) | [inline] |
bool libglass::Event< T, T, T >::setHandler | ( | void(*)(T &data) | func | ) | [inline] |