Sirikata
Classes | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
Sirikata::OH::Manual::ManualObjectQueryProcessor Class Reference

An implementation of ObjectQueryProcessor that manually manages a cut on the space servers' data structures, creates and manages a local replica of the servers' data structure, and locally executes queries over that data structure. More...

#include <ManualObjectQueryProcessor.hpp>

Inheritance diagram for Sirikata::OH::Manual::ManualObjectQueryProcessor:
Collaboration diagram for Sirikata::OH::Manual::ManualObjectQueryProcessor:

List of all members.

Classes

struct  ObjectState

Public Member Functions

 ManualObjectQueryProcessor (ObjectHostContext *ctx)
virtual ~ManualObjectQueryProcessor ()
virtual void start ()
virtual void stop ()
virtual void onObjectNodeSession (const SpaceID &space, const ObjectReference &oref, const OHDP::NodeID &id)
 Invoked when an object begins a session with the given space server node.
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)
 Request an update to the query parameters for the specified presence.
void createdServerQuery (const OHDP::SpaceNodeID &snid)
void removedServerQuery (const OHDP::SpaceNodeID &snid)
void createdReplicatedIndex (const OHDP::SpaceNodeID &snid, ProxIndexID iid, ReplicatedLocationServiceCachePtr loc_cache, ServerID objects_from_server, bool dynamic_objects)
void removedReplicatedIndex (const OHDP::SpaceNodeID &snid, ProxIndexID iid)
void queriersAreObserving (const OHDP::SpaceNodeID &snid, const ProxIndexID indexid, const ObjectReference &objid)
void queriersStoppedObserving (const OHDP::SpaceNodeID &snid, const ProxIndexID indexid, const ObjectReference &objid)
void replicatedNodeRemoved (const OHDP::SpaceNodeID &snid, ProxIndexID indexid, const ObjectReference &objid)
void deliverProximityResult (const SpaceObjectReference &sporef, const Sirikata::Protocol::Prox::ProximityUpdate &update)
void deliverLocationResult (const SpaceObjectReference &sporef, const LocUpdate &lu)

Static Public Member Functions

static ManualObjectQueryProcessorcreate (ObjectHostContext *ctx, const String &args)

Private Types

typedef std::tr1::shared_ptr
< ObjectQueryHandler
ObjectQueryHandlerPtr
typedef
std::tr1::unordered_map
< SpaceObjectReference,
ObjectState,
SpaceObjectReference::Hasher
ObjectStateMap
typedef
std::tr1::unordered_map
< OHDP::SpaceNodeID,
ObjectQueryHandlerPtr,
OHDP::SpaceNodeID::Hasher
QueryHandlerMap

Private Member Functions

void registerOrUpdateObjectQuery (const SpaceObjectReference &sporef)
void unregisterObjectQuery (const SpaceObjectReference &sporef)
virtual void commandProperties (const Command::Command &cmd, Command::Commander *cmdr, Command::CommandID cmdid)
virtual void commandListHandlers (const Command::Command &cmd, Command::Commander *cmdr, Command::CommandID cmdid)
ObjectQueryHandlerPtr lookupCommandHandler (const Command::Command &cmd, Command::Commander *cmdr, Command::CommandID cmdid) const
virtual void commandListNodes (const Command::Command &cmd, Command::Commander *cmdr, Command::CommandID cmdid)
virtual void commandListQueriers (const Command::Command &cmd, Command::Commander *cmdr, Command::CommandID cmdid)
virtual void commandForceRebuild (const Command::Command &cmd, Command::Commander *cmdr, Command::CommandID cmdid)
virtual void commandStats (const Command::Command &cmd, Command::Commander *cmdr, Command::CommandID cmdid)

Private Attributes

ObjectHostContextmContext
Network::IOStrandPtr mStrand
ObjectStateMap mObjectState
QueryHandlerMap mObjectQueryHandlers
ServerQueryHandler mServerQueryHandler

Detailed Description

An implementation of ObjectQueryProcessor that manually manages a cut on the space servers' data structures, creates and manages a local replica of the servers' data structure, and locally executes queries over that data structure.


Member Typedef Documentation


Constructor & Destructor Documentation

Sirikata::OH::Manual::ManualObjectQueryProcessor::ManualObjectQueryProcessor ( ObjectHostContext ctx)

Referenced by create().

Sirikata::OH::Manual::ManualObjectQueryProcessor::~ManualObjectQueryProcessor ( ) [virtual]

Member Function Documentation

void Sirikata::OH::Manual::ManualObjectQueryProcessor::commandForceRebuild ( const Command::Command cmd,
Command::Commander cmdr,
Command::CommandID  cmdid 
) [private, virtual]
void Sirikata::OH::Manual::ManualObjectQueryProcessor::commandListHandlers ( const Command::Command cmd,
Command::Commander cmdr,
Command::CommandID  cmdid 
) [private, virtual]
void Sirikata::OH::Manual::ManualObjectQueryProcessor::commandListNodes ( const Command::Command cmd,
Command::Commander cmdr,
Command::CommandID  cmdid 
) [private, virtual]
void Sirikata::OH::Manual::ManualObjectQueryProcessor::commandListQueriers ( const Command::Command cmd,
Command::Commander cmdr,
Command::CommandID  cmdid 
) [private, virtual]
void Sirikata::OH::Manual::ManualObjectQueryProcessor::commandProperties ( const Command::Command cmd,
Command::Commander cmdr,
Command::CommandID  cmdid 
) [private, virtual]
void Sirikata::OH::Manual::ManualObjectQueryProcessor::commandStats ( const Command::Command cmd,
Command::Commander cmdr,
Command::CommandID  cmdid 
) [private, virtual]
String Sirikata::OH::Manual::ManualObjectQueryProcessor::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 from Sirikata::OH::ObjectQueryProcessor.

References mObjectState.

ManualObjectQueryProcessor * Sirikata::OH::Manual::ManualObjectQueryProcessor::create ( ObjectHostContext ctx,
const String &  args 
) [static]

References ManualObjectQueryProcessor().

Referenced by init().

void Sirikata::OH::Manual::ManualObjectQueryProcessor::createdReplicatedIndex ( const OHDP::SpaceNodeID snid,
ProxIndexID  iid,
ReplicatedLocationServiceCachePtr  loc_cache,
ServerID  objects_from_server,
bool  dynamic_objects 
)
void Sirikata::OH::Manual::ManualObjectQueryProcessor::createdServerQuery ( const OHDP::SpaceNodeID snid)
void Sirikata::OH::Manual::ManualObjectQueryProcessor::deliverLocationResult ( const SpaceObjectReference sporef,
const LocUpdate &  lu 
)
void Sirikata::OH::Manual::ManualObjectQueryProcessor::deliverProximityResult ( const SpaceObjectReference sporef,
const Sirikata::Protocol::Prox::ProximityUpdate &  update 
)
ManualObjectQueryProcessor::ObjectQueryHandlerPtr Sirikata::OH::Manual::ManualObjectQueryProcessor::lookupCommandHandler ( const Command::Command cmd,
Command::Commander cmdr,
Command::CommandID  cmdid 
) const [private]
void Sirikata::OH::Manual::ManualObjectQueryProcessor::onObjectNodeSession ( const SpaceID space,
const ObjectReference sporef,
const OHDP::NodeID id 
) [virtual]

Invoked when an object begins a session with the given space server node.

Upon invokation, previous sessions should be considered closed. A null NodeID indicates disconnection from the space.

Reimplemented from Sirikata::ObjectNodeSessionListener.

References Sirikata::OH::Manual::ServerQueryHandler::decrementServerQuery(), Sirikata::Logging::detailed, Sirikata::OH::Manual::ServerQueryHandler::incrementServerQuery(), mObjectState, mServerQueryHandler, Sirikata::OHDP::NodeID::null(), QPLOG, and unregisterObjectQuery().

void Sirikata::OH::Manual::ManualObjectQueryProcessor::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 from Sirikata::OH::ObjectQueryProcessor.

void Sirikata::OH::Manual::ManualObjectQueryProcessor::presenceConnectedStream ( HostedObjectPtr  ho,
const SpaceObjectReference sporef,
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 from Sirikata::OH::ObjectQueryProcessor.

References mObjectState, and registerOrUpdateObjectQuery().

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

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

Reimplemented from Sirikata::OH::ObjectQueryProcessor.

void Sirikata::OH::Manual::ManualObjectQueryProcessor::queriersAreObserving ( const OHDP::SpaceNodeID snid,
const ProxIndexID  indexid,
const ObjectReference objid 
)
void Sirikata::OH::Manual::ManualObjectQueryProcessor::queriersStoppedObserving ( const OHDP::SpaceNodeID snid,
const ProxIndexID  indexid,
const ObjectReference objid 
)
void Sirikata::OH::Manual::ManualObjectQueryProcessor::registerOrUpdateObjectQuery ( const SpaceObjectReference sporef) [private]
void Sirikata::OH::Manual::ManualObjectQueryProcessor::removedReplicatedIndex ( const OHDP::SpaceNodeID snid,
ProxIndexID  iid 
)
void Sirikata::OH::Manual::ManualObjectQueryProcessor::removedServerQuery ( const OHDP::SpaceNodeID snid)
void Sirikata::OH::Manual::ManualObjectQueryProcessor::replicatedNodeRemoved ( const OHDP::SpaceNodeID snid,
ProxIndexID  indexid,
const ObjectReference objid 
)
void Sirikata::OH::Manual::ManualObjectQueryProcessor::start ( ) [virtual]
void Sirikata::OH::Manual::ManualObjectQueryProcessor::stop ( ) [virtual]
void Sirikata::OH::Manual::ManualObjectQueryProcessor::unregisterObjectQuery ( const SpaceObjectReference sporef) [private]
void Sirikata::OH::Manual::ManualObjectQueryProcessor::updateQuery ( HostedObjectPtr  ho,
const SpaceObjectReference sporef,
const String &  new_query 
) [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

Implements Sirikata::OH::ObjectQueryProcessor.

References mObjectState, registerOrUpdateObjectQuery(), and unregisterObjectQuery().


Member Data Documentation

Referenced by createdServerQuery(), start(), and stop().

Referenced by createdServerQuery().


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