utils/print-trace-sources.cc
changeset 1376 ad7e61edfb9d
parent 1375 4f45bec005b8
child 1399 5945e92014e2
equal deleted inserted replaced
1375:4f45bec005b8 1376:ad7e61edfb9d
     1 #include "ns3/internet-node.h"
     1 #include "ns3/internet-node.h"
     2 #include "ns3/ptr.h"
     2 #include "ns3/ptr.h"
     3 #include "ns3/trace-resolver.h"
     3 #include "ns3/trace-resolver.h"
     4 #include "ns3/node-list.h"
     4 #include "ns3/node-list.h"
     5 #include "ns3/point-to-point-net-device.h"
     5 #include "ns3/point-to-point-net-device.h"
     6 #include "ns3/csma-cd-net-device.h"
     6 #include "ns3/csma-net-device.h"
     7 #include "ns3/queue.h"
     7 #include "ns3/queue.h"
     8 #include "ns3/mobility-model-notifier.h"
     8 #include "ns3/mobility-model-notifier.h"
     9 
     9 
    10 using namespace ns3;
    10 using namespace ns3;
    11 
    11 
    14   Ptr<Node> node = Create<InternetNode> ();
    14   Ptr<Node> node = Create<InternetNode> ();
    15   node->AddInterface (Create<MobilityModelNotifier> ());
    15   node->AddInterface (Create<MobilityModelNotifier> ());
    16 
    16 
    17   Ptr<PointToPointNetDevice> p2p = Create<PointToPointNetDevice> (node);
    17   Ptr<PointToPointNetDevice> p2p = Create<PointToPointNetDevice> (node);
    18   p2p->AddQueue (Queue::CreateDefault ());
    18   p2p->AddQueue (Queue::CreateDefault ());
    19   Ptr<CsmaCdNetDevice> csma = Create<CsmaCdNetDevice> (node);
    19   Ptr<CsmaNetDevice> csma = Create<CsmaNetDevice> (node);
    20   csma->AddQueue (Queue::CreateDefault ());
    20   csma->AddQueue (Queue::CreateDefault ());
    21 
    21 
    22   TraceResolver::SourceCollection collection;
    22   TraceResolver::SourceCollection collection;
    23   NodeList::GetTraceResolver ()->CollectSources ("", TraceContext (), &collection);
    23   NodeList::GetTraceResolver ()->CollectSources ("", TraceContext (), &collection);
    24   collection.Print (std::cout);
    24   collection.Print (std::cout);