Sirikata
Public Member Functions | Private Attributes
Sirikata::LocalServerIDMap Class Reference

A LocalServerIDMap implements the ServerIDMap interface for single-server setups: it only provides a single external server (frequently localhost and a port), and no internal addresses since there is no inter-space-server communication. More...

#include <LocalServerIDMap.hpp>

Inheritance diagram for Sirikata::LocalServerIDMap:
Collaboration diagram for Sirikata::LocalServerIDMap:

List of all members.

Public Member Functions

 LocalServerIDMap (Context *ctx, const String &server_host, uint16 server_port)
virtual ~LocalServerIDMap ()
virtual Address4 lookupInternal (const ServerID &obj_id)
virtual void lookupInternal (const ServerID &sid, Address4LookupCallback cb)
 Lookup for internal addresses, i.e.
virtual Address4 lookupExternal (const ServerID &obj_id)
virtual void lookupExternal (const ServerID &sid, Address4LookupCallback cb)
 Lookup for external addresses, i.e.
virtual void lookupRandomExternal (Address4LookupCallback cb)
 Lookup a random external addres, e.g.

Private Attributes

ServerID mID
Address4 mAddress

Detailed Description

A LocalServerIDMap implements the ServerIDMap interface for single-server setups: it only provides a single external server (frequently localhost and a port), and no internal addresses since there is no inter-space-server communication.

Only a single ServerID is provided.


Constructor & Destructor Documentation

Sirikata::LocalServerIDMap::LocalServerIDMap ( Context ctx,
const String &  server_host,
uint16  server_port 
)
virtual Sirikata::LocalServerIDMap::~LocalServerIDMap ( ) [inline, virtual]

Member Function Documentation

Address4 Sirikata::LocalServerIDMap::lookupExternal ( const ServerID &  obj_id) [virtual]
void Sirikata::LocalServerIDMap::lookupExternal ( const ServerID &  sid,
Address4LookupCallback  cb 
) [virtual]

Lookup for external addresses, i.e.

those used for object host to space server communication. Returns NullServerID or Address4::Null if the server can't be found.

Implements Sirikata::ServerIDMap.

References Sirikata::Context::ioService, lookupExternal(), Sirikata::ServerIDMap::mContext, and Sirikata::Network::IOService::post().

void Sirikata::LocalServerIDMap::lookupInternal ( const ServerID &  sid,
Address4LookupCallback  cb 
) [virtual]

Lookup for internal addresses, i.e.

those used for space server to space server communication. Returns NullServerID or Address4::Null if the server can't be found.

Implements Sirikata::ServerIDMap.

References Sirikata::Context::ioService, lookupInternal(), Sirikata::ServerIDMap::mContext, and Sirikata::Network::IOService::post().

Referenced by lookupInternal().

Address4 Sirikata::LocalServerIDMap::lookupInternal ( const ServerID &  obj_id) [virtual]
void Sirikata::LocalServerIDMap::lookupRandomExternal ( Address4LookupCallback  cb) [virtual]

Lookup a random external addres, e.g.

to find any node to bootstrap a connection to the space.

Implements Sirikata::ServerIDMap.

References Sirikata::Context::ioService, mAddress, Sirikata::ServerIDMap::mContext, mID, and Sirikata::Network::IOService::post().


Member Data Documentation

ServerID Sirikata::LocalServerIDMap::mID [private]

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