Sirikata
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes
Sirikata::CoordinateSegmentationClient Class Reference

Distributed BSP-tree based implementation of CoordinateSegmentation. More...

#include <CoordinateSegmentationClient.hpp>

Inheritance diagram for Sirikata::CoordinateSegmentationClient:
Collaboration diagram for Sirikata::CoordinateSegmentationClient:

List of all members.

Classes

struct  LookupCacheEntry

Public Member Functions

 CoordinateSegmentationClient (SpaceContext *ctx, const BoundingBox3f &region, const Vector3ui32 &perdim, ServerIDMap *sidmap)
virtual ~CoordinateSegmentationClient ()
virtual ServerID lookup (const Vector3f &pos)
virtual BoundingBoxList serverRegion (const ServerID &server)
virtual BoundingBox3f region ()
virtual uint32 numServers ()
virtual std::vector< ServerID > lookupBoundingBox (const BoundingBox3f &bbox)
virtual void receiveMessage (Message *msg)
virtual void reportLoad (ServerID, const BoundingBox3f &bbox, uint32 loadValue)
virtual void migrationHint (std::vector< ServerLoadInfo > &svrLoadInfo)

Private Types

typedef struct
Sirikata::CoordinateSegmentationClient::LookupCacheEntry 
LookupCacheEntry

Private Member Functions

virtual void service ()
void csegChangeMessage (Sirikata::Protocol::CSeg::ChangeMessage *ccMsg)
void downloadUpdatedBSPTree ()
void handleSelfLookup (ServerID my_sid, Address4 my_addr)
void startAccepting ()
void accept_handler ()
void sendSegmentationListenMessage (const Address4 &my_addr)
boost::shared_ptr
< Network::TCPSocket
getLeasedSocket ()
void writeCSEGMessage (boost::shared_ptr< tcp::socket > socket, Sirikata::Protocol::CSeg::CSegMessage &csegMessage)
void readCSEGMessage (boost::shared_ptr< tcp::socket > socket, Sirikata::Protocol::CSeg::CSegMessage &csegMessage)

Private Attributes

bool mBSPTreeValid
Trace::TracemTrace
boost::mutex mCacheMutex
std::vector< LookupCacheEntrymLookupCache
uint16 mAvailableServersCount
std::map< ServerID,
BoundingBoxList > 
mServerRegionCache
SegmentedRegion mTopLevelRegion
Network::IOServicemIOService
boost::shared_ptr
< Network::TCPListener
mAcceptor
boost::shared_ptr
< Network::TCPSocket
mSocket
ServerIDMapmSidMap
boost::mutex mMutex
boost::shared_ptr
< Network::TCPSocket
mLeasedSocket
Time mLeaseExpiryTime
String mCSEGHost
String mCSEGPort

Detailed Description

Distributed BSP-tree based implementation of CoordinateSegmentation.


Member Typedef Documentation


Constructor & Destructor Documentation

Sirikata::CoordinateSegmentationClient::CoordinateSegmentationClient ( SpaceContext ctx,
const BoundingBox3f &  region,
const Vector3ui32 &  perdim,
ServerIDMap sidmap 
)
Sirikata::CoordinateSegmentationClient::~CoordinateSegmentationClient ( ) [virtual]

Member Function Documentation

void Sirikata::CoordinateSegmentationClient::accept_handler ( ) [private]
void Sirikata::CoordinateSegmentationClient::csegChangeMessage ( Sirikata::Protocol::CSeg::ChangeMessage *  ccMsg) [private]
void Sirikata::CoordinateSegmentationClient::downloadUpdatedBSPTree ( ) [private]
boost::shared_ptr< TCPSocket > Sirikata::CoordinateSegmentationClient::getLeasedSocket ( ) [private]
void Sirikata::CoordinateSegmentationClient::handleSelfLookup ( ServerID  my_sid,
Address4  my_addr 
) [private]
ServerID Sirikata::CoordinateSegmentationClient::lookup ( const Vector3f &  pos) [virtual]
std::vector< ServerID > Sirikata::CoordinateSegmentationClient::lookupBoundingBox ( const BoundingBox3f &  bbox) [virtual]
void Sirikata::CoordinateSegmentationClient::migrationHint ( std::vector< ServerLoadInfo > &  svrLoadInfo) [virtual]

Reimplemented from Sirikata::CoordinateSegmentation.

uint32 Sirikata::CoordinateSegmentationClient::numServers ( ) [virtual]
void Sirikata::CoordinateSegmentationClient::readCSEGMessage ( boost::shared_ptr< tcp::socket >  socket,
Sirikata::Protocol::CSeg::CSegMessage &  csegMessage 
) [private]
void Sirikata::CoordinateSegmentationClient::receiveMessage ( Message msg) [virtual]
BoundingBox3f Sirikata::CoordinateSegmentationClient::region ( ) [virtual]
void Sirikata::CoordinateSegmentationClient::reportLoad ( ServerID  sid,
const BoundingBox3f &  bbox,
uint32  loadValue 
) [virtual]
void Sirikata::CoordinateSegmentationClient::sendSegmentationListenMessage ( const Address4 my_addr) [private]
BoundingBoxList Sirikata::CoordinateSegmentationClient::serverRegion ( const ServerID &  server) [virtual]
void Sirikata::CoordinateSegmentationClient::service ( ) [private, virtual]
void Sirikata::CoordinateSegmentationClient::startAccepting ( ) [private]
void Sirikata::CoordinateSegmentationClient::writeCSEGMessage ( boost::shared_ptr< tcp::socket >  socket,
Sirikata::Protocol::CSeg::CSegMessage &  csegMessage 
) [private]

Member Data Documentation

Referenced by handleSelfLookup(), and startAccepting().

Referenced by numServers().

Referenced by getLeasedSocket(), and service().

Referenced by getLeasedSocket(), and service().

Referenced by accept_handler(), and lookup().

std::map<ServerID, BoundingBoxList> Sirikata::CoordinateSegmentationClient::mServerRegionCache [private]

Referenced by accept_handler(), and serverRegion().

Referenced by accept_handler(), and startAccepting().


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