utils/print-introspected-doxygen.cc
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Mon, 25 Feb 2008 19:33:46 +0100
changeset 2470 254581fb9e9c
parent 2258 666099a753e0
child 2500 1fb9430f642d
permissions -rw-r--r--
make NetDevice fully virtual.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1368
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     1
#include "ns3/internet-node.h"
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     2
#include "ns3/ptr.h"
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     3
#include "ns3/trace-resolver.h"
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     4
#include "ns3/node-list.h"
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     5
#include "ns3/point-to-point-net-device.h"
1376
ad7e61edfb9d merge with trunk
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1375
diff changeset
     6
#include "ns3/csma-net-device.h"
1368
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     7
#include "ns3/queue.h"
1375
4f45bec005b8 document also mobility model notifier
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1371
diff changeset
     8
#include "ns3/mobility-model-notifier.h"
1853
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
     9
#include "ns3/default-value.h"
1368
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    10
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    11
using namespace ns3;
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    12
1399
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    13
void
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    14
PrintSimpleText (const TraceResolver::SourceCollection *sources, std::ostream &os)
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    15
{
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    16
  for (TraceResolver::SourceCollection::Iterator i = sources->Begin (); i != sources->End (); i++)
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    17
    {
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    18
      os << "source=" << i->path << std::endl;
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    19
      os << "TraceContext=[";
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    20
      i->context.PrintAvailable (os, ",");
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    21
      os << "]" << std::endl;
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    22
      os << "help=\"" << i->doc.GetHelp () << "\"" << std::endl;
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    23
      os << "void TraceSinkCallback (const TraceContext &";
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    24
      for (TraceDoc::Iterator k = i->doc.ArgsBegin (); k != i->doc.ArgsEnd (); k++)
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    25
        {
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    26
          os << ", " << k->first;
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    27
        }
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    28
      os << ")" << std::endl;
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    29
      os << "argument 1  --  the trace context associated to the connected trace source." << std::endl;
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    30
      uint32_t k = 2;
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    31
      for (TraceDoc::Iterator j = i->doc.ArgsBegin (); j != i->doc.ArgsEnd (); j++)
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    32
        {
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    33
          os << "argument " << k << "  --  " << j->second << "." << std::endl;
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    34
          k++;
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    35
        }
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    36
      os << std::endl;
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    37
    }
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    38
}
1853
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
    39
static void
1399
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    40
PrintDoxygenText (const TraceResolver::SourceCollection *sources, std::ostream &os)
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    41
{
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    42
  uint32_t z = 0;
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    43
  for (TraceResolver::SourceCollection::Iterator i = sources->Begin (); i != sources->End (); i++)
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    44
    {
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    45
      os << "///" << std::endl;
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    46
      os << "/// \\ingroup TraceSourceList" << std::endl; 
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    47
      os << "/// \\brief " << i->doc.GetHelp () << std::endl;
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    48
      os << "/// \\param arg1 the trace context associated to the connected trace source." << std::endl;
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    49
      uint32_t j = 2;
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    50
      for (TraceDoc::Iterator l = i->doc.ArgsBegin (); l != i->doc.ArgsEnd (); l++)
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    51
        {
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    52
          os << "/// \\param arg" << j << " " << l->second << "." << std::endl;
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    53
          j++;
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    54
        }
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    55
      os << "///" << std::endl;
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    56
      os << "///" << std::endl;
1538
7f18d8c94d10 In trace sources list documentation, make the trace path stand out better, as it is extremely important but previously easy to miss.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1400
diff changeset
    57
      os << "/// The path to this trace source is: <b><tt>\"" << i->path << "\"</tt></b>." << std::endl;
1399
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    58
      os << "///" << std::endl;
1400
382b2a36384c rewrite the TraceContext::SourceCollection::Iterator class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1399
diff changeset
    59
      if (i->context.Begin ().IsLast ())
1399
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    60
        {
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    61
          os << "/// No data can be extracted from \\p arg1 with ns3::TraceContext::GetElement." << std::endl;
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    62
        }
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    63
      else
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    64
        {
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    65
          os << "/// The following classes can be extracted from \\p arg1 with " << std::endl;
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    66
          os << "/// ns3::TraceContext::GetElement:" << std::endl;
1400
382b2a36384c rewrite the TraceContext::SourceCollection::Iterator class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1399
diff changeset
    67
          for (TraceContext::Iterator m = i->context.Begin (); !m.IsLast (); m.Next ())
1399
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    68
            {
1400
382b2a36384c rewrite the TraceContext::SourceCollection::Iterator class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1399
diff changeset
    69
              os << "///  - " << m.Get () << std::endl;
1399
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    70
            }
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    71
        }
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    72
      os << "void TraceSinkCallback" << z << " (const TraceContext & arg1" ;
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    73
      j = 2;
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    74
      for (TraceDoc::Iterator k = i->doc.ArgsBegin (); k != i->doc.ArgsEnd (); k++)
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    75
        {
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    76
          os << ", " << k->first << " arg" << j;
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    77
          j++;
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    78
        }
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    79
      os << ");" << std::endl;
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    80
      os << std::endl;
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    81
      z++;
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    82
    }
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    83
}
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    84
1853
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
    85
static void
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
    86
PrintOneDefaultValue (DefaultValueBase *value, std::ostream &os)
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
    87
{
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
    88
  os << "///  <li> \\anchor DefaultValue" << value->GetName ()
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
    89
     << " " << value->GetName () << std::endl;
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
    90
  os << "///    <ul>" << std::endl;
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
    91
  os << "///         <li>Type: " << value->GetType () << "</td></tr>" << std::endl;
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
    92
  os << "///         <li>Default value: " << value->GetDefaultValue () << "</td></tr>" << std::endl;
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
    93
  os << "///         <li>Description: " << value->GetHelp () << "</td></tr>" << std::endl;
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
    94
  os << "///    </ul>" << std::endl;
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
    95
  os << "///  </li>" << std::endl;
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
    96
}
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
    97
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
    98
static void
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
    99
PrintDefaultValuesDoxygen (std::ostream &os)
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
   100
{
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
   101
  os << "/// \\page ListOfDefaultValues The list of default values" << std::endl;
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
   102
  os << "/// \\defgroup ListOfDefaultValuesGroup The list of default values" << std::endl;
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
   103
  os << "/// <ul>" << std::endl;
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
   104
  for (DefaultValueList::Iterator i = DefaultValueList::Begin ();
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
   105
       i != DefaultValueList::End (); i++)
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
   106
    {
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
   107
      if ((*i)->GetName () == "help")
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
   108
	{
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
   109
	  continue;
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
   110
	}
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
   111
      PrintOneDefaultValue (*i, os);
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
   112
    }
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
   113
  os << "/// </ul>" << std::endl;
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
   114
}
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
   115
1399
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
   116
1368
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   117
int main (int argc, char *argv[])
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   118
{
2230
9f13ac3291e0 add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1855
diff changeset
   119
  Ptr<Node> node = CreateObject<InternetNode> ();
2258
666099a753e0 AddInterface -> AggregateObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2253
diff changeset
   120
  node->AggregateObject (CreateObject<MobilityModelNotifier> ());
1368
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   121
2470
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2258
diff changeset
   122
  Ptr<PointToPointNetDevice> p2p = CreateObject<PointToPointNetDevice> (node, Mac48Address::Allocate ());
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2258
diff changeset
   123
  node->AddDevice (p2p);
1368
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   124
  p2p->AddQueue (Queue::CreateDefault ());
2470
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2258
diff changeset
   125
  Ptr<CsmaNetDevice> csma = CreateObject<CsmaNetDevice> (node, Mac48Address::Allocate (),
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2258
diff changeset
   126
							 CsmaNetDevice::LLC);
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2258
diff changeset
   127
  node->AddDevice (csma);
1368
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   128
  csma->AddQueue (Queue::CreateDefault ());
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   129
1371
bebf690257c9 replace TraceResolver::PrintAvailable with TraceResolver::CollectSources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1368
diff changeset
   130
  TraceResolver::SourceCollection collection;
bebf690257c9 replace TraceResolver::PrintAvailable with TraceResolver::CollectSources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1368
diff changeset
   131
  NodeList::GetTraceResolver ()->CollectSources ("", TraceContext (), &collection);
1399
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
   132
  PrintDoxygenText (&collection, std::cout);
1368
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   133
1853
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
   134
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
   135
  PrintDefaultValuesDoxygen (std::cout);
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
   136
1368
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   137
  return 0;
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   138
}