20 #include "ns3/core-config.h"
62 (
"SimulatorImplementationType",
63 "The object class to use as the simulator implementation",
74 "The object class to use as the scheduler implementation",
147 (*pimpl)->SetScheduler (factory);
180 (*pimpl)->Destroy ();
369 NS_FATAL_ERROR (
"It is not possible to set the implementation after calling any Simulator:: function. Call Simulator::SetImplementation earlier or after Simulator::Destroy.");
377 impl->SetScheduler (factory);
static Time GetDelayLeft(const EventId &id)
Get the remaining time until this event will execute.
Ptr< const AttributeChecker > MakeStringChecker(void)
Simulation virtual time values and global simulation resolution.
virtual void ScheduleWithContext(uint32_t context, Time const &time, EventImpl *event)=0
Schedule a future event execution (in a different context).
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 "...
std::string Get(void) const
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.
String attribute value declarations.
Smart pointer 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.
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.
static EventId DoSchedule(Time const &time, EventImpl *event)
Implementation of the various Schedule methods.
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)
Fatal error handling.
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...
ns3::Simulator declaration.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
virtual void SetScheduler(ObjectFactory schedulerFactory)=0
Set the Scheduler to be used to manage the event list.
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
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 SimulatorImpl * GetImpl(void)
Get the SimulatorImpl singleton.
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.
Declaration of class ns3::SimulatorImpl.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
ns3::Scheduler abstract base class, ns3::Scheduler::Event and ns3::Scheduler::EventKey declarations...
U * GetPointer(const Ptr< U > &p)
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
void LogSetNodePrinter(LogNodePrinter printer)
Set the LogNodePrinter function to be used to prepend log messages with the node id.
Definition of assertion macros NS_ASSERT() and NS_ASSERT_MSG().
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.
static void ScheduleWithContext(uint32_t context, Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event with the given context.
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 void NodePrinter(std::ostream &os)
Default node id printer implementation.
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
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.
ns3::GlobalValue declaration.
static void TimePrinter(std::ostream &os)
Default TimePrinter implementation.
static EventId ScheduleNow(MEM mem_ptr, OBJ obj)
Schedule an event to expire Now.
static void SetScheduler(ObjectFactory schedulerFactory)
static Time Now(void)
Return the current simulation virtual time.
virtual EventId Schedule(Time const &time, EventImpl *event)=0
Schedule a future event execution (in the same context).
void LogSetTimePrinter(LogTimePrinter printer)
Set the LogTimePrinter function to be used to prepend log messages with the simulation time...
static GlobalValue g_schedTypeImpl
The specific event scheduler implementation to use.
Instantiate subclasses of ns3::Object.
static EventId DoScheduleNow(EventImpl *event)
Implementation of the various ScheduleNow methods.
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.
static bool IsFinished(void)
Check if the simulation should finish.
static EventId ScheduleDestroy(MEM mem_ptr, OBJ obj)
Schedule an event to expire at Destroy time.
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
virtual uint32_t GetSystemId() const =0
Get the system id of this simulator.
Declaration of ns3::MapScheduler class.
static void ClearMarkedTimes()
Remove all MarkedTimes.
static GlobalValue g_simTypeImpl
The specific simulator implementation to use.
Ptr< const AttributeChecker > MakeTypeIdChecker(void)
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.
void GetValue(AttributeValue &value) const
EventImpl * MakeEvent(void(*f)(void))
Make an EventImpl from a function pointer taking varying numbers of arguments.
static TypeId GetTypeId(void)