GetName -> GetTypeName
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Thu, 30 Aug 2007 14:35:44 +0200
changeset 1401 96a21130865c
parent 1400 382b2a36384c
child 1402 b7a9dd908866
GetName -> GetTypeName
doc/trace-source-list.h
src/core/composite-trace-resolver.cc
src/core/trace-context-element.cc
src/core/trace-context-element.h
src/core/trace-context.cc
src/devices/csma/csma-net-device.cc
src/devices/csma/csma-net-device.h
src/devices/point-to-point/point-to-point-net-device.cc
src/devices/point-to-point/point-to-point-net-device.h
src/internet-node/ipv4-l3-protocol.cc
src/internet-node/ipv4-l3-protocol.h
src/internet-node/ipv4-l4-demux.cc
src/internet-node/ipv4-l4-demux.h
src/node/node-list.cc
src/node/node-list.h
src/node/node.cc
src/node/node.h
src/node/queue.cc
src/node/queue.h
--- a/doc/trace-source-list.h	Thu Aug 30 14:25:09 2007 +0200
+++ b/doc/trace-source-list.h	Thu Aug 30 14:35:44 2007 +0200
@@ -0,0 +1,204 @@
+///
+/// \ingroup TraceSourceList
+/// \brief send ipv4 packet to outgoing interface
+/// \param arg1 the trace context associated to the connected trace source.
+/// \param arg2 packet sent.
+/// \param arg3 index of output ipv4 interface.
+///
+///
+/// The path to this trace source is: /nodes/[0-n]/ipv4/tx.
+///
+/// The following classes can be extracted from \p arg1 with 
+/// ns3::TraceContext::GetElement:
+///  - ns3::NodeListIndex
+///  - ns3::Ipv4L3ProtocolTraceContextElement
+void TraceSinkCallback0 (const TraceContext & arg1, const Packet & arg2, uint32_t arg3);
+
+///
+/// \ingroup TraceSourceList
+/// \brief receive ipv4 packet from incoming interface
+/// \param arg1 the trace context associated to the connected trace source.
+/// \param arg2 packet received.
+/// \param arg3 index of input ipv4 interface.
+///
+///
+/// The path to this trace source is: /nodes/[0-n]/ipv4/rx.
+///
+/// The following classes can be extracted from \p arg1 with 
+/// ns3::TraceContext::GetElement:
+///  - ns3::NodeListIndex
+///  - ns3::Ipv4L3ProtocolTraceContextElement
+void TraceSinkCallback1 (const TraceContext & arg1, const Packet & arg2, uint32_t arg3);
+
+///
+/// \ingroup TraceSourceList
+/// \brief drop ipv4 packet
+/// \param arg1 the trace context associated to the connected trace source.
+/// \param arg2 packet dropped.
+///
+///
+/// The path to this trace source is: /nodes/[0-n]/ipv4/drop.
+///
+/// The following classes can be extracted from \p arg1 with 
+/// ns3::TraceContext::GetElement:
+///  - ns3::NodeListIndex
+///  - ns3::Ipv4L3ProtocolTraceContextElement
+void TraceSinkCallback2 (const TraceContext & arg1, const Packet & arg2);
+
+///
+/// \ingroup TraceSourceList
+/// \brief store packet in queue
+/// \param arg1 the trace context associated to the connected trace source.
+/// \param arg2 packet queued.
+///
+///
+/// The path to this trace source is: /nodes/[0-n]/devices/[0-n]/queue/enqueue.
+///
+/// The following classes can be extracted from \p arg1 with 
+/// ns3::TraceContext::GetElement:
+///  - ns3::NodeListIndex
+///  - ns3::NodeNetDeviceIndex
+///  - ns3::QueueTraceType
+void TraceSinkCallback3 (const TraceContext & arg1, const Packet & arg2);
+
+///
+/// \ingroup TraceSourceList
+/// \brief remove packet from queue
+/// \param arg1 the trace context associated to the connected trace source.
+/// \param arg2 packet dequeued.
+///
+///
+/// The path to this trace source is: /nodes/[0-n]/devices/[0-n]/queue/dequeue.
+///
+/// The following classes can be extracted from \p arg1 with 
+/// ns3::TraceContext::GetElement:
+///  - ns3::NodeListIndex
+///  - ns3::NodeNetDeviceIndex
+///  - ns3::QueueTraceType
+void TraceSinkCallback4 (const TraceContext & arg1, const Packet & arg2);
+
+///
+/// \ingroup TraceSourceList
+/// \brief drop packet from queue
+/// \param arg1 the trace context associated to the connected trace source.
+/// \param arg2 packet dropped.
+///
+///
+/// The path to this trace source is: /nodes/[0-n]/devices/[0-n]/queue/drop.
+///
+/// The following classes can be extracted from \p arg1 with 
+/// ns3::TraceContext::GetElement:
+///  - ns3::NodeListIndex
+///  - ns3::NodeNetDeviceIndex
+///  - ns3::QueueTraceType
+void TraceSinkCallback5 (const TraceContext & arg1, const Packet & arg2);
+
+///
+/// \ingroup TraceSourceList
+/// \brief receive MAC packet
+/// \param arg1 the trace context associated to the connected trace source.
+/// \param arg2 packet received.
+///
+///
+/// The path to this trace source is: /nodes/[0-n]/devices/[0-n]/rx.
+///
+/// The following classes can be extracted from \p arg1 with 
+/// ns3::TraceContext::GetElement:
+///  - ns3::NodeListIndex
+///  - ns3::NodeNetDeviceIndex
+///  - ns3::PointToPointTraceType
+void TraceSinkCallback6 (const TraceContext & arg1, const Packet & arg2);
+
+///
+/// \ingroup TraceSourceList
+/// \brief receive MAC packet
+/// \param arg1 the trace context associated to the connected trace source.
+/// \param arg2 packet received.
+///
+///
+/// The path to this trace source is: /nodes/[0-n]/devices/[0-n]/rx.
+///
+/// The following classes can be extracted from \p arg1 with 
+/// ns3::TraceContext::GetElement:
+///  - ns3::NodeListIndex
+///  - ns3::NodeNetDeviceIndex
+///  - ns3::CsmaTraceType
+void TraceSinkCallback7 (const TraceContext & arg1, const Packet & arg2);
+
+///
+/// \ingroup TraceSourceList
+/// \brief drop MAC packet
+/// \param arg1 the trace context associated to the connected trace source.
+/// \param arg2 packet dropped.
+///
+///
+/// The path to this trace source is: /nodes/[0-n]/devices/[0-n]/drop.
+///
+/// The following classes can be extracted from \p arg1 with 
+/// ns3::TraceContext::GetElement:
+///  - ns3::NodeListIndex
+///  - ns3::NodeNetDeviceIndex
+///  - ns3::CsmaTraceType
+void TraceSinkCallback8 (const TraceContext & arg1, const Packet & arg2);
+
+///
+/// \ingroup TraceSourceList
+/// \brief The value of the speed vector changed
+/// \param arg1 the trace context associated to the connected trace source.
+/// \param arg2 the mobility model whose course changed.
+///
+///
+/// The path to this trace source is: /nodes/[0-n]/$MobilityModelNotifier/course-change.
+///
+/// The following classes can be extracted from \p arg1 with 
+/// ns3::TraceContext::GetElement:
+///  - ns3::NodeListIndex
+void TraceSinkCallback9 (const TraceContext & arg1, Ptr<const MobilityModel> arg2);
+
+///
+/// \ingroup TraceSourceList
+/// \brief send ipv4 packet to outgoing interface
+/// \param arg1 the trace context associated to the connected trace source.
+/// \param arg2 packet sent.
+/// \param arg3 index of output ipv4 interface.
+///
+///
+/// The path to this trace source is: /nodes/[0-n]/$Ipv4L3Protocol/tx.
+///
+/// The following classes can be extracted from \p arg1 with 
+/// ns3::TraceContext::GetElement:
+///  - ns3::NodeListIndex
+///  - ns3::Ipv4L3ProtocolTraceContextElement
+void TraceSinkCallback10 (const TraceContext & arg1, const Packet & arg2, uint32_t arg3);
+
+///
+/// \ingroup TraceSourceList
+/// \brief receive ipv4 packet from incoming interface
+/// \param arg1 the trace context associated to the connected trace source.
+/// \param arg2 packet received.
+/// \param arg3 index of input ipv4 interface.
+///
+///
+/// The path to this trace source is: /nodes/[0-n]/$Ipv4L3Protocol/rx.
+///
+/// The following classes can be extracted from \p arg1 with 
+/// ns3::TraceContext::GetElement:
+///  - ns3::NodeListIndex
+///  - ns3::Ipv4L3ProtocolTraceContextElement
+void TraceSinkCallback11 (const TraceContext & arg1, const Packet & arg2, uint32_t arg3);
+
+///
+/// \ingroup TraceSourceList
+/// \brief drop ipv4 packet
+/// \param arg1 the trace context associated to the connected trace source.
+/// \param arg2 packet dropped.
+///
+///
+/// The path to this trace source is: /nodes/[0-n]/$Ipv4L3Protocol/drop.
+///
+/// The following classes can be extracted from \p arg1 with 
+/// ns3::TraceContext::GetElement:
+///  - ns3::NodeListIndex
+///  - ns3::Ipv4L3ProtocolTraceContextElement
+void TraceSinkCallback12 (const TraceContext & arg1, const Packet & arg2);
+
--- a/src/core/composite-trace-resolver.cc	Thu Aug 30 14:25:09 2007 +0200
+++ b/src/core/composite-trace-resolver.cc	Thu Aug 30 14:35:44 2007 +0200
@@ -320,7 +320,7 @@
     else if (m_sources == DOUBLEB) {os << "doubleB";}
     else if (m_sources == UINT16_T) {os << "uint16_t";}
   }
-  std::string GetName (void) {return "TraceSourceTest";}
+  std::string GetTypeName (void) {return "ns3::TraceSourceTest";}
   TraceSourceTest () : m_sources (TraceSourceTest::DOUBLEA) {}
   TraceSourceTest (enum Sources sources) :m_sources (sources) {}
   bool IsDoubleA (void) const {return m_sources == TraceSourceTest::DOUBLEA;}
@@ -340,7 +340,7 @@
   {static uint16_t uid = AllocateUid<SubTraceSourceTest> ("SubTraceSourceTest"); return uid;}
   void Print (std::ostream &os)
   {os << "subtracesource=int";}
-  std::string GetName (void) const {return "SubTraceSourceTest";}
+  std::string GetTypeName (void) const {return "ns3::SubTraceSourceTest";}
   SubTraceSourceTest () : m_sources (SubTraceSourceTest::INT) {}
   SubTraceSourceTest (enum Sources sources) : m_sources (sources) {}
 private:
--- a/src/core/trace-context-element.cc	Thu Aug 30 14:25:09 2007 +0200
+++ b/src/core/trace-context-element.cc	Thu Aug 30 14:35:44 2007 +0200
@@ -3,11 +3,11 @@
 namespace ns3 {
 
 std::string 
-ElementRegistry::GetName (uint16_t uid)
+ElementRegistry::GetTypeName (uint16_t uid)
 {
   InfoVector *vec = GetInfoVector ();
   struct Info info = (*vec)[uid - 1];
-  return info.getName ();
+  return info.getTypeName ();
 }
 uint32_t 
 ElementRegistry::GetSize (uint16_t uid)
--- a/src/core/trace-context-element.h	Thu Aug 30 14:25:09 2007 +0200
+++ b/src/core/trace-context-element.h	Thu Aug 30 14:35:44 2007 +0200
@@ -48,7 +48,7 @@
  *   MyContext ();
  *   ~MyContext ();
  *   void Print (std::ostream &os) const;
- *   std::string GetName (void) const;
+ *   std::string GetTypeName (void) const;
  *
  *   // the user-specific API to manipulate the context.
  *   void SetData (uint8_t data);
@@ -73,8 +73,9 @@
  *   os << "mycontext=" << (uint32_t) m_myContextData;
  * }
  * std::string 
- * MyContext::GetName (void) const
+ * MyContext::GetTypeName (void) const
  * {
+ *   // return a fully-qualified c++ type name
  *   return "MyContext";
  * }
  * void 
@@ -121,23 +122,23 @@
 
   static uint32_t GetSize (uint16_t uid);
   static void Print (uint16_t uid, uint8_t *instance, std::ostream &os);
-  static std::string GetName (uint16_t uid);
+  static std::string GetTypeName (uint16_t uid);
   static void Destroy (uint16_t uid, uint8_t *instance);
 private:
-  typedef std::string (*GetNameCb) (void);
+  typedef std::string (*GetTypeNameCb) (void);
   typedef void (*PrintCb) (uint8_t *instance, std::ostream &os);
   typedef void (*DestroyCb) (uint8_t *instance);
   struct Info {
     uint32_t size;
     std::string uidString;
-    GetNameCb getName;
+    GetTypeNameCb getTypeName;
     PrintCb print;
     DestroyCb destroy;
   };
   typedef std::vector<struct Info> InfoVector;
   static InfoVector *GetInfoVector (void);
   template <typename T>
-  static std::string DoGetName (void);
+  static std::string DoGetTypeName (void);
   template <typename T>
   static void DoPrint (uint8_t *instance, std::ostream &os);
   template <typename T>
@@ -155,10 +156,10 @@
 }
 template <typename T>
 std::string
-ElementRegistry::DoGetName (void)
+ElementRegistry::DoGetTypeName (void)
 {
   static T obj;
-  return obj.GetName ();
+  return obj.GetTypeName ();
 }
 template <typename T>
 void 
@@ -187,7 +188,7 @@
   struct Info info;
   info.size = sizeof (T);
   info.uidString = name;
-  info.getName = &ElementRegistry::DoGetName<T>;
+  info.getTypeName = &ElementRegistry::DoGetTypeName<T>;
   info.print = &ElementRegistry::DoPrint<T>;
   info.destroy = &ElementRegistry::DoDestroy<T>;
   vec->push_back (info);
--- a/src/core/trace-context.cc	Thu Aug 30 14:25:09 2007 +0200
+++ b/src/core/trace-context.cc	Thu Aug 30 14:35:44 2007 +0200
@@ -66,7 +66,7 @@
 std::string
 TraceContext::Iterator::Get (void) const
 {
-  std::string name = ElementRegistry::GetName (m_uid);
+  std::string name = ElementRegistry::GetTypeName (m_uid);
   return name;
 }
 
@@ -298,7 +298,7 @@
   do {
     currentUid = m_data->data[i];
     uint8_t size = ElementRegistry::GetSize (currentUid);
-    os << ElementRegistry::GetName (currentUid);
+    os << ElementRegistry::GetTypeName (currentUid);
     i += 1 + size;
     if (i < m_data->size && currentUid != 0)
       {
@@ -371,8 +371,8 @@
 class Ctx : public TraceContextElement
 {
 public:
-  static uint16_t GetUid (void) {static uint16_t uid = AllocateUid<Ctx<N> > (GetName ()); return uid;}
-  static std::string GetName (void) {std::ostringstream oss; oss << "Ctx" << N; return oss.str ();}
+  static uint16_t GetUid (void) {static uint16_t uid = AllocateUid<Ctx<N> > (GetTypeName ()); return uid;}
+  static std::string GetTypeName (void) {std::ostringstream oss; oss << "Ctx" << N; return oss.str ();}
   Ctx () : m_v (0) {}
   Ctx (int v) : m_v (v) {}
   void Print (std::ostream &os) {os << N;}
--- a/src/devices/csma/csma-net-device.cc	Thu Aug 30 14:25:09 2007 +0200
+++ b/src/devices/csma/csma-net-device.cc	Thu Aug 30 14:35:44 2007 +0200
@@ -60,9 +60,9 @@
   return uid;
 }
 std::string 
-CsmaTraceType::GetName (void) const
+CsmaTraceType::GetTypeName (void) const
 {
-  return "CsmaTraceType";
+  return "ns3::CsmaTraceType";
 }
 
 
--- a/src/devices/csma/csma-net-device.h	Thu Aug 30 14:25:09 2007 +0200
+++ b/src/devices/csma/csma-net-device.h	Thu Aug 30 14:35:44 2007 +0200
@@ -52,7 +52,7 @@
   CsmaTraceType ();
   void Print (std::ostream &os) const;
   static uint16_t GetUid (void);
-  std::string GetName (void) const;
+  std::string GetTypeName (void) const;
 private:
   enum Type m_type;
 };
--- a/src/devices/point-to-point/point-to-point-net-device.cc	Thu Aug 30 14:25:09 2007 +0200
+++ b/src/devices/point-to-point/point-to-point-net-device.cc	Thu Aug 30 14:35:44 2007 +0200
@@ -54,9 +54,9 @@
   return uid;
 }
 std::string 
-PointToPointTraceType::GetName (void) const
+PointToPointTraceType::GetTypeName (void) const
 {
-  return "PointToPointTraceType";
+  return "ns3::PointToPointTraceType";
 }
 
 
--- a/src/devices/point-to-point/point-to-point-net-device.h	Thu Aug 30 14:25:09 2007 +0200
+++ b/src/devices/point-to-point/point-to-point-net-device.h	Thu Aug 30 14:35:44 2007 +0200
@@ -44,7 +44,7 @@
   PointToPointTraceType ();
   void Print (std::ostream &os) const;
   static uint16_t GetUid (void);
-  std::string GetName (void) const;
+  std::string GetTypeName (void) const;
 };
 
 /**
--- a/src/internet-node/ipv4-l3-protocol.cc	Thu Aug 30 14:25:09 2007 +0200
+++ b/src/internet-node/ipv4-l3-protocol.cc	Thu Aug 30 14:35:44 2007 +0200
@@ -88,9 +88,9 @@
   return uid;
 }
 std::string 
-Ipv4L3ProtocolTraceContextElement::GetName (void) const
+Ipv4L3ProtocolTraceContextElement::GetTypeName (void) const
 {
-  return "Ipv4L3ProtocolTraceContextElement";
+  return "ns3::Ipv4L3ProtocolTraceContextElement";
 }
 
 
@@ -117,9 +117,9 @@
   return uid;
 }
 std::string
-Ipv4L3ProtocolInterfaceIndex::GetName (void) const
+Ipv4L3ProtocolInterfaceIndex::GetTypeName (void) const
 {
-  return "Ipv4L3ProtocolInterfaceIndex";
+  return "ns3::Ipv4L3ProtocolInterfaceIndex";
 }
 
 
--- a/src/internet-node/ipv4-l3-protocol.h	Thu Aug 30 14:25:09 2007 +0200
+++ b/src/internet-node/ipv4-l3-protocol.h	Thu Aug 30 14:35:44 2007 +0200
@@ -59,7 +59,7 @@
   bool IsDrop (void) const;
   void Print (std::ostream &os) const;
   static uint16_t GetUid (void);
-  std::string GetName (void) const;
+  std::string GetTypeName (void) const;
 private:
   enum Type m_type;
 };
@@ -72,7 +72,7 @@
   uint32_t Get (void) const;
   void Print (std::ostream &os) const;
   static uint16_t GetUid (void);
-  std::string GetName (void) const;
+  std::string GetTypeName (void) const;
 private:
   uint32_t m_index;
 };
--- a/src/internet-node/ipv4-l4-demux.cc	Thu Aug 30 14:25:09 2007 +0200
+++ b/src/internet-node/ipv4-l4-demux.cc	Thu Aug 30 14:35:44 2007 +0200
@@ -55,9 +55,9 @@
   return uid;
 }
 std::string 
-Ipv4L4ProtocolTraceContextElement::GetName (void) const
+Ipv4L4ProtocolTraceContextElement::GetTypeName (void) const
 {
-  return "Ipv4L4ProtocolTraceContextElement";
+  return "ns3::Ipv4L4ProtocolTraceContextElement";
 }
 
 
--- a/src/internet-node/ipv4-l4-demux.h	Thu Aug 30 14:25:09 2007 +0200
+++ b/src/internet-node/ipv4-l4-demux.h	Thu Aug 30 14:35:44 2007 +0200
@@ -45,7 +45,7 @@
   int Get (void) const;
   void Print (std::ostream &os) const;
   static uint16_t GetUid (void);
-  std::string GetName (void) const;
+  std::string GetTypeName (void) const;
 private:
   int m_protocolNumber;
 };
--- a/src/node/node-list.cc	Thu Aug 30 14:25:09 2007 +0200
+++ b/src/node/node-list.cc	Thu Aug 30 14:35:44 2007 +0200
@@ -51,9 +51,9 @@
   return m_index;
 }
 std::string 
-NodeListIndex::GetName (void) const
+NodeListIndex::GetTypeName (void) const
 {
-  return "NodeListIndex";
+  return "ns3::NodeListIndex";
 }
 
 
--- a/src/node/node-list.h	Thu Aug 30 14:25:09 2007 +0200
+++ b/src/node/node-list.h	Thu Aug 30 14:35:44 2007 +0200
@@ -40,7 +40,7 @@
   void Print (std::ostream &os);
   static uint16_t GetUid (void);
   uint32_t Get (void) const;
-  std::string GetName (void) const;
+  std::string GetTypeName (void) const;
 private:
   uint32_t m_index;
 };
--- a/src/node/node.cc	Thu Aug 30 14:25:09 2007 +0200
+++ b/src/node/node.cc	Thu Aug 30 14:35:44 2007 +0200
@@ -53,9 +53,9 @@
   return uid;
 }
 std::string 
-NodeNetDeviceIndex::GetName (void) const
+NodeNetDeviceIndex::GetTypeName (void) const
 {
-  return "NodeNetDeviceIndex";
+  return "ns3::NodeNetDeviceIndex";
 }
 
 
--- a/src/node/node.h	Thu Aug 30 14:25:09 2007 +0200
+++ b/src/node/node.h	Thu Aug 30 14:35:44 2007 +0200
@@ -44,7 +44,7 @@
   NodeNetDeviceIndex (uint32_t index);
   uint32_t Get (void) const;
   void Print (std::ostream &os) const;
-  std::string GetName (void) const;
+  std::string GetTypeName (void) const;
   static uint16_t GetUid (void);
 private:
   uint32_t m_index;
--- a/src/node/queue.cc	Thu Aug 30 14:25:09 2007 +0200
+++ b/src/node/queue.cc	Thu Aug 30 14:35:44 2007 +0200
@@ -33,9 +33,9 @@
 
 
 std::string 
-QueueTraceType::GetName (void) const
+QueueTraceType::GetTypeName (void) const
 {
-  return "QueueTraceType";
+  return "ns3::QueueTraceType";
 }
 uint16_t 
 QueueTraceType::GetUid (void)
--- a/src/node/queue.h	Thu Aug 30 14:25:09 2007 +0200
+++ b/src/node/queue.h	Thu Aug 30 14:35:44 2007 +0200
@@ -52,7 +52,7 @@
   bool IsDequeue (void) const;
   bool IsDrop (void) const;
   void Print (std::ostream &os) const;
-  std::string GetName (void) const;
+  std::string GetTypeName (void) const;
 private:
   enum Type m_type;
 };