ns3::RealtimeSimulatorImpl Class Reference

#include <realtime-simulator-impl.h>

Inheritance diagram for ns3::RealtimeSimulatorImpl:
Inheritance graph
[legend]
Collaboration diagram for ns3::RealtimeSimulatorImpl:
Collaboration graph
[legend]

List of all members.

Public Types

enum  SynchronizationMode { SYNC_BEST_EFFORT, SYNC_HARD_LIMIT }

Public Member Functions

 RealtimeSimulatorImpl ()
 ~RealtimeSimulatorImpl ()
virtual void Destroy ()
virtual bool IsFinished (void) const
virtual Time Next (void) const
virtual void Stop (void)
virtual EventId Schedule (Time const &time, EventImpl *event)
virtual EventId ScheduleNow (EventImpl *event)
virtual EventId ScheduleDestroy (EventImpl *event)
virtual void Remove (const EventId &ev)
virtual void Cancel (const EventId &ev)
virtual bool IsExpired (const EventId &ev) const
virtual void Run (void)
virtual void RunOneEvent (void)
virtual Time Now (void) const
virtual Time GetDelayLeft (const EventId &id) const
virtual Time GetMaximumSimulationTime (void) const
virtual void SetScheduler (Ptr< Scheduler > scheduler)
virtual Ptr< SchedulerGetScheduler (void) const
void ScheduleRealtime (Time const &time, EventImpl *event)
void ScheduleRealtimeNow (EventImpl *event)
Time RealtimeNow (void) const
void SetSynchronizationMode (RealtimeSimulatorImpl::SynchronizationMode mode)
RealtimeSimulatorImpl::SynchronizationMode GetSynchronizationMode (void) const
void SetHardLimit (Time limit)
Time GetHardLimit (void) const

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::RealtimeSimulatorImpl.

Private Types

typedef std::list< EventIdDestroyEvents

Private Member Functions

bool Running (void) const
bool Realtime (void) const
void ProcessOneEvent (void)
uint64_t NextTs (void) const

Private Attributes

DestroyEvents m_destroyEvents
bool m_stop
bool m_running
Ptr< Schedulerm_events
int m_unscheduledEvents
uint32_t m_uid
uint32_t m_currentUid
uint64_t m_currentTs
SystemMutex m_mutex
Ptr< Synchronizerm_synchronizer
SynchronizationMode m_synchronizationMode
Time m_hardLimit

Detailed Description

Definition at line 37 of file realtime-simulator-impl.h.


Member Typedef Documentation

typedef std::list<EventId> ns3::RealtimeSimulatorImpl::DestroyEvents [private]

Definition at line 89 of file realtime-simulator-impl.h.


Member Enumeration Documentation

Enumeration of the types of packets supported in the class.

Enumerator:
SYNC_BEST_EFFORT 
SYNC_HARD_LIMIT 

Make a best effort to keep synced to real-time

Definition at line 46 of file realtime-simulator-impl.h.


Constructor & Destructor Documentation

ns3::RealtimeSimulatorImpl::RealtimeSimulatorImpl (  ) 
ns3::RealtimeSimulatorImpl::~RealtimeSimulatorImpl (  ) 

Member Function Documentation

void ns3::RealtimeSimulatorImpl::Cancel ( const EventId ev  )  [virtual]

Implements ns3::SimulatorImpl.

Definition at line 722 of file realtime-simulator-impl.cc.

References IsExpired().

void ns3::RealtimeSimulatorImpl::Destroy ( void   )  [virtual]

Implements ns3::SimulatorImpl.

Definition at line 100 of file realtime-simulator-impl.cc.

References m_destroyEvents, NS_LOG_FUNCTION_NOARGS, and NS_LOG_LOGIC.

Time ns3::RealtimeSimulatorImpl::GetDelayLeft ( const EventId id  )  const [virtual]

Implements ns3::SimulatorImpl.

Definition at line 669 of file realtime-simulator-impl.cc.

References IsExpired(), m_currentTs, and ns3::TimeStep().

Time ns3::RealtimeSimulatorImpl::GetHardLimit ( void   )  const

Definition at line 798 of file realtime-simulator-impl.cc.

References m_hardLimit, and NS_LOG_FUNCTION_NOARGS.

Time ns3::RealtimeSimulatorImpl::GetMaximumSimulationTime ( void   )  const [virtual]

Implements ns3::SimulatorImpl.

Definition at line 769 of file realtime-simulator-impl.cc.

References ns3::TimeStep().

Ptr< Scheduler > ns3::RealtimeSimulatorImpl::GetScheduler ( void   )  const [virtual]

Implements ns3::SimulatorImpl.

Definition at line 145 of file realtime-simulator-impl.cc.

References m_events, and NS_LOG_FUNCTION_NOARGS.

RealtimeSimulatorImpl::SynchronizationMode ns3::RealtimeSimulatorImpl::GetSynchronizationMode ( void   )  const

Definition at line 784 of file realtime-simulator-impl.cc.

References m_synchronizationMode, and NS_LOG_FUNCTION_NOARGS.

TypeId ns3::RealtimeSimulatorImpl::GetTypeId ( void   )  [static]

This method returns the TypeId associated to ns3::RealtimeSimulatorImpl.

Attributes defined for this type:

  • SynchronizationMode: What to do if the simulation cannot keep up with real time.
    • Set with class: ns3::EnumValue
    • Underlying type: BestEffort|HardLimit
    • Initial value: BestEffort
    • Flags: construct write
  • HardLimit: Maximum acceptable real-time jitter (used in conjunction with SynchronizationMode=HardLimit)
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: 100000000ns
    • Flags: construct write read

No TraceSources defined for this type.

Reimplemented from ns3::Object.

Definition at line 45 of file realtime-simulator-impl.cc.

References ns3::TypeId::AddAttribute(), m_hardLimit, ns3::MakeEnumAccessor(), ns3::MakeEnumChecker(), ns3::Seconds(), ns3::TypeId::SetParent(), SetSynchronizationMode(), SYNC_BEST_EFFORT, and SYNC_HARD_LIMIT.

bool ns3::RealtimeSimulatorImpl::IsExpired ( const EventId ev  )  const [virtual]
bool ns3::RealtimeSimulatorImpl::IsFinished ( void   )  const [virtual]

Implements ns3::SimulatorImpl.

Definition at line 381 of file realtime-simulator-impl.cc.

References m_events, m_mutex, and NS_LOG_FUNCTION_NOARGS.

Time ns3::RealtimeSimulatorImpl::Next ( void   )  const [virtual]

Implements ns3::SimulatorImpl.

Definition at line 410 of file realtime-simulator-impl.cc.

References NextTs(), NS_LOG_FUNCTION_NOARGS, and ns3::TimeStep().

uint64_t ns3::RealtimeSimulatorImpl::NextTs ( void   )  const [private]

Definition at line 397 of file realtime-simulator-impl.cc.

References m_events, NS_ASSERT_MSG, and NS_LOG_FUNCTION_NOARGS.

Referenced by Next(), and ProcessOneEvent().

Time ns3::RealtimeSimulatorImpl::Now ( void   )  const [virtual]

Implements ns3::SimulatorImpl.

Definition at line 585 of file realtime-simulator-impl.cc.

References m_currentTs, and ns3::TimeStep().

Referenced by Schedule().

void ns3::RealtimeSimulatorImpl::ProcessOneEvent ( void   )  [private]
bool ns3::RealtimeSimulatorImpl::Realtime ( void   )  const [private]

Definition at line 476 of file realtime-simulator-impl.cc.

References m_synchronizer, and NS_LOG_FUNCTION_NOARGS.

Time ns3::RealtimeSimulatorImpl::RealtimeNow ( void   )  const

Definition at line 641 of file realtime-simulator-impl.cc.

References m_synchronizer, and ns3::TimeStep().

void ns3::RealtimeSimulatorImpl::Remove ( const EventId ev  )  [virtual]
void ns3::RealtimeSimulatorImpl::Run ( void   )  [virtual]
bool ns3::RealtimeSimulatorImpl::Running ( void   )  const [private]

Definition at line 469 of file realtime-simulator-impl.cc.

References m_running, and NS_LOG_FUNCTION_NOARGS.

void ns3::RealtimeSimulatorImpl::RunOneEvent ( void   )  [virtual]
EventId ns3::RealtimeSimulatorImpl::Schedule ( Time const &  time,
EventImpl event 
) [virtual]
EventId ns3::RealtimeSimulatorImpl::ScheduleDestroy ( EventImpl event  )  [virtual]
EventId ns3::RealtimeSimulatorImpl::ScheduleNow ( EventImpl event  )  [virtual]
void ns3::RealtimeSimulatorImpl::ScheduleRealtime ( Time const &  time,
EventImpl event 
)
void ns3::RealtimeSimulatorImpl::ScheduleRealtimeNow ( EventImpl event  ) 
void ns3::RealtimeSimulatorImpl::SetHardLimit ( Time  limit  ) 

Definition at line 791 of file realtime-simulator-impl.cc.

References m_hardLimit, and NS_LOG_FUNCTION.

void ns3::RealtimeSimulatorImpl::SetScheduler ( Ptr< Scheduler scheduler  )  [virtual]

Implements ns3::SimulatorImpl.

Definition at line 125 of file realtime-simulator-impl.cc.

References m_events, m_mutex, and NS_LOG_FUNCTION_NOARGS.

void ns3::RealtimeSimulatorImpl::SetSynchronizationMode ( RealtimeSimulatorImpl::SynchronizationMode  mode  ) 

Definition at line 777 of file realtime-simulator-impl.cc.

References m_synchronizationMode, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

void ns3::RealtimeSimulatorImpl::Stop ( void   )  [virtual]

Implements ns3::SimulatorImpl.

Definition at line 526 of file realtime-simulator-impl.cc.

References m_stop, and NS_LOG_FUNCTION_NOARGS.


Member Data Documentation

Definition at line 90 of file realtime-simulator-impl.h.

Referenced by Destroy(), IsExpired(), Remove(), and ScheduleDestroy().

The maximum allowable drift from real-time in SYNC_HARD_LIMIT mode.

Definition at line 113 of file realtime-simulator-impl.h.

Referenced by GetHardLimit(), GetTypeId(), ProcessOneEvent(), and SetHardLimit().

Definition at line 91 of file realtime-simulator-impl.h.

Referenced by RealtimeSimulatorImpl(), Run(), and Stop().

The policy to use if the simulation cannot keep synchronized to real-time.

Definition at line 108 of file realtime-simulator-impl.h.

Referenced by GetSynchronizationMode(), ProcessOneEvent(), and SetSynchronizationMode().


The documentation for this class was generated from the following files:
Generated on Thu Dec 3 14:12:15 2009 for NS-3 by  doxygen 1.6.3