utils/print-introspected-doxygen.cc
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Mon, 03 Mar 2008 01:58:57 +0100
changeset 2542 a9b88fdc09d6
parent 2540 4e9ba43f7b9e
child 2577 5b41cb5c3fcf
permissions -rw-r--r--
kill TraceResolver et al.
mathieu@1368
     1
#include "ns3/internet-node.h"
mathieu@1368
     2
#include "ns3/ptr.h"
mathieu@1368
     3
#include "ns3/node-list.h"
mathieu@1368
     4
#include "ns3/point-to-point-net-device.h"
mathieu@1376
     5
#include "ns3/csma-net-device.h"
mathieu@1368
     6
#include "ns3/queue.h"
mathieu@2533
     7
#include "ns3/drop-tail-queue.h"
mathieu@1375
     8
#include "ns3/mobility-model-notifier.h"
mathieu@1853
     9
#include "ns3/default-value.h"
mathieu@2502
    10
#include "ns3/string.h"
mathieu@1368
    11
mathieu@1368
    12
using namespace ns3;
mathieu@1368
    13
mathieu@1399
    14
mathieu@1853
    15
static void
mathieu@1853
    16
PrintOneDefaultValue (DefaultValueBase *value, std::ostream &os)
mathieu@1853
    17
{
mathieu@1853
    18
  os << "///  <li> \\anchor DefaultValue" << value->GetName ()
mathieu@1853
    19
     << " " << value->GetName () << std::endl;
mathieu@1853
    20
  os << "///    <ul>" << std::endl;
mathieu@1853
    21
  os << "///         <li>Type: " << value->GetType () << "</td></tr>" << std::endl;
mathieu@1853
    22
  os << "///         <li>Default value: " << value->GetDefaultValue () << "</td></tr>" << std::endl;
mathieu@1853
    23
  os << "///         <li>Description: " << value->GetHelp () << "</td></tr>" << std::endl;
mathieu@1853
    24
  os << "///    </ul>" << std::endl;
mathieu@1853
    25
  os << "///  </li>" << std::endl;
mathieu@1853
    26
}
mathieu@1853
    27
mathieu@1853
    28
static void
mathieu@1853
    29
PrintDefaultValuesDoxygen (std::ostream &os)
mathieu@1853
    30
{
mathieu@1853
    31
  os << "/// \\page ListOfDefaultValues The list of default values" << std::endl;
mathieu@1853
    32
  os << "/// \\defgroup ListOfDefaultValuesGroup The list of default values" << std::endl;
mathieu@1853
    33
  os << "/// <ul>" << std::endl;
mathieu@1853
    34
  for (DefaultValueList::Iterator i = DefaultValueList::Begin ();
mathieu@1853
    35
       i != DefaultValueList::End (); i++)
mathieu@1853
    36
    {
mathieu@1853
    37
      if ((*i)->GetName () == "help")
mathieu@1853
    38
	{
mathieu@1853
    39
	  continue;
mathieu@1853
    40
	}
mathieu@1853
    41
      PrintOneDefaultValue (*i, os);
mathieu@1853
    42
    }
mathieu@1853
    43
  os << "/// </ul>" << std::endl;
mathieu@1853
    44
}
mathieu@1853
    45
mathieu@1399
    46
mathieu@1368
    47
int main (int argc, char *argv[])
mathieu@1368
    48
{
mathieu@2230
    49
  Ptr<Node> node = CreateObject<InternetNode> ();
mathieu@2258
    50
  node->AggregateObject (CreateObject<MobilityModelNotifier> ());
mathieu@1368
    51
mathieu@2502
    52
  Ptr<PointToPointNetDevice> p2p = CreateObjectWith<PointToPointNetDevice> ("Node", node, 
mathieu@2502
    53
									    "Address", Mac48Address::Allocate ());
mathieu@2470
    54
  node->AddDevice (p2p);
mathieu@2533
    55
  p2p->AddQueue (CreateObject<DropTailQueue> ());
mathieu@2500
    56
  Ptr<CsmaNetDevice> csma = CreateObjectWith<CsmaNetDevice> ("Node", node, 
mathieu@2500
    57
							     "Address", Mac48Address::Allocate (),
mathieu@2502
    58
							     "EncapsulationMode", String ("Llc"));
mathieu@2470
    59
  node->AddDevice (csma);
mathieu@2533
    60
  csma->AddQueue (CreateObject<DropTailQueue> ());
mathieu@1368
    61
mathieu@1853
    62
mathieu@1853
    63
  PrintDefaultValuesDoxygen (std::cout);
mathieu@1853
    64
mathieu@1368
    65
  return 0;
mathieu@1368
    66
}