27 #include "ns3/core-module.h"
28 #include "ns3/double-probe.h"
41 static TypeId GetTypeId (
void);
44 void DoInitialize (
void);
62 .AddTraceSource (
"Counter",
73 m_var = CreateObject<ExponentialRandomVariable> ();
106 NS_LOG_DEBUG (
"context: " << context <<
" old " << oldVal <<
" new " << newVal);
113 NS_LOG_DEBUG (
"context: " << context <<
" old " << oldVal <<
" new " << newVal);
116 int main (
int argc,
char *argv[])
119 cmd.
Parse (argc, argv);
144 probe1->
SetName (
"ObjectProbe");
148 NS_ASSERT_MSG (connected,
"Trace source not connected to probe1");
154 NS_ASSERT_MSG (connected,
"Trace source not connected to probe1 Output");
172 NS_ASSERT_MSG (connected,
"Trace source not connected to probe2 Output");
179 probe3->
SetName (
"StaticallyAccessedProbe");
187 NS_ASSERT_MSG (connected,
"Trace source not connected to probe3 Output");
#define NS_LOG_FUNCTION(parameters)
TypeId AddConstructor(void)
NS_LOG_COMPONENT_DEFINE("GrantedTimeWindowMpiInterface")
std::string GetName(void) const
Get the object's name.
void NotifyViaProbe(std::string context, double oldVal, double newVal)
static void Run(void)
Run the simulation until one of:
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
static TypeId GetTypeId(void)
static void Add(std::string name, Ptr< Object > object)
Add the association between the string "name" and the Ptr
virtual void ConnectByPath(std::string path)
connect to a trace source provided by a config path
Ptr< ExponentialRandomVariable > m_var
static void SetValueByPath(std::string path, double value)
Set a probe value by its name in the Config system.
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
Parse command-line arguments.
static void Destroy(void)
Every event scheduled by the Simulator::insertAtDestroy method is invoked.
void DoInitialize(void)
This method is called only once by Object::Initialize.
TracedValue< double > m_counter
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
int main(int argc, char *argv[])
static Time Now(void)
Return the "current simulation time".
#define NS_ASSERT_MSG(condition, message)
virtual bool ConnectByObject(std::string traceSource, Ptr< Object > obj)
connect to a trace source attribute provided by a given object
static void Stop(void)
If an event invokes this method, it will be the last event scheduled by the Simulator::run method bef...
void SetName(std::string name)
Set the object's name. All spaces are replaced by underscores.
#define NS_LOG_DEBUG(msg)
void Initialize(void)
This method calls the virtual DoInitialize method on all the objects aggregated to this object...
bool TraceConnect(std::string name, std::string context, const CallbackBase &cb)
void NotifyViaTraceSource(std::string context, double oldVal, double newVal)
void Parse(int argc, char *argv[])
Parse the program arguments.
a base class which provides memory management and object aggregation
a unique identifier for an interface.