A representation of a single NetDog event. More...
Public Types | |
| typedef uint32_t | EventID |
| Sequential ID number of event. | |
| typedef int8_t | Type |
| Type of event. | |
Public Member Functions | |
| NDNodeID | getCreatorNodeID (void) |
| Returns the NDNodeID of the node that created the event. | |
| EventID | getCreatorEventID (void) |
| Returns the EventID for this event, as specified by the creator. | |
| void | routeToAll (void) |
| Sets routing destination to ALL. | |
| void | routeToNode (NDNodeID nid) |
| Sets routing destination to specific node. | |
| void | setReliable (bool rel) |
| (Un)sets the "reliable" flag for this event. | |
| bool | getReliable (void) |
| Determines whether this event's "reliable" flag has been set. | |
| Type | getEventType (void) |
| Returns the event type for this event. | |
| NDTimeValue | getEventTime (void) |
| Returns the time at which the event is supposed to occur. | |
| uint32_t | getDataLength (void) |
| Returns the size of the event data payload. | |
| void * | getData (void) |
| Returns pointer to the event data payload. | |
| NDResult | send (void) |
| Sends the event. | |
Static Public Member Functions | |
| static void * | operator new (size_t s) |
| static void | operator delete (void *p) |
A representation of a single event. The actual event "payload" is contained inside the NDEvent and must be accessed/modified using the provided accessor functions.
Sequential ID number of event.
Note that these numbers are only sequential and unique for the NetDog node that generated them.
Describes the type of event. This is a user defined quantity. Each type should be identified by a unique non-negative integer.
| NDEvent::EventID NDEvent::getCreatorEventID | ( | void | ) |
Returns the EventID for this event, as specified by the creator.
| NDNodeID NDEvent::getCreatorNodeID | ( | void | ) |
Returns the NDNodeID of the node that created the event.
| void * NDEvent::getData | ( | void | ) |
Returns a pointer to the event data payload, the actual user-defined "guts" of the event being sent. This is completely user defined, and should not be accessed beyond than the number of bytes returned by getDataLength().
| uint32_t NDEvent::getDataLength | ( | void | ) |
Returns the size of the event data payload in bytes.
| NDTimeValue NDEvent::getEventTime | ( | void | ) |
Returns the time at which the event is supposed to occur. This is relative to the NDChannel's universe time. The event may be scheduled to happen in the future, past, present, etc.
| NDEvent::Type NDEvent::getEventType | ( | void | ) |
Returns the event type for this event.
| bool NDEvent::getReliable | ( | void | ) |
Determines whether this event's "reliable" flag has been set.
| void NDEvent::routeToAll | ( | void | ) |
Sets routing destination to ALL.
This only makes sense for smaller network topologies. In fact, depending on the routing used, this may not actually reach ALL destinations.
| void NDEvent::routeToNode | ( | NDNodeID | nid | ) |
Sets routing destination to specific node.
This could be used, for example, to send a 'chat' message directly to another player node.
| nid | NDNodeID of destination node |
| NDResult NDEvent::send | ( | void | ) |
Sends the event. This triggers NetDog to dispatch the event. Note that this does not deallocate the event, so be sure to deallocate the event when you are done with it using the "delete" operator.
| void NDEvent::setReliable | ( | bool | rel | ) |
Un(sets) the "reliable" flag for this event.
If set, the flag will result in the event being sent reliably, i.e. with guaranteed delivery.
For performance reasons, this should only be set for events that actually need to be delivered reliably.
| rel | A boolean value, true if the reliable flag should be set, false if it should be unset. |
1.6.1