[Doxygen] Various in src/core
This commit is contained in:
@@ -21,17 +21,39 @@
|
||||
#include "ns3/assert.h"
|
||||
#include <iostream>
|
||||
|
||||
/**
|
||||
* \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;
|
||||
|
||||
@@ -29,12 +29,23 @@
|
||||
#include <unistd.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
/**
|
||||
* \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)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -436,7 +436,7 @@ private:
|
||||
|
||||
|
||||
/** \ingroup commandline
|
||||
* \defgroup commandlinehelper Helpers to Specialize on \c bool
|
||||
* \defgroup commandlinehelper Helpers to Specialize on bool
|
||||
*/
|
||||
/**
|
||||
* \ingroup commandlinehelper
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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 (); //<! Constructor, prints the list and exits.
|
||||
};
|
||||
|
||||
/** Invoke handler for \c print-list in NS_LOG environment variable. */
|
||||
/**
|
||||
* Invoke handler for \c print-list in NS_LOG environment variable.
|
||||
* This is private to the logging implementation.
|
||||
*/
|
||||
static PrintList g_printList;
|
||||
|
||||
|
||||
@@ -479,7 +484,9 @@ LogComponentPrintList (void)
|
||||
}
|
||||
|
||||
/**
|
||||
* \ingroup
|
||||
* Check if a log component exists.
|
||||
* This is private to the logging implementation.
|
||||
*
|
||||
* \param componentName The putative log component name.
|
||||
* \returns \c true if \c componentName exists.
|
||||
@@ -505,6 +512,7 @@ static bool ComponentExists(std::string componentName)
|
||||
|
||||
/**
|
||||
* Parse the \c NS_LOG environment variable.
|
||||
* This is private to the logging implementation.
|
||||
*/
|
||||
static void CheckEnvironmentVariables (void)
|
||||
{
|
||||
|
||||
@@ -145,9 +145,13 @@ public:
|
||||
Mark (this);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* \name Numeric constructors.
|
||||
* Construct from a numeric value.
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* Construct from a numeric value.
|
||||
*
|
||||
* The current time resolution will be assumed as the unit.
|
||||
* \param [in] v The value.
|
||||
* @{
|
||||
@@ -217,6 +221,7 @@ public:
|
||||
}
|
||||
}
|
||||
/**@}*/
|
||||
/**@}*/
|
||||
|
||||
/**
|
||||
* \brief Construct Time object from common time expressions like "1ms"
|
||||
@@ -803,7 +808,7 @@ std::istream & operator >> (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
|
||||
|
||||
@@ -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 <typename T>
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user