Sirikata
|
ODP::Service is the interface provided by classes that are able to send ODP messages. More...
#include <Service.hpp>
Public Types | |
typedef Endpoint::MessageHandler | MessageHandler |
Public Member Functions | |
virtual | ~Service () |
virtual Port * | bindODPPort (const SpaceID &space, const ObjectReference &objref, PortID port)=0 |
Bind an ODP port for use. | |
virtual Port * | bindODPPort (const SpaceObjectReference &sor, PortID port)=0 |
virtual Port * | bindODPPort (const SpaceID &space, const ObjectReference &objref)=0 |
Bind a random, unused ODP port for use. | |
virtual Port * | bindODPPort (const SpaceObjectReference &sor)=0 |
virtual PortID | unusedODPPort (const SpaceID &space, const ObjectReference &objref)=0 |
Get a random, unused ODP port. | |
virtual PortID | unusedODPPort (const SpaceObjectReference &sor)=0 |
virtual void | registerDefaultODPHandler (const MessageHandler &cb)=0 |
Register a handler for messages that arrive on unbound ports. |
ODP::Service is the interface provided by classes that are able to send ODP messages.
ODP::Service mainly handles management of ODP::Ports, which in turn allow sending and receiving of ODP messages.
A Service allocates Ports and (behind the scenes) handles requests on the Ports, but once allocated the Port is owned by the allocator. The allocator is responsible for deleting all allocated Ports, even if the Service that generated them was destroyed.
virtual Sirikata::ODP::Service::~Service | ( | ) | [inline, virtual] |
virtual Port* Sirikata::ODP::Service::bindODPPort | ( | const SpaceID & | space, |
const ObjectReference & | objref, | ||
PortID | port | ||
) | [pure virtual] |
Bind an ODP port for use.
space | the Space to communicate via |
objref | the Object to communicate via |
port | the PortID to attempt to bind |
PortAllocationError | if the Service cannot allocate the port for some reason other than it already being allocated. |
Implemented in Sirikata::ODP::DelegateService, and Sirikata::HostedObject.
virtual Port* Sirikata::ODP::Service::bindODPPort | ( | const SpaceObjectReference & | sor, |
PortID | port | ||
) | [pure virtual] |
Implemented in Sirikata::ODP::DelegateService, and Sirikata::HostedObject.
virtual Port* Sirikata::ODP::Service::bindODPPort | ( | const SpaceObjectReference & | sor | ) | [pure virtual] |
Implemented in Sirikata::ODP::DelegateService, and Sirikata::HostedObject.
virtual Port* Sirikata::ODP::Service::bindODPPort | ( | const SpaceID & | space, |
const ObjectReference & | objref | ||
) | [pure virtual] |
Bind a random, unused ODP port for use.
space | the Space to communicate via |
PortAllocationError | if the Service cannot allocate the port for some reason other than it already being allocated. |
Implemented in Sirikata::ODP::DelegateService, and Sirikata::HostedObject.
virtual void Sirikata::ODP::Service::registerDefaultODPHandler | ( | const MessageHandler & | cb | ) | [pure virtual] |
Register a handler for messages that arrive on unbound ports.
By default there is no handler and such messages are ignored. Note that this handler will not be invoked for messages arriving at a bound port for which no handler has been registered.
cb | the handler for messages arriving at unbound ports |
Implemented in Sirikata::ODP::DelegateService.
virtual PortID Sirikata::ODP::Service::unusedODPPort | ( | const SpaceID & | space, |
const ObjectReference & | objref | ||
) | [pure virtual] |
Get a random, unused ODP port.
Implemented in Sirikata::ODP::DelegateService, and Sirikata::HostedObject.
virtual PortID Sirikata::ODP::Service::unusedODPPort | ( | const SpaceObjectReference & | sor | ) | [pure virtual] |
Implemented in Sirikata::ODP::DelegateService, and Sirikata::HostedObject.