utils/print-introspected-doxygen.cc
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Thu, 13 Mar 2008 11:10:38 -0700
changeset 2600 6c389d0c717d
parent 2592 3ebf97150166
child 2602 d9262bff6df2
permissions -rw-r--r--
add Application::SetNode and NetDevice::SetNode, use them from Node::AddApplication and Node::AddDevice. kill useless "Node" attributes.
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@2600
    20
  Ptr<PointToPointNetDevice> p2p = CreateObject<PointToPointNetDevice> ("Address", Mac48Address::Allocate ());
mathieu@2470
    21
  node->AddDevice (p2p);
mathieu@2533
    22
  p2p->AddQueue (CreateObject<DropTailQueue> ());
mathieu@2600
    23
  Ptr<CsmaNetDevice> csma = CreateObject<CsmaNetDevice> ("Address", Mac48Address::Allocate (),
mathieu@2600
    24
							 "EncapsulationMode", String ("Llc"));
mathieu@2470
    25
  node->AddDevice (csma);
mathieu@2533
    26
  csma->AddQueue (CreateObject<DropTailQueue> ());
mathieu@1368
    27
mathieu@1853
    28
mathieu@1368
    29
  return 0;
mathieu@1368
    30
}