19 #include "ns3/command-line.h"
20 #include "ns3/simulator.h"
21 #include "ns3/realtime-simulator-impl.h"
22 #include "ns3/nstime.h"
24 #include "ns3/string.h"
25 #include "ns3/config.h"
26 #include "ns3/global-value.h"
49 bool gFirstRun =
false;
53 inserted_function (
void)
62 background_function (
void)
88 FakeNetDevice::FakeNetDevice ()
94 FakeNetDevice::Doit3 (
void)
97 std::this_thread::sleep_for (std::chrono::seconds (1));
99 for (uint32_t i = 0; i < 10000; ++i)
105 std::this_thread::sleep_for (std::chrono::milliseconds (1));
134 for (
double d = 0.; d < 14.999; d += 0.01)
139 std::thread st3 = std::thread (&FakeNetDevice::Doit3, &fnd);
156 main (
int argc,
char *argv[])
159 cmd.Parse (argc, argv);
Parse command-line arguments.
static void Bind(std::string name, const AttributeValue &value)
Iterate over the set of GlobalValues until a matching name is found and then set its value with Globa...
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void ScheduleWithContext(uint32_t context, Time const &delay, FUNC f, Ts &&... args)
Schedule an event with the given context.
static void Run(void)
Run the simulation.
static Time Now(void)
Return the current simulation virtual time.
@ NO_CONTEXT
Flag for events not associated with any particular context.
Hold variables of type string.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_LOG_UNCOND(msg)
Output the requested message unconditionally.
#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.
EventImpl * MakeEvent(void(*f)(void))
Make an EventImpl from a function pointer taking varying numbers of arguments.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.