20 #include "ns3/core-config.h"
64 (
"SimulatorImplementationType",
65 "The object class to use as the simulator implementation",
77 "The object class to use as the scheduler implementation",
119 (*pimpl)->SetScheduler (factory);
152 (*pimpl)->Destroy ();
224 #ifdef ENABLE_DES_METRICS
237 #ifdef ENABLE_DES_METRICS
245 #ifdef ENABLE_DES_METRICS
332 NS_FATAL_ERROR (
"It is not possible to set the implementation after calling any Simulator:: function. Call Simulator::SetImplementation earlier or after Simulator::Destroy.");
340 impl->SetScheduler (factory);
NS_ASSERT() and NS_ASSERT_MSG() macro definitions.
void Trace(const Time &now, const Time &delay)
Trace an event to self at the time it is scheduled.
void TraceWithContext(uint32_t context, const Time &now, const Time &delay)
Trace an event (with context) at the time it is scheduled.
An identifier for simulation events.
Hold a so-called 'global value'.
void GetValue(AttributeValue &value) const
Get the value.
static TypeId GetTypeId(void)
Register this type.
Instantiate subclasses of ns3::Object.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Smart pointer class similar to boost::intrusive_ptr.
static EventId DoScheduleDestroy(EventImpl *event)
Implementation of the various ScheduleDestroy methods.
static void Cancel(const EventId &id)
Set the cancel bit on this event: the event's associated function will not be invoked when it expires...
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static EventId DoSchedule(Time const &delay, EventImpl *event)
Implementation of the various Schedule methods.
static void ScheduleWithContext(uint32_t context, Time const &delay, FUNC f, Ts &&... args)
Schedule an event with the given context.
static bool IsExpired(const EventId &id)
Check if an event has already run or been cancelled.
static void Run(void)
Run the simulation.
static uint32_t GetContext(void)
Get the current simulation context.
static EventId ScheduleDestroy(FUNC f, Ts &&... args)
Schedule an event to run at the end of the simulation, when Simulator::Destroy() is called.
static void SetScheduler(ObjectFactory schedulerFactory)
Set the scheduler type with an ObjectFactory.
static EventId DoScheduleNow(EventImpl *event)
Implementation of the various ScheduleNow methods.
static bool IsFinished(void)
Check if the simulation should finish.
static Time GetMaximumSimulationTime(void)
Get the maximum representable simulation time.
static EventId ScheduleNow(FUNC f, Ts &&... args)
Schedule an event to expire Now.
static Time Now(void)
Return the current simulation virtual time.
static uint32_t GetSystemId(void)
Get the system id of this simulator.
static void Remove(const EventId &id)
Remove an event from the event list.
static void SetImplementation(Ptr< SimulatorImpl > impl)
static Time GetDelayLeft(const EventId &id)
Get the remaining time until this event will execute.
static uint64_t GetEventCount(void)
Get the number of events executed.
static Ptr< SimulatorImpl > GetImplementation(void)
Get the SimulatorImpl singleton.
The SimulatorImpl base class.
virtual EventId ScheduleDestroy(EventImpl *event)=0
Schedule an event to run at the end of the simulation, after the Stop() time or condition has been re...
virtual Time GetMaximumSimulationTime(void) const =0
Get the maximum representable simulation time.
virtual Time GetDelayLeft(const EventId &id) const =0
Get the remaining time until this event will execute.
virtual void SetScheduler(ObjectFactory schedulerFactory)=0
Set the Scheduler to be used to manage the event list.
virtual uint32_t GetSystemId() const =0
Get the system id of this simulator.
virtual EventId Schedule(const Time &delay, EventImpl *event)=0
Schedule a future event execution (in the same context).
virtual bool IsExpired(const EventId &id) const =0
Check if an event has already run or been cancelled.
virtual void Run(void)=0
Run the simulation.
virtual void Remove(const EventId &id)=0
Remove an event from the event list.
virtual void ScheduleWithContext(uint32_t context, const Time &delay, EventImpl *event)=0
Schedule a future event execution (in a different context).
virtual uint32_t GetContext(void) const =0
Get the current simulation context.
virtual EventId ScheduleNow(EventImpl *event)=0
Schedule an event to run at the current virtual time.
virtual Time Now(void) const =0
Return the current simulation virtual time.
virtual void Cancel(const EventId &id)=0
Set the cancel bit on this event: the event's associated function will not be invoked when it expires...
virtual void Stop(void)=0
Tell the Simulator the calling event should be the last one executed.
virtual bool IsFinished(void) const =0
Check if the simulation should finish.
virtual uint64_t GetEventCount(void) const =0
Get the number of events executed.
static DesMetrics * Get(void)
Get a pointer to the singleton instance.
Hold variables of type string.
std::string Get(void) const
Simulation virtual time values and global simulation resolution.
static void ClearMarkedTimes()
Remove all MarkedTimes.
AttributeValue implementation for TypeId.
ns3::DesMetrics declaration.
ns3::EventImpl declarations.
ns3::GlobalValue declaration.
Ptr< const AttributeChecker > MakeStringChecker(void)
Ptr< const AttributeChecker > MakeTypeIdChecker(void)
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
void DefaultNodePrinter(std::ostream &os)
Default node id printer implementation.
static GlobalValue g_schedTypeImpl
The specific event scheduler implementation to use.
static SimulatorImpl ** PeekImpl(void)
Get the static SimulatorImpl instance.
static SimulatorImpl * GetImpl(void)
Get the SimulatorImpl singleton.
static GlobalValue g_simTypeImpl
The specific simulator implementation to use.
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
ns3::MapScheduler declaration.
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void LogSetTimePrinter(TimePrinter printer)
Set the TimePrinter function to be used to prepend log messages with the simulation time.
U * GetPointer(const Ptr< U > &p)
void DefaultTimePrinter(std::ostream &os)
Default Time printer.
void LogSetNodePrinter(NodePrinter printer)
Set the LogNodePrinter function to be used to prepend log messages with the node id.
ns3::ObjectFactory class declaration.
ns3::Ptr smart pointer declaration and implementation.
ns3::Scheduler abstract base class, ns3::Scheduler::Event and ns3::Scheduler::EventKey declarations.
ns3::SimulatorImpl declaration.
ns3::Simulator declaration.
ns3::StringValue attribute value declarations.