2014-10-06 17:24:00 -07:00
|
|
|
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
|
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2007 INRIA
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
|
* published by the Free Software Foundation;
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
|
*
|
|
|
|
|
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
|
|
|
|
|
*/
|
|
|
|
|
|
2015-07-22 17:09:55 -07:00
|
|
|
/**
|
|
|
|
|
* \file
|
|
|
|
|
* \ingroup utils
|
|
|
|
|
* Generate documentation from the TypeId database.
|
|
|
|
|
*/
|
|
|
|
|
|
2008-03-13 12:56:49 -07:00
|
|
|
#include <iostream>
|
2020-02-03 15:22:41 -08:00
|
|
|
#include <iomanip>
|
2011-03-03 19:54:57 +00:00
|
|
|
#include <algorithm>
|
2011-09-20 12:12:08 -07:00
|
|
|
#include <map>
|
2014-10-09 12:40:49 +02:00
|
|
|
#include <climits> // CHAR_BIT
|
2013-07-04 15:57:10 +02:00
|
|
|
|
2014-10-05 17:58:48 -07:00
|
|
|
#include "ns3/command-line.h"
|
2008-04-10 11:50:47 -07:00
|
|
|
#include "ns3/config.h"
|
2009-06-08 14:14:04 +02:00
|
|
|
#include "ns3/global-value.h"
|
2014-10-05 17:58:48 -07:00
|
|
|
#include "ns3/log.h"
|
|
|
|
|
#include "ns3/object-vector.h"
|
|
|
|
|
#include "ns3/object.h"
|
|
|
|
|
#include "ns3/pointer.h"
|
2009-06-08 14:14:04 +02:00
|
|
|
#include "ns3/string.h"
|
2011-04-03 20:54:34 -07:00
|
|
|
#include "ns3/node-container.h"
|
2015-01-29 19:03:22 -08:00
|
|
|
#include "ns3/simple-channel.h"
|
2017-08-29 07:56:38 -07:00
|
|
|
#include "ns3/system-path.h"
|
2007-08-27 20:25:15 +02:00
|
|
|
|
|
|
|
|
using namespace ns3;
|
|
|
|
|
|
2011-04-03 20:54:34 -07:00
|
|
|
NS_LOG_COMPONENT_DEFINE ("PrintIntrospectedDoxygen");
|
2008-04-10 11:50:47 -07:00
|
|
|
|
2011-09-20 12:12:08 -07:00
|
|
|
namespace
|
|
|
|
|
{
|
2022-08-29 23:32:37 -07:00
|
|
|
/** Are we generating text or Doxygen? */
|
|
|
|
|
bool outputText = false;
|
|
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
/**
|
|
|
|
|
* Markup tokens.
|
|
|
|
|
* @{
|
|
|
|
|
*/
|
2014-10-05 17:58:48 -07:00
|
|
|
std::string anchor; ///< hyperlink anchor
|
2014-10-21 16:14:35 -07:00
|
|
|
std::string argument; ///< function argument
|
2014-10-05 17:58:48 -07:00
|
|
|
std::string boldStart; ///< start of bold span
|
|
|
|
|
std::string boldStop; ///< end of bold span
|
|
|
|
|
std::string breakBoth; ///< linebreak
|
|
|
|
|
std::string breakHtmlOnly; ///< linebreak for html output only
|
|
|
|
|
std::string breakTextOnly; ///< linebreak for text output only
|
|
|
|
|
std::string brief; ///< brief tag
|
2014-10-21 16:14:35 -07:00
|
|
|
std::string classStart; ///< start of a class
|
|
|
|
|
std::string classStop; ///< end of a class
|
|
|
|
|
std::string codeWord; ///< format next word as source code
|
2014-10-05 17:58:48 -07:00
|
|
|
std::string commentStart; ///< start of code comment
|
|
|
|
|
std::string commentStop; ///< end of code comment
|
2014-10-21 16:14:35 -07:00
|
|
|
std::string copyDoc; ///< copy (or refer) to docs elsewhere
|
2022-06-05 21:01:11 -07:00
|
|
|
std::string file; ///< file
|
2014-10-05 17:58:48 -07:00
|
|
|
std::string flagSpanStart; ///< start of Attribute flag value
|
|
|
|
|
std::string flagSpanStop; ///< end of Attribute flag value
|
2014-10-21 16:14:35 -07:00
|
|
|
std::string functionStart; ///< start of a method/function
|
|
|
|
|
std::string functionStop; ///< end of a method/function
|
2014-10-05 17:58:48 -07:00
|
|
|
std::string headingStart; ///< start of section heading (h3)
|
|
|
|
|
std::string headingStop; ///< end of section heading (h3)
|
2022-06-05 21:01:11 -07:00
|
|
|
// Linking: [The link text displayed](\ref TheTarget)
|
2020-04-23 16:52:54 -07:00
|
|
|
std::string hrefStart; ///< start of a link
|
|
|
|
|
std::string hrefMid; ///< middle part of a link
|
|
|
|
|
std::string hrefStop; ///< end of a link
|
2014-10-05 17:58:48 -07:00
|
|
|
std::string indentHtmlOnly; ///< small indent
|
|
|
|
|
std::string listLineStart; ///< start unordered list item
|
|
|
|
|
std::string listLineStop; ///< end unordered list item
|
|
|
|
|
std::string listStart; ///< start unordered list
|
|
|
|
|
std::string listStop; ///< end unordered list
|
2017-08-29 07:56:38 -07:00
|
|
|
std::string note; ///< start a note section
|
2014-10-06 17:24:00 -07:00
|
|
|
std::string page; ///< start a separate page
|
2014-10-05 17:58:48 -07:00
|
|
|
std::string reference; ///< reference tag
|
2020-04-23 16:52:54 -07:00
|
|
|
std::string referenceNo; ///< block automatic references
|
2014-10-21 16:14:35 -07:00
|
|
|
std::string returns; ///< the return value
|
2014-10-05 20:42:52 -07:00
|
|
|
std::string sectionStart; ///< start of a section or group
|
2014-10-21 16:14:35 -07:00
|
|
|
std::string seeAlso; ///< Reference to other docs
|
2014-10-05 20:42:52 -07:00
|
|
|
std::string subSectionStart; ///< start a new subsection
|
2015-07-22 17:09:55 -07:00
|
|
|
std::string templArgDeduced; ///< template argument deduced from function
|
2017-08-29 07:56:38 -07:00
|
|
|
std::string templArgExplicit; ///< template argument required
|
|
|
|
|
std::string templateArgument; ///< template argument
|
2014-10-21 16:14:35 -07:00
|
|
|
std::string variable; ///< variable or class member
|
2020-02-03 15:22:41 -08:00
|
|
|
/** @} */
|
2011-09-20 12:12:08 -07:00
|
|
|
|
2017-09-17 19:47:23 -07:00
|
|
|
} // unnamed namespace
|
2011-09-20 12:12:08 -07:00
|
|
|
|
2014-10-05 17:58:48 -07:00
|
|
|
|
2014-10-05 20:42:52 -07:00
|
|
|
/**
|
|
|
|
|
* Initialize the markup strings, for either doxygen or text.
|
|
|
|
|
*
|
2014-10-21 16:14:35 -07:00
|
|
|
* \param [in] outputText true for text output, false for doxygen output.
|
2014-10-05 20:42:52 -07:00
|
|
|
*/
|
2008-03-13 12:56:49 -07:00
|
|
|
void
|
2022-08-29 23:32:37 -07:00
|
|
|
SetMarkup ()
|
2014-10-05 17:58:48 -07:00
|
|
|
{
|
2014-10-08 13:52:14 -07:00
|
|
|
NS_LOG_FUNCTION (outputText);
|
2014-10-05 17:58:48 -07:00
|
|
|
if (outputText)
|
|
|
|
|
{
|
|
|
|
|
anchor = "";
|
2014-10-21 16:14:35 -07:00
|
|
|
argument = " Arg: ";
|
2014-10-05 17:58:48 -07:00
|
|
|
boldStart = "";
|
|
|
|
|
boldStop = "";
|
|
|
|
|
breakBoth = "\n";
|
|
|
|
|
breakHtmlOnly = "";
|
|
|
|
|
breakTextOnly = "\n";
|
|
|
|
|
brief = "";
|
2014-10-21 16:14:35 -07:00
|
|
|
classStart = "";
|
|
|
|
|
classStop = "\n\n";
|
|
|
|
|
codeWord = " ";
|
2014-10-05 17:58:48 -07:00
|
|
|
commentStart = "===============================================================\n";
|
|
|
|
|
commentStop = "";
|
2014-10-21 16:14:35 -07:00
|
|
|
copyDoc = " See: ";
|
2022-08-29 23:32:37 -07:00
|
|
|
file = "File: introspected-doxygen.txt";
|
2014-10-05 17:58:48 -07:00
|
|
|
flagSpanStart = "";
|
|
|
|
|
flagSpanStop = "";
|
|
|
|
|
functionStart = "";
|
|
|
|
|
functionStop = "\n\n";
|
|
|
|
|
headingStart = "";
|
|
|
|
|
headingStop = "";
|
2022-06-05 21:01:11 -07:00
|
|
|
// Linking: The link text displayed (see TheTarget)
|
2020-04-23 16:52:54 -07:00
|
|
|
hrefStart = "";
|
|
|
|
|
hrefMid = "(see ";
|
|
|
|
|
hrefStop = ")";
|
2014-10-05 17:58:48 -07:00
|
|
|
indentHtmlOnly = "";
|
|
|
|
|
listLineStart = " * ";
|
|
|
|
|
listLineStop = "";
|
2017-08-29 07:56:38 -07:00
|
|
|
listStart = "";
|
|
|
|
|
listStop = "";
|
|
|
|
|
note = "Note: ";
|
|
|
|
|
page = "Page ";
|
2014-10-21 16:14:35 -07:00
|
|
|
reference = " ";
|
2020-04-23 16:52:54 -07:00
|
|
|
referenceNo = " ";
|
2014-10-21 16:14:35 -07:00
|
|
|
returns = " Returns: ";
|
2022-08-29 23:32:37 -07:00
|
|
|
sectionStart = "Section: ";
|
2014-10-21 16:14:35 -07:00
|
|
|
seeAlso = " See: ";
|
2014-10-05 20:42:52 -07:00
|
|
|
subSectionStart = "Subsection ";
|
2015-07-22 17:09:55 -07:00
|
|
|
templArgDeduced = "[deduced] ";
|
|
|
|
|
templArgExplicit = "[explicit] ";
|
2017-08-29 07:56:38 -07:00
|
|
|
templateArgument = "Template Arg: ";
|
2014-10-21 16:14:35 -07:00
|
|
|
variable = "Variable: ";
|
2014-10-05 17:58:48 -07:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
anchor = "\\anchor ";
|
2014-10-21 16:14:35 -07:00
|
|
|
argument = "\\param ";
|
2014-10-05 17:58:48 -07:00
|
|
|
boldStart = "<b>";
|
|
|
|
|
boldStop = "</b>";
|
|
|
|
|
breakBoth = "<br>";
|
|
|
|
|
breakHtmlOnly = "<br>";
|
|
|
|
|
breakTextOnly = "";
|
|
|
|
|
brief = "\\brief ";
|
2014-10-21 16:14:35 -07:00
|
|
|
classStart = "\\class ";
|
|
|
|
|
classStop = "";
|
|
|
|
|
codeWord = "\\p ";
|
2014-10-05 17:58:48 -07:00
|
|
|
commentStart = "/*!\n";
|
|
|
|
|
commentStop = "*/\n";
|
2014-10-21 16:14:35 -07:00
|
|
|
copyDoc = "\\copydoc ";
|
2022-08-29 23:32:37 -07:00
|
|
|
file = "\\file";
|
2014-10-05 17:58:48 -07:00
|
|
|
flagSpanStart = "<span class=\"mlabel\">";
|
|
|
|
|
flagSpanStop = "</span>";
|
2014-10-21 16:14:35 -07:00
|
|
|
functionStart = "\\fn ";
|
2014-10-05 17:58:48 -07:00
|
|
|
functionStop = "";
|
|
|
|
|
headingStart = "<h3>";
|
|
|
|
|
headingStop = "</h3>";
|
2022-06-05 21:01:11 -07:00
|
|
|
// Linking: [The link text displayed](\ref TheTarget)
|
2020-04-23 16:52:54 -07:00
|
|
|
hrefStart = "[";
|
|
|
|
|
hrefMid = "](\\ref ";
|
|
|
|
|
hrefStop = ")";
|
2014-10-05 17:58:48 -07:00
|
|
|
indentHtmlOnly = " ";
|
|
|
|
|
listLineStart = "<li>";
|
|
|
|
|
listLineStop = "</li>";
|
2017-08-29 07:56:38 -07:00
|
|
|
listStart = "<ul>";
|
|
|
|
|
listStop = "</ul>";
|
|
|
|
|
note = "\\note ";
|
|
|
|
|
page = "\\page ";
|
2014-10-21 16:14:35 -07:00
|
|
|
reference = " \\ref ";
|
2020-04-23 16:52:54 -07:00
|
|
|
referenceNo = " %";
|
2014-10-21 16:14:35 -07:00
|
|
|
returns = "\\returns ";
|
2014-10-05 20:42:52 -07:00
|
|
|
sectionStart = "\\ingroup ";
|
2014-10-21 16:14:35 -07:00
|
|
|
seeAlso = "\\see ";
|
2014-10-05 20:42:52 -07:00
|
|
|
subSectionStart = "\\addtogroup ";
|
2015-07-22 17:09:55 -07:00
|
|
|
templArgDeduced = "\\deduced ";
|
|
|
|
|
templArgExplicit = "\\explicit ";
|
2017-08-29 07:56:38 -07:00
|
|
|
templateArgument = "\\tparam ";
|
2014-10-21 16:14:35 -07:00
|
|
|
variable = "\\var ";
|
2014-10-05 17:58:48 -07:00
|
|
|
}
|
|
|
|
|
} // SetMarkup ()
|
|
|
|
|
|
|
|
|
|
|
2014-10-21 16:14:35 -07:00
|
|
|
/***************************************************************
|
2020-02-03 15:22:41 -08:00
|
|
|
* Aggregation and configuration paths
|
2014-10-21 16:14:35 -07:00
|
|
|
***************************************************************/
|
|
|
|
|
|
2014-10-05 20:42:52 -07:00
|
|
|
/**
|
2020-02-03 15:22:41 -08:00
|
|
|
* Gather aggregation and configuration path information from registered types.
|
2014-10-05 20:42:52 -07:00
|
|
|
*/
|
2020-02-03 15:22:41 -08:00
|
|
|
class StaticInformation
|
2008-03-13 12:56:49 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
public:
|
|
|
|
|
/**
|
|
|
|
|
* Record the a -> b aggregation relation.
|
|
|
|
|
*
|
|
|
|
|
* \param a [in] the source(?) TypeId name
|
|
|
|
|
* \param b [in] the destination(?) TypeId name
|
|
|
|
|
*/
|
|
|
|
|
void RecordAggregationInfo (std::string a, std::string b);
|
|
|
|
|
/**
|
|
|
|
|
* Gather aggregation and configuration path information for tid
|
|
|
|
|
*
|
|
|
|
|
* \param tid [in] the TypeId to gather information from
|
|
|
|
|
*/
|
|
|
|
|
void Gather (TypeId tid);
|
|
|
|
|
/**
|
|
|
|
|
* Print output in "a -> b" form on std::cout
|
|
|
|
|
*/
|
2022-10-06 21:33:49 +00:00
|
|
|
void Print () const;
|
2007-08-30 13:58:15 +02:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
/**
|
|
|
|
|
* \return the configuration paths for tid
|
|
|
|
|
*
|
|
|
|
|
* \param tid [in] the TypeId to return information for
|
|
|
|
|
*/
|
|
|
|
|
std::vector<std::string> Get (TypeId tid) const;
|
2014-10-05 17:58:48 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
/**
|
|
|
|
|
* \return the type names we couldn't aggregate.
|
|
|
|
|
*/
|
2022-10-06 21:33:49 +00:00
|
|
|
std::vector<std::string> GetNoTypeIds () const;
|
2020-02-03 15:22:41 -08:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
/**
|
|
|
|
|
* \return the current configuration path
|
|
|
|
|
*/
|
2022-10-06 21:33:49 +00:00
|
|
|
std::string GetCurrentPath () const;
|
2020-02-03 15:22:41 -08:00
|
|
|
/**
|
|
|
|
|
* Gather attribute, configuration path information for tid
|
|
|
|
|
*
|
|
|
|
|
* \param tid [in] the TypeId to gather information from
|
|
|
|
|
*/
|
|
|
|
|
void DoGather (TypeId tid);
|
|
|
|
|
/**
|
|
|
|
|
* Record the current config path for tid.
|
|
|
|
|
*
|
|
|
|
|
* \param tid [in] the TypeId to record.
|
|
|
|
|
*/
|
|
|
|
|
void RecordOutput (TypeId tid);
|
|
|
|
|
/**
|
|
|
|
|
* \return whether the tid has already been processed
|
|
|
|
|
*
|
|
|
|
|
* \param tid [in] the TypeId to check.
|
|
|
|
|
*/
|
|
|
|
|
bool HasAlreadyBeenProcessed (TypeId tid) const;
|
|
|
|
|
/**
|
|
|
|
|
* Configuration path for each TypeId
|
|
|
|
|
*/
|
|
|
|
|
std::vector<std::pair<TypeId,std::string> > m_output;
|
|
|
|
|
/**
|
|
|
|
|
* Current configuration path
|
|
|
|
|
*/
|
|
|
|
|
std::vector<std::string> m_currentPath;
|
|
|
|
|
/**
|
|
|
|
|
* List of TypeIds we've already processed
|
|
|
|
|
*/
|
|
|
|
|
std::vector<TypeId> m_alreadyProcessed;
|
|
|
|
|
/**
|
|
|
|
|
* List of aggregation relationships.
|
|
|
|
|
*/
|
|
|
|
|
std::vector<std::pair<TypeId,TypeId> > m_aggregates;
|
|
|
|
|
/**
|
|
|
|
|
* List of type names without TypeIds, because those modules aren't enabled.
|
|
|
|
|
*
|
|
|
|
|
* This is mutable because GetNoTypeIds sorts and uniquifies this list
|
|
|
|
|
* before returning it.
|
|
|
|
|
*/
|
|
|
|
|
mutable std::vector<std::string> m_noTids;
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
}; // class StaticInformation
|
|
|
|
|
|
|
|
|
|
|
2022-06-05 21:01:11 -07:00
|
|
|
void
|
2020-02-03 15:22:41 -08:00
|
|
|
StaticInformation::RecordAggregationInfo (std::string a, std::string b)
|
2014-10-05 17:58:48 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
NS_LOG_FUNCTION (this << a << b);
|
|
|
|
|
TypeId aTid;
|
|
|
|
|
bool found = TypeId::LookupByNameFailSafe (a, &aTid);
|
|
|
|
|
if (!found)
|
2014-10-05 17:58:48 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
m_noTids.push_back (a);
|
|
|
|
|
return;
|
2014-10-05 17:58:48 -07:00
|
|
|
}
|
2020-02-03 15:22:41 -08:00
|
|
|
TypeId bTid;
|
|
|
|
|
found = TypeId::LookupByNameFailSafe (b, &bTid);
|
|
|
|
|
if (!found)
|
2014-10-05 17:58:48 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
m_noTids.push_back (b);
|
|
|
|
|
return;
|
2014-10-05 17:58:48 -07:00
|
|
|
}
|
|
|
|
|
|
2022-10-06 21:49:56 +00:00
|
|
|
m_aggregates.emplace_back (aTid, bTid);
|
2020-02-03 15:22:41 -08:00
|
|
|
}
|
2014-10-05 17:58:48 -07:00
|
|
|
|
|
|
|
|
|
2022-06-05 21:01:11 -07:00
|
|
|
void
|
2022-10-06 21:33:49 +00:00
|
|
|
StaticInformation::Print () const
|
2008-04-10 12:24:36 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
NS_LOG_FUNCTION (this);
|
2022-10-06 22:34:11 +00:00
|
|
|
for (const auto& item : m_output)
|
2008-04-10 12:24:36 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
std::cout << item.first.GetName () << " -> " << item.second << std::endl;
|
2008-04-10 12:24:36 -07:00
|
|
|
}
|
2020-02-03 15:22:41 -08:00
|
|
|
}
|
2008-04-10 12:24:36 -07:00
|
|
|
|
|
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
std::string
|
2022-10-06 21:33:49 +00:00
|
|
|
StaticInformation::GetCurrentPath () const
|
2014-10-05 17:58:48 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
NS_LOG_FUNCTION (this);
|
|
|
|
|
std::ostringstream oss;
|
2022-10-06 22:34:11 +00:00
|
|
|
for (const auto& item : m_currentPath)
|
2014-10-05 17:58:48 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
oss << "/" << item;
|
2014-10-05 17:58:48 -07:00
|
|
|
}
|
2020-02-03 15:22:41 -08:00
|
|
|
return oss.str ();
|
|
|
|
|
}
|
2014-10-05 17:58:48 -07:00
|
|
|
|
|
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
void
|
|
|
|
|
StaticInformation::RecordOutput (TypeId tid)
|
2014-10-08 13:52:14 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
NS_LOG_FUNCTION (this << tid);
|
2022-10-06 21:49:56 +00:00
|
|
|
m_output.emplace_back (tid, GetCurrentPath ());
|
2020-02-03 15:22:41 -08:00
|
|
|
}
|
2014-10-05 17:58:48 -07:00
|
|
|
|
|
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
bool
|
|
|
|
|
StaticInformation::HasAlreadyBeenProcessed (TypeId tid) const
|
2014-10-05 17:58:48 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
NS_LOG_FUNCTION (this << tid);
|
2022-10-06 22:34:11 +00:00
|
|
|
for (const auto& it : m_alreadyProcessed)
|
2014-10-05 17:58:48 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
if (it == tid)
|
2014-10-05 17:58:48 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
return true;
|
2014-10-05 17:58:48 -07:00
|
|
|
}
|
|
|
|
|
}
|
2020-02-03 15:22:41 -08:00
|
|
|
return false;
|
|
|
|
|
}
|
2014-10-05 17:58:48 -07:00
|
|
|
|
|
|
|
|
|
2022-06-05 21:01:11 -07:00
|
|
|
std::vector<std::string>
|
2020-02-03 15:22:41 -08:00
|
|
|
StaticInformation::Get (TypeId tid) const
|
2014-10-05 17:58:48 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
NS_LOG_FUNCTION (this << tid);
|
|
|
|
|
std::vector<std::string> paths;
|
2022-10-06 22:34:11 +00:00
|
|
|
for (const auto& item : m_output)
|
2014-10-05 17:58:48 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
if (item.first == tid)
|
|
|
|
|
{
|
|
|
|
|
paths.push_back (item.second);
|
|
|
|
|
}
|
2014-10-05 17:58:48 -07:00
|
|
|
}
|
2020-02-03 15:22:41 -08:00
|
|
|
return paths;
|
|
|
|
|
}
|
2014-10-05 17:58:48 -07:00
|
|
|
|
2014-10-06 17:24:00 -07:00
|
|
|
/**
|
2020-02-03 15:22:41 -08:00
|
|
|
* Helper to keep only the unique items in a container.
|
2014-10-06 17:24:00 -07:00
|
|
|
*
|
2020-02-03 15:22:41 -08:00
|
|
|
* The container is modified in place; the elements end up sorted.
|
|
|
|
|
*
|
|
|
|
|
* The container must support \c begin(), \c end() and \c erase(),
|
|
|
|
|
* which, among the STL containers, limits this to
|
|
|
|
|
* \c std::vector, \c std::dequeue and \c std::list.
|
|
|
|
|
*
|
|
|
|
|
* The container elements must support \c operator< (for \c std::sort)
|
|
|
|
|
* and \c operator== (for \c std::unique).
|
|
|
|
|
*
|
|
|
|
|
* \tparam T \deduced The container type.
|
|
|
|
|
* \param t The container.
|
2014-10-06 17:24:00 -07:00
|
|
|
*/
|
2020-02-03 15:22:41 -08:00
|
|
|
template <typename T>
|
2014-10-06 17:24:00 -07:00
|
|
|
void
|
2020-02-03 15:22:41 -08:00
|
|
|
Uniquefy (T t)
|
2014-10-06 17:24:00 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
std::sort (t.begin (), t.end ());
|
|
|
|
|
t.erase (std::unique (t.begin (), t.end ()), t.end ());
|
|
|
|
|
}
|
2014-10-06 17:24:00 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
std::vector<std::string>
|
2022-10-06 21:33:49 +00:00
|
|
|
StaticInformation::GetNoTypeIds () const
|
2020-02-03 15:22:41 -08:00
|
|
|
{
|
|
|
|
|
NS_LOG_FUNCTION (this);
|
|
|
|
|
Uniquefy (m_noTids);
|
|
|
|
|
return m_noTids;
|
|
|
|
|
}
|
2014-10-21 16:14:35 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
2020-02-03 15:22:41 -08:00
|
|
|
StaticInformation::Gather (TypeId tid)
|
2014-10-21 16:14:35 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
NS_LOG_FUNCTION (this << tid);
|
|
|
|
|
DoGather (tid);
|
|
|
|
|
Uniquefy (m_output);
|
|
|
|
|
}
|
|
|
|
|
|
2014-10-21 16:14:35 -07:00
|
|
|
|
2022-06-05 21:01:11 -07:00
|
|
|
void
|
2020-02-03 15:22:41 -08:00
|
|
|
StaticInformation::DoGather (TypeId tid)
|
|
|
|
|
{
|
|
|
|
|
NS_LOG_FUNCTION (this << tid);
|
|
|
|
|
if (HasAlreadyBeenProcessed (tid))
|
2014-10-21 16:14:35 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
return;
|
2014-10-21 16:14:35 -07:00
|
|
|
}
|
2020-02-03 15:22:41 -08:00
|
|
|
RecordOutput (tid);
|
|
|
|
|
for (uint32_t i = 0; i < tid.GetAttributeN (); ++i)
|
|
|
|
|
{
|
|
|
|
|
struct TypeId::AttributeInformation info = tid.GetAttribute(i);
|
|
|
|
|
const PointerChecker *ptrChecker = dynamic_cast<const PointerChecker *> (PeekPointer (info.checker));
|
2022-10-06 21:45:05 +00:00
|
|
|
if (ptrChecker != nullptr)
|
2020-02-03 15:22:41 -08:00
|
|
|
{
|
|
|
|
|
TypeId pointee = ptrChecker->GetPointeeTypeId ();
|
2014-10-21 16:14:35 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
// See if this is a pointer to an Object.
|
|
|
|
|
Ptr<Object> object = CreateObject<Object> ();
|
|
|
|
|
TypeId objectTypeId = object->GetTypeId ();
|
|
|
|
|
if (objectTypeId == pointee)
|
|
|
|
|
{
|
|
|
|
|
// Stop the recursion at this attribute if it is a
|
|
|
|
|
// pointer to an Object, which create too many spurious
|
|
|
|
|
// paths in the list of attribute paths because any
|
|
|
|
|
// Object can be in that part of the path.
|
|
|
|
|
continue;
|
|
|
|
|
}
|
2014-10-21 16:14:35 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
m_currentPath.push_back (info.name);
|
|
|
|
|
m_alreadyProcessed.push_back (tid);
|
|
|
|
|
DoGather (pointee);
|
|
|
|
|
m_alreadyProcessed.pop_back ();
|
|
|
|
|
m_currentPath.pop_back ();
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
// attempt to cast to an object vector.
|
|
|
|
|
const ObjectPtrContainerChecker *vectorChecker = dynamic_cast<const ObjectPtrContainerChecker *> (PeekPointer (info.checker));
|
2022-10-06 21:45:05 +00:00
|
|
|
if (vectorChecker != nullptr)
|
2020-02-03 15:22:41 -08:00
|
|
|
{
|
|
|
|
|
TypeId item = vectorChecker->GetItemTypeId ();
|
|
|
|
|
m_currentPath.push_back (info.name + "/[i]");
|
|
|
|
|
m_alreadyProcessed.push_back (tid);
|
|
|
|
|
DoGather (item);
|
|
|
|
|
m_alreadyProcessed.pop_back ();
|
|
|
|
|
m_currentPath.pop_back ();
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for (uint32_t j = 0; j < TypeId::GetRegisteredN (); j++)
|
2014-10-21 16:14:35 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
TypeId child = TypeId::GetRegistered (j);
|
|
|
|
|
if (child.IsChildOf (tid))
|
2014-10-21 16:14:35 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
std::string childName = "$" + child.GetName ();
|
|
|
|
|
m_currentPath.push_back (childName);
|
|
|
|
|
m_alreadyProcessed.push_back (tid);
|
|
|
|
|
DoGather (child);
|
|
|
|
|
m_alreadyProcessed.pop_back ();
|
|
|
|
|
m_currentPath.pop_back ();
|
2014-10-21 16:14:35 -07:00
|
|
|
}
|
2020-02-03 15:22:41 -08:00
|
|
|
}
|
2022-10-06 22:34:11 +00:00
|
|
|
for (const auto& item : m_aggregates)
|
2020-02-03 15:22:41 -08:00
|
|
|
{
|
|
|
|
|
if (item.first == tid || item.second == tid)
|
2014-10-21 16:14:35 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
TypeId other;
|
|
|
|
|
if (item.first == tid)
|
|
|
|
|
{
|
|
|
|
|
other = item.second;
|
|
|
|
|
}
|
|
|
|
|
if (item.second == tid)
|
|
|
|
|
{
|
|
|
|
|
other = item.first;
|
|
|
|
|
}
|
|
|
|
|
std::string name = "$" + other.GetName ();
|
|
|
|
|
m_currentPath.push_back (name);
|
|
|
|
|
m_alreadyProcessed.push_back (tid);
|
|
|
|
|
DoGather (other);
|
|
|
|
|
m_alreadyProcessed.pop_back ();
|
2022-06-05 21:01:11 -07:00
|
|
|
m_currentPath.pop_back ();
|
2014-10-21 16:14:35 -07:00
|
|
|
}
|
|
|
|
|
}
|
2020-02-03 15:22:41 -08:00
|
|
|
} // StaticInformation::DoGather ()
|
2014-10-21 16:14:35 -07:00
|
|
|
|
|
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
/// Register aggregation relationships that are not automatically
|
|
|
|
|
/// detected by this introspection program. Statements added here
|
|
|
|
|
/// result in more configuration paths being added to the doxygen.
|
|
|
|
|
/// \return instance of StaticInformation with the registered information
|
|
|
|
|
StaticInformation GetTypicalAggregations ()
|
2014-10-21 16:14:35 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
NS_LOG_FUNCTION_NOARGS ();
|
2014-10-21 16:14:35 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
static StaticInformation info;
|
|
|
|
|
static bool mapped = false;
|
|
|
|
|
|
|
|
|
|
if (mapped)
|
2014-10-21 16:14:35 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
return info;
|
2014-10-21 16:14:35 -07:00
|
|
|
}
|
|
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
// Short circuit next call
|
|
|
|
|
mapped = true;
|
2014-10-21 16:14:35 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
// The below statements register typical aggregation relationships
|
|
|
|
|
// in ns-3 programs, that otherwise aren't picked up automatically
|
|
|
|
|
// by the creation of the above node. To manually list other common
|
|
|
|
|
// aggregation relationships that you would like to see show up in
|
|
|
|
|
// the list of configuration paths in the doxygen, add additional
|
|
|
|
|
// statements below.
|
|
|
|
|
info.RecordAggregationInfo ("ns3::Node", "ns3::TcpSocketFactory");
|
|
|
|
|
info.RecordAggregationInfo ("ns3::Node", "ns3::UdpSocketFactory");
|
|
|
|
|
info.RecordAggregationInfo ("ns3::Node", "ns3::PacketSocketFactory");
|
|
|
|
|
info.RecordAggregationInfo ("ns3::Node", "ns3::MobilityModel");
|
|
|
|
|
info.RecordAggregationInfo ("ns3::Node", "ns3::Ipv4L3Protocol");
|
|
|
|
|
info.RecordAggregationInfo ("ns3::Node", "ns3::Ipv4NixVectorRouting");
|
|
|
|
|
info.RecordAggregationInfo ("ns3::Node", "ns3::Icmpv4L4Protocol");
|
|
|
|
|
info.RecordAggregationInfo ("ns3::Node", "ns3::ArpL3Protocol");
|
|
|
|
|
info.RecordAggregationInfo ("ns3::Node", "ns3::Icmpv4L4Protocol");
|
|
|
|
|
info.RecordAggregationInfo ("ns3::Node", "ns3::UdpL4Protocol");
|
|
|
|
|
info.RecordAggregationInfo ("ns3::Node", "ns3::Ipv6L3Protocol");
|
|
|
|
|
info.RecordAggregationInfo ("ns3::Node", "ns3::Icmpv6L4Protocol");
|
|
|
|
|
info.RecordAggregationInfo ("ns3::Node", "ns3::TcpL4Protocol");
|
|
|
|
|
info.RecordAggregationInfo ("ns3::Node", "ns3::RipNg");
|
|
|
|
|
info.RecordAggregationInfo ("ns3::Node", "ns3::GlobalRouter");
|
|
|
|
|
info.RecordAggregationInfo ("ns3::Node", "ns3::aodv::RoutingProtocol");
|
|
|
|
|
info.RecordAggregationInfo ("ns3::Node", "ns3::dsdv::RoutingProtocol");
|
|
|
|
|
info.RecordAggregationInfo ("ns3::Node", "ns3::dsr::DsrRouting");
|
|
|
|
|
info.RecordAggregationInfo ("ns3::Node", "ns3::olsr::RoutingProtocol");
|
|
|
|
|
info.RecordAggregationInfo ("ns3::Node", "ns3::EnergyHarvesterContainer");
|
|
|
|
|
info.RecordAggregationInfo ("ns3::Node", "ns3::EnergySourceContainer");
|
2014-10-21 16:14:35 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
// Create a channel object so that channels appear in the namespace
|
|
|
|
|
// paths that will be generated here.
|
|
|
|
|
Ptr<SimpleChannel> simpleChannel;
|
|
|
|
|
simpleChannel = CreateObject<SimpleChannel> ();
|
|
|
|
|
|
|
|
|
|
for (uint32_t i = 0; i < Config::GetRootNamespaceObjectN (); ++i)
|
2014-10-21 16:14:35 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
Ptr<Object> object = Config::GetRootNamespaceObject (i);
|
|
|
|
|
info.Gather (object->GetInstanceTypeId ());
|
2014-10-21 16:14:35 -07:00
|
|
|
}
|
|
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
return info;
|
2014-10-06 17:24:00 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
} // GetTypicalAggregations ()
|
2014-10-06 17:24:00 -07:00
|
|
|
|
2014-10-21 16:14:35 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
/// Map from TypeId name to tid
|
|
|
|
|
typedef std::map< std::string, int32_t> NameMap;
|
|
|
|
|
typedef NameMap::const_iterator NameMapIterator; ///< NameMap iterator
|
2014-10-21 16:14:35 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2020-02-03 15:22:41 -08:00
|
|
|
* Create a map from the class names to their index in the vector of
|
|
|
|
|
* TypeId's so that the names will end up in alphabetical order.
|
2014-10-21 16:14:35 -07:00
|
|
|
*
|
2020-02-03 15:22:41 -08:00
|
|
|
* \returns NameMap
|
2014-10-21 16:14:35 -07:00
|
|
|
*/
|
2020-02-03 15:22:41 -08:00
|
|
|
NameMap
|
2022-10-06 21:33:49 +00:00
|
|
|
GetNameMap ()
|
2014-10-21 16:14:35 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
NS_LOG_FUNCTION_NOARGS ();
|
2014-10-21 16:14:35 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
static NameMap nameMap;
|
|
|
|
|
static bool mapped = false;
|
2014-10-21 16:14:35 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
if (mapped)
|
|
|
|
|
{
|
|
|
|
|
return nameMap;
|
|
|
|
|
}
|
2014-10-21 16:14:35 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
// Short circuit next call
|
|
|
|
|
mapped = true;
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
// Get typical aggregation relationships.
|
|
|
|
|
StaticInformation info = GetTypicalAggregations ();
|
2014-10-21 16:14:35 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
// Registered types
|
|
|
|
|
for (uint32_t i = 0; i < TypeId::GetRegisteredN (); i++)
|
2014-10-21 16:14:35 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
TypeId tid = TypeId::GetRegistered (i);
|
|
|
|
|
if (tid.MustHideFromDocumentation ())
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
// Capitalize all of letters in the name so that it sorts
|
|
|
|
|
// correctly in the map.
|
|
|
|
|
std::string name = tid.GetName ();
|
|
|
|
|
std::transform (name.begin (), name.end (), name.begin (), ::toupper);
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
// Save this name's index.
|
|
|
|
|
nameMap[name] = i;
|
|
|
|
|
}
|
2014-10-21 16:14:35 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
// Type names without TypeIds
|
|
|
|
|
std::vector<std::string> noTids = info.GetNoTypeIds ();
|
2022-10-06 22:34:11 +00:00
|
|
|
for (const auto& item : noTids)
|
2014-10-21 16:14:35 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
nameMap[item] = -1;
|
2014-10-21 16:14:35 -07:00
|
|
|
}
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
return nameMap;
|
|
|
|
|
} // GetNameMap ()
|
2014-10-21 16:14:35 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/***************************************************************
|
2020-02-03 15:22:41 -08:00
|
|
|
* Docs for a single TypeId
|
2014-10-21 16:14:35 -07:00
|
|
|
***************************************************************/
|
|
|
|
|
|
2012-11-07 15:32:36 -08:00
|
|
|
/**
|
2020-02-03 15:22:41 -08:00
|
|
|
* Print config paths
|
|
|
|
|
* \param os the output stream
|
|
|
|
|
* \param tid the type ID
|
2012-11-07 15:32:36 -08:00
|
|
|
*/
|
2020-02-03 15:22:41 -08:00
|
|
|
void
|
|
|
|
|
PrintConfigPaths (std::ostream & os, const TypeId tid)
|
2008-04-10 11:50:47 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
NS_LOG_FUNCTION (tid);
|
|
|
|
|
std::vector<std::string> paths = GetTypicalAggregations ().Get (tid);
|
2015-01-29 19:03:22 -08:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
// Config --------------
|
|
|
|
|
if (paths.empty ())
|
|
|
|
|
{
|
|
|
|
|
os << "Introspection did not find any typical Config paths."
|
|
|
|
|
<< breakBoth
|
|
|
|
|
<< std::endl;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
os << headingStart
|
|
|
|
|
<< "Config Paths"
|
|
|
|
|
<< headingStop
|
|
|
|
|
<< std::endl;
|
|
|
|
|
os << std::endl;
|
|
|
|
|
os << tid.GetName ()
|
|
|
|
|
<< " is accessible through the following paths"
|
|
|
|
|
<< " with Config::Set and Config::Connect:"
|
|
|
|
|
<< std::endl;
|
|
|
|
|
os << listStart << std::endl;
|
2022-10-06 22:34:11 +00:00
|
|
|
for (const auto& path : paths)
|
2020-02-03 15:22:41 -08:00
|
|
|
{
|
|
|
|
|
os << listLineStart
|
|
|
|
|
<< "\"" << path << "\""
|
2022-06-05 21:01:11 -07:00
|
|
|
<< listLineStop
|
2020-02-03 15:22:41 -08:00
|
|
|
<< breakTextOnly
|
|
|
|
|
<< std::endl;
|
|
|
|
|
}
|
|
|
|
|
os << listStop << std::endl;
|
|
|
|
|
}
|
|
|
|
|
} // PrintConfigPaths ()
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Print direct Attributes for this TypeId.
|
|
|
|
|
*
|
|
|
|
|
* Only attributes defined directly by this TypeId will be printed.
|
|
|
|
|
*
|
|
|
|
|
* \param [in,out] os The output stream.
|
|
|
|
|
* \param [in] tid The TypeId to print.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
PrintAttributesTid (std::ostream &os, const TypeId tid)
|
|
|
|
|
{
|
|
|
|
|
NS_LOG_FUNCTION (tid);
|
|
|
|
|
os << listStart << std::endl;
|
|
|
|
|
for (uint32_t j = 0; j < tid.GetAttributeN (); j++)
|
|
|
|
|
{
|
|
|
|
|
struct TypeId::AttributeInformation info = tid.GetAttribute(j);
|
|
|
|
|
os << listLineStart
|
|
|
|
|
<< boldStart << info.name << boldStop << ": "
|
|
|
|
|
<< info.help
|
|
|
|
|
<< std::endl;
|
2022-08-29 23:32:37 -07:00
|
|
|
os << indentHtmlOnly
|
2020-02-03 15:22:41 -08:00
|
|
|
<< listStart << std::endl;
|
|
|
|
|
os << " "
|
|
|
|
|
<< listLineStart
|
|
|
|
|
<< "Set with class: " << reference
|
|
|
|
|
<< info.checker->GetValueTypeName ()
|
|
|
|
|
<< listLineStop
|
|
|
|
|
<< std::endl;
|
2022-08-29 23:32:37 -07:00
|
|
|
|
|
|
|
|
std::string underType;
|
2020-02-03 15:22:41 -08:00
|
|
|
if (info.checker->HasUnderlyingTypeInformation ())
|
|
|
|
|
{
|
|
|
|
|
os << " "
|
|
|
|
|
<< listLineStart
|
|
|
|
|
<< "Underlying type: ";
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
std::string valType = info.checker->GetValueTypeName ();
|
2022-08-29 23:32:37 -07:00
|
|
|
underType = info.checker->GetUnderlyingTypeInformation ();
|
|
|
|
|
bool handled = false;
|
2020-02-03 15:22:41 -08:00
|
|
|
if ((valType != "ns3::EnumValue") && (underType != "std::string"))
|
|
|
|
|
{
|
|
|
|
|
// Indirect cases to handle
|
|
|
|
|
if (valType == "ns3::PointerValue")
|
|
|
|
|
{
|
|
|
|
|
const PointerChecker *ptrChecker =
|
|
|
|
|
dynamic_cast<const PointerChecker *> (PeekPointer (info.checker));
|
2022-10-06 21:45:05 +00:00
|
|
|
if (ptrChecker != nullptr)
|
2020-02-03 15:22:41 -08:00
|
|
|
{
|
|
|
|
|
os << reference << "ns3::Ptr" << "< "
|
|
|
|
|
<< reference << ptrChecker->GetPointeeTypeId ().GetName ()
|
|
|
|
|
<< ">";
|
|
|
|
|
handled = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (valType == "ns3::ObjectPtrContainerValue")
|
|
|
|
|
{
|
|
|
|
|
const ObjectPtrContainerChecker * ptrChecker =
|
|
|
|
|
dynamic_cast<const ObjectPtrContainerChecker *> (PeekPointer (info.checker));
|
2022-10-06 21:45:05 +00:00
|
|
|
if (ptrChecker != nullptr)
|
2020-02-03 15:22:41 -08:00
|
|
|
{
|
|
|
|
|
os << reference << "ns3::Ptr" << "< "
|
|
|
|
|
<< reference << ptrChecker->GetItemTypeId ().GetName ()
|
|
|
|
|
<< ">";
|
|
|
|
|
handled = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Helper to match first part of string
|
|
|
|
|
class StringBeginMatcher
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
StringBeginMatcher (const std::string s)
|
|
|
|
|
: m_string (s) { };
|
|
|
|
|
bool operator () (const std::string t)
|
|
|
|
|
{
|
|
|
|
|
std::size_t pos = m_string.find (t);
|
|
|
|
|
return pos == 0;
|
|
|
|
|
};
|
|
|
|
|
private:
|
|
|
|
|
std::string m_string;
|
|
|
|
|
};
|
|
|
|
|
StringBeginMatcher match (underType);
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
if ( match ("bool") || match ("double") ||
|
|
|
|
|
match ("int8_t") || match ("uint8_t") ||
|
|
|
|
|
match ("int16_t") || match ("uint16_t") ||
|
|
|
|
|
match ("int32_t") || match ("uint32_t") ||
|
|
|
|
|
match ("int64_t") || match ("uint64_t")
|
|
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
os << underType;
|
|
|
|
|
handled = true;
|
|
|
|
|
}
|
2022-08-29 23:32:37 -07:00
|
|
|
}
|
|
|
|
|
if (! handled)
|
|
|
|
|
{
|
|
|
|
|
os << codeWord << underType;
|
|
|
|
|
}
|
2020-02-03 15:22:41 -08:00
|
|
|
os << listLineStop << std::endl;
|
|
|
|
|
}
|
|
|
|
|
if (info.flags & TypeId::ATTR_CONSTRUCT && info.accessor->HasSetter ())
|
|
|
|
|
{
|
2022-08-29 23:32:37 -07:00
|
|
|
std::string value = info.initialValue->SerializeToString (info.checker);
|
|
|
|
|
if (underType == "std::string" && value == "")
|
|
|
|
|
{
|
|
|
|
|
value = "\"\"";
|
|
|
|
|
}
|
2020-02-03 15:22:41 -08:00
|
|
|
os << " "
|
|
|
|
|
<< listLineStart
|
|
|
|
|
<< "Initial value: "
|
2022-08-29 23:32:37 -07:00
|
|
|
<< value
|
2020-02-03 15:22:41 -08:00
|
|
|
<< listLineStop
|
|
|
|
|
<< std::endl;
|
|
|
|
|
}
|
2022-08-29 23:32:37 -07:00
|
|
|
bool moreFlags {false};
|
2020-02-03 15:22:41 -08:00
|
|
|
os << " " << listLineStart << "Flags: ";
|
|
|
|
|
if (info.flags & TypeId::ATTR_CONSTRUCT && info.accessor->HasSetter ())
|
|
|
|
|
{
|
2022-08-29 23:32:37 -07:00
|
|
|
os << flagSpanStart << "construct" << flagSpanStop;
|
|
|
|
|
moreFlags = true;
|
2020-02-03 15:22:41 -08:00
|
|
|
}
|
|
|
|
|
if (info.flags & TypeId::ATTR_SET && info.accessor->HasSetter ())
|
|
|
|
|
{
|
2022-08-29 23:32:37 -07:00
|
|
|
os << (outputText && moreFlags ? ", " : "")
|
|
|
|
|
<< flagSpanStart << "write" << flagSpanStop;
|
|
|
|
|
moreFlags = true;
|
2020-02-03 15:22:41 -08:00
|
|
|
}
|
|
|
|
|
if (info.flags & TypeId::ATTR_GET && info.accessor->HasGetter ())
|
|
|
|
|
{
|
2022-08-29 23:32:37 -07:00
|
|
|
os << (outputText && moreFlags ? ", " : "")
|
|
|
|
|
<< flagSpanStart << "read" << flagSpanStop;
|
|
|
|
|
moreFlags = true;
|
2020-02-03 15:22:41 -08:00
|
|
|
}
|
|
|
|
|
os << listLineStop << std::endl;
|
2022-08-29 23:32:37 -07:00
|
|
|
os << indentHtmlOnly
|
2020-02-03 15:22:41 -08:00
|
|
|
<< listStop
|
2022-08-29 23:32:37 -07:00
|
|
|
<< std::endl;
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
}
|
|
|
|
|
os << listStop << std::endl;
|
|
|
|
|
} // PrintAttributesTid ()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Print the Attributes block for tid,
|
|
|
|
|
* including Attributes declared in base classes.
|
|
|
|
|
*
|
|
|
|
|
* All Attributes of this TypeId will be printed,
|
|
|
|
|
* including those defined in parent classes.
|
|
|
|
|
*
|
|
|
|
|
* \param [in,out] os The output stream.
|
|
|
|
|
* \param [in] tid The TypeId to print.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
PrintAttributes (std::ostream & os, const TypeId tid)
|
|
|
|
|
{
|
|
|
|
|
NS_LOG_FUNCTION (tid);
|
|
|
|
|
if (tid.GetAttributeN () == 0)
|
|
|
|
|
{
|
|
|
|
|
os << "No Attributes are defined for this type."
|
|
|
|
|
<< breakBoth
|
|
|
|
|
<< std::endl;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
os << headingStart
|
|
|
|
|
<< "Attributes"
|
|
|
|
|
<< headingStop
|
|
|
|
|
<< std::endl;
|
|
|
|
|
PrintAttributesTid (os, tid);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Attributes from base classes
|
|
|
|
|
TypeId tmp = tid.GetParent ();
|
|
|
|
|
while (tmp.GetParent () != tmp)
|
|
|
|
|
{
|
|
|
|
|
if (tmp.GetAttributeN () != 0)
|
|
|
|
|
{
|
|
|
|
|
os << headingStart
|
|
|
|
|
<< "Attributes defined in parent class "
|
|
|
|
|
<< tmp.GetName ()
|
|
|
|
|
<< headingStop
|
|
|
|
|
<< std::endl;
|
|
|
|
|
PrintAttributesTid (os, tmp);
|
|
|
|
|
}
|
|
|
|
|
tmp = tmp.GetParent ();
|
|
|
|
|
|
|
|
|
|
} // Attributes
|
|
|
|
|
} // PrintAttributes ()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Print direct Trace sources for this TypeId.
|
|
|
|
|
*
|
|
|
|
|
* Only Trace sources defined directly by this TypeId will be printed.
|
|
|
|
|
*
|
|
|
|
|
* \param [in,out] os The output stream.
|
|
|
|
|
* \param [in] tid The TypeId to print.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
PrintTraceSourcesTid (std::ostream & os, const TypeId tid)
|
|
|
|
|
{
|
|
|
|
|
NS_LOG_FUNCTION (tid);
|
|
|
|
|
os << listStart << std::endl;
|
|
|
|
|
for (uint32_t i = 0; i < tid.GetTraceSourceN (); ++i)
|
|
|
|
|
{
|
|
|
|
|
struct TypeId::TraceSourceInformation info = tid.GetTraceSource (i);
|
|
|
|
|
os << listLineStart
|
|
|
|
|
<< boldStart << info.name << boldStop << ": "
|
2022-08-29 23:32:37 -07:00
|
|
|
<< info.help << breakBoth;
|
|
|
|
|
if (!outputText)
|
|
|
|
|
{
|
|
|
|
|
// '%' prevents doxygen from linking to the Callback class...
|
|
|
|
|
os << "%";
|
|
|
|
|
}
|
|
|
|
|
os << "Callback signature: "
|
2020-02-03 15:22:41 -08:00
|
|
|
<< info.callback
|
|
|
|
|
<< std::endl;
|
|
|
|
|
os << listLineStop << std::endl;
|
|
|
|
|
}
|
|
|
|
|
os << listStop << std::endl;
|
|
|
|
|
} // PrintTraceSourcesTid ()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Print the Trace sources block for tid,
|
|
|
|
|
* including Trace sources declared in base classes.
|
|
|
|
|
*
|
|
|
|
|
* All Trace sources of this TypeId will be printed,
|
|
|
|
|
* including those defined in parent classes.
|
|
|
|
|
*
|
|
|
|
|
* \param [in,out] os The output stream.
|
|
|
|
|
* \param [in] tid The TypeId to print.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
PrintTraceSources (std::ostream & os, const TypeId tid)
|
|
|
|
|
{
|
|
|
|
|
NS_LOG_FUNCTION (tid);
|
|
|
|
|
if (tid.GetTraceSourceN () == 0)
|
|
|
|
|
{
|
|
|
|
|
os << "No TraceSources are defined for this type."
|
|
|
|
|
<< breakBoth
|
|
|
|
|
<< std::endl;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
os << headingStart
|
|
|
|
|
<< "TraceSources"
|
|
|
|
|
<< headingStop << std::endl;
|
|
|
|
|
PrintTraceSourcesTid (os, tid);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Trace sources from base classes
|
|
|
|
|
TypeId tmp = tid.GetParent ();
|
|
|
|
|
while (tmp.GetParent () != tmp)
|
|
|
|
|
{
|
|
|
|
|
if (tmp.GetTraceSourceN () != 0)
|
|
|
|
|
{
|
|
|
|
|
os << headingStart
|
|
|
|
|
<< "TraceSources defined in parent class "
|
|
|
|
|
<< tmp.GetName ()
|
|
|
|
|
<< headingStop << std::endl;
|
|
|
|
|
PrintTraceSourcesTid (os, tmp);
|
|
|
|
|
}
|
|
|
|
|
tmp = tmp.GetParent ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // PrintTraceSources ()
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Print the size of the type represented by this tid.
|
|
|
|
|
*
|
|
|
|
|
* \param [in,out] os The output stream.
|
|
|
|
|
* \param [in] tid The TypeId to print.
|
|
|
|
|
*/
|
|
|
|
|
void PrintSize (std::ostream & os, const TypeId tid)
|
|
|
|
|
{
|
|
|
|
|
NS_LOG_FUNCTION (tid);
|
|
|
|
|
NS_ASSERT_MSG (CHAR_BIT != 0, "CHAR_BIT is zero");
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
std::size_t arch = (sizeof (void *) * CHAR_BIT);
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
os << boldStart << "Size" << boldStop
|
|
|
|
|
<< " of this type is " << tid.GetSize ()
|
|
|
|
|
<< " bytes (on a " << arch << "-bit architecture)."
|
|
|
|
|
<< std::endl;
|
|
|
|
|
} // PrintSize ()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Print the doxy block for each TypeId
|
|
|
|
|
*
|
|
|
|
|
* \param [in,out] os The output stream.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
PrintTypeIdBlocks (std::ostream & os)
|
|
|
|
|
{
|
|
|
|
|
NS_LOG_FUNCTION_NOARGS ();
|
2008-04-10 11:50:47 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
NameMap nameMap = GetNameMap ();
|
2014-10-05 17:58:48 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
// Iterate over the map, which will print the class names in
|
|
|
|
|
// alphabetical order.
|
2022-10-06 22:34:11 +00:00
|
|
|
for (const auto& item : nameMap)
|
2015-01-29 19:03:22 -08:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
// Handle only real TypeIds
|
|
|
|
|
if (item.second < 0)
|
|
|
|
|
{
|
|
|
|
|
continue ;
|
|
|
|
|
}
|
|
|
|
|
// Get the class's index out of the map;
|
|
|
|
|
TypeId tid = TypeId::GetRegistered (item.second);
|
|
|
|
|
std::string name = tid.GetName ();
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
std::cout << commentStart << std::endl;
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
std::cout << classStart << name << std::endl;
|
|
|
|
|
std::cout << std::endl;
|
|
|
|
|
|
|
|
|
|
PrintConfigPaths (std::cout, tid);
|
|
|
|
|
PrintAttributes (std::cout, tid);
|
|
|
|
|
PrintTraceSources (std::cout, tid);
|
|
|
|
|
PrintSize (std::cout, tid);
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
std::cout << commentStop << std::endl;
|
|
|
|
|
} // for class documentation
|
|
|
|
|
|
|
|
|
|
} // PrintTypeIdBlocks
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***************************************************************
|
|
|
|
|
* Lists of All things
|
|
|
|
|
***************************************************************/
|
|
|
|
|
|
2020-02-03 15:49:55 -08:00
|
|
|
/**
|
|
|
|
|
* Print the list of all TypeIds
|
|
|
|
|
*
|
|
|
|
|
* \param [in,out] os The output stream.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
PrintAllTypeIds (std::ostream & os)
|
|
|
|
|
{
|
|
|
|
|
NS_LOG_FUNCTION_NOARGS ();
|
2020-04-23 16:52:54 -07:00
|
|
|
os << commentStart << page << "TypeIdList All ns3::TypeId's\n"
|
2020-02-03 15:49:55 -08:00
|
|
|
<< std::endl;
|
2020-04-23 16:52:54 -07:00
|
|
|
os << "This is a list of all" << reference << "ns3::TypeId's.\n"
|
|
|
|
|
<< "For more information see the" << reference << "ns3::TypeId "
|
|
|
|
|
<< "section of this API documentation and the"
|
|
|
|
|
<< referenceNo << "TypeId section "
|
|
|
|
|
<< "in the Configuration and "
|
|
|
|
|
<< referenceNo << "Attributes chapter of the Manual.\n"
|
2020-02-03 15:49:55 -08:00
|
|
|
<< std::endl;
|
|
|
|
|
|
|
|
|
|
os << listStart << std::endl;
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2020-02-03 15:49:55 -08:00
|
|
|
NameMap nameMap = GetNameMap ();
|
|
|
|
|
// Iterate over the map, which will print the class names in
|
|
|
|
|
// alphabetical order.
|
2022-10-06 22:34:11 +00:00
|
|
|
for (const auto& item : nameMap)
|
2020-02-03 15:49:55 -08:00
|
|
|
{
|
|
|
|
|
// Handle only real TypeIds
|
|
|
|
|
if (item.second < 0)
|
|
|
|
|
{
|
|
|
|
|
continue ;
|
|
|
|
|
}
|
|
|
|
|
// Get the class's index out of the map;
|
|
|
|
|
TypeId tid = TypeId::GetRegistered (item.second);
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2020-02-03 15:49:55 -08:00
|
|
|
os << indentHtmlOnly
|
|
|
|
|
<< listLineStart
|
|
|
|
|
<< boldStart
|
|
|
|
|
<< tid.GetName ()
|
|
|
|
|
<< boldStop
|
|
|
|
|
<< listLineStop
|
|
|
|
|
<< std::endl;
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2020-02-03 15:49:55 -08:00
|
|
|
}
|
2020-04-23 16:52:54 -07:00
|
|
|
os << listStop << std::endl;
|
2020-02-03 15:49:55 -08:00
|
|
|
os << commentStop << std::endl;
|
|
|
|
|
|
|
|
|
|
} // PrintAllTypeIds ()
|
|
|
|
|
|
|
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
/**
|
|
|
|
|
* Print the list of all Attributes.
|
|
|
|
|
*
|
|
|
|
|
* \param [in,out] os The output stream.
|
|
|
|
|
*
|
|
|
|
|
* \todo Print this sorted by class (the current version)
|
|
|
|
|
* as well as by Attribute name.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
PrintAllAttributes (std::ostream & os)
|
|
|
|
|
{
|
|
|
|
|
NS_LOG_FUNCTION_NOARGS ();
|
|
|
|
|
os << commentStart << page << "AttributeList All Attributes\n"
|
|
|
|
|
<< std::endl;
|
2022-01-07 23:34:10 -06:00
|
|
|
os << "This is a list of all" << reference << "attributes classes. "
|
|
|
|
|
<< "For more information see the" << reference << "attributes "
|
2020-02-03 15:22:41 -08:00
|
|
|
<< "section of this API documentation and the Attributes sections "
|
|
|
|
|
<< "in the Tutorial and Manual.\n"
|
|
|
|
|
<< std::endl;
|
|
|
|
|
|
|
|
|
|
NameMap nameMap = GetNameMap ();
|
|
|
|
|
// Iterate over the map, which will print the class names in
|
|
|
|
|
// alphabetical order.
|
2022-10-06 22:34:11 +00:00
|
|
|
for (const auto& item: nameMap)
|
2015-01-29 19:03:22 -08:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
// Handle only real TypeIds
|
|
|
|
|
if (item.second < 0)
|
|
|
|
|
{
|
|
|
|
|
continue ;
|
|
|
|
|
}
|
|
|
|
|
// Get the class's index out of the map;
|
|
|
|
|
TypeId tid = TypeId::GetRegistered (item.second);
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
if (tid.GetAttributeN () == 0 )
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
os << boldStart << tid.GetName () << boldStop << breakHtmlOnly
|
|
|
|
|
<< std::endl;
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
os << listStart << std::endl;
|
|
|
|
|
for (uint32_t j = 0; j < tid.GetAttributeN (); ++j)
|
|
|
|
|
{
|
|
|
|
|
struct TypeId::AttributeInformation info = tid.GetAttribute(j);
|
|
|
|
|
os << listLineStart
|
|
|
|
|
<< boldStart << info.name << boldStop
|
|
|
|
|
<< ": " << info.help
|
|
|
|
|
<< listLineStop
|
|
|
|
|
<< std::endl;
|
|
|
|
|
}
|
|
|
|
|
os << listStop << std::endl;
|
2015-01-29 19:03:22 -08:00
|
|
|
}
|
2020-02-03 15:22:41 -08:00
|
|
|
os << commentStop << std::endl;
|
2015-01-29 19:03:22 -08:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
} // PrintAllAttributes ()
|
2008-04-10 11:50:47 -07:00
|
|
|
|
2014-10-05 17:58:48 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
/**
|
|
|
|
|
* Print the list of all global variables.
|
|
|
|
|
*
|
|
|
|
|
* \param [in,out] os The output stream.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
PrintAllGlobals (std::ostream & os)
|
2008-04-10 11:50:47 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
NS_LOG_FUNCTION_NOARGS ();
|
|
|
|
|
os << commentStart << page << "GlobalValueList All GlobalValues\n"
|
|
|
|
|
<< std::endl;
|
|
|
|
|
os << "This is a list of all" << reference << "ns3::GlobalValue instances.\n"
|
2020-04-27 15:23:28 -07:00
|
|
|
<< "See ns3::GlobalValue for how to set these."
|
2020-02-03 15:22:41 -08:00
|
|
|
<< std::endl;
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
os << listStart << std::endl;
|
|
|
|
|
for (GlobalValue::Iterator i = GlobalValue::Begin ();
|
|
|
|
|
i != GlobalValue::End ();
|
|
|
|
|
++i)
|
2008-04-10 11:50:47 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
StringValue val;
|
|
|
|
|
(*i)->GetValue (val);
|
|
|
|
|
os << indentHtmlOnly
|
|
|
|
|
<< listLineStart
|
|
|
|
|
<< boldStart
|
2020-04-23 16:52:54 -07:00
|
|
|
<< hrefStart << (*i)->GetName ()
|
|
|
|
|
<< hrefMid << "GlobalValue" << (*i)->GetName ()
|
|
|
|
|
<< hrefStop
|
2020-02-03 15:22:41 -08:00
|
|
|
<< boldStop
|
2020-04-23 16:52:54 -07:00
|
|
|
<< ": " << (*i)->GetHelp ()
|
2022-08-29 23:32:37 -07:00
|
|
|
<< ". Default value: " << val.Get () << "."
|
2020-02-03 15:22:41 -08:00
|
|
|
<< listLineStop
|
|
|
|
|
<< std::endl;
|
2008-04-10 11:50:47 -07:00
|
|
|
}
|
2020-02-03 15:22:41 -08:00
|
|
|
os << listStop << std::endl;
|
|
|
|
|
os << commentStop << std::endl;
|
2008-04-10 11:50:47 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
} // PrintAllGlobals ()
|
2014-10-05 17:58:48 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Print the list of all LogComponents.
|
|
|
|
|
*
|
|
|
|
|
* \param [in,out] os The output stream.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
PrintAllLogComponents (std::ostream & os)
|
2008-04-10 11:50:47 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
NS_LOG_FUNCTION_NOARGS ();
|
|
|
|
|
os << commentStart << page << "LogComponentList All LogComponents\n"
|
|
|
|
|
<< std::endl;
|
|
|
|
|
os << "This is a list of all" << reference << "ns3::LogComponent instances.\n"
|
|
|
|
|
<< std::endl;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \todo Switch to a border-less table, so the file links align
|
2022-06-06 01:24:09 -03:00
|
|
|
* See https://www.doxygen.nl/manual/htmlcmds.html
|
2020-02-03 15:22:41 -08:00
|
|
|
*/
|
|
|
|
|
LogComponent::ComponentList * logs = LogComponent::GetComponentList ();
|
|
|
|
|
// Find longest log name
|
|
|
|
|
std::size_t widthL = std::string ("Log Component").size ();
|
|
|
|
|
std::size_t widthR = std::string ("file").size ();
|
2022-10-06 22:34:11 +00:00
|
|
|
for (const auto& it : (*logs))
|
2008-04-10 11:50:47 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
widthL = std::max (widthL, it.first.size ());
|
|
|
|
|
std::string file = it.second->File ();
|
|
|
|
|
// Strip leading "../" related to depth in build directory
|
|
|
|
|
// since doxygen only sees the path starting with "src/", etc.
|
|
|
|
|
while (file.find ("../") == 0)
|
|
|
|
|
{
|
|
|
|
|
file = file.substr (3);
|
|
|
|
|
}
|
|
|
|
|
widthR = std::max (widthR, file.size ());
|
2008-04-10 11:50:47 -07:00
|
|
|
}
|
2022-08-29 23:32:37 -07:00
|
|
|
const std::string tLeft ("| ");
|
|
|
|
|
const std::string tMid (" | ");
|
|
|
|
|
const std::string tRight (" |");
|
2020-02-03 15:22:41 -08:00
|
|
|
|
2022-08-29 23:32:37 -07:00
|
|
|
// Header line has to be padded to same length as separator line
|
|
|
|
|
os << tLeft << std::setw (widthL) << std::left << "Log Component"
|
|
|
|
|
<< tMid << std::setw (widthR) << std::left << "File" << tRight
|
|
|
|
|
<< std::endl;
|
|
|
|
|
os << tLeft << ":" << std::string (widthL - 1, '-')
|
|
|
|
|
<< tMid << ":" << std::string (widthR - 1, '-') << tRight
|
|
|
|
|
<< std::endl;
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
LogComponent::ComponentList::const_iterator it;
|
2022-10-06 22:34:11 +00:00
|
|
|
for (const auto& it : (*logs))
|
2020-02-03 15:22:41 -08:00
|
|
|
{
|
|
|
|
|
std::string file = it.second->File ();
|
|
|
|
|
// Strip leading "../" related to depth in build directory
|
|
|
|
|
// since doxygen only sees the path starting with "src/", etc.
|
|
|
|
|
while (file.find ("../") == 0)
|
|
|
|
|
{
|
|
|
|
|
file = file.substr (3);
|
|
|
|
|
}
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2022-08-29 23:32:37 -07:00
|
|
|
os << tLeft << std::setw (widthL) << std::left << it.first
|
|
|
|
|
<< tMid << std::setw (widthR) << file << tRight
|
|
|
|
|
<< std::endl;
|
2020-02-03 15:22:41 -08:00
|
|
|
}
|
|
|
|
|
os << std::right << std::endl;
|
|
|
|
|
os << commentStop << std::endl;
|
|
|
|
|
} // PrintAllLogComponents ()
|
2008-04-10 11:50:47 -07:00
|
|
|
|
2014-10-05 17:58:48 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
/**
|
|
|
|
|
* Print the list of all Trace sources.
|
|
|
|
|
*
|
|
|
|
|
* \param [in,out] os The output stream.
|
|
|
|
|
*
|
|
|
|
|
* \todo Print this sorted by class (the current version)
|
|
|
|
|
* as well as by TraceSource name.
|
|
|
|
|
*/
|
2008-04-10 11:50:47 -07:00
|
|
|
void
|
2020-02-03 15:22:41 -08:00
|
|
|
PrintAllTraceSources (std::ostream & os)
|
2008-04-10 11:50:47 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
NS_LOG_FUNCTION_NOARGS ();
|
|
|
|
|
os << commentStart << page << "TraceSourceList All TraceSources\n"
|
|
|
|
|
<< std::endl;
|
|
|
|
|
os << "This is a list of all" << reference << "tracing sources. "
|
|
|
|
|
<< "For more information see the " << reference << "tracing "
|
|
|
|
|
<< "section of this API documentation and the Tracing sections "
|
|
|
|
|
<< "in the Tutorial and Manual.\n"
|
|
|
|
|
<< std::endl;
|
2008-04-10 11:50:47 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
NameMap nameMap = GetNameMap ();
|
2014-10-05 17:58:48 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
// Iterate over the map, which will print the class names in
|
|
|
|
|
// alphabetical order.
|
2022-10-06 22:34:11 +00:00
|
|
|
for (const auto& item : nameMap)
|
2008-04-10 11:50:47 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
// Handle only real TypeIds
|
|
|
|
|
if (item.second < 0)
|
|
|
|
|
{
|
|
|
|
|
continue ;
|
|
|
|
|
}
|
|
|
|
|
// Get the class's index out of the map;
|
|
|
|
|
TypeId tid = TypeId::GetRegistered (item.second);
|
|
|
|
|
|
|
|
|
|
if (tid.GetTraceSourceN () == 0 )
|
2008-04-10 11:50:47 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
os << boldStart << tid.GetName () << boldStop << breakHtmlOnly
|
|
|
|
|
<< std::endl;
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
os << listStart << std::endl;
|
|
|
|
|
for (uint32_t j = 0; j < tid.GetTraceSourceN (); ++j)
|
|
|
|
|
{
|
|
|
|
|
struct TypeId::TraceSourceInformation info = tid.GetTraceSource(j);
|
2022-06-05 21:01:11 -07:00
|
|
|
os << listLineStart
|
2020-02-03 15:22:41 -08:00
|
|
|
<< boldStart << info.name << boldStop
|
|
|
|
|
<< ": " << info.help
|
|
|
|
|
<< listLineStop
|
|
|
|
|
<< std::endl;
|
2008-04-10 11:50:47 -07:00
|
|
|
}
|
2020-02-03 15:22:41 -08:00
|
|
|
os << listStop << std::endl;
|
|
|
|
|
}
|
|
|
|
|
os << commentStop << std::endl;
|
|
|
|
|
|
|
|
|
|
} // PrintAllTraceSources ()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***************************************************************
|
|
|
|
|
* Docs for Attribute classes
|
|
|
|
|
***************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Print the section definition for an AttributeValue.
|
|
|
|
|
*
|
|
|
|
|
* In doxygen form this will print a comment block with
|
|
|
|
|
* \verbatim
|
2021-12-21 17:06:57 +00:00
|
|
|
* \ingroup attributes
|
2020-02-03 15:22:41 -08:00
|
|
|
* \defgroup attribute_<name>Value <name>Value
|
|
|
|
|
* \endverbatim
|
|
|
|
|
*
|
|
|
|
|
* \param [in,out] os The output stream.
|
|
|
|
|
* \param [in] name The base name of the resulting AttributeValue type.
|
|
|
|
|
* \param [in] seeBase Print a "see also" pointing to the base class.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
PrintAttributeValueSection (std::ostream & os,
|
|
|
|
|
const std::string & name,
|
|
|
|
|
const bool seeBase = true)
|
|
|
|
|
{
|
|
|
|
|
NS_LOG_FUNCTION (name);
|
|
|
|
|
std::string section = "attribute_" + name;
|
|
|
|
|
|
2021-12-21 17:06:57 +00:00
|
|
|
// \ingroup attributes
|
2020-02-03 15:22:41 -08:00
|
|
|
// \defgroup attribute_<name>Value <name> Attribute
|
2021-12-21 17:06:57 +00:00
|
|
|
os << commentStart << sectionStart << "attributes\n"
|
2020-02-03 15:22:41 -08:00
|
|
|
<< subSectionStart << "attribute_" << name << " "
|
|
|
|
|
<< name << " Attribute\n"
|
2021-12-21 17:06:57 +00:00
|
|
|
<< "AttributeValue implementation for " << name << "\n";
|
2020-02-03 15:22:41 -08:00
|
|
|
if (seeBase)
|
|
|
|
|
{
|
|
|
|
|
// Some classes don't live in ns3::. Yuck
|
|
|
|
|
if (name != "IeMeshId")
|
|
|
|
|
{
|
|
|
|
|
os << seeAlso << "ns3::" << name << "\n";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
os << seeAlso << "ns3::dot11s::" << name << "\n";
|
|
|
|
|
}
|
2008-04-10 11:50:47 -07:00
|
|
|
}
|
2020-02-03 15:22:41 -08:00
|
|
|
os << commentStop;
|
2008-04-10 11:50:47 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
} // PrintAttributeValueSection ()
|
2014-10-05 17:58:48 -07:00
|
|
|
|
2008-04-10 11:50:47 -07:00
|
|
|
|
2015-01-29 19:03:22 -08:00
|
|
|
/**
|
2020-02-03 15:22:41 -08:00
|
|
|
* Print the AttributeValue documentation for a class.
|
2015-01-29 19:03:22 -08:00
|
|
|
*
|
2020-04-10 16:19:35 -07:00
|
|
|
* This will print documentation for the \pname{AttributeValue} class and methods.
|
2015-01-29 19:03:22 -08:00
|
|
|
*
|
2020-02-03 15:22:41 -08:00
|
|
|
* \param [in,out] os The output stream.
|
|
|
|
|
* \param [in] name The token to use in defining the accessor name.
|
|
|
|
|
* \param [in] type The underlying type name.
|
|
|
|
|
* \param [in] header The header file which contains this declaration.
|
2015-01-29 19:03:22 -08:00
|
|
|
*/
|
2008-04-10 11:50:47 -07:00
|
|
|
void
|
2020-02-03 15:22:41 -08:00
|
|
|
PrintAttributeValueWithName (std::ostream & os,
|
|
|
|
|
const std::string & name,
|
|
|
|
|
const std::string & type,
|
|
|
|
|
const std::string & header)
|
2008-04-10 11:50:47 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
NS_LOG_FUNCTION (name << type << header);
|
|
|
|
|
std::string sectAttr = sectionStart + "attribute_" + name;
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
// \ingroup attribute_<name>Value
|
|
|
|
|
// \class ns3::<name>Value "header"
|
|
|
|
|
std::string valClass = name + "Value";
|
|
|
|
|
std::string qualClass = " ns3::" + valClass;
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
os << commentStart << sectAttr << std::endl;
|
|
|
|
|
os << classStart << qualClass << " \"" << header << "\"" << std::endl;
|
|
|
|
|
os << "AttributeValue implementation for " << name << "." << std::endl;
|
|
|
|
|
os << seeAlso << "AttributeValue" << std::endl;
|
|
|
|
|
os << commentStop;
|
2014-10-05 17:58:48 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
// Copy ctor: <name>Value::<name>Value
|
|
|
|
|
os << commentStart
|
|
|
|
|
<< functionStart << name
|
|
|
|
|
<< qualClass << "::" << valClass;
|
|
|
|
|
if ( (name == "EmptyAttribute") ||
|
|
|
|
|
(name == "ObjectPtrContainer") )
|
2008-04-10 11:50:47 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
// Just default constructors.
|
|
|
|
|
os << "(void)\n";
|
2008-04-10 11:50:47 -07:00
|
|
|
}
|
2020-02-03 15:22:41 -08:00
|
|
|
else
|
2008-04-10 11:50:47 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
// Copy constructors
|
|
|
|
|
os << "(const " << type << " & value)\n"
|
|
|
|
|
<< "Copy constructor.\n"
|
|
|
|
|
<< argument << "[in] value The " << name << " value to copy.\n";
|
|
|
|
|
}
|
|
|
|
|
os << commentStop;
|
2012-05-01 10:18:37 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
// <name>Value::Get (void) const
|
|
|
|
|
os << commentStart
|
|
|
|
|
<< functionStart << type
|
|
|
|
|
<< qualClass << "::Get (void) const\n"
|
|
|
|
|
<< returns << "The " << name << " value.\n"
|
|
|
|
|
<< commentStop;
|
2012-05-01 10:18:37 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
// <name>Value::GetAccessor (T & value) const
|
|
|
|
|
os << commentStart
|
|
|
|
|
<< functionStart << "bool"
|
|
|
|
|
<< qualClass << "::GetAccessor (T & value) const\n"
|
|
|
|
|
<< "Access the " << name << " value as type " << codeWord << "T.\n"
|
|
|
|
|
<< templateArgument << "T " << templArgExplicit << "The type to cast to.\n"
|
|
|
|
|
<< argument << "[out] value The " << name << " value, as type "
|
|
|
|
|
<< codeWord << "T.\n"
|
|
|
|
|
<< returns << "true.\n"
|
|
|
|
|
<< commentStop;
|
|
|
|
|
|
|
|
|
|
// <name>Value::Set (const name & value)
|
|
|
|
|
if (type != "Callback") // Yuck
|
2008-04-10 11:50:47 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
os << commentStart
|
|
|
|
|
<< functionStart << "void"
|
|
|
|
|
<< qualClass << "::Set (const " << type << " & value)\n"
|
|
|
|
|
<< "Set the value.\n"
|
|
|
|
|
<< argument << "[in] value The value to adopt.\n"
|
|
|
|
|
<< commentStop;
|
2009-06-24 09:45:31 +02:00
|
|
|
}
|
2020-02-03 15:22:41 -08:00
|
|
|
|
|
|
|
|
// <name>Value::m_value
|
|
|
|
|
os << commentStart
|
|
|
|
|
<< variable << type
|
2022-06-05 21:01:11 -07:00
|
|
|
<< qualClass << "::m_value\n"
|
2020-02-03 15:22:41 -08:00
|
|
|
<< "The stored " << name << " instance.\n"
|
|
|
|
|
<< commentStop
|
|
|
|
|
<< std::endl;
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
} // PrintAttributeValueWithName ()
|
2009-06-24 09:45:31 +02:00
|
|
|
|
2014-10-05 17:58:48 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
/**
|
|
|
|
|
* Print the AttributeValue MakeAccessor documentation for a class.
|
|
|
|
|
*
|
2020-04-10 16:19:35 -07:00
|
|
|
* This will print documentation for the \pname{Make<name>Accessor} functions.
|
2020-02-03 15:22:41 -08:00
|
|
|
*
|
|
|
|
|
* \param [in,out] os The output stream.
|
|
|
|
|
* \param [in] name The token to use in defining the accessor name.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
PrintMakeAccessors (std::ostream & os, const std::string & name)
|
2007-08-27 20:25:15 +02:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
NS_LOG_FUNCTION (name);
|
|
|
|
|
std::string sectAttr = sectionStart + "attribute_" + name + "\n";
|
|
|
|
|
std::string make = "ns3::Make" + name + "Accessor ";
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
// \ingroup attribute_<name>Value
|
|
|
|
|
// Make<name>Accessor (T1 a1)
|
|
|
|
|
os << commentStart << sectAttr
|
|
|
|
|
<< functionStart << "ns3::Ptr<const ns3::AttributeAccessor> "
|
|
|
|
|
<< make << "(T1 a1)\n"
|
|
|
|
|
<< copyDoc << "ns3::MakeAccessorHelper(T1)\n"
|
|
|
|
|
<< seeAlso << "AttributeAccessor\n"
|
|
|
|
|
<< commentStop;
|
2012-12-05 17:06:27 -08:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
// \ingroup attribute_<name>Value
|
|
|
|
|
// Make<name>Accessor (T1 a1)
|
|
|
|
|
os << commentStart << sectAttr
|
|
|
|
|
<< functionStart << "ns3::Ptr<const ns3::AttributeAccessor> "
|
|
|
|
|
<< make << "(T1 a1, T2 a2)\n"
|
|
|
|
|
<< copyDoc << "ns3::MakeAccessorHelper(T1,T2)\n"
|
|
|
|
|
<< seeAlso << "AttributeAccessor\n"
|
|
|
|
|
<< commentStop;
|
|
|
|
|
} // PrintMakeAccessors ()
|
2007-08-27 20:25:15 +02:00
|
|
|
|
2014-10-05 17:58:48 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
/**
|
|
|
|
|
* Print the AttributeValue MakeChecker documentation for a class.
|
|
|
|
|
*
|
2020-04-10 16:19:35 -07:00
|
|
|
* This will print documentation for the \pname{Make<name>Checker} function.
|
2020-02-03 15:22:41 -08:00
|
|
|
*
|
|
|
|
|
* \param [in,out] os The output stream.
|
|
|
|
|
* \param [in] name The token to use in defining the accessor name.
|
|
|
|
|
* \param [in] header The header file which contains this declaration.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
PrintMakeChecker (std::ostream & os,
|
|
|
|
|
const std::string & name,
|
|
|
|
|
const std::string & header)
|
|
|
|
|
{
|
|
|
|
|
NS_LOG_FUNCTION (name << header);
|
|
|
|
|
std::string sectAttr = sectionStart + "attribute_" + name + "\n";
|
|
|
|
|
std::string make = "ns3::Make" + name + "Checker ";
|
|
|
|
|
|
|
|
|
|
// \ingroup attribute_<name>Value
|
|
|
|
|
// class <name>Checker
|
|
|
|
|
os << commentStart << sectAttr << std::endl;
|
|
|
|
|
os << classStart << " ns3::" << name << "Checker"
|
|
|
|
|
<< " \"" << header << "\"" << std::endl;
|
|
|
|
|
os << "AttributeChecker implementation for " << name << "Value." << std::endl;
|
|
|
|
|
os << seeAlso << "AttributeChecker" << std::endl;
|
|
|
|
|
os << commentStop;
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
// \ingroup attribute_<name>Value
|
|
|
|
|
// Make<name>Checker (void)
|
|
|
|
|
os << commentStart << sectAttr
|
|
|
|
|
<< functionStart << "ns3::Ptr<const ns3::AttributeChecker> "
|
|
|
|
|
<< make << "(void)\n"
|
|
|
|
|
<< returns << "The AttributeChecker.\n"
|
|
|
|
|
<< seeAlso << "AttributeChecker\n"
|
|
|
|
|
<< commentStop;
|
|
|
|
|
} // PrintMakeChecker ()
|
2011-09-20 12:12:08 -07:00
|
|
|
|
2014-10-05 17:58:48 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
/**Descriptor for an AttributeValue. */
|
|
|
|
|
typedef struct {
|
|
|
|
|
const std::string m_name; //!< The base name of the resulting AttributeValue type.
|
|
|
|
|
const std::string m_type; //!< The name of the underlying type.
|
|
|
|
|
const bool m_seeBase; //!< Print a "see also" pointing to the base class.
|
|
|
|
|
const std::string m_header; //!< The header file name.
|
|
|
|
|
} AttributeDescriptor;
|
2014-10-05 17:58:48 -07:00
|
|
|
|
|
|
|
|
|
2017-02-24 09:23:49 -08:00
|
|
|
/**
|
2020-02-03 15:22:41 -08:00
|
|
|
* Print documentation corresponding to use of the
|
|
|
|
|
* ATTRIBUTE_HELPER_HEADER macro or
|
|
|
|
|
* ATTRIBUTE_VALUE_DEFINE_WITH_NAME macro.
|
2017-02-24 09:23:49 -08:00
|
|
|
*
|
2020-02-03 15:22:41 -08:00
|
|
|
* \param [in,out] os The output stream.
|
|
|
|
|
* \param [in] attr The AttributeDescriptor.
|
2017-02-24 09:23:49 -08:00
|
|
|
*/
|
2020-02-03 15:22:41 -08:00
|
|
|
void
|
|
|
|
|
PrintAttributeHelper (std::ostream & os,
|
|
|
|
|
const AttributeDescriptor & attr)
|
2014-10-05 17:58:48 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
NS_LOG_FUNCTION (attr.m_name << attr.m_type << attr.m_seeBase <<
|
|
|
|
|
attr.m_header);
|
|
|
|
|
PrintAttributeValueSection (os, attr.m_name, attr.m_seeBase);
|
|
|
|
|
PrintAttributeValueWithName (os, attr.m_name, attr.m_type, attr.m_header);
|
|
|
|
|
PrintMakeAccessors (os, attr.m_name);
|
|
|
|
|
PrintMakeChecker (os, attr.m_name, attr.m_header);
|
|
|
|
|
} // PrintAttributeHelper ()
|
2014-10-05 17:58:48 -07:00
|
|
|
|
|
|
|
|
|
2017-02-24 09:23:49 -08:00
|
|
|
/**
|
2020-02-03 15:22:41 -08:00
|
|
|
* Print documentation for Attribute implementations.
|
2020-04-10 17:29:54 -07:00
|
|
|
* \param os The stream to print on.
|
2017-02-24 09:23:49 -08:00
|
|
|
*/
|
2014-10-05 17:58:48 -07:00
|
|
|
void
|
2020-02-03 15:22:41 -08:00
|
|
|
PrintAttributeImplementations (std::ostream & os)
|
2014-10-05 17:58:48 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
NS_LOG_FUNCTION_NOARGS ();
|
2014-10-05 17:58:48 -07:00
|
|
|
|
2022-08-26 22:42:46 +01:00
|
|
|
// clang-format off
|
2020-02-03 15:22:41 -08:00
|
|
|
const AttributeDescriptor attributes [] =
|
2014-10-05 17:58:48 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
// Name Type see Base header-file
|
|
|
|
|
// Users of ATTRIBUTE_HELPER_HEADER
|
|
|
|
|
//
|
|
|
|
|
{ "Address", "Address", true, "address.h" },
|
|
|
|
|
{ "Box", "Box", true, "box.h" },
|
|
|
|
|
{ "DataRate", "DataRate", true, "data-rate.h" },
|
2020-10-02 11:06:06 -07:00
|
|
|
{ "Length", "Length", true, "length.h" },
|
2020-02-03 15:22:41 -08:00
|
|
|
{ "IeMeshId", "IeMeshId", true, "ie-dot11s-id.h" },
|
|
|
|
|
{ "Ipv4Address", "Ipv4Address", true, "ipv4-address.h" },
|
|
|
|
|
{ "Ipv4Mask", "Ipv4Mask", true, "ipv4-address.h" },
|
|
|
|
|
{ "Ipv6Address", "Ipv6Address", true, "ipv6-address.h" },
|
|
|
|
|
{ "Ipv6Prefix", "Ipv6Prefix", true, "ipv6-address.h" },
|
|
|
|
|
{ "Mac16Address", "Mac16Address", true, "mac16-address.h" },
|
|
|
|
|
{ "Mac48Address", "Mac48Address", true, "mac48-address.h" },
|
|
|
|
|
{ "Mac64Address", "Mac64Address", true, "mac64-address.h" },
|
|
|
|
|
{ "ObjectFactory", "ObjectFactory", true, "object-factory.h" },
|
|
|
|
|
{ "OrganizationIdentifier",
|
|
|
|
|
"OrganizationIdentifier",
|
|
|
|
|
true, "vendor-specific-action.h" },
|
2022-01-05 00:22:31 -06:00
|
|
|
{ "Priomap", "Priomap", true, "prio-queue-disc.h" },
|
|
|
|
|
{ "QueueSize", "QueueSize", true, "queue-size.h" },
|
2020-02-03 15:22:41 -08:00
|
|
|
{ "Rectangle", "Rectangle", true, "rectangle.h" },
|
|
|
|
|
{ "Ssid", "Ssid", true, "ssid.h" },
|
|
|
|
|
{ "TypeId", "TypeId", true, "type-id.h" },
|
|
|
|
|
{ "UanModesList", "UanModesList", true, "uan-tx-mode.h" },
|
2022-01-17 09:49:08 -06:00
|
|
|
{ "ValueClassTest", "ValueClassTest", false, "attribute-test-suite.cc" /* core/test/ */ },
|
2020-04-10 17:29:54 -07:00
|
|
|
{ "Vector", "Vector", true, "vector.h" },
|
2020-02-03 15:22:41 -08:00
|
|
|
{ "Vector2D", "Vector2D", true, "vector.h" },
|
|
|
|
|
{ "Vector3D", "Vector3D", true, "vector.h" },
|
|
|
|
|
{ "Waypoint", "Waypoint", true, "waypoint.h" },
|
|
|
|
|
{ "WifiMode", "WifiMode", true, "wifi-mode.h" },
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
// All three (Value, Access and Checkers) defined, but custom
|
2020-04-23 16:52:54 -07:00
|
|
|
{ "Boolean", "bool", false, "boolean.h" },
|
2020-02-03 15:22:41 -08:00
|
|
|
{ "Callback", "Callback", true, "callback.h" },
|
|
|
|
|
{ "Double", "double", false, "double.h" },
|
|
|
|
|
{ "Enum", "int", false, "enum.h" },
|
|
|
|
|
{ "Integer", "int64_t", false, "integer.h" },
|
|
|
|
|
{ "Pointer", "Pointer", false, "pointer.h" },
|
|
|
|
|
{ "String", "std::string", false, "string.h" },
|
|
|
|
|
{ "Time", "Time", true, "nstime.h" },
|
|
|
|
|
{ "Uinteger", "uint64_t", false, "uinteger.h" },
|
|
|
|
|
{ "", "", false, "last placeholder" }
|
|
|
|
|
};
|
2022-08-26 22:42:46 +01:00
|
|
|
// clang-format on
|
2020-02-03 15:22:41 -08:00
|
|
|
|
|
|
|
|
int i = 0;
|
|
|
|
|
while (attributes[i].m_name != "")
|
2014-10-05 17:58:48 -07:00
|
|
|
{
|
2020-02-03 15:22:41 -08:00
|
|
|
PrintAttributeHelper (os, attributes[i]);
|
|
|
|
|
++i;
|
2014-10-05 17:58:48 -07:00
|
|
|
}
|
2020-02-03 15:22:41 -08:00
|
|
|
|
|
|
|
|
// Special cases
|
|
|
|
|
PrintAttributeValueSection (os, "EmptyAttribute", false);
|
|
|
|
|
PrintAttributeValueWithName (os, "EmptyAttribute", "EmptyAttribute",
|
|
|
|
|
"attribute.h");
|
|
|
|
|
|
|
|
|
|
PrintAttributeValueSection (os, "ObjectPtrContainer", false);
|
|
|
|
|
PrintAttributeValueWithName (os, "ObjectPtrContainer", "ObjectPtrContainer", "object-ptr-container.h");
|
|
|
|
|
PrintMakeChecker (os, "ObjectPtrContainer", "object-ptr-container.h");
|
|
|
|
|
|
|
|
|
|
PrintAttributeValueSection (os, "ObjectVector", false);
|
|
|
|
|
PrintMakeAccessors (os, "ObjectVector");
|
|
|
|
|
PrintMakeChecker (os, "ObjectVector", "object-vector.h");
|
|
|
|
|
|
|
|
|
|
PrintAttributeValueSection (os, "ObjectMap", false);
|
|
|
|
|
PrintMakeAccessors (os, "ObjectMap");
|
|
|
|
|
PrintMakeChecker (os, "ObjectMap", "object-map.h");
|
2020-08-25 13:03:03 -06:00
|
|
|
|
|
|
|
|
PrintAttributeValueSection (os, "Pair", false);
|
2020-09-10 16:43:51 -06:00
|
|
|
PrintAttributeValueWithName (os, "Pair", "std::pair<A, B>", "pair.h");
|
2020-08-25 13:03:03 -06:00
|
|
|
PrintMakeChecker (os, "Pair", "pair.h");
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2021-11-16 12:18:12 +01:00
|
|
|
PrintAttributeValueSection (os, "Tuple", false);
|
|
|
|
|
PrintAttributeValueWithName (os, "Tuple", "std::tuple<Args...>", "tuple.h");
|
|
|
|
|
PrintMakeChecker (os, "Tuple", "tuple.h");
|
|
|
|
|
|
2022-01-31 22:19:11 +00:00
|
|
|
// AttributeContainer is already documented.
|
|
|
|
|
// PrintAttributeValueSection (os, "AttributeContainer", false);
|
|
|
|
|
// PrintAttributeValueWithName (os, "AttributeContainer", "AttributeContainer", "attribute-container.h");
|
2020-08-25 13:03:03 -06:00
|
|
|
PrintMakeChecker (os, "AttributeContainer", "attribute-container.h");
|
2020-02-03 15:22:41 -08:00
|
|
|
} // PrintAttributeImplementations ()
|
|
|
|
|
|
2014-10-05 17:58:48 -07:00
|
|
|
|
2014-10-21 16:14:35 -07:00
|
|
|
/***************************************************************
|
|
|
|
|
* Main
|
|
|
|
|
***************************************************************/
|
|
|
|
|
|
2014-10-05 17:58:48 -07:00
|
|
|
int main (int argc, char *argv[])
|
|
|
|
|
{
|
2014-10-08 13:52:14 -07:00
|
|
|
NS_LOG_FUNCTION_NOARGS ();
|
2014-10-05 17:58:48 -07:00
|
|
|
|
2020-05-01 14:42:53 -07:00
|
|
|
CommandLine cmd (__FILE__);
|
2014-10-05 17:58:48 -07:00
|
|
|
cmd.Usage ("Generate documentation for all ns-3 registered types, "
|
|
|
|
|
"trace sources, attributes and global variables.");
|
|
|
|
|
cmd.AddValue ("output-text", "format output as plain text", outputText);
|
|
|
|
|
cmd.Parse (argc, argv);
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2022-08-29 23:32:37 -07:00
|
|
|
SetMarkup ();
|
2014-10-05 17:58:48 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
// Create a Node, to force linking and instantiation of our TypeIds
|
|
|
|
|
NodeContainer c;
|
|
|
|
|
c.Create (1);
|
|
|
|
|
|
2014-10-06 17:24:00 -07:00
|
|
|
// mode-line: helpful when debugging introspected-doxygen.h
|
|
|
|
|
if (!outputText)
|
|
|
|
|
{
|
|
|
|
|
std::cout << "/* -*- Mode:C++; c-file-style:\"gnu\"; "
|
2020-04-23 16:52:54 -07:00
|
|
|
"indent-tabs-mode:nil; -*- */\n"
|
2014-10-06 17:24:00 -07:00
|
|
|
<< std::endl;
|
|
|
|
|
}
|
2017-08-29 07:56:38 -07:00
|
|
|
|
|
|
|
|
std::cout << std::endl;
|
|
|
|
|
std::cout << commentStart
|
|
|
|
|
<< file << "\n"
|
|
|
|
|
<< sectionStart << "utils\n"
|
|
|
|
|
<< "Doxygen docs generated from the TypeId database.\n"
|
|
|
|
|
<< note << "This file is automatically generated by "
|
|
|
|
|
<< codeWord << "print-introspected-doxygen.cc. Do not edit this file! "
|
|
|
|
|
<< "Edit that file instead.\n"
|
|
|
|
|
<< commentStop
|
|
|
|
|
<< std::endl;
|
2007-10-29 14:55:16 +01:00
|
|
|
|
2020-02-03 15:22:41 -08:00
|
|
|
PrintTypeIdBlocks (std::cout);
|
2022-06-05 21:01:11 -07:00
|
|
|
|
2020-02-03 15:49:55 -08:00
|
|
|
PrintAllTypeIds (std::cout);
|
2014-10-05 17:58:48 -07:00
|
|
|
PrintAllAttributes (std::cout);
|
|
|
|
|
PrintAllGlobals (std::cout);
|
2014-10-06 17:24:00 -07:00
|
|
|
PrintAllLogComponents (std::cout);
|
|
|
|
|
PrintAllTraceSources (std::cout);
|
2014-10-21 16:14:35 -07:00
|
|
|
PrintAttributeImplementations (std::cout);
|
2009-06-08 14:14:04 +02:00
|
|
|
|
2007-08-27 20:25:15 +02:00
|
|
|
return 0;
|
|
|
|
|
}
|