# HG changeset patch # User Mathieu Lacage # Date 1208471418 25200 # Node ID 9d05d2a95dfae932d4c94b09e1145ef7a794b0a5 # Parent d6b2d00acab21167a9e6302c79cfaca4cc088dee improve the auto-generated doxygen output. diff -r d6b2d00acab2 -r 9d05d2a95dfa doc/doxygen.conf --- 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 diff -r d6b2d00acab2 -r 9d05d2a95dfa src/common/data-rate.h --- 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); /** diff -r d6b2d00acab2 -r 9d05d2a95dfa src/core/attribute-helper.h --- 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 Ptr -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 (&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 Create (void) const { return ns3::Create (); @@ -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 (checker, false); } @@ -108,7 +110,7 @@ return MakeAccessorHelper (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 Make##type##Checker (void) \ { \ - return MakeSimpleAttributeChecker (#type); \ + return MakeSimpleAttributeChecker (#type "Value", #type); \ } \ +#define ATTRIBUTE_CHECKER_IMPLEMENT_WITH_NAME(type,name) \ + Ptr Make##type##Checker (void) \ + { \ + return MakeSimpleAttributeChecker (#type "Value", name); \ + } \ + + /** * \ingroup AttributeHelper * \param type the name of the class diff -r d6b2d00acab2 -r 9d05d2a95dfa src/core/attribute.h --- 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. diff -r d6b2d00acab2 -r 9d05d2a95dfa src/core/boolean.cc --- 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 diff -r d6b2d00acab2 -r 9d05d2a95dfa src/core/double.cc --- 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 Create (void) const { diff -r d6b2d00acab2 -r 9d05d2a95dfa src/core/double.h --- 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 diff -r d6b2d00acab2 -r 9d05d2a95dfa src/core/enum.cc --- 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 ();) diff -r d6b2d00acab2 -r 9d05d2a95dfa src/core/enum.h --- 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 Create (void) const; virtual bool Copy (const AttributeValue &src, AttributeValue &dst) const; diff -r d6b2d00acab2 -r 9d05d2a95dfa src/core/integer.cc --- 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 Create (void) const { diff -r d6b2d00acab2 -r 9d05d2a95dfa src/core/integer.h --- 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 diff -r d6b2d00acab2 -r 9d05d2a95dfa src/core/object-factory.h --- 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 diff -r d6b2d00acab2 -r 9d05d2a95dfa src/core/object-vector.h --- 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 (&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 Create (void) const { diff -r d6b2d00acab2 -r 9d05d2a95dfa src/core/pointer.h --- 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 + */ 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 Create (void) const { return ns3::Create (); } diff -r d6b2d00acab2 -r 9d05d2a95dfa src/core/random-variable.h --- 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); diff -r d6b2d00acab2 -r 9d05d2a95dfa src/core/string.cc --- 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); diff -r d6b2d00acab2 -r 9d05d2a95dfa src/core/string.h --- 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, diff -r d6b2d00acab2 -r 9d05d2a95dfa src/core/type-id.h --- 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); diff -r d6b2d00acab2 -r 9d05d2a95dfa src/core/uinteger.cc --- 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 Create (void) const { diff -r d6b2d00acab2 -r 9d05d2a95dfa src/devices/wifi/ssid.h --- 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 diff -r d6b2d00acab2 -r 9d05d2a95dfa src/devices/wifi/wifi-mode.h --- 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); /** diff -r d6b2d00acab2 -r 9d05d2a95dfa src/mobility/rectangle.h --- 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 diff -r d6b2d00acab2 -r 9d05d2a95dfa src/mobility/vector.h --- 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); diff -r d6b2d00acab2 -r 9d05d2a95dfa src/node/address.h --- 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); diff -r d6b2d00acab2 -r 9d05d2a95dfa src/node/ipv4-address.h --- 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); diff -r d6b2d00acab2 -r 9d05d2a95dfa src/node/mac48-address.h --- 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); diff -r d6b2d00acab2 -r 9d05d2a95dfa src/simulator/nstime.h --- 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); diff -r d6b2d00acab2 -r 9d05d2a95dfa utils/print-introspected-doxygen.cc --- 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 << "
  • " << tid.GetAttributeName (j) << ": " << tid.GetAttributeHelp (j) << std::endl; Ptr checker = tid.GetAttributeChecker (j); - os << "
      " << std::endl << "
    • Type: \\ref " << checker->GetType (); - if (checker->HasTypeConstraints ()) + os << "
        " << std::endl << "
      • Set with class: \\ref " + << checker->GetValueTypeName () << "
      • " << std::endl; + if (checker->HasUnderlyingTypeInformation ()) { - os << " -> " << checker->GetTypeConstraints (); + os << "
      • Underlying type: \\ref " << checker->GetUnderlyingTypeInformation () << "
      • " << std::endl; } - os << "" << std::endl; uint32_t flags = tid.GetAttributeFlags (j); Ptr accessor = tid.GetAttributeAccessor (j); os << "
      • Flags: ";