19 #include "ns3/simulator.h"
20 #include "ns3/realtime-simulator-impl.h"
21 #include "ns3/nstime.h"
23 #include "ns3/system-thread.h"
24 #include "ns3/string.h"
25 #include "ns3/config.h"
26 #include "ns3/global-value.h"
95 for (uint32_t i = 0; i < 10000; ++i)
130 for (
double d = 0.; d < 14.999; d += 0.01)
146 main (
int argc,
char *argv[])
Smart pointer class similar to boost::intrusive_ptr.
Hold variables of type string.
void Start(void)
Start a thread of execution, running the provided callback.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
static void Run(void)
Run the simulation.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
FakeNetDevice()
Constructor.
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
static void Bind(std::string name, const AttributeValue &value)
static void ScheduleWithContext(uint32_t context, Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event with the given context.
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void first_function(void)
An event method called once from the main thread.
#define NS_LOG_UNCOND(msg)
Output the requested message unconditionaly.
static Time Now(void)
Return the current simulation virtual time.
void Doit3(void)
The thread entry point.
void background_function(void)
An event method called many times from the main thread.
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
bool gFirstRun
Check that the event functions run in the intended order.
Time Seconds(double value)
Construct a Time in the indicated unit.
void Join(void)
Suspend the caller until the thread of execution, running the provided callback, finishes.
Example class with a method for the background task.
void inserted_function(void)
An event method called many times from the background thread.
void test(void)
Example use of ns3::SystemThread.
EventImpl * MakeEvent(void(*f)(void))
Make an EventImpl from a function pointer taking varying numbers of arguments.