make GetAttributeFlags and GetAttributeChecker public. add GetAttributeHelp
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Sun, 09 Mar 2008 22:55:25 +0100
changeset 2573 b45af20ffe2b
parent 2572 5f3bdaf2a77c
child 2574 cc6ceef18cd3
make GetAttributeFlags and GetAttributeChecker public. add GetAttributeHelp
src/core/object.cc
src/core/object.h
--- a/src/core/object.cc	Sun Mar 09 21:28:27 2008 +0100
+++ b/src/core/object.cc	Sun Mar 09 22:55:25 2008 +0100
@@ -63,6 +63,7 @@
                      ns3::Ptr<const ns3::AttributeChecker> checker);
   uint32_t GetAttributeListN (uint16_t uid) const;
   std::string GetAttributeName (uint16_t uid, uint32_t i) const;
+  std::string GetAttributeHelp (uint16_t uid, uint32_t i) const;
   uint32_t GetAttributeFlags (uint16_t uid, uint32_t i) const;
   ns3::Attribute GetAttributeInitialValue (uint16_t uid, uint32_t i) const;
   ns3::Ptr<const ns3::AttributeAccessor> GetAttributeAccessor (uint16_t uid, uint32_t i) const;
@@ -300,6 +301,13 @@
   NS_ASSERT (i < information->attributes.size ());
   return information->attributes[i].name;
 }
+std::string 
+IidManager::GetAttributeHelp (uint16_t uid, uint32_t i) const
+{
+  struct IidInformation *information = LookupInformation (uid);
+  NS_ASSERT (i < information->attributes.size ());
+  return information->attributes[i].help;
+}
 uint32_t
 IidManager::GetAttributeFlags (uint16_t uid, uint32_t i) const
 {
@@ -608,6 +616,12 @@
   return name;
 }
 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
 {
   return GetName () + "::" + GetAttributeName (i);
--- a/src/core/object.h	Sun Mar 09 21:28:27 2008 +0100
+++ b/src/core/object.h	Sun Mar 09 22:55:25 2008 +0100
@@ -142,6 +142,7 @@
    *          index is \i i.
    */
   std::string GetAttributeName (uint32_t i) const;
+  std::string GetAttributeHelp (uint32_t i) const;
   /**
    * \param i index into attribute array
    * \returns the full name associated to the attribute whose
@@ -150,6 +151,9 @@
   std::string GetAttributeFullName (uint32_t i) const;
 
   Attribute GetAttributeInitialValue (uint32_t i) const;
+  uint32_t GetAttributeFlags (uint32_t i) const;
+  Ptr<const AttributeChecker> GetAttributeChecker (uint32_t i) const;
+
 
   uint32_t GetTraceSourceN (void) const;
   std::string GetTraceSourceName (uint32_t i) const;
@@ -291,8 +295,6 @@
   void DoAddConstructor (CallbackBase callback, uint32_t nArguments);
   CallbackBase LookupConstructor (uint32_t nArguments) const;
   Ptr<const AttributeAccessor> GetAttributeAccessor (uint32_t i) const;
-  uint32_t GetAttributeFlags (uint32_t i) const;
-  Ptr<const AttributeChecker> GetAttributeChecker (uint32_t i) const;
   
   uint16_t m_tid;
 };