Skip to content

Commit

Permalink
[Doxygen] various in src/core
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter D. Barnes, Jr. committed Nov 3, 2014
1 parent ee641c7 commit 1e1a1ed
Show file tree
Hide file tree
Showing 15 changed files with 239 additions and 107 deletions.
3 changes: 3 additions & 0 deletions src/core/model/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ void LogComponentDisableAll (enum LogLevel level);
* ns3::LogComponentDisable functions or with the NS_LOG
* environment variable.
*
* LogComponent names should be simple string tokens, _i.e._,
* "ArfWifiManager", not "ns3::ArfWifiManager".
*
* This macro should be placed within namespace ns3. If functions
* outside of namespace ns3 require access to logging, the preferred
* solution is to add the following 'using' directive at file scope,
Expand Down
4 changes: 4 additions & 0 deletions src/core/model/random-variable-stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ class RngStream;
class RandomVariableStream : public Object
{
public:
/**
* \brief Register this type.
* \return The object TypeId.
*/
static TypeId GetTypeId (void);
RandomVariableStream ();
virtual ~RandomVariableStream();
Expand Down
17 changes: 17 additions & 0 deletions src/core/model/rng-seed-manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,28 @@ namespace ns3 {

NS_LOG_COMPONENT_DEFINE ("RngSeedManager");

/**
* \relates RngSeedManager
* The next random number generator stream number to use
* for automatic assignment.
*/
static uint64_t g_nextStreamIndex = 0;
/**
* \relates RngSeedManager
* The random number generator seed number global value.
*
* This is accessible as "--RngSeed" from CommandLine.
*/
static ns3::GlobalValue g_rngSeed ("RngSeed",
"The global seed of all rng streams",
ns3::IntegerValue(1),
ns3::MakeIntegerChecker<uint32_t> ());
/**
* \relates RngSeedManager
* The random number generator run number global value.
*
* This is accessible as "--RngRun" from CommandLine.
*/
static ns3::GlobalValue g_rngRun ("RngRun",
"The run number used to modify the global seed",
ns3::IntegerValue (1),
Expand Down
10 changes: 10 additions & 0 deletions src/core/model/system-path.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ NS_LOG_COMPONENT_DEFINE ("SystemPath");

namespace SystemPath {

/**
* \ingroup systempath
* \brief Get the directory path for a file.
*
* This is an internal function (by virtue of not being
* declared in a \c .h file); the public API is FindSelfDirectory().
*
* \param path The full path to a file.
* \returns The full path to the containing directory.
*/
std::string Dirname (std::string path)
{
NS_LOG_FUNCTION (path);
Expand Down
25 changes: 23 additions & 2 deletions src/core/model/system-path.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,42 @@
namespace ns3 {

/**
* \brief Encapsulate OS-specific functions to manipulate file and directory paths.
* \ingroup testing
* \defgroup systempath Host Filesystem
* \brief Encapsulate OS-specific functions to manipulate file
* and directory paths.
*
* The functions provided here are used mostly to implement the ns-3 test framework.
* The functions provided here are used mostly to implement
* the ns-3 test framework.
*/

/**
* \addtogroup core
* \see systempath
*/

/**
* \ingroup systempath
* \brief Namespace for various file and directory path functions.
*/
namespace SystemPath {

/**
* \ingroup systempath
* \return the directory in which the currently-executing binary is located
*/
std::string FindSelfDirectory (void);

/**
* \ingroup systempath
* \param left a path element
* \param right a path element
* \return a concatenation of the two input paths
*/
std::string Append (std::string left, std::string right);

/**
* \ingroup systempath
* \param path a path
* \return a list of path elements that can be joined together again with
* the Join function.
Expand All @@ -53,6 +70,7 @@ namespace SystemPath {
std::list<std::string> Split (std::string path);

/**
* \ingroup systempath
* \param begin iterator to first element to join
* \param end iterator to last element to join
* \return a path that is a concatenation of all the input elements.
Expand All @@ -61,12 +79,14 @@ namespace SystemPath {
std::list<std::string>::const_iterator end);

/**
* \ingroup systempath
* \param path a path which identifies a directory
* \return a list of the filenames which are located in the input directory
*/
std::list<std::string> ReadFiles (std::string path);

/**
* \ingroup systempath
* \return a path which identifies a temporary directory.
*
* The returned path identifies a directory which does not exist yet
Expand All @@ -76,6 +96,7 @@ namespace SystemPath {
std::string MakeTemporaryDirectoryName (void);

/**
* \ingroup systempath
* \param path a path to a directory
*
* Create all the directories leading to path.
Expand Down
34 changes: 19 additions & 15 deletions src/core/model/system-wall-clock-ms.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@
namespace ns3 {

/**
* \brief measure elapsed time in milliseconds
*
* \addtogroup core
* \see SystemWallClockMs
*/
/**
* \ingroup testing
* \brief Measure elapsed wall clock time in milliseconds.
*/
class SystemWallClockMs {
public:
Expand All @@ -41,39 +45,39 @@ class SystemWallClockMs {
/**
* \brief Stop measuring the time since Start() was called.
* \returns the measured elapsed wall clock time (in milliseconds) since
* ns3::SystemWallClockMs::Start was invoked.
* Start() was invoked.
*
* It is possible to start a new measurement with ns3::SystemWallClockMs::Start
* after this method returns.
* It is possible to start a new measurement with Start() after
* this method returns.
*
* Returns int64_t to avoid dependency on clock_t in ns-3 code.
* Returns \c int64_t to avoid dependency on \c clock_t in ns-3 code.
*/
int64_t End (void);

/**
* \returns the measured elapsed wall clock time (in milliseconds) since
* ns3::SystemWallClockMs::Start was invoked.
* Start() was invoked.
*
* Returns int64_t to avoid dependency on clock_t in ns-3 code.
* Returns \c int64_t to avoid dependency on \c clock_t in ns-3 code.
*/
int64_t GetElapsedReal (void) const;
/**
* \returns the measured elapsed 'user' wall clock time (in milliseconds) since
* ns3::SystemWallClockMs::Start was invoked.
* \returns the measured elapsed 'user' wall clock time (in milliseconds)
* since Start() was invoked.
*
* Returns int64_t to avoid dependency on clock_t in ns-3 code.
* Returns \c int64_t to avoid dependency on \c clock_t in ns-3 code.
*/
int64_t GetElapsedUser (void) const;
/**
* \returns the measured elapsed 'system' wall clock time (in milliseconds) since
* ns3::SystemWallClockMs::Start was invoked.
* \returns the measured elapsed 'system' wall clock time (in milliseconds)
* since Start() was invoked.
*
* Returns int64_t to avoid dependency on clock_t in ns-3 code.
* Returns \c int64_t to avoid dependency on \c clock_t in ns-3 code.
*/
int64_t GetElapsedSystem (void) const;

private:
class SystemWallClockMsPrivate *m_priv;
class SystemWallClockMsPrivate *m_priv; //!< The implementation.
};

} // namespace ns3
Expand Down
Loading

0 comments on commit 1e1a1ed

Please sign in to comment.