Sirikata
|
#include <TabularServerIDMap.hpp>
Public Member Functions | |
TabularServerIDMap (Context *ctx, std::istream &filestream) | |
virtual | ~TabularServerIDMap () |
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 Types | |
typedef std::tr1::unordered_map < ServerID, Address4 > | ServerToAddressMap |
Private Attributes | |
ServerToAddressMap | mInternalIDMap |
ServerToAddressMap | mExternalIDMap |
typedef std::tr1::unordered_map<ServerID,Address4> Sirikata::TabularServerIDMap::ServerToAddressMap [private] |
Sirikata::TabularServerIDMap::TabularServerIDMap | ( | Context * | ctx, |
std::istream & | filestream | ||
) |
References mExternalIDMap, and mInternalIDMap.
virtual Sirikata::TabularServerIDMap::~TabularServerIDMap | ( | ) | [inline, virtual] |
Address4 Sirikata::TabularServerIDMap::lookupExternal | ( | const ServerID & | obj_id | ) | [virtual] |
References mExternalIDMap, and Sirikata::Address4::Null.
Referenced by lookupExternal().
void Sirikata::TabularServerIDMap::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::TabularServerIDMap::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().
Address4 Sirikata::TabularServerIDMap::lookupInternal | ( | const ServerID & | obj_id | ) | [virtual] |
References mInternalIDMap, and Sirikata::Address4::Null.
Referenced by lookupInternal().
void Sirikata::TabularServerIDMap::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, Sirikata::ServerIDMap::mContext, mExternalIDMap, and Sirikata::Network::IOService::post().
Referenced by lookupExternal(), lookupRandomExternal(), and TabularServerIDMap().
Referenced by lookupInternal(), and TabularServerIDMap().