19 #ifndef SYNCHRONIZER_H
20 #define SYNCHRONIZER_H
140 bool Synchronize (uint64_t tsCurrent, uint64_t tsDelay);
265 virtual bool DoSynchronize (uint64_t nsCurrent, uint64_t nsDelay) = 0;
virtual int64_t DoGetDrift(uint64_t ns)=0
Declaration of method used to retrieve drift between the real time clock used to synchronize the simu...
virtual void DoSetCondition(bool)=0
Declaration of the method used to set the condition variable that tells a possible simulator thread w...
uint64_t NanosecondToTimeStep(uint64_t ns)
Convert a normalized nanosecond count into a simulator time step (which can be steps of time in a use...
uint64_t GetCurrentRealtime(void)
Retrieve the value of the origin of the underlying normalized wall clock time in simulator timestep u...
void SetCondition(bool)
Set the condition variable that tells a possible simulator thread waiting in the Synchronize method t...
void EventStart(void)
Ask the synchronizer to remember what time it is.
uint64_t EventEnd(void)
Ask the synchronizer to return the time step between the instant remembered during EventStart and now...
virtual void DoSetOrigin(uint64_t ns)=0
Establish a correspondence between a simulation time and a wall-clock (real) time.
bool Synchronize(uint64_t tsCurrent, uint64_t tsDelay)
Wait until the real time is in sync with the specified simulation time or until the synchronizer is S...
bool Realtime(void)
Return true if this synchronizer is actually synchronizing to a realtime clock.
uint64_t GetOrigin(void)
Retrieve the value of the origin of the simulation time in simulator timestep units.
Base class used for synchronizing the simulation events to some real time "wall clock.".
virtual uint64_t DoGetCurrentRealtime(void)=0
Retrieve the value of the origin of the underlying normalized wall clock time in simulator timestep u...
uint64_t m_realtimeOriginNano
virtual void DoEventStart(void)=0
int64_t GetDrift(uint64_t ts)
Retrieve the difference between the real time clock used to synchronize the simulation and the simula...
virtual void DoSignal(void)=0
Declaration of the method used to tell a possible simulator thread waiting in the DoSynchronize metho...
static TypeId GetTypeId(void)
void SetOrigin(uint64_t ts)
Establish a correspondence between a simulation time and the synchronizer real time.
void Signal(void)
Tell a possible simulator thread waiting in the Synchronize method that an event has happened which d...
uint64_t TimeStepToNanosecond(uint64_t ts)
Convert a simulator time step (which can be steps of time in a user-specified unit) to a normalized t...
a base class which provides memory management and object aggregation
virtual uint64_t DoEventEnd(void)=0
a unique identifier for an interface.
virtual bool DoRealtime(void)=0
Return true if this synchronizer is actually synchronizing to a realtime clock.
virtual bool DoSynchronize(uint64_t nsCurrent, uint64_t nsDelay)=0
Wait until the real time is in sync with the specified simulation time.