Sirikata
Public Types | Public Member Functions | Protected Member Functions
Sirikata::OH::ObjectQueryProcessor Class Reference

ObjectQueryProcessor is the interface for a geometric (proximity) query service for objects in an object host. More...

#include <ObjectQueryProcessor.hpp>

Inheritance diagram for Sirikata::OH::ObjectQueryProcessor:
Collaboration diagram for Sirikata::OH::ObjectQueryProcessor:

List of all members.

Public Types

typedef HostedObject::SSTStreamPtr SSTStreamPtr
typedef
HostedObject::SSTConnectionPtr 
SSTConnectionPtr

Public Member Functions

 ObjectQueryProcessor (Context *ctx)
virtual ~ObjectQueryProcessor ()
virtual void presenceConnected (HostedObjectPtr ho, const SpaceObjectReference &sporef)
 Invoked by the ObjectHost when an object's presence is connected to the space.
virtual void presenceConnectedStream (HostedObjectPtr ho, const SpaceObjectReference &sporef, SSTStreamPtr strm)
 Invoked by the ObjectHost when an object's presence is connected to the space and the underlying stream has been fully established.
virtual void presenceDisconnected (HostedObjectPtr ho, const SpaceObjectReference &sporef)
 Invoked by the ObjectHost when an object's presence has been disconnected from the space.
virtual String connectRequest (HostedObjectPtr ho, const SpaceObjectReference &sporef, const String &query)
 Request a query during connection.
virtual void updateQuery (HostedObjectPtr ho, const SpaceObjectReference &sporef, const String &new_query)=0
 Request an update to the query parameters for the specified presence.

Protected Member Functions

void deliverProximityUpdate (HostedObjectPtr ho, const SpaceObjectReference &sporef, const Sirikata::Protocol::Prox::ProximityUpdate &update)
 Helper method for implementations which delivers proximity results to the HostedObject.
void deliverLocationUpdate (HostedObjectPtr ho, const SpaceObjectReference &sporef, const LocUpdate &lu)
 Helper method for implementations which delivers location updates to the HostedObject.

Detailed Description

ObjectQueryProcessor is the interface for a geometric (proximity) query service for objects in an object host.

The query format is opaque: different implementations may support different query formats. Results are provided directly to the HostedObject in the form of Protocol::Prox::ProximityResults, as sets of atomic additions and removals. An implementation may generate results in different ways -- simple versions might just forward requests to the server and manage receiving results whereas more complicated versions might process queries locally.

ObjectQueryProcessor is also responsible for managing location updates. This is necessary because proximity and location are tightly coupled -- their updates depend on synchronized sequence numbers and updates for objects may not even be directly from the server (i.e. they may be generated by local query processing).


Member Typedef Documentation


Constructor & Destructor Documentation

Sirikata::OH::ObjectQueryProcessor::ObjectQueryProcessor ( Context ctx)
Sirikata::OH::ObjectQueryProcessor::~ObjectQueryProcessor ( ) [virtual]

Member Function Documentation

String Sirikata::OH::ObjectQueryProcessor::connectRequest ( HostedObjectPtr  ho,
const SpaceObjectReference sporef,
const String &  query 
) [virtual]

Request a query during connection.

This is used by the object host to inform the ObjectQueryProcessor that the object wants to connect with the given query. This gives a chance to filter the query before it is passed to the space. However, the query processor should *not* start processing it until the object has been successfully connected to the space. The default implementation is a noop.

Parameters:
hothe HostedObject requesting connection
sporefthe ID of the presence requesting connection
querythe query requested
Returns:
a new query to actually pass to the space server with the connection request. It may be empty if no object-specific query should be registered

Reimplemented in Sirikata::OH::Manual::ManualObjectQueryProcessor.

Referenced by Sirikata::ObjectHost::connect().

void Sirikata::OH::ObjectQueryProcessor::deliverLocationUpdate ( HostedObjectPtr  ho,
const SpaceObjectReference sporef,
const LocUpdate &  lu 
) [protected]

Helper method for implementations which delivers location updates to the HostedObject.

Parameters:
hothe HostedObject requesting the update
sporefthe ID of the presence that registered the query
luthe location update

Referenced by Sirikata::OH::Manual::ManualObjectQueryProcessor::deliverLocationResult(), Sirikata::OH::Simple::SimpleObjectQueryProcessor::handleLocationMessage(), and Sirikata::OH::Simple::SimpleObjectQueryProcessor::onOrphanLocUpdate().

void Sirikata::OH::ObjectQueryProcessor::deliverProximityUpdate ( HostedObjectPtr  ho,
const SpaceObjectReference sporef,
const Sirikata::Protocol::Prox::ProximityUpdate &  update 
) [protected]

Helper method for implementations which delivers proximity results to the HostedObject.

Parameters:
hothe HostedObject requesting the update
sporefthe ID of the presence that registered the query
updatea single proximity update to apply

Referenced by Sirikata::OH::Manual::ManualObjectQueryProcessor::deliverProximityResult(), and Sirikata::OH::Simple::SimpleObjectQueryProcessor::handleProximityMessage().

void Sirikata::OH::ObjectQueryProcessor::presenceConnected ( HostedObjectPtr  ho,
const SpaceObjectReference sporef 
) [virtual]

Invoked by the ObjectHost when an object's presence is connected to the space.

While it has received an acknowledgement, the connection may not fully be established (e.g. streams may not have finished connecting).

Reimplemented in Sirikata::OH::Manual::ManualObjectQueryProcessor.

Referenced by Sirikata::ObjectHost::wrappedConnectedCallback().

void Sirikata::OH::ObjectQueryProcessor::presenceConnectedStream ( HostedObjectPtr  ho,
const SpaceObjectReference sporef,
HostedObject::SSTStreamPtr  strm 
) [virtual]

Invoked by the ObjectHost when an object's presence is connected to the space and the underlying stream has been fully established.

Reimplemented in Sirikata::OH::Manual::ManualObjectQueryProcessor, and Sirikata::OH::Simple::SimpleObjectQueryProcessor.

Referenced by Sirikata::ObjectHost::wrappedStreamCreatedCallback().

void Sirikata::OH::ObjectQueryProcessor::presenceDisconnected ( HostedObjectPtr  ho,
const SpaceObjectReference sporef 
) [virtual]

Invoked by the ObjectHost when an object's presence has been disconnected from the space.

Reimplemented in Sirikata::OH::Manual::ManualObjectQueryProcessor, and Sirikata::OH::Simple::SimpleObjectQueryProcessor.

Referenced by Sirikata::ObjectHost::wrappedDisconnectedCallback().

virtual void Sirikata::OH::ObjectQueryProcessor::updateQuery ( HostedObjectPtr  ho,
const SpaceObjectReference sporef,
const String &  new_query 
) [pure virtual]

Request an update to the query parameters for the specified presence.

Parameters:
hothe HostedObject requesting the update
sporefthe ID of the presence to update a query for
new_querythe encoded, updated query

Implemented in Sirikata::OH::Manual::ManualObjectQueryProcessor, and Sirikata::OH::Simple::SimpleObjectQueryProcessor.

Referenced by Sirikata::HostedObject::requestQueryUpdate().


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