Sirikata
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
Sirikata::MasterPintoServerQuerierBase Class Reference

MasterPintoServerQuerierBase uses a single, centralized master Pinto query server to discover which other space servers must be queried. More...

#include <MasterPintoServerQuerierBase.hpp>

Inheritance diagram for Sirikata::MasterPintoServerQuerierBase:
Collaboration diagram for Sirikata::MasterPintoServerQuerierBase:

List of all members.

Public Member Functions

 MasterPintoServerQuerierBase (SpaceContext *ctx, const String &params)
virtual ~MasterPintoServerQuerierBase ()
virtual void start ()
virtual void stop ()
virtual void updateRegion (const BoundingBox3f &region)
 Update this server's parameters.
virtual void updateLargestObject (float max_radius)
 Update this server's parameters.
virtual void updateQuery (const String &update)=0
 Update query parameters with the server.

Protected Types

enum  QueueUpdateType { QueueUpdate, DoNotQueueUpdate }

Protected Member Functions

virtual void onConnected ()
virtual void onDisconnected ()
virtual void onPintoData (const String &data)=0
void sendQueryUpdate (const String &data, QueueUpdateType queue=QueueUpdate)

Protected Attributes

SpaceContextmContext
Network::IOStrandmIOStrand
Network::StreammServerStream

Private Member Functions

void connect ()
bool connected ()
void handleServerConnection (Network::Stream::ConnectionStatus status, const std::string &reason)
void handleServerReceived (Network::Chunk &data, const Network::Stream::PauseReceiveCallback &pause)
void handleServerReadySend ()
void tryServerUpdate ()

Private Attributes

String mHost
String mPort
bool mConnecting
bool mConnected
bool mGaveID
BoundingBox3f mRegion
bool mRegionDirty
float32 mMaxRadius
bool mMaxRadiusDirty
std::vector< String > mQueuedQueryUpdates

Detailed Description

MasterPintoServerQuerierBase uses a single, centralized master Pinto query server to discover which other space servers must be queried.

Base class for specific implementation, e.g. using aggregated queries, or replicated top-level trees. It handles setting up the connection and managing updates for the required properties. Implementations need to handle query update requests from Proximity and deal with interaction over the connection generated by this class.


Member Enumeration Documentation

Enumerator:
QueueUpdate 
DoNotQueueUpdate 

Constructor & Destructor Documentation

Sirikata::MasterPintoServerQuerierBase::MasterPintoServerQuerierBase ( SpaceContext ctx,
const String &  params 
)
Sirikata::MasterPintoServerQuerierBase::~MasterPintoServerQuerierBase ( ) [virtual]

References mIOStrand, and mServerStream.


Member Function Documentation

void Sirikata::MasterPintoServerQuerierBase::connect ( ) [private]
bool Sirikata::MasterPintoServerQuerierBase::connected ( ) [inline, private]

References mConnected.

Referenced by sendQueryUpdate().

void Sirikata::MasterPintoServerQuerierBase::handleServerConnection ( Network::Stream::ConnectionStatus  status,
const std::string &  reason 
) [private]
void Sirikata::MasterPintoServerQuerierBase::handleServerReadySend ( ) [private]

Referenced by connect().

void Sirikata::MasterPintoServerQuerierBase::handleServerReceived ( Network::Chunk &  data,
const Network::Stream::PauseReceiveCallback pause 
) [private]

References onPintoData().

Referenced by connect().

virtual void Sirikata::MasterPintoServerQuerierBase::onConnected ( ) [inline, protected, virtual]
virtual void Sirikata::MasterPintoServerQuerierBase::onDisconnected ( ) [inline, protected, virtual]

Referenced by handleServerConnection().

virtual void Sirikata::MasterPintoServerQuerierBase::onPintoData ( const String &  data) [protected, pure virtual]
void Sirikata::MasterPintoServerQuerierBase::sendQueryUpdate ( const String &  data,
QueueUpdateType  queue = QueueUpdate 
) [protected]
void Sirikata::MasterPintoServerQuerierBase::start ( ) [virtual]

Implements Sirikata::Service.

References connect().

void Sirikata::MasterPintoServerQuerierBase::stop ( ) [virtual]
void Sirikata::MasterPintoServerQuerierBase::tryServerUpdate ( ) [private]
void Sirikata::MasterPintoServerQuerierBase::updateLargestObject ( float  max_radius) [virtual]

Update this server's parameters.

Parameters:
max_radiussize of the largest object in the region

Implements Sirikata::PintoServerQuerier.

References Sirikata::Logging::debug, mIOStrand, mMaxRadius, mMaxRadiusDirty, MP_LOG, Sirikata::Network::IOStrand::post(), and tryServerUpdate().

virtual void Sirikata::MasterPintoServerQuerierBase::updateQuery ( const String &  update) [pure virtual]

Update query parameters with the server.

Parameters:
updatea string containing the data to send to the server as an update

Implements Sirikata::PintoServerQuerier.

Implemented in Sirikata::MasterPintoManualServerQuerier, and Sirikata::MasterPintoServerQuerier.

void Sirikata::MasterPintoServerQuerierBase::updateRegion ( const BoundingBox3f &  region) [virtual]

Update this server's parameters.

Parameters:
regionbounding box of the region covered by this server

Implements Sirikata::PintoServerQuerier.

References Sirikata::Logging::debug, mIOStrand, MP_LOG, mRegion, mRegionDirty, Sirikata::Network::IOStrand::post(), and tryServerUpdate().


Member Data Documentation

Referenced by connect(), and handleServerConnection().

Referenced by tryServerUpdate().

Referenced by tryServerUpdate(), and updateRegion().

Referenced by tryServerUpdate(), and updateRegion().


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