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/system-thread.h"
25#include "ns3/string.h"
26#include "ns3/config.h"
27#include "ns3/global-value.h"
51bool gFirstRun =
false;
55inserted_function (
void)
64background_function (
void)
90FakeNetDevice::FakeNetDevice ()
96FakeNetDevice::Doit3 (
void)
99 std::this_thread::sleep_for (std::chrono::seconds (1));
101 for (
uint32_t i = 0; i < 10000; ++i)
106 Simulator::ScheduleWithContext (Simulator::NO_CONTEXT,
Seconds (0.0),
MakeEvent (&inserted_function));
107 std::this_thread::sleep_for (std::chrono::milliseconds (1));
123 GlobalValue::Bind (
"SimulatorImplementationType",
131 Simulator::ScheduleWithContext (0xffffffff,
Seconds (0.0),
MakeEvent (&first_function));
136 for (
double d = 0.; d < 14.999; d += 0.01)
138 Simulator::Schedule (
Seconds (d), &background_function);
145 Simulator::Stop (
Seconds (15.0));
148 Simulator::Destroy ();
155main (
int argc,
char *argv[])
158 cmd.Parse (argc, argv);
Parse command-line arguments.
Smart pointer class similar to boost::intrusive_ptr.
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 Now(void)
create an ns3::Time instance which contains the current simulation time.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...