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