#include <ObjectBroker.h>
Inheritance diagram for GNE::ObjectBroker:
Public Member Functions | |
int | numObjects () const |
Returns the number of objects currently being managed by this ObjectBroker. | |
NetworkObject * | getObjectById (int objId) |
Returns the NetworkObject currently registered with the given object ID. | |
void | deregisterObject (NetworkObject &obj) |
Deregisters the given object entirely from the ObjectBroker. | |
Protected Types | |
typedef std::map< int, NetworkObject * > | ObjectsMap |
typedef std::map< int, NetworkObject * >::iterator | ObjectsIter |
Protected Member Functions | |
bool | exists (int objId) |
Returns true if the object ID given exists. | |
void | assignId (NetworkObject &o, int newId) |
Assigns the given ID to the object. | |
Protected Attributes | |
Mutex | sync |
ObjectsMap | objects |
Associates an integer object ID to a NetworkObject. |
|
Deregisters the given object entirely from the ObjectBroker. The ID of the object is set to an invalid ID, and the onDeregistration event is called. Once deregistered, an object must be reregistered before it can be used with the ObjectBroker again. Note that in ObjectBrokerClient, processing an ObjectDeathPacket automatically deregisteres an object, so this method is most useful with ObjectBrokerServer.
|
|
Returns true if the object ID given exists. The mutex sync must be locked when this method is called. |
|
Returns the NetworkObject currently registered with the given object ID. Returns NULL if there is no object with that ID. |