# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NLNET::_CUniTime Class Reference

This class provide a independant universal time system. More...

#include <unitime.h>

Inheritance diagram for NLNET::_CUniTime:

NLMISC::CTime List of all members.

Static Public Methods

NLMISC::TTime getUniTime ()
 Return the time in millisecond. This time is the same on all computers at the same moment. More...

const char * getStringUniTime ()
 Return the time in a string format to be display. More...

const char * getStringUniTime (NLMISC::TTime ut)
 Return the time in a string format to be display. More...

void syncUniTimeFromService (CCallbackNetBase::TRecordingState rec=CCallbackNetBase::Off, const CInetAddress *addr=NULL)
 You need to call this function before calling getUniTime or an assert will occured. More...

void installServer (CCallbackServer *server)
 Call this function in the init part of the front end service to enable time syncro between shard and clients. More...

void syncUniTimeFromServer (CCallbackClient *client)
 Call this functions in the init part of the client side to synchronize between client and shard. More...

void setUniTime (NLMISC::TTime uTime, NLMISC::TTime lTime)
void setUniTime (NLMISC::TTime uTime)
void simulate ()
 Call this method before to prevent syncUniTimeFromService() from real synchronization: syncUniTimeFromService() will still communicate with the time service, as usual, but the local time will not be synchronized. More...


Static Public Attributes

bool Sync = false

Static Private Attributes

NLMISC::TTime _SyncUniTime = 0
NLMISC::TTime _SyncLocalTime = 0
bool _Simulate = false

Detailed Description

This class provide a independant universal time system.

Author:
Vianney Lecroart , Nevrax France
Date:
2000

Definition at line 47 of file unitime.h.


Member Function Documentation

const char * NLNET::_CUniTime::getStringUniTime NLMISC::TTime    ut [static]
 

Return the time in a string format to be display.

Definition at line 95 of file unitime.cpp.

References nlstop, s, NLMISC::smprintf, and NLMISC::TTime.

const char * NLNET::_CUniTime::getStringUniTime   [static]
 

Return the time in a string format to be display.

Definition at line 88 of file unitime.cpp.

References nlstop.

TTime NLNET::_CUniTime::getUniTime   [static]
 

Return the time in millisecond. This time is the same on all computers at the same moment.

Definition at line 75 of file unitime.cpp.

References nlstop, and NLMISC::TTime.

void NLNET::_CUniTime::installServer CCallbackServer   server [static]
 

Call this function in the init part of the front end service to enable time syncro between shard and clients.

Definition at line 279 of file unitime.cpp.

References nlassert, nlstop, and NLNET::ServerTimeServiceCallbackArray.

void NLNET::_CUniTime::setUniTime NLMISC::TTime    uTime [static]
 

Definition at line 67 of file unitime.cpp.

References nlstop.

void NLNET::_CUniTime::setUniTime NLMISC::TTime    uTime,
NLMISC::TTime    lTime
[static]
 

Definition at line 48 of file unitime.cpp.

References nlstop.

void NLNET::_CUniTime::simulate   [inline, static]
 

Call this method before to prevent syncUniTimeFromService() from real synchronization: syncUniTimeFromService() will still communicate with the time service, as usual, but the local time will not be synchronized.

Definition at line 94 of file unitime.h.

References _Simulate, _SyncLocalTime, _SyncUniTime, and Sync.

void NLNET::_CUniTime::syncUniTimeFromServer CCallbackClient   client [static]
 

Call this functions in the init part of the client side to synchronize between client and shard.

client is the connection between the client and the front end. The connection must be established before calling this function.

Definition at line 313 of file unitime.cpp.

References nlstop.

void NLNET::_CUniTime::syncUniTimeFromService CCallbackNetBase::TRecordingState    rec = CCallbackNetBase::Off,
const CInetAddress   addr = NULL
[static]
 

You need to call this function before calling getUniTime or an assert will occured.

This function will connect to the time service and synchronize your computer. This function assumes that all services run on server that are time synchronized with NTP for example. If addr is NULL, the function will connect to the Time Service via the Naming Service. In this case, the CNamingClient must be connected to a Naming Service. This function can be called *ONLY* by services that are inside of the shard. Don't use it for a client or a service outside of the shard.

Definition at line 156 of file unitime.cpp.

References addr, and nlstop.


Member Data Documentation

bool NLNET::_CUniTime::_Simulate = false [static, private]
 

Definition at line 43 of file unitime.cpp.

Referenced by simulate.

TTime NLNET::_CUniTime::_SyncLocalTime = 0 [static, private]
 

Definition at line 42 of file unitime.cpp.

Referenced by simulate.

TTime NLNET::_CUniTime::_SyncUniTime = 0 [static, private]
 

Definition at line 41 of file unitime.cpp.

Referenced by simulate.

bool NLNET::_CUniTime::Sync = false [static]
 

Definition at line 45 of file unitime.cpp.

Referenced by simulate.


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