utils/print-introspected-doxygen.cc
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Tue, 11 Mar 2008 13:30:12 -0700
changeset 2592 3ebf97150166
parent 2577 5b41cb5c3fcf
child 2600 6c389d0c717d
permissions -rw-r--r--
get rid of CreateObjectWith
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@2502
     9
#include "ns3/string.h"
mathieu@1368
    10
mathieu@1368
    11
using namespace ns3;
mathieu@1368
    12
mathieu@1399
    13
mathieu@1399
    14
mathieu@1368
    15
int main (int argc, char *argv[])
mathieu@1368
    16
{
mathieu@2230
    17
  Ptr<Node> node = CreateObject<InternetNode> ();
mathieu@2258
    18
  node->AggregateObject (CreateObject<MobilityModelNotifier> ());
mathieu@1368
    19
mathieu@2592
    20
  Ptr<PointToPointNetDevice> p2p = CreateObject<PointToPointNetDevice> ("Node", node, 
mathieu@2502
    21
									    "Address", Mac48Address::Allocate ());
mathieu@2470
    22
  node->AddDevice (p2p);
mathieu@2533
    23
  p2p->AddQueue (CreateObject<DropTailQueue> ());
mathieu@2592
    24
  Ptr<CsmaNetDevice> csma = CreateObject<CsmaNetDevice> ("Node", node, 
mathieu@2500
    25
							     "Address", Mac48Address::Allocate (),
mathieu@2502
    26
							     "EncapsulationMode", String ("Llc"));
mathieu@2470
    27
  node->AddDevice (csma);
mathieu@2533
    28
  csma->AddQueue (CreateObject<DropTailQueue> ());
mathieu@1368
    29
mathieu@1853
    30
mathieu@1368
    31
  return 0;
mathieu@1368
    32
}