Sirikata
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes
Sirikata::TimeSyncClient Class Reference

TimeSyncClient communicates with a server for simple time synchronization. More...

#include <TimeSyncClient.hpp>

Inheritance diagram for Sirikata::TimeSyncClient:
Collaboration diagram for Sirikata::TimeSyncClient:

List of all members.

Public Types

typedef std::tr1::function< void()> UpdatedCallback

Public Member Functions

 TimeSyncClient (Context *ctx, OHDP::Service *ohdp_service, const SpaceID &space, const Duration &polling_interval, UpdatedCallback cb=0)
 ~TimeSyncClient ()
void addNode (const OHDP::NodeID &ss)
void removeNode (const OHDP::NodeID &ss)
bool valid () const
const Durationoffset () const

Private Types

typedef
std::tr1::unordered_set
< OHDP::NodeID,
OHDP::NodeID::Hasher
SyncServerSet

Private Member Functions

virtual void poll ()
 Override this method to specify the work to be done when polling.
void handleSyncMessage (const OHDP::Endpoint &src, const OHDP::Endpoint &dst, MemoryReference payload)

Private Attributes

ContextmContext
OHDP::PortmPort
SyncServerSet mServers
uint8 mSeqno
Time mRequestTimes [256]
bool mHasBeenInitialized
Duration mOffset
UpdatedCallback mCB

Detailed Description

TimeSyncClient communicates with a server for simple time synchronization.

protocol. You give it a Context to get time information from, an ODP::Port to handle messaging, and an ODP::Endpoint for the server to sync with.


Member Typedef Documentation

typedef std::tr1::unordered_set<OHDP::NodeID, OHDP::NodeID::Hasher> Sirikata::TimeSyncClient::SyncServerSet [private]
typedef std::tr1::function<void()> Sirikata::TimeSyncClient::UpdatedCallback

Constructor & Destructor Documentation

Sirikata::TimeSyncClient::TimeSyncClient ( Context ctx,
OHDP::Service ohdp_service,
const SpaceID space,
const Duration polling_interval,
UpdatedCallback  cb = 0 
)
Sirikata::TimeSyncClient::~TimeSyncClient ( )

References mPort.


Member Function Documentation

void Sirikata::TimeSyncClient::addNode ( const OHDP::NodeID ss)
void Sirikata::TimeSyncClient::handleSyncMessage ( const OHDP::Endpoint src,
const OHDP::Endpoint dst,
MemoryReference  payload 
) [private]
const Duration& Sirikata::TimeSyncClient::offset ( ) const [inline]
void Sirikata::TimeSyncClient::poll ( ) [private, virtual]
void Sirikata::TimeSyncClient::removeNode ( const OHDP::NodeID ss)
bool Sirikata::TimeSyncClient::valid ( ) const [inline]

Member Data Documentation

Reimplemented from Sirikata::Poller.

Referenced by handleSyncMessage().

Referenced by handleSyncMessage(), and poll().

Referenced by handleSyncMessage().

Referenced by handleSyncMessage().

Referenced by handleSyncMessage(), and poll().

Referenced by poll().

Referenced by addNode(), poll(), and removeNode().


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