diff --git a/src/core/examples/main-callback.cc b/src/core/examples/main-callback.cc index 06bd5a8b6..519db657a 100644 --- a/src/core/examples/main-callback.cc +++ b/src/core/examples/main-callback.cc @@ -21,17 +21,39 @@ #include "ns3/assert.h" #include +/** + * \file + * \ingroup callback + * Example program illustrating use of callback functions and methods. + * + * See \ref callback + */ + using namespace ns3; -static double +/** + * Example Callback function. + * + * \param [in] a The first argument. + * \param [in] b The second argument. + * \returns The first argument. + */ +static double CbOne (double a, double b) { std::cout << "invoke cbOne a=" << a << ", b=" << b << std::endl; return a; } +/** Example Callback class. */ class MyCb { public: + /** + * Example Callback class method. + * + * \param [in] a The argument. + * \returns -5 + */ int CbTwo (double a) { std::cout << "invoke cbTwo a=" << a << std::endl; return -5; diff --git a/src/core/examples/main-test-sync.cc b/src/core/examples/main-test-sync.cc index 1cb591ace..5aa120eed 100644 --- a/src/core/examples/main-test-sync.cc +++ b/src/core/examples/main-test-sync.cc @@ -29,12 +29,23 @@ #include #include +/** + * \file + * \ingroup scheduler + * An example of scheduling events in a background thread. + * + * See \ref ns3::SystemThread, + * \ref ns3::SimulatorImpl::ScheduleWithContext + */ + using namespace ns3; NS_LOG_COMPONENT_DEFINE ("TestSync"); +/** Check that the event functions run in the intended order. */ bool gFirstRun = false; +/** An event method called many times from the background thread. */ void inserted_function (void) { @@ -43,6 +54,7 @@ inserted_function (void) Simulator::Now ().GetSeconds () << " s"); } +/** An event method called many times from the main thread. */ void background_function (void) { @@ -51,6 +63,7 @@ background_function (void) Simulator::Now ().GetSeconds () << " s"); } +/** An event method called once from the main thread. */ void first_function (void) { @@ -59,10 +72,13 @@ first_function (void) gFirstRun = true; } +/** Example class with a method for the background task. */ class FakeNetDevice { public: + /** Constructor. */ FakeNetDevice (); + /** The thread entry point. */ void Doit3 (void); }; @@ -86,7 +102,15 @@ FakeNetDevice::Doit3 (void) } } - +/** + * Example use of ns3::SystemThread. + * + * This example is a complete simulation. + * It schedules \c first_function and many executions of \c background_function + * to execute in the main (foreground) thread. It also launches a background + * thread with an instance of FakeNetDevice, which schedules many instances of + * \c inserted_function. + */ void test (void) { diff --git a/src/core/examples/sample-simulator.cc b/src/core/examples/sample-simulator.cc index 4accc4b45..925dd2cd3 100644 --- a/src/core/examples/sample-simulator.cc +++ b/src/core/examples/sample-simulator.cc @@ -25,6 +25,12 @@ #include "ns3/double.h" #include "ns3/random-variable-stream.h" +/** + * \file + * \ingroup simulator + * Example program demonstrating use of various Schedule functions. + */ + using namespace ns3; class MyModel diff --git a/src/core/model/command-line.h b/src/core/model/command-line.h index aa81586b5..888f29263 100644 --- a/src/core/model/command-line.h +++ b/src/core/model/command-line.h @@ -436,7 +436,7 @@ private: /** \ingroup commandline - * \defgroup commandlinehelper Helpers to Specialize on \c bool + * \defgroup commandlinehelper Helpers to Specialize on bool */ /** * \ingroup commandlinehelper diff --git a/src/core/model/int64x64-128.h b/src/core/model/int64x64-128.h index d935f60a6..aa2a24573 100644 --- a/src/core/model/int64x64-128.h +++ b/src/core/model/int64x64-128.h @@ -79,12 +79,12 @@ public: /// Default constructor. inline int64x64_t () : _v (0) {} - /**@{*/ /** - * Construct from a floating point value. + * \name Construct from a floating point value. * * \param [in] value Floating value to represent. */ + /**@{*/ inline int64x64_t (const double value) { const int64x64_t tmp ((long double)value); @@ -120,12 +120,12 @@ public: } /**@}*/ - /**@{*/ /** - * Construct from an integral type. + * \name Construct from an integral type. * * \param [in] v Integer value to represent. */ + /**@{*/ inline int64x64_t (const int v) : _v (v) { @@ -157,6 +157,7 @@ public: _v <<= 64; } /**@}*/ + /** * Construct from explicit high and low values. * diff --git a/src/core/model/log.cc b/src/core/model/log.cc index 46d537567..39ffdccb5 100644 --- a/src/core/model/log.cc +++ b/src/core/model/log.cc @@ -46,6 +46,7 @@ namespace ns3 { /** * \ingroup logging * The LogTimePrinter. + * This is private to the logging implementation. */ static LogTimePrinter g_logTimePrinter = 0; /** @@ -58,6 +59,7 @@ static LogNodePrinter g_logNodePrinter = 0; * \ingroup logging * Handler for \c print-list token in NS_LOG * to print the list of log components. + * This is private to the logging implementation. */ class PrintList { @@ -65,7 +67,10 @@ public: PrintList (); //> (std::istream & is, Time & time); /** * \ingroup time - * \defgroup timecivil Standard time units. + * \defgroup timecivil Standard Time Units. * \brief Convenience constructors in standard units. * * For example: @@ -913,19 +918,8 @@ inline Time TimeStep (uint64_t ts) return Time (ts); } -/** - * \ingroup time - * \class ns3::TimeValue - * \brief Attribute for objects of type ns3::Time - */ ATTRIBUTE_VALUE_DEFINE (Time); - -/** - * Attribute accessor function for Time - * @{ - */ ATTRIBUTE_ACCESSOR_DEFINE (Time); -/**@}*/ /** * \ingroup time diff --git a/src/core/model/object-factory.h b/src/core/model/object-factory.h index 4173bfe4d..c16efde4f 100644 --- a/src/core/model/object-factory.h +++ b/src/core/model/object-factory.h @@ -61,12 +61,12 @@ public: */ ObjectFactory (std::string typeId); + /**@{*/ /** * Set the TypeId of the Objects to be created by this factory. * * \param tid The TypeId of the object to instantiate. */ - /**@{*/ void SetTypeId (TypeId tid); void SetTypeId (const char *tid); void SetTypeId (std::string tid); @@ -184,6 +184,11 @@ ATTRIBUTE_HELPER_HEADER (ObjectFactory); } // namespace ns3 + +/*************************************************************** + * Implementation of the templates declared above. + ***************************************************************/ + namespace ns3 { template diff --git a/src/core/model/object.cc b/src/core/model/object.cc index 8de97d1a6..1fbad4235 100644 --- a/src/core/model/object.cc +++ b/src/core/model/object.cc @@ -22,7 +22,6 @@ #include "object.h" #include "object-factory.h" #include "assert.h" -#include "singleton.h" #include "attribute.h" #include "log.h" #include "string.h"