improve the auto-generated doxygen output.
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Thu, 17 Apr 2008 15:30:18 -0700
changeset 2969 9d05d2a95dfa
parent 2968 d6b2d00acab2
child 2970 0384d6f6cca1
improve the auto-generated doxygen output.
doc/doxygen.conf
src/common/data-rate.h
src/core/attribute-helper.h
src/core/attribute.h
src/core/boolean.cc
src/core/double.cc
src/core/double.h
src/core/enum.cc
src/core/enum.h
src/core/integer.cc
src/core/integer.h
src/core/object-factory.h
src/core/object-vector.h
src/core/pointer.h
src/core/random-variable.h
src/core/string.cc
src/core/string.h
src/core/type-id.h
src/core/uinteger.cc
src/devices/wifi/ssid.h
src/devices/wifi/wifi-mode.h
src/mobility/rectangle.h
src/mobility/vector.h
src/node/address.h
src/node/ipv4-address.h
src/node/mac48-address.h
src/simulator/nstime.h
utils/print-introspected-doxygen.cc
--- a/doc/doxygen.conf	Thu Apr 17 14:33:45 2008 -0700
+++ b/doc/doxygen.conf	Thu Apr 17 15:30:18 2008 -0700
@@ -1046,13 +1046,13 @@
 # compilation will be performed. Macro expansion can be done in a controlled 
 # way by setting EXPAND_ONLY_PREDEF to YES.
 
-MACRO_EXPANSION        = NO
+MACRO_EXPANSION        = YES
 
 # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
 # then the macro expansion is limited to the macros specified with the 
 # PREDEFINED and EXPAND_AS_DEFINED tags.
 
-EXPAND_ONLY_PREDEF     = NO
+EXPAND_ONLY_PREDEF     = YES
 
 # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
 # in the INCLUDE_PATH (see below) will be search if a #include is found.
@@ -1089,7 +1089,9 @@
 # The macro definition that is found in the sources will be used. 
 # Use the PREDEFINED tag if you want to use a different macro definition.
 
-EXPAND_AS_DEFINED      = 
+EXPAND_AS_DEFINED      = ATTRIBUTE_VALUE_DEFINE \
+		       ATTRIBUTE_VALUE_DEFINE_WITH_NAME \
+		       ATTRIBUTE_HELPER_HEADER_2
 
 # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
 # doxygen's preprocessor will remove all function-like macros that are alone 
--- a/src/common/data-rate.h	Thu Apr 17 14:33:45 2008 -0700
+++ b/src/common/data-rate.h	Thu Apr 17 15:30:18 2008 -0700
@@ -89,6 +89,11 @@
 std::ostream &operator << (std::ostream &os, const DataRate &rate);
 std::istream &operator >> (std::istream &is, DataRate &rate);
 
+/**
+ * \class ns3::DataRateValue
+ * \brief hold objects of type ns3::DataRate
+ */
+
 ATTRIBUTE_HELPER_HEADER_2 (DataRate);
 
 /**
--- a/src/core/attribute-helper.h	Thu Apr 17 14:33:45 2008 -0700
+++ b/src/core/attribute-helper.h	Thu Apr 17 15:30:18 2008 -0700
@@ -29,21 +29,21 @@
 
 template <typename T, typename BASE>
 Ptr<AttributeChecker>
-MakeSimpleAttributeChecker (std::string name)
+MakeSimpleAttributeChecker (std::string name, std::string underlying)
 {
   struct SimpleAttributeChecker : public BASE
   {
     virtual bool Check (const AttributeValue &value) const {
       return dynamic_cast<const T *> (&value) != 0;
     }
-    virtual std::string GetType (void) const {
+    virtual std::string GetValueTypeName (void) const {
       return m_type;
     }
-    virtual bool HasTypeConstraints (void) const {
-      return false;
+    virtual bool HasUnderlyingTypeInformation (void) const {
+      return true;
     }
-    virtual std::string GetTypeConstraints (void) const {
-      return "";
+    virtual std::string GetUnderlyingTypeInformation (void) const {
+      return m_underlying;
     }
     virtual Ptr<AttributeValue> Create (void) const {
       return ns3::Create<T> ();
@@ -59,8 +59,10 @@
       return true;
     }
     std::string m_type;
+    std::string m_underlying;
   } *checker = new SimpleAttributeChecker ();
   checker->m_type = name;
+  checker->m_underlying = underlying;
   return Ptr<AttributeChecker> (checker, false);
 }
 
@@ -108,7 +110,7 @@
     return MakeAccessorHelper<type##Value> (a1, a2);			\
   }
 
-#define ATTRIBUTE_VALUE_DEFINE_WITH_NAME(type,name) \
+#define ATTRIBUTE_VALUE_DEFINE_WITH_NAME(type,name)                     \
   class name##Value : public AttributeValue				\
   {									\
   public:								\
@@ -210,9 +212,16 @@
 #define ATTRIBUTE_CHECKER_IMPLEMENT(type)				\
   Ptr<const AttributeChecker> Make##type##Checker (void)		\
   {									\
-    return MakeSimpleAttributeChecker<type##Value,type##Checker> (#type);	\
+    return MakeSimpleAttributeChecker<type##Value,type##Checker> (#type "Value", #type); \
   }									\
 
+#define ATTRIBUTE_CHECKER_IMPLEMENT_WITH_NAME(type,name)                    \
+  Ptr<const AttributeChecker> Make##type##Checker (void)		\
+  {									\
+    return MakeSimpleAttributeChecker<type##Value,type##Checker> (#type "Value", name); \
+  }									\
+
+
 /**
  * \ingroup AttributeHelper
  * \param type the name of the class
--- a/src/core/attribute.h	Thu Apr 17 14:33:45 2008 -0700
+++ b/src/core/attribute.h	Thu Apr 17 15:30:18 2008 -0700
@@ -145,9 +145,28 @@
    *          false otherwise.
    */
   virtual bool Check (const AttributeValue &value) const = 0;
-  virtual std::string GetType (void) const = 0;
-  virtual bool HasTypeConstraints (void) const = 0;
-  virtual std::string GetTypeConstraints (void) const = 0;
+  /**
+   * \returns the c++ fully-qualified typename of the subclass
+   *          of the ns3::AttributeValue base class which is associated
+   *          to this checker.
+   *
+   * A typical return value here is FooValue where Foo is the name of the
+   * type being wrapped.
+   */
+  virtual std::string GetValueTypeName (void) const = 0;
+  /**
+   * \returns true if this checker has information about the underlying
+   *          C++ type, false otherwise.
+   *
+   * If this method returns false, the return value of the GetUnderlyingTypeInformation
+   * method cannot be relied upon.
+   */
+  virtual bool HasUnderlyingTypeInformation (void) const = 0;
+  /**
+   * \returns a human-readable representation of information about
+   *          the underlying C++ type.
+   */
+  virtual std::string GetUnderlyingTypeInformation (void) const = 0;
   /**
    * \returns a new instance of an AttributeValue (wrapper in an Attribute 
    *          instance) which matches the type of the underlying attribute.
--- a/src/core/boolean.cc	Thu Apr 17 14:33:45 2008 -0700
+++ b/src/core/boolean.cc	Thu Apr 17 15:30:18 2008 -0700
@@ -97,6 +97,6 @@
 }
 
 
-ATTRIBUTE_CHECKER_IMPLEMENT (Boolean);
+ATTRIBUTE_CHECKER_IMPLEMENT_WITH_NAME (Boolean,"bool");
 
 } // namespace ns3
--- a/src/core/double.cc	Thu Apr 17 14:33:45 2008 -0700
+++ b/src/core/double.cc	Thu Apr 17 15:30:18 2008 -0700
@@ -43,15 +43,15 @@
 	}
       return v->Get () >= m_minValue && v->Get () <= m_maxValue;
     }
-    virtual std::string GetType (void) const {
-      return m_name;
+    virtual std::string GetValueTypeName (void) const {
+      return "ns3::DoubleValue";
     }
-    virtual bool HasTypeConstraints (void) const {
+    virtual bool HasUnderlyingTypeInformation (void) const {
       return true;
     }
-    virtual std::string GetTypeConstraints (void) const {
+    virtual std::string GetUnderlyingTypeInformation (void) const {
       std::ostringstream oss;
-      oss << m_minValue << ":" << m_maxValue;
+      oss << m_name << " " << m_minValue << ":" << m_maxValue;
       return oss.str ();
     }
     virtual Ptr<AttributeValue> Create (void) const {
--- a/src/core/double.h	Thu Apr 17 14:33:45 2008 -0700
+++ b/src/core/double.h	Thu Apr 17 15:30:18 2008 -0700
@@ -27,7 +27,7 @@
 namespace ns3 {
 
 /**
- * \class DoubleValue
+ * \class ns3::DoubleValue
  * \brief Hold an floating point type
  *
  * \anchor double
--- a/src/core/enum.cc	Thu Apr 17 14:33:45 2008 -0700
+++ b/src/core/enum.cc	Thu Apr 17 15:30:18 2008 -0700
@@ -109,17 +109,17 @@
   return false;
 }
 std::string 
-EnumChecker::GetType (void) const
+EnumChecker::GetValueTypeName (void) const
 {
-  return "EnumValue";
+  return "ns3::EnumValue";
 }
 bool 
-EnumChecker::HasTypeConstraints (void) const
+EnumChecker::HasUnderlyingTypeInformation (void) const
 {
   return true;
 }
 std::string 
-EnumChecker::GetTypeConstraints (void) const
+EnumChecker::GetUnderlyingTypeInformation (void) const
 {
   std::ostringstream oss;
   for (ValueSet::const_iterator i = m_valueSet.begin (); i != m_valueSet.end ();)
--- a/src/core/enum.h	Thu Apr 17 14:33:45 2008 -0700
+++ b/src/core/enum.h	Thu Apr 17 15:30:18 2008 -0700
@@ -57,9 +57,9 @@
   void Add (int v, std::string name);
 
   virtual bool Check (const AttributeValue &value) const;
-  virtual std::string GetType (void) const;
-  virtual bool HasTypeConstraints (void) const;
-  virtual std::string GetTypeConstraints (void) const;
+  virtual std::string GetValueTypeName (void) const;
+  virtual bool HasUnderlyingTypeInformation (void) const;
+  virtual std::string GetUnderlyingTypeInformation (void) const;
   virtual Ptr<AttributeValue> Create (void) const;
   virtual bool Copy (const AttributeValue &src, AttributeValue &dst) const;
 
--- a/src/core/integer.cc	Thu Apr 17 14:33:45 2008 -0700
+++ b/src/core/integer.cc	Thu Apr 17 15:30:18 2008 -0700
@@ -44,15 +44,15 @@
 	}
       return v->Get () >= m_minValue && v->Get () <= m_maxValue;
     }
-    virtual std::string GetType (void) const {
-      return m_name;
+    virtual std::string GetValueTypeName (void) const {
+      return "ns3::IntegerValue";
     }
-    virtual bool HasTypeConstraints (void) const {
+    virtual bool HasUnderlyingTypeInformation (void) const {
       return true;
     }
-    virtual std::string GetTypeConstraints (void) const {
+    virtual std::string GetUnderlyingTypeInformation (void) const {
       std::ostringstream oss;
-      oss << m_minValue << ":" << m_maxValue;
+      oss << m_name << " " << m_minValue << ":" << m_maxValue;
       return oss.str ();
     }
     virtual Ptr<AttributeValue> Create (void) const {
--- a/src/core/integer.h	Thu Apr 17 14:33:45 2008 -0700
+++ b/src/core/integer.h	Thu Apr 17 15:30:18 2008 -0700
@@ -27,7 +27,7 @@
 namespace ns3 {
 
 /**
- * \class IntegerValue
+ * \class ns3::IntegerValue
  * \brief Hold a signed integer type
  *
  * \anchor int8_t
--- a/src/core/object-factory.h	Thu Apr 17 14:33:45 2008 -0700
+++ b/src/core/object-factory.h	Thu Apr 17 15:30:18 2008 -0700
@@ -89,6 +89,11 @@
 std::ostream & operator << (std::ostream &os, const ObjectFactory &factory);
 std::istream & operator >> (std::istream &is, ObjectFactory &factory);
 
+/**
+ * \class ns3::ObjectFactoryValue
+ * \brief hold objects of type ns3::ObjectFactory
+ */
+
 ATTRIBUTE_HELPER_HEADER_2 (ObjectFactory);
 
 } // namespace ns3
--- a/src/core/object-vector.h	Thu Apr 17 14:33:45 2008 -0700
+++ b/src/core/object-vector.h	Thu Apr 17 15:30:18 2008 -0700
@@ -87,13 +87,13 @@
   virtual bool Check (const AttributeValue &value) const {
     return dynamic_cast<const ObjectVectorValue *> (&value) != 0;
   }
-  virtual std::string GetType (void) const {
+  virtual std::string GetValueTypeName (void) const {
     return "ns3::ObjectVectorValue";
   }
-  virtual bool HasTypeConstraints (void) const {
+  virtual bool HasUnderlyingTypeInformation (void) const {
     return true;
   }
-  virtual std::string GetTypeConstraints (void) const {
+  virtual std::string GetUnderlyingTypeInformation (void) const {
     return T::GetTypeId ().GetName ();
   }
   virtual Ptr<AttributeValue> Create (void) const {
--- a/src/core/pointer.h	Thu Apr 17 14:33:45 2008 -0700
+++ b/src/core/pointer.h	Thu Apr 17 15:30:18 2008 -0700
@@ -25,6 +25,9 @@
 
 namespace ns3 {
 
+/**
+ * \brief hold objects of type Ptr<T>
+ */
 class PointerValue : public AttributeValue
 {
 public:
@@ -109,17 +112,16 @@
       }
     return true;
   }
-  virtual std::string GetType (void) const {
-    // XXX: we should be able to return better information
+  virtual std::string GetValueTypeName (void) const {
+    return "ns3::PointerValue";
+  }
+  virtual bool HasUnderlyingTypeInformation (void) const {
+    return true;
+  }
+  virtual std::string GetUnderlyingTypeInformation (void) const {
     TypeId tid = T::GetTypeId ();
     return "Ptr< " + tid.GetName () + " >";
   }
-  virtual bool HasTypeConstraints (void) const {
-    return false;
-  }
-  virtual std::string GetTypeConstraints (void) const {
-    return "";
-  }
   virtual Ptr<AttributeValue> Create (void) const {
     return ns3::Create<PointerValue> ();
   }
--- a/src/core/random-variable.h	Thu Apr 17 14:33:45 2008 -0700
+++ b/src/core/random-variable.h	Thu Apr 17 15:30:18 2008 -0700
@@ -662,6 +662,11 @@
 std::ostream &operator << (std::ostream &os, const RandomVariable &var);
 std::istream &operator >> (std::istream &os, RandomVariable &var);
 
+/**
+ * \class ns3::RandomVariableValue
+ * \brief hold objects of type ns3::RandomVariable
+ */
+
 ATTRIBUTE_VALUE_DEFINE (RandomVariable);
 ATTRIBUTE_CHECKER_DEFINE (RandomVariable);
 ATTRIBUTE_ACCESSOR_DEFINE (RandomVariable);
--- a/src/core/string.cc	Thu Apr 17 14:33:45 2008 -0700
+++ b/src/core/string.cc	Thu Apr 17 15:30:18 2008 -0700
@@ -2,7 +2,7 @@
 
 namespace ns3 {
 
-ATTRIBUTE_CHECKER_IMPLEMENT (String);
+ATTRIBUTE_CHECKER_IMPLEMENT_WITH_NAME (String, "std::string");
 ATTRIBUTE_CONVERTER_IMPLEMENT (String);
 ATTRIBUTE_VALUE_IMPLEMENT_WITH_NAME (std::string, String);
 
--- a/src/core/string.h	Thu Apr 17 14:33:45 2008 -0700
+++ b/src/core/string.h	Thu Apr 17 15:30:18 2008 -0700
@@ -7,7 +7,7 @@
 namespace ns3 {
 
 /**
- * \class StringValue
+ * \class ns3::StringValue
  * \brief hold variables of type string
  *
  * This class can be used to hold variables of type string,
--- a/src/core/type-id.h	Thu Apr 17 14:33:45 2008 -0700
+++ b/src/core/type-id.h	Thu Apr 17 15:30:18 2008 -0700
@@ -380,6 +380,11 @@
 bool operator != (TypeId a, TypeId b);
 bool operator <  (TypeId a, TypeId b);
 
+/**
+ * \class ns3::TypeIdValue
+ * \brief hold objects of type ns3::TypeId
+ */
+
 
 ATTRIBUTE_HELPER_HEADER_2 (TypeId);
 
--- a/src/core/uinteger.cc	Thu Apr 17 14:33:45 2008 -0700
+++ b/src/core/uinteger.cc	Thu Apr 17 15:30:18 2008 -0700
@@ -43,15 +43,15 @@
 	}
       return v->Get () >= m_minValue && v->Get () <= m_maxValue;
     }
-    virtual std::string GetType (void) const {
-      return m_name;
+    virtual std::string GetValueTypeName (void) const {
+      return "ns3::UintegerValue";
     }
-    virtual bool HasTypeConstraints (void) const {
+    virtual bool HasUnderlyingTypeInformation (void) const {
       return true;
     }
-    virtual std::string GetTypeConstraints (void) const {
+    virtual std::string GetUnderlyingTypeInformation (void) const {
       std::ostringstream oss;
-      oss << m_minValue << ":" << m_maxValue;
+      oss << m_name << " " << m_minValue << ":" << m_maxValue;
       return oss.str ();
     }
     virtual Ptr<AttributeValue> Create (void) const {
--- a/src/devices/wifi/ssid.h	Thu Apr 17 14:33:45 2008 -0700
+++ b/src/devices/wifi/ssid.h	Thu Apr 17 15:30:18 2008 -0700
@@ -58,6 +58,11 @@
 std::ostream &operator << (std::ostream &os, const Ssid &ssid);
 std::istream &operator >> (std::istream &is, Ssid &ssid);
 
+/**
+ * \class ns3::SsidValue
+ * \brief hold objects of type ns3::Ssid
+ */
+
 ATTRIBUTE_HELPER_HEADER_2 (Ssid);
 
 } // namespace ns3
--- a/src/devices/wifi/wifi-mode.h	Thu Apr 17 14:33:45 2008 -0700
+++ b/src/devices/wifi/wifi-mode.h	Thu Apr 17 15:30:18 2008 -0700
@@ -118,6 +118,11 @@
 std::ostream & operator << (std::ostream & os, const WifiMode &mode);
 std::istream & operator >> (std::istream &is, WifiMode &mode);
 
+/**
+ * \class ns3::WifiModeValue
+ * \brief hold objects of type ns3::WifiMode
+ */
+
 ATTRIBUTE_HELPER_HEADER_2 (WifiMode);
 
 /**
--- a/src/mobility/rectangle.h	Thu Apr 17 14:33:45 2008 -0700
+++ b/src/mobility/rectangle.h	Thu Apr 17 15:30:18 2008 -0700
@@ -68,6 +68,11 @@
 std::ostream &operator << (std::ostream &os, const Rectangle &rectangle);
 std::istream &operator >> (std::istream &is, Rectangle &rectangle);
 
+/**
+ * \class ns3::RectangleValue
+ * \brief hold objects of type ns3::Rectangle
+ */
+
 ATTRIBUTE_HELPER_HEADER_2 (Rectangle);
 
 } // namespace ns3
--- a/src/mobility/vector.h	Thu Apr 17 14:33:45 2008 -0700
+++ b/src/mobility/vector.h	Thu Apr 17 15:30:18 2008 -0700
@@ -63,6 +63,11 @@
 
 double CalculateDistance (const Vector &a, const Vector &b);
 
+/**
+ * \class ns3::VectorValue
+ * \brief hold objects of type ns3::Vector
+ */
+
 ATTRIBUTE_HELPER_HEADER_2 (Vector);
 
 std::ostream &operator << (std::ostream &os, const Vector &vector);
--- a/src/node/address.h	Thu Apr 17 14:33:45 2008 -0700
+++ b/src/node/address.h	Thu Apr 17 15:30:18 2008 -0700
@@ -166,6 +166,11 @@
   uint8_t m_data[MAX_SIZE];
 };
 
+/**
+ * \class ns3::AddressValue
+ * \brief hold objects of type ns3::Address
+ */
+
 ATTRIBUTE_HELPER_HEADER_2 (Address);
 
 bool operator == (const Address &a, const Address &b);
--- a/src/node/ipv4-address.h	Thu Apr 17 14:33:45 2008 -0700
+++ b/src/node/ipv4-address.h	Thu Apr 17 15:30:18 2008 -0700
@@ -185,6 +185,15 @@
   uint32_t m_mask;
 };
 
+/**
+ * \class ns3::Ipv4AddressValue
+ * \brief hold objects of type ns3::Ipv4Address
+ */
+/**
+ * \class ns3::Ipv4MaskValue
+ * \brief hold objects of type ns3::Ipv4Mask
+ */
+
 ATTRIBUTE_HELPER_HEADER_2 (Ipv4Address);
 ATTRIBUTE_HELPER_HEADER_2 (Ipv4Mask);
 
--- a/src/node/mac48-address.h	Thu Apr 17 14:33:45 2008 -0700
+++ b/src/node/mac48-address.h	Thu Apr 17 15:30:18 2008 -0700
@@ -112,6 +112,11 @@
   uint8_t m_address[6];
 };
 
+/**
+ * \class ns3::Mac48AddressValue
+ * \brief hold objects of type ns3::Mac48Address
+ */
+
 ATTRIBUTE_HELPER_HEADER_2 (Mac48Address);
 
 bool operator == (const Mac48Address &a, const Mac48Address &b);
--- a/src/simulator/nstime.h	Thu Apr 17 14:33:45 2008 -0700
+++ b/src/simulator/nstime.h	Thu Apr 17 15:30:18 2008 -0700
@@ -667,6 +667,12 @@
 typedef TimeUnit<-1> TimeInvert;
 typedef TimeUnit<2> TimeSquare;
 
+/**
+ * \class ns3::TimeValue
+ * \brief hold objects of type ns3::Time
+ */
+
+
 ATTRIBUTE_ACCESSOR_DEFINE (Time);
 ATTRIBUTE_VALUE_DEFINE (Time);
 ATTRIBUTE_CHECKER_DEFINE (Time);
--- a/utils/print-introspected-doxygen.cc	Thu Apr 17 14:33:45 2008 -0700
+++ b/utils/print-introspected-doxygen.cc	Thu Apr 17 15:30:18 2008 -0700
@@ -19,12 +19,12 @@
       os << "<li><b>" << tid.GetAttributeName (j) << "</b>: "
 		<< tid.GetAttributeHelp (j) << std::endl;
       Ptr<const AttributeChecker> checker = tid.GetAttributeChecker (j);
-      os << "  <ul>" << std::endl << "    <li>Type: \\ref " <<  checker->GetType ();
-      if (checker->HasTypeConstraints ())
+      os << "  <ul>" << std::endl << "    <li>Set with class: \\ref " 
+	 <<  checker->GetValueTypeName () << "</li>" << std::endl;
+      if (checker->HasUnderlyingTypeInformation ())
 	{
-	  os << " -> " << checker->GetTypeConstraints ();
+	  os << "    <li>Underlying type: \\ref " << checker->GetUnderlyingTypeInformation () << "</li>" << std::endl;
 	}
-      os << "</li>" << std::endl;
       uint32_t flags = tid.GetAttributeFlags (j);
       Ptr<const AttributeAccessor> accessor = tid.GetAttributeAccessor (j);
       os << "    <li>Flags: ";