33#include "ns3/core-config.h"
66 "The object class to use as the simulator implementation",
79 "The object class to use as the scheduler implementation",
108 if (*pimpl ==
nullptr)
123 (*pimpl)->SetScheduler(factory);
145 if (*pimpl ==
nullptr)
229#ifdef ENABLE_DES_METRICS
244#ifdef ENABLE_DES_METRICS
253#ifdef ENABLE_DES_METRICS
342 "It is not possible to set the implementation after calling any Simulator:: function. "
343 "Call Simulator::SetImplementation earlier or after Simulator::Destroy.");
351 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()
Register this type.
Instantiate subclasses of ns3::Object.
Ptr< Object > Create() 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 EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static Ptr< SimulatorImpl > GetImplementation()
Get the SimulatorImpl singleton.
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 Destroy()
Execute the events scheduled with ScheduleDestroy().
static void ScheduleWithContext(uint32_t context, const Time &delay, FUNC f, Ts &&... args)
Schedule an event with the given context.
static bool IsFinished()
Check if the simulation should finish.
static uint32_t GetSystemId()
Get the system id of this simulator.
static Time Now()
Return the current simulation virtual time.
static void Run()
Run the simulation.
static bool IsExpired(const EventId &id)
Check if an event has already run or been cancelled.
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 uint64_t GetEventCount()
Get the number of events executed.
static EventId ScheduleNow(FUNC f, Ts &&... args)
Schedule an event to expire Now.
static EventId DoSchedule(const Time &delay, EventImpl *event)
Implementation of the various Schedule methods.
static Time GetMaximumSimulationTime()
Get the maximum representable simulation time.
static void Remove(const EventId &id)
Remove an event from the event list.
static void Stop()
Tell the Simulator the calling event should be the last one executed.
static void SetImplementation(Ptr< SimulatorImpl > impl)
static uint32_t GetContext()
Get the current simulation context.
static Time GetDelayLeft(const EventId &id)
Get the remaining time until this event will execute.
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 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 void Run()=0
Run the simulation.
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 Remove(const EventId &id)=0
Remove an event from the event list.
virtual Time GetMaximumSimulationTime() const =0
Get the maximum representable simulation time.
virtual void ScheduleWithContext(uint32_t context, const Time &delay, EventImpl *event)=0
Schedule a future event execution (in a different context).
virtual EventId ScheduleNow(EventImpl *event)=0
Schedule an event to run at the current virtual time.
virtual Time Now() const =0
Return the current simulation virtual time.
virtual bool IsFinished() const =0
Check if the simulation should finish.
virtual uint64_t GetEventCount() const =0
Get the number of events executed.
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 uint32_t GetContext() const =0
Get the current simulation context.
virtual void Stop()=0
Tell the Simulator the calling event should be the last one executed.
static DesMetrics * Get()
Get a pointer to the singleton instance.
Hold variables of type string.
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()
Ptr< const AttributeChecker > MakeTypeIdChecker()
#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()
Get the static SimulatorImpl instance.
static GlobalValue g_simTypeImpl
The specific simulator implementation to use.
Time Now()
create an ns3::Time instance which contains the current simulation time.
static SimulatorImpl * GetImpl()
Get the SimulatorImpl singleton.
ns3::MapScheduler declaration.
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.