Sirikata
Classes | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
Sirikata::OH::Simple::SimpleObjectQueryProcessor Class Reference

A simple implementation of ObjectQueryProcessor: it mostly acts as a pass through, only managing the coordination with the space server. More...

#include <SimpleObjectQueryProcessor.hpp>

Inheritance diagram for Sirikata::OH::Simple::SimpleObjectQueryProcessor:
Collaboration diagram for Sirikata::OH::Simple::SimpleObjectQueryProcessor:

List of all members.

Classes

struct  ObjectState

Public Member Functions

 SimpleObjectQueryProcessor (ObjectHostContext *ctx)
virtual ~SimpleObjectQueryProcessor ()
virtual void start ()
virtual void stop ()
virtual void presenceConnectedStream (HostedObjectPtr ho, const SpaceObjectReference &sporef, HostedObject::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 void updateQuery (HostedObjectPtr ho, const SpaceObjectReference &sporef, const String &new_query)
 Request an update to the query parameters for the specified presence.
virtual void onOrphanLocUpdate (const LocUpdate &lu, const SpaceObjectReference &observer)

Static Public Member Functions

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

Private Types

typedef std::tr1::shared_ptr
< ObjectState
ObjectStatePtr
typedef
std::tr1::unordered_map
< SpaceObjectReference,
ObjectStatePtr,
SpaceObjectReference::Hasher
ObjectStateMap

Private Member Functions

void handleStop ()
void handleProximitySubstream (const HostedObjectWPtr &weakSelf, const SpaceObjectReference &spaceobj, int err, SSTStreamPtr s)
void handleProximitySubstreamRead (const HostedObjectWPtr &weakSelf, const SpaceObjectReference &spaceobj, SSTStreamPtr s, String *prevdata, uint8 *buffer, int length)
bool handleProximityMessage (HostedObjectPtr self, const SpaceObjectReference &spaceobj, const std::string &payload)
void handleLocationSubstream (const HostedObjectWPtr &weakSelf, const SpaceObjectReference &spaceobj, int err, SSTStreamPtr s)
void handleLocationSubstreamRead (const HostedObjectWPtr &weakSelf, const SpaceObjectReference &spaceobj, SSTStreamPtr s, std::stringstream *prevdata, uint8 *buffer, int length)
bool handleLocationMessage (const HostedObjectPtr &self, const SpaceObjectReference &spaceobj, const std::string &paylod)
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)
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
ObjectStateMap mObjectStateMap

Detailed Description

A simple implementation of ObjectQueryProcessor: it mostly acts as a pass through, only managing the coordination with the space server.

Query updates are passed directly through and it only manages listening for new result streams and parsing the results.


Member Typedef Documentation


Constructor & Destructor Documentation

Sirikata::OH::Simple::SimpleObjectQueryProcessor::SimpleObjectQueryProcessor ( ObjectHostContext ctx)

Referenced by create().

Sirikata::OH::Simple::SimpleObjectQueryProcessor::~SimpleObjectQueryProcessor ( ) [virtual]

Member Function Documentation

void Sirikata::OH::Simple::SimpleObjectQueryProcessor::commandForceRebuild ( const Command::Command cmd,
Command::Commander cmdr,
Command::CommandID  cmdid 
) [private, virtual]
void Sirikata::OH::Simple::SimpleObjectQueryProcessor::commandListHandlers ( const Command::Command cmd,
Command::Commander cmdr,
Command::CommandID  cmdid 
) [private, virtual]
void Sirikata::OH::Simple::SimpleObjectQueryProcessor::commandListNodes ( const Command::Command cmd,
Command::Commander cmdr,
Command::CommandID  cmdid 
) [private, virtual]
void Sirikata::OH::Simple::SimpleObjectQueryProcessor::commandListQueriers ( const Command::Command cmd,
Command::Commander cmdr,
Command::CommandID  cmdid 
) [private, virtual]
void Sirikata::OH::Simple::SimpleObjectQueryProcessor::commandProperties ( const Command::Command cmd,
Command::Commander cmdr,
Command::CommandID  cmdid 
) [private, virtual]
void Sirikata::OH::Simple::SimpleObjectQueryProcessor::commandStats ( const Command::Command cmd,
Command::Commander cmdr,
Command::CommandID  cmdid 
) [private, virtual]
SimpleObjectQueryProcessor * Sirikata::OH::Simple::SimpleObjectQueryProcessor::create ( ObjectHostContext ctx,
const String &  args 
) [static]

References SimpleObjectQueryProcessor().

Referenced by init().

bool Sirikata::OH::Simple::SimpleObjectQueryProcessor::handleLocationMessage ( const HostedObjectPtr self,
const SpaceObjectReference spaceobj,
const std::string &  paylod 
) [private]
void Sirikata::OH::Simple::SimpleObjectQueryProcessor::handleLocationSubstream ( const HostedObjectWPtr weakSelf,
const SpaceObjectReference spaceobj,
int  err,
SSTStreamPtr  s 
) [private]
void Sirikata::OH::Simple::SimpleObjectQueryProcessor::handleLocationSubstreamRead ( const HostedObjectWPtr weakSelf,
const SpaceObjectReference spaceobj,
SSTStreamPtr  s,
std::stringstream *  prevdata,
uint8 *  buffer,
int  length 
) [private]
bool Sirikata::OH::Simple::SimpleObjectQueryProcessor::handleProximityMessage ( HostedObjectPtr  self,
const SpaceObjectReference spaceobj,
const std::string &  payload 
) [private]
void Sirikata::OH::Simple::SimpleObjectQueryProcessor::handleProximitySubstream ( const HostedObjectWPtr weakSelf,
const SpaceObjectReference spaceobj,
int  err,
SSTStreamPtr  s 
) [private]
void Sirikata::OH::Simple::SimpleObjectQueryProcessor::handleProximitySubstreamRead ( const HostedObjectWPtr weakSelf,
const SpaceObjectReference spaceobj,
SSTStreamPtr  s,
String *  prevdata,
uint8 *  buffer,
int  length 
) [private]
void Sirikata::OH::Simple::SimpleObjectQueryProcessor::handleStop ( ) [private]

References mObjectStateMap.

Referenced by stop().

void Sirikata::OH::Simple::SimpleObjectQueryProcessor::onOrphanLocUpdate ( const LocUpdate &  lu,
const SpaceObjectReference observer 
) [virtual]
void Sirikata::OH::Simple::SimpleObjectQueryProcessor::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 from Sirikata::OH::ObjectQueryProcessor.

References handleLocationSubstream(), handleProximitySubstream(), mContext, mObjectStateMap, OBJECT_PORT_LOCATION, and OBJECT_PORT_PROXIMITY.

void Sirikata::OH::Simple::SimpleObjectQueryProcessor::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.

References mObjectStateMap.

void Sirikata::OH::Simple::SimpleObjectQueryProcessor::start ( ) [virtual]

Implements Sirikata::Service.

void Sirikata::OH::Simple::SimpleObjectQueryProcessor::stop ( ) [virtual]
void Sirikata::OH::Simple::SimpleObjectQueryProcessor::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 Sirikata::ObjectHost::getSpaceStream(), mContext, Sirikata::SpaceObjectReference::object(), OBJECT_PORT_PROXIMITY, Sirikata::ObjectHostContext::objectHost, Sirikata::serializePBJMessage(), and Sirikata::SpaceObjectReference::space().


Member Data Documentation


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