use new API, kill old one.
authorMathieu Lacage <mathieu.lacage@gmail.com>
Wed, 03 Aug 2011 10:17:01 -0400
changeset 7395 a1bb24a8ae25
parent 7394 48475b398d9d
child 7396 dbef5c3ceb80
use new API, kill old one.
src/core/model/type-id.cc
src/core/model/type-id.h
utils/print-introspected-doxygen.cc
--- a/src/core/model/type-id.cc	Wed Aug 03 10:08:47 2011 -0400
+++ b/src/core/model/type-id.cc	Wed Aug 03 10:17:01 2011 -0400
@@ -618,12 +618,6 @@
   return Singleton<IidManager>::Get ()->GetAttribute(m_tid, i);
 }
 std::string 
-TypeId::GetAttributeHelp (uint32_t i) const
-{
-  std::string help = Singleton<IidManager>::Get ()->GetAttributeHelp (m_tid, i);
-  return help;
-}
-std::string 
 TypeId::GetAttributeFullName (uint32_t i) const
 {
   struct TypeId::AttributeInformation info = GetAttribute(i);
@@ -647,22 +641,6 @@
   return Singleton<IidManager>::Get ()->GetTraceSource(m_tid, i);
 }
 
-std::string 
-TypeId::GetTraceSourceName (uint32_t i) const
-{
-  return Singleton<IidManager>::Get ()->GetTraceSourceName (m_tid, i);
-}
-std::string 
-TypeId::GetTraceSourceHelp (uint32_t i) const
-{
-  return Singleton<IidManager>::Get ()->GetTraceSourceHelp (m_tid, i);
-}
-Ptr<const TraceSourceAccessor> 
-TypeId::GetTraceSourceAccessor (uint32_t i) const
-{
-  return Singleton<IidManager>::Get ()->GetTraceSourceAccessor (m_tid, i);
-}
-
 TypeId 
 TypeId::AddTraceSource (std::string name,
                         std::string help,
@@ -689,10 +667,10 @@
       tid = nextTid;
       for (uint32_t i = 0; i < tid.GetTraceSourceN (); i++)
         {
-          std::string srcName = tid.GetTraceSourceName (i);
-          if (srcName == name)
+          struct TypeId::TraceSourceInformation info = tid.GetTraceSource (i);
+          if (info.name == name)
             {
-              return tid.GetTraceSourceAccessor (i);
+              return info.accessor;
             }
         }
       nextTid = tid.GetParent ();
--- a/src/core/model/type-id.h	Wed Aug 03 10:08:47 2011 -0400
+++ b/src/core/model/type-id.h	Wed Aug 03 10:17:01 2011 -0400
@@ -22,6 +22,7 @@
 
 #include "attribute.h"
 #include "attribute-accessor-helper.h"
+#include "trace-source-accessor.h"
 #include "attribute-helper.h"
 #include "callback.h"
 #include <string>
@@ -30,7 +31,6 @@
 namespace ns3 {
 
 class ObjectBase;
-class TraceSourceAccessor;
 
 /**
  * \brief a unique identifier for an interface.
@@ -152,12 +152,6 @@
    */
   struct TypeId::AttributeInformation GetAttribute(uint32_t i) const;
   /**
-   * \param i index into attribute array.
-   * \returns the help text associated to the attribute whose
-   *          index is i.
-   */
-  std::string GetAttributeHelp (uint32_t i) const;
-  /**
    * \param i index into attribute array
    * \returns the full name associated to the attribute whose
    *          index is i.
@@ -193,23 +187,6 @@
    * \returns detailed information about the requested trace source.
    */
   struct TypeId::TraceSourceInformation GetTraceSource(uint32_t i) const;
-  /**
-   * \param i index into trace source array.
-   * \returns the name of the requested trace source.
-   */
-  std::string GetTraceSourceName (uint32_t i) const;
-  /**
-   * \param i index into trace source array.
-   * \returns the help text of the requested trace source.
-   */
-  std::string GetTraceSourceHelp (uint32_t i) const;
-  /**
-   * \param i index into trace source array.
-   * \returns the accessor used to get access to the requested
-   *          trace source.
-   */
-  Ptr<const TraceSourceAccessor> GetTraceSourceAccessor (uint32_t i) const;
-
 
   /**
    * \param tid the TypeId of the base class.
--- a/utils/print-introspected-doxygen.cc	Wed Aug 03 10:08:47 2011 -0400
+++ b/utils/print-introspected-doxygen.cc	Wed Aug 03 10:17:01 2011 -0400
@@ -58,8 +58,9 @@
   os << "<ul>"<<std::endl;
   for (uint32_t i = 0; i < tid.GetTraceSourceN (); ++i)
     {
-      os << "<li><b>" << tid.GetTraceSourceName (i) << "</b>: "
-	 << tid.GetTraceSourceHelp (i)
+      struct TypeId::TraceSourceInformation info = tid.GetTraceSource (i);
+      os << "<li><b>" << info.name << "</b>: "
+	 << info.help
 	 << std::endl;
       os << "</li>" << std::endl;
     }
@@ -362,7 +363,8 @@
 		<< "<ul>" << std::endl;
       for (uint32_t j = 0; j < tid.GetTraceSourceN (); ++j)
 	{
-	  std::cout << "<li>" << tid.GetTraceSourceName (j) << ": " << tid.GetTraceSourceHelp (j) << "</li>" << std::endl;
+	  struct TypeId::TraceSourceInformation info = tid.GetTraceSource(j);
+	  std::cout << "<li>" << info.name << ": " << info.help << "</li>" << std::endl;
 	}
       std::cout << "</ul>" << std::endl;
     }