diff --git a/doc/doxygen.conf b/doc/doxygen.conf index ebc874d59..a0170b302 100644 --- a/doc/doxygen.conf +++ b/doc/doxygen.conf @@ -358,7 +358,7 @@ TYPEDEF_HIDES_STRUCT = YES # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, # corresponding to a cache size of 2^16 = 65536 symbols. -SYMBOL_CACHE_SIZE = 0 +SYMBOL_CACHE_SIZE = 1 # Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be # set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given @@ -1660,10 +1660,25 @@ INCLUDE_FILE_PATTERNS = # undefined via #undef or recursively expanded use the := operator # instead of the = operator. -# Function like macros at file global scope typically need to be here: +# ns-3: +# +# We predefine NS3_ASSERT_ENABLE and NS3_LOG_ENABLE so doxygen sees +# the working definitions. +# +# Function like macros at file global scope typically need to be here, +# since doxygen confuses invocations of these macros for function +# definitions. +# +# We also list the generic logging macros to suppress the "Referenced by" +# sections. Since these macros are so heavily used the references are +# pages long. -PREDEFINED = NS_LOG_COMPONENT_DEFINE()=1 \ - NS_OBJECT_ENSURE_REGISTERED()=1 +PREDEFINED = \ + NS3_ASSERT_ENABLE \ + NS3_LOG_ENABLE \ + NS_LOG_COMPONENT_DEFINE()=1 \ + NS_LOG_COMPONENT_DEFINE_MASK()=1 \ + NS_OBJECT_ENSURE_REGISTERED()=1 \ # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. diff --git a/doc/main.h b/doc/main.h index 8f9eed9c1..93d5f39eb 100644 --- a/doc/main.h +++ b/doc/main.h @@ -71,3 +71,28 @@ * ns3 namespace. */ +// Macros defined by the build system. +// +// These have to be visible for doxygen to document them, +// so we put them here in a file only seen by doxygen, not the compiler. +/** + * \ingroup assert + * + * \def NS3_ASSERT_ENABLE + * + * Enable asserts at compile time. + * + * This is normally set by `./waf configure --build-profile=debug`. + */ +#define NS3_ASSERT_ENABLE + +/** + * \ingroup logging + * + * \def NS3_LOG_ENABLE + * + * Enable logging at compile time. + * + * This is normally set by `./waf configure --build-profile=debug`. + */ +#define NS3_LOG_ENABLE diff --git a/doc/modules b/doc/modules index 11d7e1eb8..7f25aec15 100644 --- a/doc/modules +++ b/doc/modules @@ -1,33 +1,42 @@ /** * @anchor modules_anchor * - * @defgroup constructs Introspected Lists - * \brief These are lists of useful items found by examining the type system. - * * @defgroup constants Constants * @brief Constants you can change * * @defgroup utils Utils * @brief The utils directory is for various programs and scripts related * to code coverage, test suites, style checking, and benchmarking. - * + */ +/** * @defgroup core Core * \brief The "core" module contains: - * - a time management class to hold a time and convert between various time units: ns3::Time - * - a scheduler base class used to implement new simulation event schedulers: + * - a time management class to hold a time and convert between various + * time units: ns3::Time + * - a scheduler base class used to implement new simulation event + * schedulers: * ns3::Scheduler and ns3::SchedulerFactory - * - a simulator class used to create, schedule and cancel events: ns3::Simulator + * - a simulator class used to create, schedule and cancel events: + * ns3::Simulator * - a Functor class: ns3::Callback - * - an os-independent interface to get access to the elapsed wall clock time: ns3::SystemWallClockMs - * - a class to register regression tests with the test manager: ns3::Test and ns3::TestManager - * - debugging facilities: \ref logging, \ref assert + * - an os-independent interface to get access to the elapsed wall clock + * time: ns3::SystemWallClockMs + * - a class to register regression tests with the test manager: ns3::Test + * and ns3::TestManager + * - debugging facilities: \ref debugging * - \ref randomvariable - * - a base class for objects which need to support per-instance "attributes" and - * trace sources: ns3::ObjectBase + * - a base class for objects which need to support per-instance + * "attributes" and trace sources: ns3::ObjectBase * - a base class for objects which need to support reference counting * and dynamic object aggregation: ns3::Object - * - a smart-pointer class ns3::Ptr designed to work together with ns3::Object - * - a configuration class used to set and control all attributes and trace sources - * in a simulation: ns3::Config. - * + * - a smart-pointer class ns3::Ptr designed to work together with + * ns3::Object + * - a configuration class used to set and control all attributes and + * trace sources in a simulation: ns3::Config. + */ +/** + * @ingroup core + * @defgroup debugging Debugging tools + * + * @brief Assertions, breakpoints, logging, and abnormal program termination */ diff --git a/src/core/model/abort.h b/src/core/model/abort.h index 6796aa17a..d91e3d2e3 100644 --- a/src/core/model/abort.h +++ b/src/core/model/abort.h @@ -24,7 +24,8 @@ #include "fatal-error.h" /** - * \ingroup debugging + * \ingroup fatal + * * \brief Abnormal program termination * * \param msg message to output when this macro is hit. @@ -48,7 +49,8 @@ /** - * \ingroup debugging + * \ingroup fatal + * * \brief Abnormal program termination if cond is true. * * \param cond condition to be evaluated. @@ -76,7 +78,8 @@ } while (false) /** - * \ingroup debugging + * \ingroup fatal + * * \brief Abnormal program termination if cond is true. * * \param cond condition to be evaluated. @@ -105,7 +108,8 @@ } while (false) /** - * \ingroup debugging + * \ingroup fatal + * * \brief Abnormal program termination if cond is false. * * \param cond condition to be evaluated. @@ -118,7 +122,8 @@ NS_ABORT_IF (!(cond)) /** - * \ingroup debugging + * \ingroup fatal + * * \brief Abnormal program termination if cond is false. * * \param cond condition to be evaluated. diff --git a/src/core/model/assert.h b/src/core/model/assert.h index 8b2f4652c..cb004f4ff 100644 --- a/src/core/model/assert.h +++ b/src/core/model/assert.h @@ -21,21 +21,11 @@ #ifndef NS_ASSERT_H #define NS_ASSERT_H -#ifdef NS3_ASSERT_ENABLE - -#include - -#include "fatal-error.h" - -/** - * \ingroup core - * \defgroup debugging Debugging - */ /** * \ingroup debugging - * \defgroup assert Assert + * \defgroup assert Assertions * - * \brief assert functions and macros + * \brief Assert functions and macros * * The assert macros are used to verify * at runtime that a certain condition is true. If it is @@ -53,13 +43,20 @@ * builds, use NS_ABORT_UNLESS and NS_ABORT_MSG_UNLESS. */ +#ifdef NS3_ASSERT_ENABLE + +#include + +#include "fatal-error.h" + /** * \ingroup assert - * \param condition condition to verify. * * At runtime, in debugging builds, if this condition is not * true, the program prints the source file, line number and * unverified condition and halts by calling std::terminate + * + * \param condition condition to verify. */ #define NS_ASSERT(condition) \ do \ @@ -76,12 +73,13 @@ /** * \ingroup assert - * \param condition condition to verify. - * \param message message to output * * At runtime, in debugging builds, if this condition is not * true, the program prints the message to output and * halts by calling std::terminate. + * + * \param condition condition to verify. + * \param message message to output */ #define NS_ASSERT_MSG(condition, message) \ do \ diff --git a/src/core/model/attribute-helper.h b/src/core/model/attribute-helper.h index aec10d753..1880a239f 100644 --- a/src/core/model/attribute-helper.h +++ b/src/core/model/attribute-helper.h @@ -99,13 +99,13 @@ MakeSimpleAttributeChecker (std::string name, std::string underlying) /** * \ingroup attributehelper * - * Define the attribute accessor functions \c MakeAccessor + * Define the attribute accessor functions \c MakeTypeAccessor * for class \pname{type}. * * \param type the name of the class * * This macro defines and generates the code for the implementation - * of the \c MakeAccessor template functions. This macro is typically + * of the \c MakeTypeAccessor template functions. This macro is typically * invoked in a class header to allow users of this class to view and * use the template functions defined here. This macro is implemented * through the helper templates functions ns3::MakeAccessorHelper<>. @@ -128,10 +128,10 @@ MakeSimpleAttributeChecker (std::string name, std::string underlying) * Declare the attribute value class \pname{name}Value * for underlying class \pname{type}. * - * \param type The underlying type. + * \param type The underlying type name * \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 declares the class \c TypeValue 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, @@ -165,16 +165,16 @@ MakeSimpleAttributeChecker (std::string name, std::string underlying) /** * \ingroup attributehelper * - * Declare the attribute value class \pname{type}Value - * for the class \pname{type}. + * Declare the attribute value class \pname{Name}Value + * for the class \pname{Name} * - * \param type the name of the class. + * \param Name the name of the class. * - * This macro declares the class \c Value associated to class \c type. + * This macro declares the class \c NameValue associated to class \c Name. * This macro is typically invoked in the class header file. */ -#define ATTRIBUTE_VALUE_DEFINE(type) \ - ATTRIBUTE_VALUE_DEFINE_WITH_NAME (type,type) +#define ATTRIBUTE_VALUE_DEFINE(Name) \ + ATTRIBUTE_VALUE_DEFINE_WITH_NAME (Name,Name) /** @@ -198,12 +198,12 @@ MakeSimpleAttributeChecker (std::string name, std::string underlying) * \ingroup attributehelper * * Declare the AttributeChecker class \pname{type}Checker - * and the \c MakeChecker function for class \pname{type}. + * and the \c MakeTypeChecker function for class \pname{type}. * * \param type the name of the class * * This macro declares the \pname{type}Checker class and the associated - * \c MakeChecker function. + * \c MakeTypeChecker function. * * (Note that the \pname{type}Checker class needs no implementation * since it just inherits all its implementation from AttributeChecker.) @@ -222,7 +222,7 @@ MakeSimpleAttributeChecker (std::string name, std::string underlying) * the attribute value class \pname{name}Value * of the underlying class \pname{type}. * - * \param type The underlying type. + * \param type The underlying type name * \param name The token to use in defining the accessor name. * * This macro implements the \pname{type}Value class methods @@ -281,11 +281,11 @@ MakeSimpleAttributeChecker (std::string name, std::string underlying) /** * \ingroup attributehelper * - * Define the \c MakeChecker function for class \pname{type}. + * Define the \c MakeTypeChecker function for class \pname{type}. * * \param type the name of the class * - * This macro implements the \c MakeChecker function. + * This macro implements the \c MakeTypeChecker function. * * Typically invoked in the source file.. */ @@ -298,12 +298,12 @@ MakeSimpleAttributeChecker (std::string name, std::string underlying) /** * \ingroup attributehelper * - * Define the \c MakeChecker function for class \pname{type}. + * Define the \c MakeTypeChecker 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 + * This macro implements the \c MakeTypeChecker function * for class \pname{type}. * * Typically invoked in the source file.. @@ -325,10 +325,10 @@ MakeSimpleAttributeChecker (std::string name, std::string underlying) * * - The attribute value class \pname{type}Value, * - * - The attribute accessor functions \c MakeAccessor, + * - The attribute accessor functions \c MakeTypeAccessor, * * - The AttributeChecker class \pname{type}Checker - * and the \c MakeChecker function, + * and the \c MakeTypeChecker function, * * for class \pname{type}. * @@ -351,7 +351,7 @@ MakeSimpleAttributeChecker (std::string name, std::string underlying) * * - The \pname{type}Value class methods, * - * - The \c MakeChecker function, + * - The \c MakeTypeChecker function, * * for class \pname{type}. * diff --git a/src/core/model/breakpoint.h b/src/core/model/breakpoint.h index 56e146027..79361a4ca 100644 --- a/src/core/model/breakpoint.h +++ b/src/core/model/breakpoint.h @@ -36,10 +36,17 @@ namespace ns3 { /** * \ingroup debugging + * \defgroup breakpoint Breakpoints + * + * \brief Trigger a debugger breakpoint. + */ + +/** + * \ingroup breakpoint * * Inserts a breakpoint instruction (or equivalent system call) into - * the code for selected machines. When an NS_ASSERT cannot verify its condition, - * this macro is used. Falls back to calling + * the code for selected machines. When an NS_ASSERT cannot verify + * its condition, this macro is used. Falls back to calling * AssertBreakpoint() for architectures where breakpoint assembly * instructions are not supported. */ @@ -57,7 +64,7 @@ namespace ns3 { #endif /** - * \ingroup debugging + * \ingroup breakpoint * * \brief fallback breakpoint function * diff --git a/src/core/model/cairo-wideint.c b/src/core/model/cairo-wideint.c index 921e0bd4c..2e9d66467 100644 --- a/src/core/model/cairo-wideint.c +++ b/src/core/model/cairo-wideint.c @@ -667,7 +667,7 @@ _cairo_int128_divrem (cairo_int128_t num, cairo_int128_t den) * dividend and 64 bit divisor. If the quotient doesn't fit into 32 * bits then the returned remainder is equal to the divisor, and the * quotient is the largest representable 64 bit integer. It is an - * error to call this function with the high 32 bits of @num being + * error to call this function with the high 32 bits of `num' being * non-zero. */ cairo_uquorem64_t _cairo_uint_96by64_32x64_divrem (cairo_uint128_t num, diff --git a/src/core/model/callback.h b/src/core/model/callback.h index 40201825b..2b9583d57 100644 --- a/src/core/model/callback.h +++ b/src/core/model/callback.h @@ -35,6 +35,10 @@ namespace ns3 { /** * \ingroup core * \defgroup callback Callbacks + * \brief Wrap functions, objects, and arguments into self contained callbacks. + * + * Wrapped callbacks are at the heart of scheduling events in the + * simulator. */ /** * \ingroup callback @@ -1658,12 +1662,14 @@ namespace ns3 { class CallbackValue : public AttributeValue { public: + /** Constructor */ CallbackValue (); /** * Copy constructor * \param base Callback to copy */ - CallbackValue (const CallbackBase &base); + CallbackValue (const CallbackBase &base); + /** Destructor */ virtual ~CallbackValue (); /** \param base the Callbackbase to use */ void Set (CallbackBase base); diff --git a/src/core/model/command-line.h b/src/core/model/command-line.h index acfb4d957..e920ff008 100644 --- a/src/core/model/command-line.h +++ b/src/core/model/command-line.h @@ -353,12 +353,14 @@ private: /** * Handler for \c \-\-PrintAttributes: print the attributes for a given type. * + * \param os the output stream. * \param type the TypeId whose Attributes should be displayed */ void PrintAttributes (std::ostream &os, const std::string &type) const; /** * Handler for \c \-\-PrintGroup: print all types belonging to a given group. * + * \param os the output stream. * \param group the name of the TypeId group to display */ void PrintGroup (std::ostream &os, const std::string &group) const; diff --git a/src/core/model/fatal-error.h b/src/core/model/fatal-error.h index 1f3fb6b84..e5fc65ea7 100644 --- a/src/core/model/fatal-error.h +++ b/src/core/model/fatal-error.h @@ -28,7 +28,29 @@ #include "fatal-impl.h" /** - * \ingroup debugging + * \ingroup core + * \defgroup fatal Fatal Error Handlers + * + * \brief Functions to help clean up when a fatal error + * is encountered. + * + * The functions in this group are used to perform + * limited clean up, like flushing active streams, when + * fatal errors are encountered (through assertion fail, + * calls to NS_ABORT_* or calls to NS_FATAL_ERROR). + * + * Currently, other than flushing active ostreams, these + * functions does not interfere with outside memory. There + * is still a residual risk that invalid ostream + * pointers may be present, and may corrupt the memory + * on the attempt to execute the flush() function. + */ + + +/** + * \ingroup fatal + * \private + * * \brief fatal error handling * * When this macro is hit at runtime, details of filename @@ -52,7 +74,8 @@ while (false) /** - * \ingroup debugging + * \ingroup fatal + * * \brief fatal error handling * * \param msg message to output when this macro is hit. diff --git a/src/core/model/fatal-impl.h b/src/core/model/fatal-impl.h index 183a29321..6344228f5 100644 --- a/src/core/model/fatal-impl.h +++ b/src/core/model/fatal-impl.h @@ -23,30 +23,11 @@ #include -/** - * \ingroup debugging - * \defgroup fatalHandler Fatal Error Handler - * - * \brief Functions to help clean up when fatal error - * is encountered. - * - * The functions in this group are used to perform - * limited clean up, like flushing active streams, when - * fatal error are encountered (through assertion fail, - * calls to NS_ABORT_* and calls to NS_FATAL_ERROR. - * - * Currently, other than flushing active ostreams, these - * functions does not interfere with outside memory. There - * is still a residual risk that may be invalid ostream - * pointers may be present, and may corrupt the memory - * on the attempt to execute the flush() function. - */ - namespace ns3 { namespace FatalImpl { /** - * \ingroup fatalHandler + * \ingroup fatal * \param stream The stream to be flushed on abnormal exit. * * \brief Register a stream to be flushed on abnormal exit. @@ -60,7 +41,7 @@ namespace FatalImpl { void RegisterStream (std::ostream* stream); /** - * \ingroup fatalHandler + * \ingroup fatal * \param stream The stream to be unregistered. * * \brief Unregister a stream for flushing on abnormal exit. @@ -74,7 +55,7 @@ void RegisterStream (std::ostream* stream); void UnregisterStream (std::ostream* stream); /** - * \ingroup fatalHandler + * \ingroup fatal * * \brief Flush all currently registered streams. * diff --git a/src/core/model/hash.h b/src/core/model/hash.h index eb39a5ad9..898338aaf 100644 --- a/src/core/model/hash.h +++ b/src/core/model/hash.h @@ -35,6 +35,8 @@ namespace ns3 { /** * \ingroup core * \defgroup hash Hash Functions + * + * \brief Generic Hash function interface */ /** * \ingroup hash @@ -70,7 +72,7 @@ namespace ns3 { * offer \c unsigned. * * Longer hashes require returning a byte buffer of some sort, - * but our \ref buffer class seems a bit overkill for this case. + * but our \ref Buffer class seems a bit overkill for this case. * */ class Hasher diff --git a/src/core/model/log.h b/src/core/model/log.h index c5b22a838..08cc30dff 100644 --- a/src/core/model/log.h +++ b/src/core/model/log.h @@ -31,6 +31,7 @@ namespace ns3 { /** * \ingroup debugging * \defgroup logging Logging + * * \brief Logging functions and macros * * LOG functionality: macros which allow developers to @@ -59,7 +60,6 @@ namespace ns3 { * Use NS_LOG_FUNCTION_NOARGS() only in static functions. */ - /** * \ingroup logging * @@ -97,47 +97,53 @@ enum LogLevel { }; /** - * \param name a log component name - * \param level a logging level * \ingroup logging * * Enable the logging output associated with that log component. + * * The logging output can be later disabled with a call * to ns3::LogComponentDisable. * * Same as running your program with the NS_LOG environment * variable set as NS_LOG='name=level' + * + * \param name a log component name + * \param level a logging level */ void LogComponentEnable (char const *name, enum LogLevel level); /** - * \param level a logging level * \ingroup logging * * Enable the logging output for all registered log components. * * Same as running your program with the NS_LOG environment * variable set as NS_LOG='*=level' + * + * \param level a logging level */ void LogComponentEnableAll (enum LogLevel level); /** - * \param name a log component name - * \param level a logging level * \ingroup logging * * Disable the logging output associated with that log component. + * * The logging output can be later re-enabled with a call * to ns3::LogComponentEnable. + * + * \param name a log component name + * \param level a logging level */ void LogComponentDisable (char const *name, enum LogLevel level); /** - * \param level a logging level * \ingroup logging * * Disable all logging for all components. + * + * \param level a logging level */ void LogComponentDisableAll (enum LogLevel level); @@ -164,7 +170,9 @@ void LogComponentDisableAll (enum LogLevel level); /** * \ingroup logging * - * Define a logging component with a default mask. + * Define a logging component with a mask. + * + * See LogComponent(). * * \param name a string * \param mask the default mask @@ -175,6 +183,8 @@ void LogComponentDisableAll (enum LogLevel level); /** * \ingroup logging * Append the simulation time to a log message. + * \internal + * Logging implementation macro; should not be called directly. */ #define NS_LOG_APPEND_TIME_PREFIX \ if (g_log.IsEnabled (ns3::LOG_PREFIX_TIME)) \ @@ -190,6 +200,8 @@ void LogComponentDisableAll (enum LogLevel level); /** * \ingroup logging * Append the simulation node id to a log message. + * \internal + * Logging implementation macro; should not be called directly. */ #define NS_LOG_APPEND_NODE_PREFIX \ if (g_log.IsEnabled (ns3::LOG_PREFIX_NODE)) \ @@ -205,6 +217,8 @@ void LogComponentDisableAll (enum LogLevel level); /** * \ingroup logging * Append the function name to a log message. + * \internal + * Logging implementation macro; should not be called directly. */ #define NS_LOG_APPEND_FUNC_PREFIX \ if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) \ @@ -216,6 +230,8 @@ void LogComponentDisableAll (enum LogLevel level); /** * \ingroup logging * Append the log severity level to a log message. + * \internal + * Logging implementation macro; should not be called directly. */ #define NS_LOG_APPEND_LEVEL_PREFIX(level) \ if (g_log.IsEnabled (ns3::LOG_PREFIX_LEVEL)) \ @@ -225,28 +241,50 @@ void LogComponentDisableAll (enum LogLevel level); #ifndef NS_LOG_APPEND_CONTEXT +/** + * \ingroup logging + * Append the node id to a log message. + * + * This is implemented locally in `.cc` files because + * the the relevant variable is only known there. + * + * Preferred format is something like (assuming the node id is + * accessible from `var`: + * \code + * if (var) + * { + * std::clog << "[node " << var->GetObject ()->GetId () << "] "; + * } + * \endcode + * + * \internal + * Logging implementation macro; should not be called directly. + * + */ #define NS_LOG_APPEND_CONTEXT #endif /* NS_LOG_APPEND_CONTEXT */ - #ifdef NS3_LOG_ENABLE - - /** * \ingroup logging - * \param level the log level - * \param msg the message to log * * This macro allows you to log an arbitrary message at a specific - * log level. The log message is expected to be a C++ ostream + * log level. + * + * The log message is expected to be a C++ ostream * message such as "my string" << aNumber << "my oth stream". * * Typical usage looks like: * \code * NS_LOG (LOG_DEBUG, "a number="< o` */ - inline int Compare (const Time &o) const + inline int Compare (const Time & o) const { return (m_data < o.m_data) ? -1 : (m_data == o.m_data) ? 0 : 1; } @@ -445,7 +441,7 @@ public: { return To (timeUnit).GetDouble (); } - static inline Time From (const int64x64_t &from, enum Unit timeUnit) + static inline Time From (const int64x64_t & from, enum Unit timeUnit) { struct Information *info = PeekInformation (timeUnit); // DO NOT REMOVE this temporary variable. It's here @@ -479,7 +475,7 @@ public: { return int64x64_t (m_data); } - explicit inline Time (const int64x64_t &value) + explicit inline Time (const int64x64_t & value) : m_data (value.GetHigh ()) { if (g_markingTimes) @@ -487,7 +483,7 @@ public: Mark (this); } } - inline static Time From (const int64x64_t &value) + inline static Time From (const int64x64_t & value) { return Time (value); } @@ -516,11 +512,11 @@ private: static inline struct Resolution *PeekResolution (void) { static struct Time::Resolution resolution = SetDefaultNsResolution (); - return &resolution; + return & resolution; } static inline struct Information *PeekInformation (enum Unit timeUnit) { - return &(PeekResolution ()->info[timeUnit]); + return & (PeekResolution ()->info[timeUnit]); } static struct Resolution SetDefaultNsResolution (void); @@ -543,7 +539,7 @@ private: * [Stack Overflow](http://stackoverflow.com/questions/5526019/compile-errors-stdset-with-const-members) * says otherwise, quoting the standard: * - * > §23.1/3 states that std::set key types must be assignable + * > & sect;23.1/3 states that std::set key types must be assignable * > and copy constructable; clearly a const type will not be assignable. */ typedef std::set< Time * > MarkedTimes; @@ -593,23 +589,23 @@ private: */ static void ConvertTimes (const enum Unit unit); - friend bool operator == (const Time &lhs, const Time &rhs); - friend bool operator != (const Time &lhs, const Time &rhs); - friend bool operator <= (const Time &lhs, const Time &rhs); - friend bool operator >= (const Time &lhs, const Time &rhs); - friend bool operator < (const Time &lhs, const Time &rhs); - friend bool operator > (const Time &lhs, const Time &rhs); - friend Time operator + (const Time &lhs, const Time &rhs); - friend Time operator - (const Time &lhs, const Time &rhs); - friend Time operator * (const Time &lhs, const int64_t &rhs); - friend Time operator * (const int64_t &lhs, const Time &rhs); - friend int64_t operator / (const Time &lhs, const Time &rhs); - friend Time operator / (const Time &lhs, const int64_t &rhs); - friend Time &operator += (Time &lhs, const Time &rhs); - friend Time &operator -= (Time &lhs, const Time &rhs); - friend Time Abs (const Time &time); - friend Time Max (const Time &ta, const Time &tb); - friend Time Min (const Time &ta, const Time &tb); + friend bool operator == (const Time & lhs, const Time & rhs); + friend bool operator != (const Time & lhs, const Time & rhs); + friend bool operator <= (const Time & lhs, const Time & rhs); + friend bool operator >= (const Time & lhs, const Time & rhs); + friend bool operator < (const Time & lhs, const Time & rhs); + friend bool operator > (const Time & lhs, const Time & rhs); + friend Time operator + (const Time & lhs, const Time & rhs); + friend Time operator - (const Time & lhs, const Time & rhs); + friend Time operator * (const Time & lhs, const int64_t & rhs); + friend Time operator * (const int64_t & lhs, const Time & rhs); + friend int64_t operator / (const Time & lhs, const Time & rhs); + friend Time operator / (const Time & lhs, const int64_t & rhs); + friend Time & operator += (Time & lhs, const Time & rhs); + friend Time & operator -= (Time & lhs, const Time & rhs); + friend Time Abs (const Time & time); + friend Time Max (const Time & ta, const Time & tb); + friend Time Min (const Time & ta, const Time & tb); int64_t m_data; //!< Virtual time value, in the current unit. @@ -621,111 +617,111 @@ private: static bool NS_UNUSED_GLOBAL (g_TimeStaticInit) = Time::StaticInit (); inline bool -operator == (const Time &lhs, const Time &rhs) +operator == (const Time & lhs, const Time & rhs) { return lhs.m_data == rhs.m_data; } inline bool -operator != (const Time &lhs, const Time &rhs) +operator != (const Time & lhs, const Time & rhs) { return lhs.m_data != rhs.m_data; } inline bool -operator <= (const Time &lhs, const Time &rhs) +operator <= (const Time & lhs, const Time & rhs) { return lhs.m_data <= rhs.m_data; } inline bool -operator >= (const Time &lhs, const Time &rhs) +operator >= (const Time & lhs, const Time & rhs) { return lhs.m_data >= rhs.m_data; } inline bool -operator < (const Time &lhs, const Time &rhs) +operator < (const Time & lhs, const Time & rhs) { return lhs.m_data < rhs.m_data; } inline bool -operator > (const Time &lhs, const Time &rhs) +operator > (const Time & lhs, const Time & rhs) { return lhs.m_data > rhs.m_data; } -inline Time operator + (const Time &lhs, const Time &rhs) +inline Time operator + (const Time & lhs, const Time & rhs) { return Time (lhs.m_data + rhs.m_data); } -inline Time operator - (const Time &lhs, const Time &rhs) +inline Time operator - (const Time & lhs, const Time & rhs) { return Time (lhs.m_data - rhs.m_data); } inline Time -operator * (const Time &lhs, const int64_t &rhs) +operator * (const Time & lhs, const int64_t & rhs) { Time res = lhs; res.m_data *= rhs; return res; } inline Time -operator * (const int64_t &lhs, const Time &rhs) +operator * (const int64_t & lhs, const Time & rhs) { Time res = rhs; res.m_data *= lhs; return res; } inline int64_t -operator / (const Time &lhs, const Time &rhs) +operator / (const Time & lhs, const Time & rhs) { int64_t res = lhs.m_data / rhs.m_data; return res; } inline Time -operator / (const Time &lhs, const int64_t &rhs) +operator / (const Time & lhs, const int64_t & rhs) { Time res = lhs; res.m_data /= rhs; return res; } -inline Time &operator += (Time &lhs, const Time &rhs) +inline Time & operator += (Time & lhs, const Time & rhs) { lhs.m_data += rhs.m_data; return lhs; } -inline Time &operator -= (Time &lhs, const Time &rhs) +inline Time & operator -= (Time & lhs, const Time & rhs) { lhs.m_data -= rhs.m_data; return lhs; } /** - * \relates ns3::TimeUnit - * Absolute value function for Time - * \param time the input value - * \returns the absolute value of the input value. - */ -inline Time Abs (const Time &time) -{ - return Time ((time.m_data < 0) ? -time.m_data : time.m_data); -} -/** - * \relates ns3::TimeUnit + * Max function for Time. * \param ta the first value * \param tb the seconds value * \returns the max of the two input values. */ -inline Time Max (const Time &ta, const Time &tb) +inline Time Max (const Time & ta, const Time & tb) { return Time ((ta.m_data < tb.m_data) ? tb : ta); } /** + * Min function for Time. * \param ta the first value * \param tb the seconds value * \returns the min of the two input values. */ -inline Time Min (const Time &ta, const Time &tb) +inline Time Min (const Time & ta, const Time & tb) { return Time ((ta.m_data > tb.m_data) ? tb : ta); } +/** + * Absolute value function for Time + * \param time the input value + * \returns the absolute value of the input value. + */ +inline Time Abs (const Time & time) +{ + return Time ((time.m_data < 0) ? -time.m_data : time.m_data); +} /** * \brief Time output streamer. @@ -737,16 +733,16 @@ inline Time Min (const Time &ta, const Time &tb) * - `left` * The stream `width` and `precision` are ignored; Time output always * includes ".0". - * \relates ns3::Time + * \relates Time */ -std::ostream& operator<< (std::ostream& os, const Time & time); +std::ostream & operator<< (std::ostream & os, const Time & time); /** * \brief Time input streamer * * Uses the Time::Time (const std::string &) constructor - * \relates ns3::Time + * \relates Time */ -std::istream& operator>> (std::istream& is, Time & time); +std::istream & operator>> (std::istream & is, Time & time); /** * \brief create ns3::Time instances in units of seconds. @@ -757,7 +753,7 @@ std::istream& operator>> (std::istream& is, Time & time); * Simulator::Schedule (Seconds (5.0), ...); * \endcode * \param seconds seconds value - * \relates ns3::Time + * \relates Time */ inline Time Seconds (double seconds) { @@ -773,7 +769,7 @@ inline Time Seconds (double seconds) * Simulator::Schedule (MilliSeconds (5), ...); * \endcode * \param ms milliseconds value - * \relates ns3::Time + * \relates Time */ inline Time MilliSeconds (uint64_t ms) { @@ -788,7 +784,7 @@ inline Time MilliSeconds (uint64_t ms) * Simulator::Schedule (MicroSeconds (5), ...); * \endcode * \param us microseconds value - * \relates ns3::Time + * \relates Time */ inline Time MicroSeconds (uint64_t us) { @@ -803,7 +799,7 @@ inline Time MicroSeconds (uint64_t us) * Simulator::Schedule (NanoSeconds (5), ...); * \endcode * \param ns nanoseconds value - * \relates ns3::Time + * \relates Time */ inline Time NanoSeconds (uint64_t ns) { @@ -818,7 +814,7 @@ inline Time NanoSeconds (uint64_t ns) * Simulator::Schedule (PicoSeconds (5), ...); * \endcode * \param ps picoseconds value - * \relates ns3::Time + * \relates Time */ inline Time PicoSeconds (uint64_t ps) { @@ -833,7 +829,7 @@ inline Time PicoSeconds (uint64_t ps) * Simulator::Schedule (FemtoSeconds (5), ...); * \endcode * \param fs femtoseconds value - * \relates ns3::Time + * \relates Time */ inline Time FemtoSeconds (uint64_t fs) { @@ -848,7 +844,7 @@ inline Time FemtoSeconds (uint64_t fs) * Simulator::Schedule (Minutes (5.0), ...); * \endcode * \param minutes mintues value - * \relates ns3::Time + * \relates Time */ inline Time Minutes (double minutes) { @@ -863,7 +859,7 @@ inline Time Minutes (double minutes) * Simulator::Schedule (Hours (5.0), ...); * \endcode * \param hours hours value - * \relates ns3::Time + * \relates Time */ inline Time Hours (double hours) { @@ -878,7 +874,7 @@ inline Time Hours (double hours) * Simulator::Schedule (Days (5.0), ...); * \endcode * \param days days value - * \relates ns3::Time + * \relates Time */ inline Time Days (double days) { @@ -893,7 +889,7 @@ inline Time Days (double days) * Simulator::Schedule (Years (5.0), ...); * \endcode * \param years years value - * \relates ns3::Time + * \relates Time */ inline Time Years (double years) { @@ -902,7 +898,7 @@ inline Time Years (double years) /** * \see Seconds(double) - * \relates ns3::Time + * \relates Time */ inline Time Seconds (int64x64_t seconds) { @@ -910,7 +906,7 @@ inline Time Seconds (int64x64_t seconds) } /** * \see MilliSeconds(uint64_t) - * \relates ns3::Time + * \relates Time */ inline Time MilliSeconds (int64x64_t ms) { @@ -918,7 +914,7 @@ inline Time MilliSeconds (int64x64_t ms) } /** * \see MicroSeconds(uint64_t) - * \relates ns3::Time + * \relates Time */ inline Time MicroSeconds (int64x64_t us) { @@ -926,7 +922,7 @@ inline Time MicroSeconds (int64x64_t us) } /** * \see NanoSeconds(uint64_t) - * \relates ns3::Time + * \relates Time */ inline Time NanoSeconds (int64x64_t ns) { @@ -934,7 +930,7 @@ inline Time NanoSeconds (int64x64_t ns) } /** * \see PicoSeconds(uint64_t) - * \relates ns3::Time + * \relates Time */ inline Time PicoSeconds (int64x64_t ps) { @@ -942,7 +938,7 @@ inline Time PicoSeconds (int64x64_t ps) } /** * \see FemtoSeconds(uint64_t) - * \relates ns3::Time + * \relates Time */ inline Time FemtoSeconds (int64x64_t fs) { @@ -950,7 +946,7 @@ inline Time FemtoSeconds (int64x64_t fs) } /** * \see Minutes(uint64_t) - * \relates ns3::Time + * \relates Time */ inline Time Minutes (int64x64_t minutes) { @@ -958,7 +954,7 @@ inline Time Minutes (int64x64_t minutes) } /** * \see Minutes(uint64_t) - * \relates ns3::Time + * \relates Time */ inline Time Hours (int64x64_t hours) { @@ -966,7 +962,7 @@ inline Time Hours (int64x64_t hours) } /** * \see Minutes(uint64_t) - * \relates ns3::Time + * \relates Time */ inline Time Days (int64x64_t days) { @@ -974,7 +970,7 @@ inline Time Days (int64x64_t days) } /** * \see Minutes(uint64_t) - * \relates ns3::Time + * \relates Time */ inline Time Years (int64x64_t years) { diff --git a/src/core/model/object.h b/src/core/model/object.h index db11f6f39..e7b7823d7 100644 --- a/src/core/model/object.h +++ b/src/core/model/object.h @@ -46,6 +46,7 @@ struct ObjectDeleter /** * \ingroup core * \defgroup object Object + * \brief Base classes which provides memory management and object aggregation. */ /** * \ingroup object diff --git a/src/core/model/ptr.h b/src/core/model/ptr.h index e60c59f5b..132b2ca59 100644 --- a/src/core/model/ptr.h +++ b/src/core/model/ptr.h @@ -30,6 +30,7 @@ namespace ns3 { /** * \ingroup core * \defgroup ptr Smart Pointer + * \brief Heap memory management. */ /** * \ingroup ptr diff --git a/src/core/model/random-variable.cc b/src/core/model/random-variable.cc index 5c6dbfbad..e174f019b 100644 --- a/src/core/model/random-variable.cc +++ b/src/core/model/random-variable.cc @@ -1361,7 +1361,7 @@ public: * \brief Constructor * * Creates a generator that returns successive elements of the d array - * on successive calls to ::Value(). Note that the d pointer is copied + * on successive calls to GetValue(). Note that the d pointer is copied * for use by the generator (shallow-copy), not its contents, so the * contents of the array d points to have to remain unchanged for the use * of DeterministicVariableImpl to be meaningful. @@ -1860,7 +1860,7 @@ public: ZipfVariableImpl (long n, double alpha); /** - * \A zipf variable with N=1 and alpha=0 + * A zipf variable with N=1 and alpha=0 */ ZipfVariableImpl (); @@ -1952,7 +1952,7 @@ public: ZetaVariableImpl (double alpha); /** - * \A zipf variable with alpha=1.1 + * A zipf variable with alpha=1.1 */ ZetaVariableImpl (); diff --git a/src/core/model/scheduler.h b/src/core/model/scheduler.h index a66fa341f..cefd26d45 100644 --- a/src/core/model/scheduler.h +++ b/src/core/model/scheduler.h @@ -31,6 +31,7 @@ class EventImpl; /** * \ingroup core * \defgroup scheduler Scheduler and Events + * \brief Manage the event list by creating and scheduling events. */ /** * \ingroup scheduler diff --git a/src/core/model/simulator.h b/src/core/model/simulator.h index 9ab571ee0..473a7a226 100644 --- a/src/core/model/simulator.h +++ b/src/core/model/simulator.h @@ -40,6 +40,7 @@ class Scheduler; /** * \ingroup core * \defgroup simulator Simulator + * \brief Control the virtual time and the execution of simulation events. */ /** * \ingroup simulator diff --git a/src/core/model/string.h b/src/core/model/string.h index e2dd77d5e..e94c745e9 100644 --- a/src/core/model/string.h +++ b/src/core/model/string.h @@ -7,7 +7,7 @@ namespace ns3 { /** - * \ingroup AttributeList + * \ingroup attribute * * \class ns3::StringValue * \brief hold variables of type string diff --git a/src/core/model/test.h b/src/core/model/test.h index a4b0f7149..722cccfc3 100644 --- a/src/core/model/test.h +++ b/src/core/model/test.h @@ -31,6 +31,12 @@ #include "system-wall-clock-ms.h" #include "deprecated.h" +/** + * \ingroup core + * \defgroup testing Testing + * \brief Tools to define and execute unit tests. + */ + // // Note on below macros: // @@ -42,9 +48,9 @@ // /** + * \ingroup testing + * \brief Check if we should assert on errors, and do so * \internal - * - * Check if we should assert on errors, and do so */ #define ASSERT_ON_FAILURE \ do { \ @@ -55,9 +61,9 @@ } while (false) /** + * \ingroup testing + * \brief If we shouldn't continue on errors, return * \internal - * - * If we shouldn't continue on errors, return */ #define CONTINUE_ON_FAILURE \ do { \ @@ -68,9 +74,9 @@ } while (false) /** + * \ingroup testing + * \brief If we shouldn't continue on errors, return test status * \internal - * - * If we shouldn't continue on errors, return test status */ #define CONTINUE_ON_FAILURE_RETURNS_BOOL \ do { \ @@ -87,6 +93,9 @@ // =========================================================================== /** + * \ingroup testing + * \brief Test that an actual and expected (limit) value are equal and report + * and abort if not. * \internal */ #define NS_TEST_ASSERT_MSG_EQ_INTERNAL(actual, limit, msg, file, line) \ @@ -109,6 +118,8 @@ } while (false) /** + * \ingroup testing + * * \brief Test that an actual and expected (limit) value are equal and report * and abort if not. * @@ -138,6 +149,9 @@ NS_TEST_ASSERT_MSG_EQ_INTERNAL (actual, limit, msg, __FILE__, __LINE__) /** + * \ingroup testing + * \brief Test that an actual and expected (limit) value are equal and report + * and abort if not. * \internal */ #define NS_TEST_ASSERT_MSG_EQ_RETURNS_BOOL_INTERNAL(actual, limit, msg, file, line) \ @@ -160,6 +174,8 @@ } while (false) /** + * \ingroup testing + * * \brief Test that an actual and expected (limit) value are equal and report * and abort if not. * @@ -192,10 +208,13 @@ NS_TEST_ASSERT_MSG_EQ_RETURNS_BOOL_INTERNAL (actual, limit, msg, __FILE__, __LINE__) /** - * \internal + * \ingroup testing + * \brief Test that an actual and expected (limit) value are equal and report + * if not. * * Required to avoid use of return statement which allows use in methods * (esp. callbacks) returning void. + * \internal */ #define NS_TEST_EXPECT_MSG_EQ_INTERNAL(actual, limit, msg, file, line) \ do { \ @@ -216,6 +235,8 @@ } while (false) /** + * \ingroup testing + * * \brief Test that an actual and expected (limit) value are equal and report * if not. * @@ -250,6 +271,9 @@ // =========================================================================== /** + * \ingroup testing + * \brief Test that actual and expected (limit) values are equal to plus + * or minus some tolerance and report and abort if not. * \internal */ #define NS_TEST_ASSERT_MSG_EQ_TOL_INTERNAL(actual, limit, tol, msg, file, line) \ @@ -276,18 +300,21 @@ } while (false) /** - * \brief Test that actual and expected (limit) values are equal to plus or minus - * some tolerance and report and abort if not. + * \ingroup testing + * + * \brief Test that actual and expected (limit) values are equal to plus + * or minus some tolerance and report and abort if not. * * Check to see if the expected (limit) value is equal to the actual value found * in a test case to some tolerance. This is not the same thing as asking if * two floating point are equal to within some epsilon, but is useful for that - * case. This assertion is geared toward more of a measurement problem. Consider - * measuring a physical rod of some kind that you have ordered. You need to - * determine if it is "good." You won't measure the rod to an arbitrary precision - * of sixteen significant figures, you will measure the rod to determine if its - * length is within the tolerances you provided. For example, 12.00 inches plus - * or minus .005 inch may be just fine. + * case. This assertion is geared toward more of a measurement problem. + * Consider measuring a physical rod of some kind that you have ordered. + * You need to determine if it is "good." You want to measure the rod + * to an arbitrary precision of sixteen significant figures, you will + * measure the rod to determine if its length is within the tolerances + * you provided. For example, 12.00 inches plus or minus .005 inch + * may be just fine. * * In ns-3, you might want to measure a signal to noise ratio and check to see * if the answer is what you expect. If you naively measure (double)1128.93 and @@ -297,18 +324,18 @@ * probably quickly find that is not what you want either. It may turn out to * be the case that when you measured an snr that printed as 1128.93, what was * actually measured was something more like 1128.9287653857625442 for example. - * Given that the double epsilon is on the order of 0.0000000000000009, you would - * need to provide sixteen significant figures of expected value for this kind of - * test to pass even with a typical test for floating point "approximate equality." - * That is clearly not required or desired. You really want to be able to provide - * 1128.93 along with a tolerance just like you provided 12 inches +- 0.005 inch - * above. + * Given that the double epsilon is on the order of 0.0000000000000009, + * you would need to provide sixteen significant figures of expected value + * for this kind of test to pass even with a typical test for floating point + * "approximate equality." That is clearly not required or desired. + * You really want to be able to provide 1128.93 along with a tolerance + * just like you provided 12 inches +- 0.005 inch above. * * This assertion is designed for real measurements by taking into account * measurement tolerances. By doing so it also automatically compensates for * floating point rounding errors. If you really want to check floating point - * equality down to the numeric_limits::epsilon () range, consider using - * ns3::TestDoubleIsEqual(). + * equality down to the numeric_limits::epsilon () range, consider + * using ns3::TestDoubleIsEqual(). * * \note Mixing signed and unsigned types can lead to misleading results. * @@ -329,6 +356,9 @@ NS_TEST_ASSERT_MSG_EQ_TOL_INTERNAL (actual, limit, tol, msg, __FILE__, __LINE__) /** + * \ingroup testing + * \brief Test that actual and expected (limit) values are equal to plus + * or minus some tolerance and report and abort if not. * \internal */ #define NS_TEST_ASSERT_MSG_EQ_TOL_RETURNS_BOOL_INTERNAL(actual, limit, tol, msg, file, line) \ @@ -355,18 +385,21 @@ } while (false) /** - * \brief Test that actual and expected (limit) values are equal to plus or minus - * some tolerance and report and abort if not. + * \ingroup testing + * + * \brief Test that actual and expected (limit) values are equal to plus + * or minus some tolerance and report and abort if not. * * Check to see if the expected (limit) value is equal to the actual value found * in a test case to some tolerance. This is not the same thing as asking if * two floating point are equal to within some epsilon, but is useful for that - * case. This assertion is geared toward more of a measurement problem. Consider - * measuring a physical rod of some kind that you have ordered. You need to - * determine if it is "good." You won't measure the rod to an arbitrary precision - * of sixteen significant figures, you will measure the rod to determine if its - * length is within the tolerances you provided. For example, 12.00 inches plus - * or minus .005 inch may be just fine. + * case. This assertion is geared toward more of a measurement problem. + * Consider measuring a physical rod of some kind that you have ordered. + * You need to determine if it is "good." You want to measure the rod + * to an arbitrary precision of sixteen significant figures, you will + * measure the rod to determine if its length is within the tolerances + * you provided. For example, 12.00 inches plus or minus .005 inch + * may be just fine. * * In ns-3, you might want to measure a signal to noise ratio and check to see * if the answer is what you expect. If you naively measure (double)1128.93 and @@ -376,18 +409,18 @@ * probably quickly find that is not what you want either. It may turn out to * be the case that when you measured an snr that printed as 1128.93, what was * actually measured was something more like 1128.9287653857625442 for example. - * Given that the double epsilon is on the order of 0.0000000000000009, you would - * need to provide sixteen significant figures of expected value for this kind of - * test to pass even with a typical test for floating point "approximate equality." - * That is clearly not required or desired. You really want to be able to provide - * 1128.93 along with a tolerance just like you provided 12 inches +- 0.005 inch - * above. + * Given that the double epsilon is on the order of 0.0000000000000009, + * you would need to provide sixteen significant figures of expected value + * for this kind of test to pass even with a typical test for floating point + * "approximate equality." That is clearly not required or desired. + * You really want to be able to provide 1128.93 along with a tolerance + * just like you provided 12 inches +- 0.005 inch above. * * This assertion is designed for real measurements by taking into account * measurement tolerances. By doing so it also automatically compensates for * floating point rounding errors. If you really want to check floating point - * equality down to the numeric_limits::epsilon () range, consider using - * ns3::TestDoubleIsEqual(). + * equality down to the numeric_limits::epsilon () range, + * consider using ns3::TestDoubleIsEqual(). * * \note Mixing signed and unsigned types can lead to misleading results. * @@ -411,10 +444,13 @@ NS_TEST_ASSERT_MSG_EQ_TOL_RETURNS_BOOL_INTERNAL (actual, limit, tol, msg, __FILE__, __LINE__) /** - * \internal + * \ingroup testing + * \brief Test that actual and expected (limit) values are equal to plus or minus + * some tolerance and report if not. * * Required to avoid use of return statement which allows use in methods * (esp. callbacks) returning void. + * \internal */ #define NS_TEST_EXPECT_MSG_EQ_TOL_INTERNAL(actual, limit, tol, msg, file, line) \ do { \ @@ -439,17 +475,20 @@ } while (false) /** - * \brief Test that actual and expected (limit) values are equal to plus or minus - * some tolerance and report if not. + * \ingroup testing + * + * \brief Test that actual and expected (limit) values are equal to plus + * or minus some tolerance and report if not. * * Check to see if the expected (limit) value is equal to the actual value found * in a test case to some tolerance. This is not the same thing as asking if * two floating point are equal to within some epsilon, but is useful for that - * case. This assertion is geared toward more of a measurement problem. Consider - * measuring a physical rod of some kind that you have ordered. You need to - * determine if it is "good." You won't measure the rod to an arbitrary precision - * of sixteen significant figures, you will measure the rod to determine if its - * length is within the tolerances you provided. For example, 12.00 inches plus + * case. This assertion is geared toward more of a measurement problem. + * Consider measuring a physical rod of some kind that you have ordered. + * You need to determine if it is "good." You want to measure the rod + * to an arbitrary precision of sixteen significant figures, + * you will measure the rod to determine if its length is within + * the tolerances you provided. For example, 12.00 inches plus * or minus .005 inch may be just fine. * * In ns-3, you might want to measure a signal to noise ratio and check to see @@ -460,18 +499,18 @@ * probably quickly find that is not what you want either. It may turn out to * be the case that when you measured an snr that printed as 1128.93, what was * actually measured was something more like 1128.9287653857625442 for example. - * Given that the double epsilon is on the order of 0.0000000000000009, you would - * need to provide sixteen significant figures of expected value for this kind of - * test to pass even with a typical test for floating point "approximate equality." - * That is clearly not required or desired. You really want to be able to provide - * 1128.93 along with a tolerance just like you provided 12 inches +- 0.005 inch - * above. + * Given that the double epsilon is on the order of 0.0000000000000009, + * you would need to provide sixteen significant figures of expected value + * for this kind of test to pass even with a typical test for floating point + * "approximate equality." That is clearly not required or desired. + * You really want to be able to provide 1128.93 along with a tolerance + * just like you provided 12 inches +- 0.005 inch above. * * This assertion is designed for real measurements by taking into account * measurement tolerances. By doing so it also automatically compensates for * floating point rounding errors. If you really want to check floating point - * equality down to the numeric_limits::epsilon () range, consider using - * ns3::TestDoubleIsEqual(). + * equality down to the numeric_limits::epsilon () range, + * consider using ns3::TestDoubleIsEqual(). * * \note Mixing signed and unsigned types can lead to misleading results. * @@ -496,6 +535,9 @@ // =========================================================================== /** + * \ingroup testing + * \brief Test that an actual and expected (limit) value are not equal and + * report and abort if not. * \internal */ #define NS_TEST_ASSERT_MSG_NE_INTERNAL(actual, limit, msg, file, line) \ @@ -518,6 +560,8 @@ } while (false) /** + * \ingroup testing + * * \brief Test that an actual and expected (limit) value are not equal and * report and abort if not. * @@ -546,6 +590,9 @@ NS_TEST_ASSERT_MSG_NE_INTERNAL (actual, limit, msg, __FILE__, __LINE__) /** + * \ingroup testing + * \brief Test that an actual and expected (limit) value are not equal and + * report and abort if not. * \internal */ #define NS_TEST_ASSERT_MSG_NE_RETURNS_BOOL_INTERNAL(actual, limit, msg, file, line) \ @@ -568,6 +615,8 @@ } while (false) /** + * \ingroup testing + * * \brief Test that an actual and expected (limit) value are not equal and * report and abort if not. * @@ -599,10 +648,13 @@ NS_TEST_ASSERT_MSG_NE_RETURNS_BOOL_INTERNAL (actual, limit, msg, __FILE__, __LINE__) /** - * \internal + * \ingroup testing + * \brief Test that an actual and expected (limit) value are not equal and + * report if not. * * Required to avoid use of return statement which allows use in methods * (callbacks) returning void. + * \internal */ #define NS_TEST_EXPECT_MSG_NE_INTERNAL(actual, limit, msg, file, line) \ do { \ @@ -623,6 +675,8 @@ } while (false) /** + * \ingroup testing + * * \brief Test that an actual and expected (limit) value are not equal and * report if not. * @@ -655,6 +709,9 @@ // =========================================================================== /** + * \ingroup testing + * \brief Test that an actual value is less than a limit and report and abort + * if not. * \internal */ #define NS_TEST_ASSERT_MSG_LT_INTERNAL(actual, limit, msg, file, line) \ @@ -677,6 +734,8 @@ } while (false) /** + * \ingroup testing + * * \brief Test that an actual value is less than a limit and report and abort * if not. * @@ -695,10 +754,12 @@ NS_TEST_ASSERT_MSG_LT_INTERNAL (actual, limit, msg, __FILE__, __LINE__) /** - * \internal + * \ingroup testing + * \brief Test that an actual value is less than a limit and report if not. * * Required to avoid use of return statement which allows use in methods * (callbacks) returning void. + * \internal */ #define NS_TEST_EXPECT_MSG_LT_INTERNAL(actual, limit, msg, file, line) \ do { \ @@ -719,6 +780,8 @@ } while (false) /** + * \ingroup testing + * * \brief Test that an actual value is less than a limit and report if not. * * Check to see if the actual value found in a test case is less than the @@ -740,6 +803,9 @@ // =========================================================================== /** + * \ingroup testing + * \brief Test that an actual value is greater than a limit and report and abort + * if not. * \internal */ #define NS_TEST_ASSERT_MSG_GT_INTERNAL(actual, limit, msg, file, line) \ @@ -762,6 +828,8 @@ } while (false) /** + * \ingroup testing + * * \brief Test that an actual value is greater than a limit and report and abort * if not. * @@ -780,10 +848,12 @@ NS_TEST_ASSERT_MSG_GT_INTERNAL (actual, limit, msg, __FILE__, __LINE__) /** - * \internal + * \ingroup testing + * \brief Test that an actual value is greater than a limit and report if not. * * Required to avoid use of return statement which allows use in methods * (callbacks) returning void. + * \internal */ #define NS_TEST_EXPECT_MSG_GT_INTERNAL(actual, limit, msg, file, line) \ do { \ @@ -804,6 +874,8 @@ } while (false) /** + * \ingroup testing + * * \brief Test that an actual value is greater than a limit and report if not. * * Check to see if the actual value found in a test case is greater than the @@ -846,6 +918,8 @@ bool TestDoubleIsEqual (const double a, const double b, class TestRunnerImpl; /** + * \ingroup testing + * * \brief encapsulates test code * * To allow a new test to be run within the ns-3 test framework, users @@ -931,44 +1005,40 @@ protected: * \return a pointer to the parent of this test */ TestCase * GetParent () const; - - // The methods below are used only by test macros and should not - // be used by normal users. /** + * @{ * \internal - * + * The methods below are used only by test macros and should not + * be used by normal users. + */ + /** * Log the failure of this TestCase. */ void ReportTestFailure (std::string cond, std::string actual, std::string limit, std::string message, std::string file, int32_t line); /** - * \internal - * * \return should we assert on failure, per the TestSuite configuration */ bool MustAssertOnFailure (void) const; /** - * \internal - * * \return should we continue on failure, per the TestSuite configuration */ bool MustContinueOnFailure (void) const; /** - * \internal * \param filename the bare (no path) file name * \return the full path to filename in the data directory */ std::string CreateDataDirFilename (std::string filename); /** - * \internal * \param filename the bare (no path) file name * \return the full path to filename in the temporary directory. * If the TestRunner is invoked with "--update-data", this will be * the data directory instead. */ std::string CreateTempDirFilename (std::string filename); + /**@}*/ private: friend class TestRunnerImpl; @@ -994,26 +1064,23 @@ private: */ virtual void DoTeardown (void); - // forbid copying objects /** - * \internal * Private, to block copying */ TestCase (TestCase& tc); /** - * \internal * Private, to block copying */ TestCase& operator= (TestCase& tc); // methods called by TestRunnerImpl /** - * \internal * Actually run this TestCase + * + * \param runner The test runner implementation. */ void Run (TestRunnerImpl *runner); /** - * \internal * \return the failure status of this TestCase and all it's children */ bool IsFailed (void) const; @@ -1031,6 +1098,8 @@ private: }; /** + * \ingroup testing + * * \brief A suite of tests to run. */ class TestSuite : public TestCase @@ -1072,6 +1141,8 @@ private: }; /** + * \ingroup testing + * * \brief A runner to execute tests. */ class TestRunner @@ -1080,14 +1151,16 @@ public: /** * Run the requested suite of tests. * - * \param list of command line arguments - * \param argc number of elements in argv + * \param argc number of elements in \pname{argv} + * \param argv vector of command line arguments * \returns success status */ static int Run (int argc, char *argv[]); }; /** + * \ingroup testing + * * \brief A simple way to store test vectors (for stimulus or from responses) */ template diff --git a/src/core/model/time.cc b/src/core/model/time.cc index 64709db21..162bbb5c2 100644 --- a/src/core/model/time.cc +++ b/src/core/model/time.cc @@ -41,6 +41,7 @@ namespace ns3 { Time::MarkedTimes * Time::g_markingTimes = 0; /** + * \internal * Get mutex for critical sections around modification of Time::g_markingTimes * * \relates Time diff --git a/src/core/model/traced-value.h b/src/core/model/traced-value.h index ba50aac8c..119d9fbb1 100644 --- a/src/core/model/traced-value.h +++ b/src/core/model/traced-value.h @@ -34,6 +34,8 @@ namespace ns3 { /** * \ingroup core * \defgroup tracing Tracing + * \brief Publish/subscribe tools to collect and report changes to any + * values used by the various model components. */ /** diff --git a/src/core/model/wall-clock-synchronizer.h b/src/core/model/wall-clock-synchronizer.h index 0b15c3371..3c790b2fe 100644 --- a/src/core/model/wall-clock-synchronizer.h +++ b/src/core/model/wall-clock-synchronizer.h @@ -157,8 +157,9 @@ protected: * real-time-clock-specific work of waiting (either busy-waiting or sleeping, * or some combination) until the requested simulation time. * - * @param ns The simulation time we need to wait for (normalized to nanosecond - * units). + * @param nsCurrent The current simulation time. + * @param nsDelay The simulation time of the next event (in nanosecond units). + * * @see TimeStepPrecision::Get */ virtual bool DoSynchronize (uint64_t nsCurrent, uint64_t nsDelay); diff --git a/src/core/test/ptr-test-suite.cc b/src/core/test/ptr-test-suite.cc index 8462b2c50..71d61c912 100644 --- a/src/core/test/ptr-test-suite.cc +++ b/src/core/test/ptr-test-suite.cc @@ -25,18 +25,18 @@ using namespace ns3; class PtrTestCase; -class Base +class PtrTestBase { public: - Base (); - virtual ~Base (); + PtrTestBase (); + virtual ~PtrTestBase (); void Ref (void) const; void Unref (void) const; private: mutable uint32_t m_count; }; -class NoCount : public Base +class NoCount : public PtrTestBase { public: NoCount (PtrTestCase *test); @@ -60,20 +60,20 @@ private: }; -Base::Base () +PtrTestBase::PtrTestBase () : m_count (1) { } -Base::~Base () +PtrTestBase::~PtrTestBase () { } void -Base::Ref (void) const +PtrTestBase::Ref (void) const { m_count++; } void -Base::Unref (void) const +PtrTestBase::Unref (void) const { m_count--; if (m_count == 0) @@ -256,7 +256,7 @@ PtrTestCase::DoRun (void) NS_TEST_EXPECT_MSG_EQ (m_nDestroyed, 1, "013"); { - Ptr p0 = Create (this); + Ptr p0 = Create (this); Ptr p1 = Create (this); NS_TEST_EXPECT_MSG_EQ ((p0 == p1), false, "operator == failed"); NS_TEST_EXPECT_MSG_EQ ((p0 != p1), true, "operator != failed"); diff --git a/src/core/test/simulator-test-suite.cc b/src/core/test/simulator-test-suite.cc index 41e5848bf..bc93e9489 100644 --- a/src/core/test/simulator-test-suite.cc +++ b/src/core/test/simulator-test-suite.cc @@ -31,11 +31,11 @@ class SimulatorEventsTestCase : public TestCase public: SimulatorEventsTestCase (ObjectFactory schedulerFactory); virtual void DoRun (void); - void A (int a); - void B (int b); - void C (int c); - void D (int d); - void foo0 (void); + void EventA (int a); + void EventB (int b); + void EventC (int c); + void EventD (int d); + void Eventfoo0 (void); uint64_t NowUs (void); void destroy (void); bool m_b; @@ -62,13 +62,13 @@ SimulatorEventsTestCase::NowUs (void) } void -SimulatorEventsTestCase::A (int a) +SimulatorEventsTestCase::EventA (int a) { m_a = false; } void -SimulatorEventsTestCase::B (int b) +SimulatorEventsTestCase::EventB (int b) { if (b != 2 || NowUs () != 11) { @@ -79,17 +79,17 @@ SimulatorEventsTestCase::B (int b) m_b = true; } Simulator::Remove (m_idC); - Simulator::Schedule (MicroSeconds (10), &SimulatorEventsTestCase::D, this, 4); + Simulator::Schedule (MicroSeconds (10), &SimulatorEventsTestCase::EventD, this, 4); } void -SimulatorEventsTestCase::C (int c) +SimulatorEventsTestCase::EventC (int c) { m_c = false; } void -SimulatorEventsTestCase::D (int d) +SimulatorEventsTestCase::EventD (int d) { if (d != 4 || NowUs () != (11+10)) { @@ -102,7 +102,7 @@ SimulatorEventsTestCase::D (int d) } void -SimulatorEventsTestCase::foo0 (void) +SimulatorEventsTestCase::Eventfoo0 (void) {} void @@ -123,9 +123,9 @@ SimulatorEventsTestCase::DoRun (void) Simulator::SetScheduler (m_schedulerFactory); - EventId a = Simulator::Schedule (MicroSeconds (10), &SimulatorEventsTestCase::A, this, 1); - Simulator::Schedule (MicroSeconds (11), &SimulatorEventsTestCase::B, this, 2); - m_idC = Simulator::Schedule (MicroSeconds (12), &SimulatorEventsTestCase::C, this, 3); + EventId a = Simulator::Schedule (MicroSeconds (10), &SimulatorEventsTestCase::EventA, this, 1); + Simulator::Schedule (MicroSeconds (11), &SimulatorEventsTestCase::EventB, this, 2); + m_idC = Simulator::Schedule (MicroSeconds (12), &SimulatorEventsTestCase::EventC, this, 3); NS_TEST_EXPECT_MSG_EQ (!m_idC.IsExpired (), true, ""); NS_TEST_EXPECT_MSG_EQ (!a.IsExpired (), true, ""); @@ -137,7 +137,7 @@ SimulatorEventsTestCase::DoRun (void) NS_TEST_EXPECT_MSG_EQ (m_c, true, "Event C did not run ?"); NS_TEST_EXPECT_MSG_EQ (m_d, true, "Event D did not run ?"); - EventId anId = Simulator::ScheduleNow (&SimulatorEventsTestCase::foo0, this); + EventId anId = Simulator::ScheduleNow (&SimulatorEventsTestCase::Eventfoo0, this); EventId anotherId = anId; NS_TEST_EXPECT_MSG_EQ (!(anId.IsExpired () || anotherId.IsExpired ()), true, "Event should not have expired yet."); diff --git a/src/core/test/threaded-test-suite.cc b/src/core/test/threaded-test-suite.cc index 51a921011..b2b9d2069 100644 --- a/src/core/test/threaded-test-suite.cc +++ b/src/core/test/threaded-test-suite.cc @@ -39,10 +39,10 @@ class ThreadedSimulatorEventsTestCase : public TestCase { public: ThreadedSimulatorEventsTestCase (ObjectFactory schedulerFactory, const std::string &simulatorType, unsigned int threads); - void A (int a); - void B (int b); - void C (int c); - void D (int d); + void EventA (int a); + void EventB (int b); + void EventC (int c); + void EventD (int d); void DoNothing (unsigned int threadno); static void SchedulingThread (std::pair context); void End (void); @@ -113,7 +113,7 @@ ThreadedSimulatorEventsTestCase::DoNothing (unsigned int threadno) m_threadWaiting[threadno] = false; } void -ThreadedSimulatorEventsTestCase::A (int a) +ThreadedSimulatorEventsTestCase::EventA (int a) { if (m_a != m_b || m_a != m_c || m_a != m_d) { @@ -122,11 +122,11 @@ ThreadedSimulatorEventsTestCase::A (int a) }; ++m_a; Simulator::Schedule (MicroSeconds (10), - &ThreadedSimulatorEventsTestCase::B, this, a+1); + &ThreadedSimulatorEventsTestCase::EventB, this, a+1); } void -ThreadedSimulatorEventsTestCase::B (int b) +ThreadedSimulatorEventsTestCase::EventB (int b) { if (m_a != (m_b+1) || m_a != (m_c+1) || m_a != (m_d+1)) { @@ -135,11 +135,11 @@ ThreadedSimulatorEventsTestCase::B (int b) }; ++m_b; Simulator::Schedule (MicroSeconds (10), - &ThreadedSimulatorEventsTestCase::C, this, b+1); + &ThreadedSimulatorEventsTestCase::EventC, this, b+1); } void -ThreadedSimulatorEventsTestCase::C (int c) +ThreadedSimulatorEventsTestCase::EventC (int c) { if (m_a != m_b || m_a != (m_c+1) || m_a != (m_d+1)) { @@ -148,11 +148,11 @@ ThreadedSimulatorEventsTestCase::C (int c) }; ++m_c; Simulator::Schedule (MicroSeconds (10), - &ThreadedSimulatorEventsTestCase::D, this, c+1); + &ThreadedSimulatorEventsTestCase::EventD, this, c+1); } void -ThreadedSimulatorEventsTestCase::D (int d) +ThreadedSimulatorEventsTestCase::EventD (int d) { if (m_a != m_b || m_a != m_c || m_a != (m_d+1)) { @@ -167,7 +167,7 @@ ThreadedSimulatorEventsTestCase::D (int d) else { Simulator::Schedule (MicroSeconds (10), - &ThreadedSimulatorEventsTestCase::A, this, d+1); + &ThreadedSimulatorEventsTestCase::EventA, this, d+1); } } @@ -207,7 +207,7 @@ ThreadedSimulatorEventsTestCase::DoRun (void) m_stop = false; Simulator::SetScheduler (m_schedulerFactory); - Simulator::Schedule (MicroSeconds (10), &ThreadedSimulatorEventsTestCase::A, this, 1); + Simulator::Schedule (MicroSeconds (10), &ThreadedSimulatorEventsTestCase::EventA, this, 1); Simulator::Schedule (Seconds (1), &ThreadedSimulatorEventsTestCase::End, this); diff --git a/src/flow-monitor/model/flow-classifier.h b/src/flow-monitor/model/flow-classifier.h index c1cc11d28..8e500745b 100644 --- a/src/flow-monitor/model/flow-classifier.h +++ b/src/flow-monitor/model/flow-classifier.h @@ -41,7 +41,7 @@ typedef uint32_t FlowPacketId; /// \ingroup flow-monitor /// Provides a method to translate raw packet data into abstract -/// ``flow identifier'' and ``packet identifier'' parameters. These +/// `flow identifier` and `packet identifier` parameters. These /// identifiers are unsigned 32-bit integers that uniquely identify a /// flow and a packet within that flow, respectively, for the whole /// simulation, regardless of the point in which the packet was diff --git a/src/internet/test/ipv6-fragmentation-test.cc b/src/internet/test/ipv6-fragmentation-test.cc index f8f7bb6b1..20c042197 100644 --- a/src/internet/test/ipv6-fragmentation-test.cc +++ b/src/internet/test/ipv6-fragmentation-test.cc @@ -18,8 +18,11 @@ * Author: Tommaso Pecorella */ /** + * \file + * * This is the test code for ipv6-l3protocol.cc (only the fragmentation and reassembly part). */ + #define NS3_LOG_ENABLE 1 #include "ns3/test.h" diff --git a/utils/print-introspected-doxygen.cc b/utils/print-introspected-doxygen.cc index caee94403..e418874b2 100644 --- a/utils/print-introspected-doxygen.cc +++ b/utils/print-introspected-doxygen.cc @@ -27,12 +27,6 @@ namespace std::string brief; ///< brief tag std::string commentStart; ///< start of code comment std::string commentStop; ///< end of code comment - std::string defgroupAttributeListStart; ///< start of AttributeList group - std::string defgroupAttributeListStop; ///< end of AttributeList group - std::string defgroupGlobalValueListStart; ///< start of GlobalValueList group - std::string defgroupGlobalValueListStop; ///< end of GlobalValueList group - std::string defgroupTraceSourceListStart; ///< start of TraceSourceList group - std::string defgroupTraceSourceListStop; ///< end of TraceSourceList group std::string flagSpanStart; ///< start of Attribute flag value std::string flagSpanStop; ///< end of Attribute flag value std::string functionStart; ///< start of a class/function @@ -40,7 +34,9 @@ namespace std::string headingStart; ///< start of section heading (h3) std::string headingStop; ///< end of section heading (h3) std::string indentHtmlOnly; ///< small indent - std::string ingroupConstructs; ///< add to constructs group + std::string pageAttributeList; ///< start Attributes list + std::string pageGlobalValueList; ///< start GlobalValue page + std::string pageTraceSourceList; ///< start Trace sources page std::string listStart; ///< start unordered list std::string listStop; ///< end unordered list std::string listLineStart; ///< start unordered list item @@ -68,9 +64,37 @@ PrintAttributes (TypeId tid, std::ostream &os) && (info.checker->GetUnderlyingTypeInformation () != "std::string") ) { - os << reference; + // Two indirect cases to handle + bool handled = false; + + if (info.checker->GetValueTypeName () == "ns3::PointerValue") + { + const PointerChecker *ptrChecker = dynamic_cast (PeekPointer (info.checker)); + if (ptrChecker != 0) + { + os << reference << "ns3::Ptr" << "< " + << reference << ptrChecker->GetPointeeTypeId ().GetName () + << ">"; + handled = true; + } + } + else if (info.checker->GetValueTypeName () == "ns3::ObjectPtrContainerValue") + { + const ObjectPtrContainerChecker * ptrChecker = dynamic_cast (PeekPointer (info.checker)); + if (ptrChecker != 0) + { + os << reference << "ns3::Ptr" << "< " + << reference << ptrChecker->GetItemTypeId ().GetName () + << ">"; + handled = true; + } + } + if (! handled) + { + os << reference << info.checker->GetUnderlyingTypeInformation (); + } } - os << info.checker->GetUnderlyingTypeInformation () << listLineStop << std::endl; + os << listLineStop << std::endl; } if (info.flags & TypeId::ATTR_CONSTRUCT && info.accessor->HasSetter ()) { @@ -428,12 +452,6 @@ int main (int argc, char *argv[]) brief = ""; commentStart = "===============================================================\n"; commentStop = ""; - defgroupAttributeListStart = ""; - defgroupAttributeListStop = "\n"; - defgroupGlobalValueListStart = ""; - defgroupGlobalValueListStop = ""; - defgroupTraceSourceListStart = ""; - defgroupTraceSourceListStop = "\n"; flagSpanStart = ""; flagSpanStop = ""; functionStart = ""; @@ -441,7 +459,9 @@ int main (int argc, char *argv[]) headingStart = ""; headingStop = ""; indentHtmlOnly = ""; - ingroupConstructs = ""; + pageAttributeList = ""; + pageGlobalValueList = ""; + pageTraceSourceList = ""; listStart = ""; listStop = ""; listLineStart = " * "; @@ -458,14 +478,8 @@ int main (int argc, char *argv[]) breakHtmlOnly = "
"; breakTextOnly = ""; brief = "\\brief "; - commentStart = "/*!"; - commentStop = "*/"; - defgroupAttributeListStart = "\\defgroup AttributeList "; - defgroupAttributeListStop = ""; - defgroupGlobalValueListStart = "\\defgroup GlobalValueList "; - defgroupGlobalValueListStop = ""; - defgroupTraceSourceListStart = "\\defgroup TraceSourceList "; - defgroupTraceSourceListStop = ""; + commentStart = "/*!\n"; + commentStop = "*/\n"; flagSpanStart = ""; flagSpanStop = ""; functionStart = "\\class "; @@ -473,7 +487,9 @@ int main (int argc, char *argv[]) headingStart = "

"; headingStop = "

"; indentHtmlOnly = " "; - ingroupConstructs = "\\ingroup constructs\n"; + pageAttributeList = "\\page AttributesList "; + pageGlobalValueList = "\\page GlobalValueList "; + pageTraceSourceList = "\\page TraceSourceList "; listStart = "
    "; listStop = "
"; listLineStart = "
  • "; @@ -643,10 +659,10 @@ int main (int argc, char *argv[]) } // class documentation - std::cout << commentStart << std::endl - << ingroupConstructs - << defgroupTraceSourceListStart << "The list of all trace sources." - << defgroupTraceSourceListStop << std::endl; + std::cout << commentStart + << pageTraceSourceList << "All TraceSources\n" + << std::endl; + for (uint32_t i = 0; i < TypeId::GetRegisteredN (); ++i) { TypeId tid = TypeId::GetRegistered (i); @@ -661,17 +677,19 @@ int main (int argc, char *argv[]) for (uint32_t j = 0; j < tid.GetTraceSourceN (); ++j) { struct TypeId::TraceSourceInformation info = tid.GetTraceSource(j); - std::cout << listLineStart << info.name << ": " << info.help + std::cout << listLineStart + << boldStart << info.name << boldStop + << ": " << info.help << listLineStop << std::endl; } std::cout << listStop << std::endl; } std::cout << commentStop << std::endl; - std::cout << commentStart << std::endl - << ingroupConstructs - << defgroupAttributeListStart << "The list of all attributes." - << defgroupAttributeListStop << std::endl; + std::cout << commentStart + << pageAttributeList << "All Attributes\n" + << std::endl; + for (uint32_t i = 0; i < TypeId::GetRegisteredN (); ++i) { TypeId tid = TypeId::GetRegistered (i); @@ -686,7 +704,9 @@ int main (int argc, char *argv[]) for (uint32_t j = 0; j < tid.GetAttributeN (); ++j) { struct TypeId::AttributeInformation info = tid.GetAttribute(j); - std::cout << listLineStart << info.name << ": " << info.help + std::cout << listLineStart + << boldStart << info.name << boldStop + << ": " << info.help << listLineStop << std::endl; } std::cout << listStop << std::endl; @@ -695,11 +715,11 @@ int main (int argc, char *argv[]) - std::cout << commentStart << std::endl - << ingroupConstructs - << defgroupGlobalValueListStart << "The list of all global values." - << defgroupGlobalValueListStop << std::endl - << listStart << std::endl; + std::cout << commentStart + << pageGlobalValueList << "All GlobalValues\n" + << std::endl + << listStart << std::endl; + for (GlobalValue::Iterator i = GlobalValue::Begin (); i != GlobalValue::End (); ++i)