Sirikata
Public Types | Public Member Functions
Sirikata::ODP::Service Class Reference

ODP::Service is the interface provided by classes that are able to send ODP messages. More...

#include <Service.hpp>

Inheritance diagram for Sirikata::ODP::Service:

List of all members.

Public Types

typedef Endpoint::MessageHandler MessageHandler

Public Member Functions

virtual ~Service ()
virtual PortbindODPPort (const SpaceID &space, const ObjectReference &objref, PortID port)=0
 Bind an ODP port for use.
virtual PortbindODPPort (const SpaceObjectReference &sor, PortID port)=0
virtual PortbindODPPort (const SpaceID &space, const ObjectReference &objref)=0
 Bind a random, unused ODP port for use.
virtual PortbindODPPort (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.

Detailed Description

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.


Member Typedef Documentation


Constructor & Destructor Documentation

virtual Sirikata::ODP::Service::~Service ( ) [inline, virtual]

Member Function Documentation

virtual Port* Sirikata::ODP::Service::bindODPPort ( const SpaceID space,
const ObjectReference objref,
PortID  port 
) [pure virtual]

Bind an ODP port for use.

Parameters:
spacethe Space to communicate via
objrefthe Object to communicate via
portthe PortID to attempt to bind
Returns:
an ODP Port object which can be used immediately, or NULL if the port is already bound
Exceptions:
PortAllocationErrorif 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]
virtual Port* Sirikata::ODP::Service::bindODPPort ( const SpaceObjectReference sor) [pure virtual]
virtual Port* Sirikata::ODP::Service::bindODPPort ( const SpaceID space,
const ObjectReference objref 
) [pure virtual]

Bind a random, unused ODP port for use.

Parameters:
spacethe Space to communicate via
Returns:
an ODP Port object which can be used immediately, or, in extremely rare cases, NULL when an unused port isn't available
Exceptions:
PortAllocationErrorif 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.

Parameters:
cbthe 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]

The documentation for this class was generated from the following file: