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.
Time GetHardLimit(void) const
Get the current fatal error threshold for SynchronizationMode SYNC_HARD_LIMIT.
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.
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.
ns3::Ptr smart pointer declaration and implementation.
void ScheduleRealtimeWithContext(uint32_t context, const Time &delay, EventImpl *event)
Schedule a future event execution (in a different context).
virtual Time Now(void) const
Return the current simulation virtual time.
void ScheduleRealtimeNow(EventImpl *event)
Schedule an event to run at the current virtual time.
RealtimeSimulatorImpl()
Constructor.
Time m_hardLimit
The maximum allowable drift from real-time in SYNC_HARD_LIMIT mode.
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 uint32_t GetContext(void) const
Get the current simulation 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.
ns3::SimulatorImpl declaration.
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 void Run(void)
Run the simulation.
NS_ASSERT() and NS_ASSERT_MSG() macro definitions.
virtual void Destroy()
Execute the events scheduled with ScheduleDestroy().
bool m_stop
Has the stopping condition been reached?
bool Running(void) const
Is the simulator running?
void ScheduleRealtime(const Time &delay, EventImpl *event)
Schedule a future event execution (in the same context).
pthread_t ThreadId
Type alias for the system-dependent thread object.
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.
virtual uint32_t GetSystemId(void) const
Get the system id of this simulator.
Realtime version of SimulatorImpl.
uint32_t m_uid
Unique id of the current event.
uint64_t NextTs(void) const
Get the timestep of the next 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).
bool Realtime(void) const
Check that the Synchronizer is locked to the real time clock.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Time RealtimeNow(void) const
Get the current real time from the synchronizer.
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.
RealtimeSimulatorImpl::SynchronizationMode GetSynchronizationMode(void) const
Get the SynchronizationMode.
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.
~RealtimeSimulatorImpl()
Destructor.
virtual bool IsFinished(void) const
Check if the simulation should finish.
virtual void Stop(void)
Tell the Simulator the calling event should be the last one executed.
virtual bool IsExpired(const EventId &ev) const
Check if an event has already run or been cancelled.
virtual Time GetMaximumSimulationTime(void) const
Get the maximum representable simulation time.
a unique identifier for an interface.
uint32_t m_currentContext
The event list.
The SimulatorImpl base class.
virtual Time GetDelayLeft(const EventId &id) const
Get the remaining time until this event will execute.