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.
     1 #include "ns3/internet-node.h"
     2 #include "ns3/ptr.h"
     3 #include "ns3/node-list.h"
     4 #include "ns3/point-to-point-net-device.h"
     5 #include "ns3/csma-net-device.h"
     6 #include "ns3/queue.h"
     7 #include "ns3/drop-tail-queue.h"
     8 #include "ns3/mobility-model-notifier.h"
     9 #include "ns3/string.h"
    10 
    11 using namespace ns3;
    12 
    13 
    14 
    15 int main (int argc, char *argv[])
    16 {
    17   Ptr<Node> node = CreateObject<InternetNode> ();
    18   node->AggregateObject (CreateObject<MobilityModelNotifier> ());
    19 
    20   Ptr<PointToPointNetDevice> p2p = CreateObject<PointToPointNetDevice> ("Address", Mac48Address::Allocate ());
    21   node->AddDevice (p2p);
    22   p2p->AddQueue (CreateObject<DropTailQueue> ());
    23   Ptr<CsmaNetDevice> csma = CreateObject<CsmaNetDevice> ("Address", Mac48Address::Allocate (),
    24 							 "EncapsulationMode", String ("Llc"));
    25   node->AddDevice (csma);
    26   csma->AddQueue (CreateObject<DropTailQueue> ());
    27 
    28 
    29   return 0;
    30 }