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