19 #ifndef REALTIME_SIMULATOR_IMPL_H
20 #define REALTIME_SIMULATOR_IMPL_H
94 virtual void Stop (
void);
95 virtual void Stop (
const Time &delay);
103 virtual void Run (
void);
172 uint64_t
NextTs (
void)
const;
void ProcessOneEvent(void)
Process the next event.
void ScheduleRealtimeNowWithContext(uint32_t context, EventImpl *event)
Schedule an event to run at the current virtual time.
void SetSynchronizationMode(RealtimeSimulatorImpl::SynchronizationMode mode)
Set the SynchronizationMode.
Simulation virtual time values and global simulation resolution.
Ptr< Synchronizer > m_synchronizer
The synchronizer in use to track real time.
Smart pointer class similar to boost::intrusive_ptr.
ns3::EventImpl declarations.
uint64_t NextTs(void) const
Get the timestep of the next event.
virtual EventId ScheduleNow(EventImpl *event)
Schedule an event to run at the current virtual time.
SystemThread::ThreadId m_main
Main SystemThread.
System-independent thread class ns3::SystemThread declaration.
int m_unscheduledEvents
Unique id for the next event to be scheduled.
Smart pointer implementation.
void ScheduleRealtimeWithContext(uint32_t context, const Time &delay, EventImpl *event)
Schedule a future event execution (in a different context).
void ScheduleRealtimeNow(EventImpl *event)
Schedule an event to run at the current virtual time.
RealtimeSimulatorImpl()
Constructor.
Time RealtimeNow(void) const
Get the current real time from the synchronizer.
virtual Time GetMaximumSimulationTime(void) const
Get the maximum representable simulation time.
Time m_hardLimit
The maximum allowable drift from real-time in SYNC_HARD_LIMIT mode.
Time GetHardLimit(void) const
Get the current fatal error threshold for SynchronizationMode SYNC_HARD_LIMIT.
SynchronizationMode m_synchronizationMode
SynchronizationMode policy.
bool m_running
Is the simulator currently running.
DestroyEvents m_destroyEvents
Container for events to be run at destroy time.
virtual EventId Schedule(const Time &delay, EventImpl *event)
Schedule a future event execution (in the same context).
virtual void DoDispose(void)
Destructor implementation.
virtual EventId ScheduleDestroy(EventImpl *event)
Schedule an event to run at the end of the simulation, after the Stop() time or condition has been re...
Ptr< Scheduler > m_events
The event list.
RealtimeSimulatorImpl::SynchronizationMode GetSynchronizationMode(void) const
Get the SynchronizationMode.
Declaration of class ns3::SimulatorImpl.
uint32_t m_currentUid
Timestep of the current event.
System-independent mutex primitive, ns3::SystemMutex, and ns3::CriticalSection.
static TypeId GetTypeId(void)
Get the registered TypeId for this class.
Keep to real time within the hard limit tolerance configured with SetHardLimit, or die trying...
ns3::Scheduler abstract base class, ns3::Scheduler::Event and ns3::Scheduler::EventKey declarations...
SystemMutex m_mutex
Mutex to control access to key state.
virtual Time Now(void) const
Return the current simulation virtual time.
virtual void Run(void)
Run the simulation.
Definition of assertion macros NS_ASSERT() and NS_ASSERT_MSG().
virtual void Destroy()
Execute the events scheduled with ScheduleDestroy().
bool m_stop
Has the stopping condition been reached?
void ScheduleRealtime(const Time &delay, EventImpl *event)
Schedule a future event execution (in the same context).
std::list< EventId > DestroyEvents
Container type for events to be run at destroy time.
virtual void Remove(const EventId &ev)
Remove an event from the event list.
Realtime version of SimulatorImpl.
uint32_t m_uid
Unique id of the current event.
virtual void Cancel(const EventId &ev)
Set the cancel bit on this event: the event's associated function will not be invoked when it expires...
SynchronizationMode
What to do when we can't maintain real time synchrony.
virtual void ScheduleWithContext(uint32_t context, const Time &delay, EventImpl *event)
Schedule a future event execution (in a different context).
virtual Time GetDelayLeft(const EventId &id) const
Get the remaining time until this event will execute.
virtual uint32_t GetSystemId(void) const
Get the system id of this simulator.
void SetHardLimit(Time limit)
Set the fatal error threshold for SynchronizationMode SYNC_HARD_LIMIT.
A class which provides a relatively platform-independent Mutual Exclusion thread synchronization prim...
ns3::Synchronizer declaration.
uint64_t m_currentTs
Execution context.
virtual bool IsExpired(const EventId &ev) const
Check if an event has already run or been cancelled.
virtual void SetScheduler(ObjectFactory schedulerFactory)
Set the Scheduler to be used to manage the event list.
Instantiate subclasses of ns3::Object.
An identifier for simulation events.
Make a best effort to keep synced to real-time.
bool Running(void) const
Is the simulator running?
bool Realtime(void) const
Check that the Synchronizer is locked to the real time clock.
virtual uint32_t GetContext(void) const
Get the current simulation context.
~RealtimeSimulatorImpl()
Destructor.
virtual void Stop(void)
Tell the Simulator the calling event should be the last one executed.
virtual bool IsFinished(void) const
Check if the simulation should finish.
a unique identifier for an interface.
uint32_t m_currentContext
The event list.
The SimulatorImpl base class.