convert CsmaNetDevice to Attributes.
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Wed, 27 Feb 2008 20:23:57 +0100
changeset 25001fb9430f642d
parent 2499 806f6efe1c33
child 2501 3eaeac1dd5ed
convert CsmaNetDevice to Attributes.
examples/csma-packet-socket.cc
src/devices/csma/csma-ipv4-topology.cc
src/devices/csma/csma-net-device.cc
src/devices/csma/csma-net-device.h
src/devices/csma/csma-topology.cc
src/node/node.cc
src/node/node.h
utils/print-introspected-doxygen.cc
     1.1 --- a/examples/csma-packet-socket.cc	Wed Feb 27 19:51:34 2008 +0100
     1.2 +++ b/examples/csma-packet-socket.cc	Wed Feb 27 20:23:57 2008 +0100
     1.3 @@ -61,8 +61,9 @@
     1.4  static Ptr<CsmaNetDevice>
     1.5  CreateCsmaDevice (Ptr<Node> node, Ptr<CsmaChannel> channel)
     1.6  {
     1.7 -  Ptr<CsmaNetDevice> device = CreateObject<CsmaNetDevice> (node, Mac48Address::Allocate (),
     1.8 -                                                           CsmaNetDevice::LLC);
     1.9 +  Ptr<CsmaNetDevice> device = CreateObjectWith<CsmaNetDevice> ("Node", node, 
    1.10 +                                                               "Address", Mac48Address::Allocate (),
    1.11 +                                                               "EncapsulationMode", "Llc");
    1.12    node->AddDevice (device);
    1.13    device->Attach (channel);
    1.14    Ptr<Queue> queue = Queue::CreateDefault ();
     2.1 --- a/src/devices/csma/csma-ipv4-topology.cc	Wed Feb 27 19:51:34 2008 +0100
     2.2 +++ b/src/devices/csma/csma-ipv4-topology.cc	Wed Feb 27 20:23:57 2008 +0100
     2.3 @@ -42,8 +42,9 @@
     2.4    Ptr<Queue> q = Queue::CreateDefault ();
     2.5  
     2.6    // assume full-duplex
     2.7 -  Ptr<CsmaNetDevice> nd = CreateObject<CsmaNetDevice> (node, addr, 
     2.8 -                                                       ns3::CsmaNetDevice::IP_ARP);
     2.9 +  Ptr<CsmaNetDevice> nd = CreateObjectWith<CsmaNetDevice> ("Node", node, 
    2.10 +                                                           "Address", addr, 
    2.11 +                                                           "EncapsulationMode", "IpArp");
    2.12    node->AddDevice (nd);
    2.13  
    2.14    nd->AddQueue(q);
    2.15 @@ -59,16 +60,18 @@
    2.16  {
    2.17    Ptr<Queue> q = Queue::CreateDefault ();
    2.18  
    2.19 -  Ptr<CsmaNetDevice> nd0 = CreateObject<CsmaNetDevice> (n1, addr,
    2.20 -                                                        ns3::CsmaNetDevice::LLC);
    2.21 +  Ptr<CsmaNetDevice> nd0 = CreateObjectWith<CsmaNetDevice> ("Node", n1, 
    2.22 +                                                            "Address", addr,
    2.23 +                                                            "EncapsulationMode", "Llc");
    2.24    n1->AddDevice (nd0);
    2.25    nd0->SetSendEnable (true);
    2.26    nd0->SetReceiveEnable (false);
    2.27    nd0->AddQueue(q);
    2.28    nd0->Attach (ch);
    2.29  
    2.30 -  Ptr<CsmaNetDevice> nd1 = CreateObject<CsmaNetDevice> (n1, addr,
    2.31 -                                                        ns3::CsmaNetDevice::LLC);
    2.32 +  Ptr<CsmaNetDevice> nd1 = CreateObjectWith<CsmaNetDevice> ("Node", n1, 
    2.33 +                                                            "Address", addr,
    2.34 +                                                            "EncapsulationMode", "Llc");
    2.35    n1->AddDevice (nd1);
    2.36    nd1->SetSendEnable (false);
    2.37    nd1->SetReceiveEnable (true);
    2.38 @@ -83,16 +86,18 @@
    2.39  {
    2.40    Ptr<Queue> q = Queue::CreateDefault ();
    2.41  
    2.42 -  Ptr<CsmaNetDevice> nd0 = CreateObject<CsmaNetDevice> (n1, addr,
    2.43 -                                                        ns3::CsmaNetDevice::RAW);
    2.44 +  Ptr<CsmaNetDevice> nd0 = CreateObjectWith<CsmaNetDevice> ("Node", n1, 
    2.45 +                                                            "Address", addr,
    2.46 +                                                            "EncapsulationMode", "Raw");
    2.47    n1->AddDevice (nd0);
    2.48    nd0->SetSendEnable (true);
    2.49    nd0->SetReceiveEnable (false);
    2.50    nd0->AddQueue(q);
    2.51    nd0->Attach (ch);
    2.52  
    2.53 -  Ptr<CsmaNetDevice> nd1 = CreateObject<CsmaNetDevice> (n1, addr,
    2.54 -                                                        ns3::CsmaNetDevice::RAW);
    2.55 +  Ptr<CsmaNetDevice> nd1 = CreateObjectWith<CsmaNetDevice> ("Node", n1, 
    2.56 +                                                            "Address", addr,
    2.57 +                                                            "EncapsulationMode", "Raw");
    2.58    n1->AddDevice (nd1);
    2.59    nd1->SetSendEnable (false);
    2.60    nd1->SetReceiveEnable (true);
     3.1 --- a/src/devices/csma/csma-net-device.cc	Wed Feb 27 19:51:34 2008 +0100
     3.2 +++ b/src/devices/csma/csma-net-device.cc	Wed Feb 27 20:23:57 2008 +0100
     3.3 @@ -22,80 +22,81 @@
     3.4  #include "ns3/log.h"
     3.5  #include "ns3/queue.h"
     3.6  #include "ns3/simulator.h"
     3.7 -#include "ns3/composite-trace-resolver.h"
     3.8 -#include "csma-net-device.h"
     3.9 -#include "csma-channel.h"
    3.10  #include "ns3/ethernet-header.h"
    3.11  #include "ns3/ethernet-trailer.h"
    3.12  #include "ns3/llc-snap-header.h"
    3.13  #include "ns3/error-model.h"
    3.14 +#include "ns3/enum.h"
    3.15 +#include "ns3/boolean.h"
    3.16 +#include "ns3/trace-source-accessor.h"
    3.17 +#include "csma-net-device.h"
    3.18 +#include "csma-channel.h"
    3.19 +
    3.20  
    3.21  NS_LOG_COMPONENT_DEFINE ("CsmaNetDevice");
    3.22  
    3.23  namespace ns3 {
    3.24  
    3.25 -CsmaTraceType::CsmaTraceType (enum Type type)
    3.26 -  : m_type (type)
    3.27 +TypeId 
    3.28 +CsmaNetDevice::GetTypeId (void)
    3.29  {
    3.30 -  NS_LOG_FUNCTION;
    3.31 +  static TypeId tid = TypeId ("CsmaNetDevice")
    3.32 +    .SetParent<NetDevice> ()
    3.33 +    .AddConstructor<CsmaNetDevice> ()
    3.34 +    .AddAttribute ("Node", "The node with which this device is associated",
    3.35 +                   TypeId::ATTR_GET | TypeId::ATTR_CONSTRUCT,
    3.36 +                   Ptr<Node> (0),
    3.37 +                   MakePtrAccessor (&CsmaNetDevice::m_node),
    3.38 +                   MakePtrChecker<Node> ())
    3.39 +    .AddAttribute ("Address", "The address of this device.",
    3.40 +                   Mac48Address ("ff:ff:ff:ff:ff:ff"),
    3.41 +                   MakeMac48AddressAccessor (&CsmaNetDevice::m_address),
    3.42 +                   MakeMac48AddressChecker ())
    3.43 +    .AddAttribute ("EncapsulationMode", "The mode of link-layer encapsulation to use.",
    3.44 +                   Enum (LLC),
    3.45 +                   MakeEnumAccessor (&CsmaNetDevice::m_encapMode),
    3.46 +                   MakeEnumChecker (ETHERNET_V1, "EthernetV1",
    3.47 +                                    IP_ARP, "IpArp",
    3.48 +                                    RAW, "Raw",
    3.49 +                                    LLC, "Llc"))
    3.50 +    .AddAttribute ("SendEnable", "should tx be enabled ?",
    3.51 +                   Boolean (true),
    3.52 +                   MakeBooleanAccessor (&CsmaNetDevice::m_sendEnable),
    3.53 +                   MakeBooleanChecker ())
    3.54 +    .AddAttribute ("ReceiveEnable", "should rx be enabled ?",
    3.55 +                   Boolean (true),
    3.56 +                   MakeBooleanAccessor (&CsmaNetDevice::m_receiveEnable),
    3.57 +                   MakeBooleanChecker ())
    3.58 +    .AddAttribute ("DataRate", "XXX",
    3.59 +                   DataRate (0xffffffff),
    3.60 +                   MakeDataRateAccessor (&CsmaNetDevice::m_bps),
    3.61 +                   MakeDataRateChecker ())
    3.62 +    .AddAttribute ("RxErrorModel", "XXX",
    3.63 +                   Ptr<ErrorModel> (0),
    3.64 +                   MakePtrAccessor (&CsmaNetDevice::m_receiveErrorModel),
    3.65 +                   MakePtrChecker<ErrorModel> ())
    3.66 +    .AddAttribute ("TxQueue", "XXX",
    3.67 +                   Ptr<Queue> (0),
    3.68 +                   MakePtrAccessor (&CsmaNetDevice::m_queue),
    3.69 +                   MakePtrChecker<Queue> ())
    3.70 +    .AddTraceSource ("Rx", "Receive MAC packet.",
    3.71 +                     MakeTraceSourceAccessor (&CsmaNetDevice::m_rxTrace))
    3.72 +    .AddTraceSource ("Drop", "Drop MAC packet.",
    3.73 +                     MakeTraceSourceAccessor (&CsmaNetDevice::m_dropTrace))
    3.74 +    ;
    3.75 +  return tid;
    3.76  }
    3.77  
    3.78 -CsmaTraceType::CsmaTraceType ()
    3.79 -  : m_type (RX)
    3.80 -{
    3.81 -  NS_LOG_FUNCTION;
    3.82 -}
    3.83 -
    3.84 -void 
    3.85 -CsmaTraceType::Print (std::ostream &os) const
    3.86 -{
    3.87 -  switch (m_type) {
    3.88 -  case RX:
    3.89 -    os << "dev-rx";
    3.90 -    break;
    3.91 -  case DROP:
    3.92 -    os << "dev-drop";
    3.93 -    break;
    3.94 -  }
    3.95 -}
    3.96 -
    3.97 -uint16_t 
    3.98 -CsmaTraceType::GetUid (void)
    3.99 -{
   3.100 -  NS_LOG_FUNCTION;
   3.101 -  static uint16_t uid = AllocateUid<CsmaTraceType> ("CsmaTraceType");
   3.102 -  return uid;
   3.103 -}
   3.104 -
   3.105 -std::string 
   3.106 -CsmaTraceType::GetTypeName (void) const
   3.107 -{
   3.108 -  NS_LOG_FUNCTION;
   3.109 -  return "ns3::CsmaTraceType";
   3.110 -}
   3.111 -
   3.112 -enum CsmaTraceType::Type 
   3.113 -CsmaTraceType::Get (void) const
   3.114 -{
   3.115 -  NS_LOG_FUNCTION;
   3.116 -  return m_type;
   3.117 -}
   3.118 -
   3.119 -CsmaNetDevice::CsmaNetDevice (Ptr<Node> node, Mac48Address addr, 
   3.120 -                              CsmaEncapsulationMode encapMode)
   3.121 -  : m_bps (DataRate (0xffffffff)),
   3.122 -    m_receiveErrorModel (0),
   3.123 -    m_node (node),
   3.124 -    m_address (addr),
   3.125 -    m_name (""),
   3.126 +CsmaNetDevice::CsmaNetDevice ()
   3.127 +  : m_name (""),
   3.128      m_linkUp (false),
   3.129      m_mtu (0xffff)
   3.130  {
   3.131    NS_LOG_FUNCTION;
   3.132 -  NS_LOG_PARAMS (this << node);
   3.133 -  m_encapMode = encapMode;
   3.134 -
   3.135 -  Init(true, true);
   3.136 +  NS_LOG_PARAMS (this);
   3.137 +  m_txMachineState = READY;
   3.138 +  m_tInterframeGap = Seconds(0);
   3.139 +  m_channel = 0; 
   3.140  }
   3.141  
   3.142  CsmaNetDevice::~CsmaNetDevice()
   3.143 @@ -113,19 +114,6 @@
   3.144    NetDevice::DoDispose ();
   3.145  }
   3.146  
   3.147 -void 
   3.148 -CsmaNetDevice::Init(bool sendEnable, bool receiveEnable)
   3.149 -{
   3.150 -  NS_LOG_FUNCTION;
   3.151 -  m_txMachineState = READY;
   3.152 -  m_tInterframeGap = Seconds(0);
   3.153 -  m_channel = 0; 
   3.154 -  m_queue = 0;
   3.155 -
   3.156 -  SetSendEnable (sendEnable);
   3.157 -  SetReceiveEnable (receiveEnable);
   3.158 -}
   3.159 -
   3.160  void
   3.161  CsmaNetDevice::SetSendEnable (bool sendEnable)
   3.162  {
   3.163 @@ -394,26 +382,6 @@
   3.164      }
   3.165  }
   3.166  
   3.167 -Ptr<TraceResolver>
   3.168 -CsmaNetDevice::GetTraceResolver (void) const
   3.169 -{
   3.170 -  NS_LOG_FUNCTION;
   3.171 -  Ptr<CompositeTraceResolver> resolver = Create<CompositeTraceResolver> ();
   3.172 -  resolver->AddComposite ("queue", m_queue);
   3.173 -  resolver->AddSource ("rx",
   3.174 -                       TraceDoc ("receive MAC packet",
   3.175 -                                 "Ptr<const Packet>", "packet received"),
   3.176 -                       m_rxTrace,
   3.177 -                       CsmaTraceType (CsmaTraceType::RX));
   3.178 -  resolver->AddSource ("drop",
   3.179 -                       TraceDoc ("drop MAC packet",
   3.180 -                                 "Ptr<const Packet>", "packet dropped"),
   3.181 -                       m_dropTrace,
   3.182 -                       CsmaTraceType (CsmaTraceType::DROP));
   3.183 -  resolver->SetParentResolver (NetDevice::GetTraceResolver ());
   3.184 -  return resolver;
   3.185 -}
   3.186 -
   3.187  bool
   3.188  CsmaNetDevice::Attach (Ptr<CsmaChannel> ch)
   3.189  {
   3.190 @@ -448,7 +416,6 @@
   3.191    NS_LOG_PARAM ("(" << em << ")");
   3.192    
   3.193    m_receiveErrorModel = em; 
   3.194 -  AggregateObject (em);
   3.195  }
   3.196  
   3.197  void
     4.1 --- a/src/devices/csma/csma-net-device.h	Wed Feb 27 19:51:34 2008 +0100
     4.2 +++ b/src/devices/csma/csma-net-device.h	Wed Feb 27 20:23:57 2008 +0100
     4.3 @@ -29,7 +29,7 @@
     4.4  #include "ns3/net-device.h"
     4.5  #include "ns3/callback.h"
     4.6  #include "ns3/packet.h"
     4.7 -#include "ns3/callback-trace-source.h"
     4.8 +#include "ns3/traced-callback.h"
     4.9  #include "ns3/nstime.h"
    4.10  #include "ns3/data-rate.h"
    4.11  #include "ns3/ptr.h"
    4.12 @@ -43,29 +43,6 @@
    4.13  class ErrorModel;
    4.14  
    4.15  /**
    4.16 - * \brief hold in a TraceContext the type of trace source from a CsmaNetDevice
    4.17 - */
    4.18 -class CsmaTraceType : public TraceContextElement
    4.19 -{
    4.20 -public:
    4.21 -  enum Type {
    4.22 -    RX, 
    4.23 -    DROP
    4.24 -  };
    4.25 -  CsmaTraceType (enum Type type);
    4.26 -  CsmaTraceType ();
    4.27 -  void Print (std::ostream &os) const;
    4.28 -  static uint16_t GetUid (void);
    4.29 -  std::string GetTypeName (void) const;
    4.30 -  /**
    4.31 -   * \returns the type of the trace source which generated an event.
    4.32 -   */
    4.33 -  enum Type Get (void) const;
    4.34 -private:
    4.35 -  enum Type m_type;
    4.36 -};
    4.37 -
    4.38 -/**
    4.39   * \class CsmaNetDevice
    4.40   * \brief A Device for a Csma Network Link.
    4.41   *
    4.42 @@ -84,9 +61,10 @@
    4.43   * devices
    4.44   *
    4.45   */
    4.46 -class CsmaNetDevice : public NetDevice {
    4.47 +class CsmaNetDevice : public NetDevice 
    4.48 +{
    4.49  public:
    4.50 -
    4.51 +  static TypeId GetTypeId (void);
    4.52    /**
    4.53     * Enumeration of the types of packets supported in the class.
    4.54     *
    4.55 @@ -105,11 +83,8 @@
    4.56     * parameter the Node to which this device is connected.  Ownership of the
    4.57     * Node pointer is not implied and the node must not be deleted.
    4.58     *
    4.59 -   * \param node the Node to which this device is connected.
    4.60 -   * \param addr The source MAC address of the net device.
    4.61 -   * \param pktType the type of encapsulation
    4.62     */
    4.63 -  CsmaNetDevice (Ptr<Node> node, Mac48Address addr, CsmaEncapsulationMode pktType);
    4.64 +  CsmaNetDevice ();
    4.65  
    4.66    /**
    4.67     * Destroy a CsmaNetDevice
    4.68 @@ -252,12 +227,6 @@
    4.69  
    4.70  protected:
    4.71    virtual void DoDispose (void);
    4.72 -  /**
    4.73 -   * Create a Trace Resolver for events in the net device.
    4.74 -   * (NOT TESTED)
    4.75 -   * @see class TraceResolver
    4.76 -   */
    4.77 -  virtual Ptr<TraceResolver> GetTraceResolver (void) const;
    4.78  
    4.79    /**
    4.80     * Get a copy of the attached Queue.
    4.81 @@ -450,8 +419,8 @@
    4.82     * @see class CallBackTraceSource
    4.83     * @see class TraceResolver
    4.84     */
    4.85 -  CallbackTraceSource<Ptr<const Packet> > m_rxTrace;
    4.86 -  CallbackTraceSource<Ptr<const Packet> > m_dropTrace;
    4.87 +  TracedCallback<Ptr<const Packet> > m_rxTrace;
    4.88 +  TracedCallback<Ptr<const Packet> > m_dropTrace;
    4.89  
    4.90    Ptr<Node> m_node;
    4.91    Mac48Address m_address;
     5.1 --- a/src/devices/csma/csma-topology.cc	Wed Feb 27 19:51:34 2008 +0100
     5.2 +++ b/src/devices/csma/csma-topology.cc	Wed Feb 27 20:23:57 2008 +0100
     5.3 @@ -46,10 +46,11 @@
     5.4  CsmaTopology::AddCsmaEthernetNode(
     5.5    Ptr<Node> n1,
     5.6    Ptr<CsmaChannel> ch,
     5.7 -  MacAddress addr)
     5.8 +  Mac48Address addr)
     5.9  {
    5.10 -  Ptr<CsmaNetDevice> nd1 = CreateObject<CsmaNetDevice> (n1, addr, 
    5.11 -                                                      ns3::CsmaNetDevice::ETHERNET_V1);
    5.12 +  Ptr<CsmaNetDevice> nd1 = CreateObjectWith<CsmaNetDevice> ("Node", Ptr<Node> (n1), 
    5.13 +                                                            "Address", addr, 
    5.14 +                                                            "EncapsulationMode", "EthernetV1");
    5.15  
    5.16    Ptr<Queue> q = Queue::CreateDefault ();
    5.17    nd1->AddQueue(q);
    5.18 @@ -60,8 +61,8 @@
    5.19  
    5.20  Ptr<PacketSocket>
    5.21  CsmaTopology::ConnectPacketSocket(Ptr<PacketSocketApp> app, 
    5.22 -                                        Ptr<CsmaNetDevice> ndSrc,
    5.23 -                                        Ptr<CsmaNetDevice> ndDest)
    5.24 +                                  Ptr<CsmaNetDevice> ndSrc,
    5.25 +                                  Ptr<CsmaNetDevice> ndDest)
    5.26  {
    5.27    Ptr<PacketSocket> socket = CreateObject<PacketSocket> ();
    5.28    socket->Bind(ndSrc);
     6.1 --- a/src/node/node.cc	Wed Feb 27 19:51:34 2008 +0100
     6.2 +++ b/src/node/node.cc	Wed Feb 27 20:23:57 2008 +0100
     6.3 @@ -55,64 +55,6 @@
     6.4    return tid;
     6.5  }
     6.6  
     6.7 -NodeNetDeviceIndex::NodeNetDeviceIndex ()
     6.8 -  : m_index (0)
     6.9 -{}
    6.10 -NodeNetDeviceIndex::NodeNetDeviceIndex (uint32_t index)
    6.11 -  : m_index (index)
    6.12 -{}
    6.13 -uint32_t 
    6.14 -NodeNetDeviceIndex::Get (void) const
    6.15 -{
    6.16 -  return m_index;
    6.17 -}
    6.18 -void 
    6.19 -NodeNetDeviceIndex::Print (std::ostream &os) const
    6.20 -{
    6.21 -  os << "device=" << m_index;
    6.22 -}
    6.23 -uint16_t 
    6.24 -NodeNetDeviceIndex::GetUid (void)
    6.25 -{
    6.26 -  static uint16_t uid = AllocateUid<NodeNetDeviceIndex> ("NodeNetDeviceIndex");
    6.27 -  return uid;
    6.28 -}
    6.29 -std::string 
    6.30 -NodeNetDeviceIndex::GetTypeName (void) const
    6.31 -{
    6.32 -  return "ns3::NodeNetDeviceIndex";
    6.33 -}
    6.34 -
    6.35 -
    6.36 -NodeApplicationIndex::NodeApplicationIndex ()
    6.37 -  : m_index (0)
    6.38 -{}
    6.39 -NodeApplicationIndex::NodeApplicationIndex (uint32_t index)
    6.40 -  : m_index (index)
    6.41 -{}
    6.42 -uint32_t 
    6.43 -NodeApplicationIndex::Get (void) const
    6.44 -{
    6.45 -  return m_index;
    6.46 -}
    6.47 -void 
    6.48 -NodeApplicationIndex::Print (std::ostream &os) const
    6.49 -{
    6.50 -  os << "device=" << m_index;
    6.51 -}
    6.52 -uint16_t 
    6.53 -NodeApplicationIndex::GetUid (void)
    6.54 -{
    6.55 -  static uint16_t uid = AllocateUid<NodeApplicationIndex> ("NodeApplicationIndex");
    6.56 -  return uid;
    6.57 -}
    6.58 -std::string 
    6.59 -NodeApplicationIndex::GetTypeName (void) const
    6.60 -{
    6.61 -  return "ns3::NodeApplicationIndex";
    6.62 -}
    6.63 -
    6.64 -
    6.65  Node::Node()
    6.66    : m_id(0), 
    6.67      m_sid(0)
    6.68 @@ -138,16 +80,6 @@
    6.69  Node::~Node ()
    6.70  {}
    6.71  
    6.72 -Ptr<TraceResolver>
    6.73 -Node::GetTraceResolver (void) const
    6.74 -{
    6.75 -  Ptr<CompositeTraceResolver> resolver = Create<CompositeTraceResolver> ();
    6.76 -  resolver->AddArray ("devices", m_devices.begin (), m_devices.end (), NodeNetDeviceIndex ());
    6.77 -  resolver->AddArray ("applications", m_applications.begin (), m_applications.end (), NodeApplicationIndex ());
    6.78 -  resolver->SetParentResolver (Object::GetTraceResolver ());
    6.79 -  return resolver;
    6.80 -}
    6.81 -
    6.82  uint32_t 
    6.83  Node::GetId (void) const
    6.84  {
     7.1 --- a/src/node/node.h	Wed Feb 27 19:51:34 2008 +0100
     7.2 +++ b/src/node/node.h	Wed Feb 27 20:23:57 2008 +0100
     7.3 @@ -25,56 +25,16 @@
     7.4  
     7.5  #include "ns3/object.h"
     7.6  #include "ns3/callback.h"
     7.7 -#include "ns3/trace-context-element.h"
     7.8  #include "ns3/ptr.h"
     7.9  
    7.10  namespace ns3 {
    7.11  
    7.12  class TraceContext;
    7.13 -class TraceResolver;
    7.14  class NetDevice;
    7.15  class Application;
    7.16  class Packet;
    7.17  class Address;
    7.18 -class CompositeTraceResolver;
    7.19  
    7.20 -/**
    7.21 - * \brief hold in a TraceContext the index of a NetDevice within a Node
    7.22 - */
    7.23 -class NodeNetDeviceIndex : public TraceContextElement
    7.24 -{
    7.25 -public:
    7.26 -  NodeNetDeviceIndex ();
    7.27 -  NodeNetDeviceIndex (uint32_t index);
    7.28 -  /**
    7.29 -   * \returns the index of the NetDevice within its container Node.
    7.30 -   */
    7.31 -  uint32_t Get (void) const;
    7.32 -  void Print (std::ostream &os) const;
    7.33 -  std::string GetTypeName (void) const;
    7.34 -  static uint16_t GetUid (void);
    7.35 -private:
    7.36 -  uint32_t m_index;
    7.37 -};
    7.38 -
    7.39 -/**
    7.40 - * \brief hold in a TraceContext the index of an Application within a Node
    7.41 - */
    7.42 -class NodeApplicationIndex : public TraceContextElement
    7.43 -{
    7.44 -public:
    7.45 -  NodeApplicationIndex ();
    7.46 -  NodeApplicationIndex (uint32_t index);
    7.47 -  /**
    7.48 -   * \returns the index of the Application within its container Node.
    7.49 -   */
    7.50 -  uint32_t Get (void) const;
    7.51 -  void Print (std::ostream &os) const;
    7.52 -  std::string GetTypeName (void) const;
    7.53 -  static uint16_t GetUid (void);
    7.54 -private:
    7.55 -  uint32_t m_index;
    7.56 -};
    7.57  
    7.58  /**
    7.59   * \brief A network Node.
    7.60 @@ -199,7 +159,6 @@
    7.61    void UnregisterProtocolHandler (ProtocolHandler handler);
    7.62  
    7.63  protected:
    7.64 -  virtual Ptr<TraceResolver> GetTraceResolver (void) const;
    7.65    /**
    7.66     * The dispose method. Subclasses must override this method
    7.67     * and must chain up to it by calling Node::DoDispose at the
     8.1 --- a/utils/print-introspected-doxygen.cc	Wed Feb 27 19:51:34 2008 +0100
     8.2 +++ b/utils/print-introspected-doxygen.cc	Wed Feb 27 20:23:57 2008 +0100
     8.3 @@ -122,8 +122,9 @@
     8.4    Ptr<PointToPointNetDevice> p2p = CreateObject<PointToPointNetDevice> (node, Mac48Address::Allocate ());
     8.5    node->AddDevice (p2p);
     8.6    p2p->AddQueue (Queue::CreateDefault ());
     8.7 -  Ptr<CsmaNetDevice> csma = CreateObject<CsmaNetDevice> (node, Mac48Address::Allocate (),
     8.8 -							 CsmaNetDevice::LLC);
     8.9 +  Ptr<CsmaNetDevice> csma = CreateObjectWith<CsmaNetDevice> ("Node", node, 
    8.10 +							     "Address", Mac48Address::Allocate (),
    8.11 +							     "EncapsulationMode", "Llc");
    8.12    node->AddDevice (csma);
    8.13    csma->AddQueue (Queue::CreateDefault ());
    8.14