diff --git a/src/core/model/attribute-helper.h b/src/core/model/attribute-helper.h index e94fc5dc7..aec10d753 100644 --- a/src/core/model/attribute-helper.h +++ b/src/core/model/attribute-helper.h @@ -37,10 +37,10 @@ namespace ns3 { * the user class can then effectively be made an attribute. * * There are two kinds of helper macros: - * 1) The simple macros. - * - ATTRIBUTE_HELPER_HEADER(type) - * - ATTRIBUTE_HELPER_CPP - * 2) The more complex macros. + * -# The simple macros. + * - ATTRIBUTE_HELPER_HEADER(type) + * - ATTRIBUTE_HELPER_CPP(type) + * -# The more complex macros. * * The simple macros are implemented in terms of the complex * macros and should generally be preferred over the complex macros. @@ -98,6 +98,10 @@ MakeSimpleAttributeChecker (std::string name, std::string underlying) /** * \ingroup attributehelper + * + * Define the attribute accessor functions \c MakeAccessor + * for class \pname{type}. + * * \param type the name of the class * * This macro defines and generates the code for the implementation @@ -108,46 +112,65 @@ MakeSimpleAttributeChecker (std::string name, std::string underlying) */ #define ATTRIBUTE_ACCESSOR_DEFINE(type) \ template \ - Ptr Make ## type ## Accessor (T1 a1) \ + Ptr Make ## type ## Accessor (T1 a1) \ { \ - return MakeAccessorHelper (a1); \ + return MakeAccessorHelper (a1); \ } \ template \ - Ptr Make ## type ## Accessor (T1 a1, T2 a2) \ + Ptr Make ## type ## Accessor (T1 a1, T2 a2) \ { \ - return MakeAccessorHelper (a1, a2); \ + return MakeAccessorHelper (a1, a2); \ } /** * \ingroup attributehelper - * \internal + * + * Declare the attribute value class \pname{name}Value + * for underlying class \pname{type}. + * + * \param type The underlying type. + * \param name The token to use in defining the accessor name. + * + * This macro declares the class \c Value associated with class \c type. + * This macro is typically invoked in the class header file. + * + * This can be used directly for things like plain old data, + * such as \c std::string, to create the attribute value class + * StringValue. */ #define ATTRIBUTE_VALUE_DEFINE_WITH_NAME(type,name) \ - class name ## Value : public AttributeValue \ + class name ## Value : public AttributeValue \ { \ -public: \ - name ## Value (); \ - name ## Value (const type &value); \ + public: \ + name ## Value (); \ + name ## Value (const type &value); \ void Set (const type &value); \ type Get (void) const; \ template \ - bool GetAccessor (T &value) const { \ + bool GetAccessor (T &value) const { \ value = T (m_value); \ return true; \ } \ virtual Ptr Copy (void) const; \ - virtual std::string SerializeToString (Ptr checker) const; \ - virtual bool DeserializeFromString (std::string value, Ptr checker); \ -private: \ + virtual std::string \ + SerializeToString (Ptr checker) const; \ + virtual bool \ + DeserializeFromString (std::string value, \ + Ptr checker); \ + private: \ type m_value; \ }; /** * \ingroup attributehelper + * + * Declare the attribute value class \pname{type}Value + * for the class \pname{type}. + * * \param type the name of the class. * - * This macro defines the class \c typeValue associated to class \c type. + * This macro declares the class \c Value associated to class \c type. * This macro is typically invoked in the class header file. */ #define ATTRIBUTE_VALUE_DEFINE(type) \ @@ -156,67 +179,99 @@ private: \ /** * \ingroup attributehelper + * + * Define the conversion operators class \pname{type} and + * Attribute instances. + * * \param type the name of the class * * This macro defines the conversion operators for class \c type to and * from instances of type Attribute. * Typically invoked in the class header file. + * + * \internal + * This appears to be unused. */ #define ATTRIBUTE_CONVERTER_DEFINE(type) /** * \ingroup attributehelper + * + * Declare the AttributeChecker class \pname{type}Checker + * and the \c MakeChecker function for class \pname{type}. + * * \param type the name of the class * - * This macro defines the \c typeChecker class and the associated + * This macro declares the \pname{type}Checker class and the associated * \c MakeChecker function. - * Typically invoked in the class header file.. + * + * (Note that the \pname{type}Checker class needs no implementation + * since it just inherits all its implementation from AttributeChecker.) + * + * Typically invoked in the class header file. */ -#define ATTRIBUTE_CHECKER_DEFINE(type) \ - class type ## Checker : public AttributeChecker {}; \ - Ptr Make ## type ## Checker (void); \ +#define ATTRIBUTE_CHECKER_DEFINE(type) \ + class type ## Checker : public AttributeChecker {}; \ + Ptr Make ## type ## Checker (void) /** * \ingroup attributehelper - * \internal + * + * Define the class methods belonging to + * the attribute value class \pname{name}Value + * of the underlying class \pname{type}. + * + * \param type The underlying type. + * \param name The token to use in defining the accessor name. + * + * This macro implements the \pname{type}Value class methods + * (including the \pname{type}Value::SerializeToString + * and \pname{type}Value::DeserializeFromString methods). + * + * Typically invoked in the source file. */ #define ATTRIBUTE_VALUE_IMPLEMENT_WITH_NAME(type,name) \ - name ## Value::name ## Value () \ + name ## Value::name ## Value () \ : m_value () {} \ - name ## Value::name ## Value (const type &value) \ - : m_value (value) {} \ - void name ## Value::Set (const type &v) { \ + name ## Value::name ## Value (const type &value) \ + : m_value (value) {} \ + void name ## Value::Set (const type &v) { \ m_value = v; \ } \ - type name ## Value::Get (void) const { \ + type name ## Value::Get (void) const { \ return m_value; \ } \ Ptr \ - name ## Value::Copy (void) const { \ - return ns3::Create (*this); \ + name ## Value::Copy (void) const { \ + return ns3::Create (*this); \ } \ - std::string \ - name ## Value::SerializeToString (Ptr checker) const { \ - std::ostringstream oss; \ - oss << m_value; \ - return oss.str (); \ + std::string name ## Value::SerializeToString \ + (Ptr checker) const { \ + std::ostringstream oss; \ + oss << m_value; \ + return oss.str (); \ } \ - bool \ - name ## Value::DeserializeFromString (std::string value, Ptr checker) { \ - std::istringstream iss; \ - iss.str (value); \ - iss >> m_value; \ - return !iss.bad () && !iss.fail (); \ + bool name ## Value::DeserializeFromString \ + (std::string value, Ptr checker) { \ + std::istringstream iss; \ + iss.str (value); \ + iss >> m_value; \ + return !iss.bad () && !iss.fail (); \ } /** * \ingroup attributehelper + * + * Define the class methods belonging to + * attribute value class \pname{type}Value for class \pname{type}. + * * \param type the name of the class. * - * This macro implements the \c typeValue class (including the - * \c typeValue::SerializeToString and \c typeValue::DeserializeFromString - * methods). + * This macro implements the \pname{type}Value class methods + * (including the \pname{type}Value::SerializeToString + * and \pname{type}Value::DeserializeFromString methods). + * * Typically invoked in the source file. */ #define ATTRIBUTE_VALUE_IMPLEMENT(type) \ @@ -225,31 +280,58 @@ private: \ /** * \ingroup attributehelper + * + * Define the \c MakeChecker function for class \pname{type}. + * * \param type the name of the class * * This macro implements the \c MakeChecker function. + * * Typically invoked in the source file.. */ #define ATTRIBUTE_CHECKER_IMPLEMENT(type) \ - Ptr Make ## type ## Checker (void) \ - { \ - return MakeSimpleAttributeChecker (# type "Value", # type); \ + Ptr Make ## type ## Checker (void) { \ + return MakeSimpleAttributeChecker \ + (# type "Value", # type); \ } \ /** * \ingroup attributehelper - * \internal + * + * Define the \c MakeChecker function for class \pname{type}. + * + * \param type the name of the class. + * \param name the string name of the underlying type. + * + * This macro implements the \c MakeChecker function + * for class \pname{type}. + * + * Typically invoked in the source file.. */ -#define ATTRIBUTE_CHECKER_IMPLEMENT_WITH_NAME(type,name) \ - Ptr Make ## type ## Checker (void) \ - { \ - return MakeSimpleAttributeChecker (# type "Value", name); \ +#define ATTRIBUTE_CHECKER_IMPLEMENT_WITH_NAME(type,name) \ + Ptr Make ## type ## Checker (void) { \ + return MakeSimpleAttributeChecker \ + (# type "Value", name); \ } \ /** * \ingroup attributehelper + * + * Declare the attribute value, accessor and checkers for class \pname{type} + * * \param type the name of the class * + * This macro declares: + * + * - The attribute value class \pname{type}Value, + * + * - The attribute accessor functions \c MakeAccessor, + * + * - The AttributeChecker class \pname{type}Checker + * and the \c MakeChecker function, + * + * for class \pname{type}. + * * This macro should be invoked outside of the class * declaration in its public header. */ @@ -260,8 +342,19 @@ private: \ /** * \ingroup attributehelper + * + * Define the attribute value, accessor and checkers for class \pname{type} + * * \param type the name of the class * + * This macro implements + * + * - The \pname{type}Value class methods, + * + * - The \c MakeChecker function, + * + * for class \pname{type}. + * * This macro should be invoked from the class implementation file. */ #define ATTRIBUTE_HELPER_CPP(type) \ diff --git a/src/core/model/callback.h b/src/core/model/callback.h index 8fb2f8840..40201825b 100644 --- a/src/core/model/callback.h +++ b/src/core/model/callback.h @@ -68,7 +68,7 @@ struct CallbackTraits /** * \ingroup callback * \defgroup callbackimpl Callback Implementation - * CallbackImpl classes + * Callback implementation classes */ /** * \ingroup callbackimpl @@ -1695,10 +1695,8 @@ private: CallbackBase m_value; //!< the CallbackBase }; -/** Attribute helpers @{ */ ATTRIBUTE_ACCESSOR_DEFINE (Callback); ATTRIBUTE_CHECKER_DEFINE (Callback); -/**@}*/ } // namespace ns3 diff --git a/src/core/model/nstime.h b/src/core/model/nstime.h index 6118d5f59..59ecc8ac9 100644 --- a/src/core/model/nstime.h +++ b/src/core/model/nstime.h @@ -531,7 +531,7 @@ private: * Record all instances of Time, so we can rescale them when * the resolution changes. * - * \intern + * \internal * * We use a std::set so we can remove the record easily when * ~Time() is called. @@ -551,7 +551,7 @@ private: * Record of outstanding Time objects which will need conversion * when the resolution is set. * - * \intern + * \internal * * Use a classic static variable so we can check in Time ctors * without a function call. @@ -576,7 +576,7 @@ private: /** * Remove all MarkedTimes. * - * \intern + * \internal * Has to be visible to the Simulator class, hence the friending. */ static void ClearMarkedTimes (); @@ -617,7 +617,7 @@ private: }; // class Time -// Force static initialization of Time +/// Force static initialization of Time static bool NS_UNUSED_GLOBAL (g_TimeStaticInit) = Time::StaticInit (); inline bool @@ -697,7 +697,6 @@ inline Time &operator -= (Time &lhs, const Time &rhs) } /** - * \anchor ns3-Time-Abs * \relates ns3::TimeUnit * Absolute value function for Time * \param time the input value @@ -708,7 +707,6 @@ inline Time Abs (const Time &time) return Time ((time.m_data < 0) ? -time.m_data : time.m_data); } /** - * \anchor ns3-Time-Max * \relates ns3::TimeUnit * \param ta the first value * \param tb the seconds value diff --git a/src/core/model/string.h b/src/core/model/string.h index 8aba4b9ae..e2dd77d5e 100644 --- a/src/core/model/string.h +++ b/src/core/model/string.h @@ -7,7 +7,7 @@ namespace ns3 { /** - * \ingroup attribute + * \ingroup AttributeList * * \class ns3::StringValue * \brief hold variables of type string @@ -15,7 +15,6 @@ namespace ns3 { * This class can be used to hold variables of type string, * that is, either char * or std::string. */ - ATTRIBUTE_VALUE_DEFINE_WITH_NAME (std::string, String); ATTRIBUTE_ACCESSOR_DEFINE (String); ATTRIBUTE_CHECKER_DEFINE (String); diff --git a/src/core/model/unix-system-condition.cc b/src/core/model/unix-system-condition.cc index 08c0a69a4..b80be899b 100644 --- a/src/core/model/unix-system-condition.cc +++ b/src/core/model/unix-system-condition.cc @@ -30,7 +30,8 @@ NS_LOG_COMPONENT_DEFINE ("SystemCondition"); namespace ns3 { class SystemConditionPrivate { -public: +public: + /// Conversion from ns to s. static const uint64_t NS_PER_SEC = (uint64_t)1000000000; SystemConditionPrivate (); diff --git a/src/core/model/wall-clock-synchronizer.h b/src/core/model/wall-clock-synchronizer.h index 64755e008..0b15c3371 100644 --- a/src/core/model/wall-clock-synchronizer.h +++ b/src/core/model/wall-clock-synchronizer.h @@ -67,6 +67,7 @@ public: static const uint64_t US_PER_NS = (uint64_t)1000; static const uint64_t US_PER_SEC = (uint64_t)1000000; + /// Conversion from ns to s. static const uint64_t NS_PER_SEC = (uint64_t)1000000000; protected: diff --git a/src/mpi/model/null-message-mpi-interface.h b/src/mpi/model/null-message-mpi-interface.h index 397204c5f..6575ee52c 100644 --- a/src/mpi/model/null-message-mpi-interface.h +++ b/src/mpi/model/null-message-mpi-interface.h @@ -138,7 +138,6 @@ public: * uint32_t node id of destination * unit32_t dev id on destination * uint8_t[] serialized packet - * \endinternal */ virtual void SendPacket (Ptr p, const Time &rxTime, uint32_t node, uint32_t dev); /** @@ -164,7 +163,6 @@ public: * uint64_t guarantee time * uint32_t 0 must be zero for Null Message * uint32_t 0 must be zero for Null Message - * \endinternal */ static void SendNullMessage (const Time& guaranteeUpdate, Ptr bundle); /**