utils/print-trace-sources.cc
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Tue, 28 Aug 2007 09:37:10 +0200
changeset 1371 bebf690257c9
parent 1368 e75dc1a2a5fb
child 1375 4f45bec005b8
permissions -rw-r--r--
replace TraceResolver::PrintAvailable with TraceResolver::CollectSources
mathieu@1368
     1
#include "ns3/internet-node.h"
mathieu@1368
     2
#include "ns3/ptr.h"
mathieu@1368
     3
#include "ns3/trace-resolver.h"
mathieu@1368
     4
#include "ns3/node-list.h"
mathieu@1368
     5
#include "ns3/point-to-point-net-device.h"
mathieu@1368
     6
#include "ns3/csma-cd-net-device.h"
mathieu@1368
     7
#include "ns3/queue.h"
mathieu@1368
     8
mathieu@1368
     9
using namespace ns3;
mathieu@1368
    10
mathieu@1368
    11
int main (int argc, char *argv[])
mathieu@1368
    12
{
mathieu@1368
    13
  Ptr<Node> node = Create<InternetNode> ();
mathieu@1368
    14
mathieu@1368
    15
  Ptr<PointToPointNetDevice> p2p = Create<PointToPointNetDevice> (node);
mathieu@1368
    16
  p2p->AddQueue (Queue::CreateDefault ());
mathieu@1368
    17
  Ptr<CsmaCdNetDevice> csma = Create<CsmaCdNetDevice> (node);
mathieu@1368
    18
  csma->AddQueue (Queue::CreateDefault ());
mathieu@1368
    19
mathieu@1371
    20
  TraceResolver::SourceCollection collection;
mathieu@1371
    21
  NodeList::GetTraceResolver ()->CollectSources ("", TraceContext (), &collection);
mathieu@1371
    22
  collection.Print (std::cout);
mathieu@1368
    23
mathieu@1368
    24
  return 0;
mathieu@1368
    25
}