![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
This is the actual Time Server object. It provides a time object to all registered clients at intervals determined by the user.
By default, the Time Server uses its own default timer. If they wish, users can supply their own timers. In this case, the server ignores its default timer and uses the timer supplied by the user.
Public Member Functions | |
TSLTimeServer () | |
~TSLTimeServer () | |
bool | attach (TSLTimeClient *client) |
TSLTimer const & | defaultTimer () const |
bool | detach (TSLTimeClient *client) |
TSLTimer * | setUserTimer (TSLTimer *userTimer) |
bool | tick (TSLTimeInstant const &time) |
TSLTimer & | timer () |
TSLTimer const & | timer () const |
Static Public Member Functions | |
static TSLTime64 | calibrate (TSLTimeInterval const &duration, TSLTimerCalibrationProgress *callback=0) |
static TSLTimeHelper const & | defaultTimeHelper () |
Protected Member Functions | |
TSLTimeServer (TSLTimeServer const &) | |
TSLTimeServer & | operator= (TSLTimeServer const &) |
TSLTimeServer::TSLTimeServer | ( | ) |
Default constructor.
Creates the default timer.
TSLTimeServer::~TSLTimeServer | ( | ) |
Destructor.
Destroys the default timer.
|
protected |
Protected copy constructor and assignment operator to prevent copying of time server objects.
bool TSLTimeServer::attach | ( | TSLTimeClient * | client | ) |
Register a Time Client with the Time Server.
client | A pointer to the time client. |
|
static |
Calibrates the time server and its default timer. This call only needs to be made once before the server is ever used.
The time server does not rely on calibration having been performed. However, by calibrating the timer, users are guaranteed the best accuracy of time events.
duration | The length of time that the calibration should last for. |
callback | A callback function that is called by the calibration method to indicate progress. |
|
static |
Static query method for the server's default time helper.
Returns a (const) reference to the default time helper.
TSLTimer const & TSLTimeServer::defaultTimer | ( | ) | const |
(Const) Query method for the server's default timer.
Returns a (const) reference to the default timer.
bool TSLTimeServer::detach | ( | TSLTimeClient * | client | ) |
Register a Time Client with the Time Server.
client | A pointer to the time client. |
|
protected |
Sets the user-defined timer.
userTimer | A pointer to the user-defined timer. This can be NULL. |
bool TSLTimeServer::tick | ( | TSLTimeInstant const & | time | ) |
This method informs all registered clients of a change in time.
time | The new time. |
TSLTimer & TSLTimeServer::timer | ( | ) |
Query method for the server's timer.
Returns a reference to the default timer, if no user-defined timer has been set. Otherwise it returns a reference to the user-defined timer.
TSLTimer const & TSLTimeServer::timer | ( | ) | const |
(Const) Query method for the server's timer.
Returns a (const) reference to the default timer, if no user-defined timer has been set. Otherwise it returns a (const) reference to the user-defined timer.