A Discrete-Event Network Simulator
API
print-introspected-doxygen.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2007 INRIA
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18  */
19 
26 #include "ns3/command-line.h"
27 #include "ns3/config.h"
28 #include "ns3/global-value.h"
29 #include "ns3/log.h"
30 #include "ns3/node-container.h"
31 #include "ns3/object-vector.h"
32 #include "ns3/object.h"
33 #include "ns3/pointer.h"
34 #include "ns3/simple-channel.h"
35 #include "ns3/string.h"
36 #include "ns3/system-path.h"
37 
38 #include <algorithm>
39 #include <climits> // CHAR_BIT
40 #include <iomanip>
41 #include <iostream>
42 #include <map>
43 #include <utility> // as_const
44 
45 using namespace ns3;
46 
47 NS_LOG_COMPONENT_DEFINE("PrintIntrospectedDoxygen");
48 
49 namespace
50 {
52 bool outputText = false;
53 
58 std::string anchor;
59 std::string argument;
60 std::string boldStart;
61 std::string boldStop;
62 std::string breakBoth;
63 std::string breakHtmlOnly;
64 std::string breakTextOnly;
65 std::string brief;
66 std::string classStart;
67 std::string classStop;
68 std::string codeWord;
69 std::string commentStart;
70 std::string commentStop;
71 std::string copyDoc;
72 std::string file;
73 std::string flagSpanStart;
74 std::string flagSpanStop;
75 std::string functionStart;
76 std::string functionStop;
77 std::string headingStart;
78 std::string headingStop;
79 // Linking: [The link text displayed](\ref TheTarget)
80 std::string hrefStart;
81 std::string hrefMid;
82 std::string hrefStop;
83 std::string indentHtmlOnly;
84 std::string listLineStart;
85 std::string listLineStop;
86 std::string listStart;
87 std::string listStop;
88 std::string note;
89 std::string page;
90 std::string reference;
91 std::string referenceNo;
92 std::string returns;
93 std::string sectionStart;
94 std::string seeAlso;
95 std::string subSectionStart;
96 std::string templArgDeduced;
97 std::string templArgExplicit;
98 std::string templateArgument;
99 std::string variable;
100 
108 std::map<std::string, ns3::TypeId::AttributeInformation>
110 {
111  std::map<std::string, ns3::TypeId::AttributeInformation> index;
112  for (uint32_t j = 0; j < tid.GetAttributeN(); j++)
113  {
114  struct TypeId::AttributeInformation info = tid.GetAttribute(j);
115  index[info.name] = info;
116  }
117  return index;
118 }
119 
126 std::map<std::string, ns3::TypeId::TraceSourceInformation>
128 {
129  std::map<std::string, ns3::TypeId::TraceSourceInformation> index;
130  for (uint32_t j = 0; j < tid.GetTraceSourceN(); j++)
131  {
132  struct TypeId::TraceSourceInformation info = tid.GetTraceSource(j);
133  index[info.name] = info;
134  }
135  return index;
136 }
137 
138 } // unnamed namespace
139 
143 void
145 {
147  if (outputText)
148  {
149  anchor = "";
150  argument = " Arg: ";
151  boldStart = "";
152  boldStop = "";
153  breakBoth = "\n";
154  breakHtmlOnly = "";
155  breakTextOnly = "\n";
156  brief = "";
157  classStart = "";
158  classStop = "\n\n";
159  codeWord = " ";
160  commentStart = "===============================================================\n";
161  commentStop = "";
162  copyDoc = " See: ";
163  file = "File: introspected-doxygen.txt";
164  flagSpanStart = "";
165  flagSpanStop = "";
166  functionStart = "";
167  functionStop = "\n\n";
168  headingStart = "";
169  headingStop = "";
170  // Linking: The link text displayed (see TheTarget)
171  hrefStart = "";
172  hrefMid = "(see ";
173  hrefStop = ")";
174  indentHtmlOnly = "";
175  listLineStart = " * ";
176  listLineStop = "";
177  listStart = "";
178  listStop = "";
179  note = "Note: ";
180  page = "Page ";
181  reference = " ";
182  referenceNo = " ";
183  returns = " Returns: ";
184  sectionStart = "Section: ";
185  seeAlso = " See: ";
186  subSectionStart = "Subsection ";
187  templArgDeduced = "[deduced] ";
188  templArgExplicit = "[explicit] ";
189  templateArgument = "Template Arg: ";
190  variable = "Variable: ";
191  }
192  else
193  {
194  anchor = "\\anchor ";
195  argument = "\\param ";
196  boldStart = "<b>";
197  boldStop = "</b>";
198  breakBoth = "<br>";
199  breakHtmlOnly = "<br>";
200  breakTextOnly = "";
201  brief = "\\brief ";
202  classStart = "\\class ";
203  classStop = "";
204  codeWord = "\\p ";
205  commentStart = "/*!\n";
206  commentStop = "*/\n";
207  copyDoc = "\\copydoc ";
208  file = "\\file";
209  flagSpanStart = "<span class=\"mlabel\">";
210  flagSpanStop = "</span>";
211  functionStart = "\\fn ";
212  functionStop = "";
213  headingStart = "<h3>";
214  headingStop = "</h3>";
215  // Linking: [The link text displayed](\ref TheTarget)
216  hrefStart = "[";
217  hrefMid = "](\\ref ";
218  hrefStop = ")";
219  indentHtmlOnly = " ";
220  listLineStart = "<li>";
221  listLineStop = "</li>";
222  listStart = "<ul>";
223  listStop = "</ul>";
224  note = "\\note ";
225  page = "\\page ";
226  reference = " \\ref ";
227  referenceNo = " %";
228  returns = "\\returns ";
229  sectionStart = "\\ingroup ";
230  seeAlso = "\\see ";
231  subSectionStart = "\\addtogroup ";
232  templArgDeduced = "\\deduced ";
233  templArgExplicit = "\\explicit ";
234  templateArgument = "\\tparam ";
235  variable = "\\var ";
236  }
237 } // SetMarkup ()
238 
239 /***************************************************************
240  * Aggregation and configuration paths
241  ***************************************************************/
242 
247 {
248  public:
255  void RecordAggregationInfo(std::string a, std::string b);
261  void Gather(TypeId tid);
265  void Print() const;
266 
272  std::vector<std::string> Get(TypeId tid) const;
273 
277  std::vector<std::string> GetNoTypeIds() const;
278 
279  private:
283  std::string GetCurrentPath() const;
289  void DoGather(TypeId tid);
295  void RecordOutput(TypeId tid);
301  bool HasAlreadyBeenProcessed(TypeId tid) const;
305  std::vector<std::pair<TypeId, std::string>> m_output;
309  std::vector<std::string> m_currentPath;
313  std::vector<TypeId> m_alreadyProcessed;
317  std::vector<std::pair<TypeId, TypeId>> m_aggregates;
324  mutable std::vector<std::string> m_noTids;
325 
326 }; // class StaticInformation
327 
328 void
329 StaticInformation::RecordAggregationInfo(std::string a, std::string b)
330 {
331  NS_LOG_FUNCTION(this << a << b);
332  TypeId aTid;
333  bool found = TypeId::LookupByNameFailSafe(a, &aTid);
334  if (!found)
335  {
336  m_noTids.push_back(a);
337  return;
338  }
339  TypeId bTid;
340  found = TypeId::LookupByNameFailSafe(b, &bTid);
341  if (!found)
342  {
343  m_noTids.push_back(b);
344  return;
345  }
346 
347  m_aggregates.emplace_back(aTid, bTid);
348 }
349 
350 void
352 {
353  NS_LOG_FUNCTION(this);
354  for (const auto& item : m_output)
355  {
356  std::cout << item.first.GetName() << " -> " << item.second << std::endl;
357  }
358 }
359 
360 std::string
362 {
363  NS_LOG_FUNCTION(this);
364  std::ostringstream oss;
365  for (const auto& item : m_currentPath)
366  {
367  oss << "/" << item;
368  }
369  return oss.str();
370 }
371 
372 void
374 {
375  NS_LOG_FUNCTION(this << tid);
376  m_output.emplace_back(tid, GetCurrentPath());
377 }
378 
379 bool
381 {
382  NS_LOG_FUNCTION(this << tid);
383  for (const auto& it : m_alreadyProcessed)
384  {
385  if (it == tid)
386  {
387  return true;
388  }
389  }
390  return false;
391 }
392 
393 std::vector<std::string>
395 {
396  NS_LOG_FUNCTION(this << tid);
397  std::vector<std::string> paths;
398  for (const auto& item : m_output)
399  {
400  if (item.first == tid)
401  {
402  paths.push_back(item.second);
403  }
404  }
405  return paths;
406 }
407 
423 template <typename T>
424 void
426 {
427  std::sort(t.begin(), t.end());
428  t.erase(std::unique(t.begin(), t.end()), t.end());
429 }
430 
431 std::vector<std::string>
433 {
434  NS_LOG_FUNCTION(this);
435  Uniquefy(m_noTids);
436  return m_noTids;
437 }
438 
439 void
441 {
442  NS_LOG_FUNCTION(this << tid);
443  DoGather(tid);
444  Uniquefy(m_output);
445 }
446 
447 void
449 {
450  NS_LOG_FUNCTION(this << tid);
451  if (HasAlreadyBeenProcessed(tid))
452  {
453  return;
454  }
455  RecordOutput(tid);
456  for (uint32_t i = 0; i < tid.GetAttributeN(); ++i)
457  {
458  struct TypeId::AttributeInformation info = tid.GetAttribute(i);
459  const PointerChecker* ptrChecker =
460  dynamic_cast<const PointerChecker*>(PeekPointer(info.checker));
461  if (ptrChecker != nullptr)
462  {
463  TypeId pointee = ptrChecker->GetPointeeTypeId();
464 
465  // See if this is a pointer to an Object.
466  Ptr<Object> object = CreateObject<Object>();
467  TypeId objectTypeId = object->GetTypeId();
468  if (objectTypeId == pointee)
469  {
470  // Stop the recursion at this attribute if it is a
471  // pointer to an Object, which create too many spurious
472  // paths in the list of attribute paths because any
473  // Object can be in that part of the path.
474  continue;
475  }
476 
477  m_currentPath.push_back(info.name);
478  m_alreadyProcessed.push_back(tid);
479  DoGather(pointee);
480  m_alreadyProcessed.pop_back();
481  m_currentPath.pop_back();
482  continue;
483  }
484  // attempt to cast to an object vector.
485  const ObjectPtrContainerChecker* vectorChecker =
486  dynamic_cast<const ObjectPtrContainerChecker*>(PeekPointer(info.checker));
487  if (vectorChecker != nullptr)
488  {
489  TypeId item = vectorChecker->GetItemTypeId();
490  m_currentPath.push_back(info.name + "/[i]");
491  m_alreadyProcessed.push_back(tid);
492  DoGather(item);
493  m_alreadyProcessed.pop_back();
494  m_currentPath.pop_back();
495  continue;
496  }
497  }
498  for (uint32_t j = 0; j < TypeId::GetRegisteredN(); j++)
499  {
500  TypeId child = TypeId::GetRegistered(j);
501  if (child.IsChildOf(tid))
502  {
503  std::string childName = "$" + child.GetName();
504  m_currentPath.push_back(childName);
505  m_alreadyProcessed.push_back(tid);
506  DoGather(child);
507  m_alreadyProcessed.pop_back();
508  m_currentPath.pop_back();
509  }
510  }
511  for (const auto& item : m_aggregates)
512  {
513  if (item.first == tid || item.second == tid)
514  {
515  TypeId other;
516  if (item.first == tid)
517  {
518  other = item.second;
519  }
520  if (item.second == tid)
521  {
522  other = item.first;
523  }
524  std::string name = "$" + other.GetName();
525  m_currentPath.push_back(name);
526  m_alreadyProcessed.push_back(tid);
527  DoGather(other);
528  m_alreadyProcessed.pop_back();
529  m_currentPath.pop_back();
530  }
531  }
532 } // StaticInformation::DoGather ()
533 
540 {
542 
543  static StaticInformation info;
544  static bool mapped = false;
545 
546  if (mapped)
547  {
548  return info;
549  }
550 
551  // Short circuit next call
552  mapped = true;
553 
554  // The below statements register typical aggregation relationships
555  // in ns-3 programs, that otherwise aren't picked up automatically
556  // by the creation of the above node. To manually list other common
557  // aggregation relationships that you would like to see show up in
558  // the list of configuration paths in the doxygen, add additional
559  // statements below.
560  info.RecordAggregationInfo("ns3::Node", "ns3::TcpSocketFactory");
561  info.RecordAggregationInfo("ns3::Node", "ns3::UdpSocketFactory");
562  info.RecordAggregationInfo("ns3::Node", "ns3::PacketSocketFactory");
563  info.RecordAggregationInfo("ns3::Node", "ns3::MobilityModel");
564  info.RecordAggregationInfo("ns3::Node", "ns3::Ipv4L3Protocol");
565  info.RecordAggregationInfo("ns3::Node", "ns3::Ipv4NixVectorRouting");
566  info.RecordAggregationInfo("ns3::Node", "ns3::Icmpv4L4Protocol");
567  info.RecordAggregationInfo("ns3::Node", "ns3::ArpL3Protocol");
568  info.RecordAggregationInfo("ns3::Node", "ns3::Icmpv4L4Protocol");
569  info.RecordAggregationInfo("ns3::Node", "ns3::UdpL4Protocol");
570  info.RecordAggregationInfo("ns3::Node", "ns3::Ipv6L3Protocol");
571  info.RecordAggregationInfo("ns3::Node", "ns3::Icmpv6L4Protocol");
572  info.RecordAggregationInfo("ns3::Node", "ns3::TcpL4Protocol");
573  info.RecordAggregationInfo("ns3::Node", "ns3::RipNg");
574  info.RecordAggregationInfo("ns3::Node", "ns3::GlobalRouter");
575  info.RecordAggregationInfo("ns3::Node", "ns3::aodv::RoutingProtocol");
576  info.RecordAggregationInfo("ns3::Node", "ns3::dsdv::RoutingProtocol");
577  info.RecordAggregationInfo("ns3::Node", "ns3::dsr::DsrRouting");
578  info.RecordAggregationInfo("ns3::Node", "ns3::olsr::RoutingProtocol");
579  info.RecordAggregationInfo("ns3::Node", "ns3::EnergyHarvesterContainer");
580  info.RecordAggregationInfo("ns3::Node", "ns3::EnergySourceContainer");
581 
582  // Create a channel object so that channels appear in the namespace
583  // paths that will be generated here.
584  Ptr<SimpleChannel> simpleChannel;
585  simpleChannel = CreateObject<SimpleChannel>();
586 
587  for (uint32_t i = 0; i < Config::GetRootNamespaceObjectN(); ++i)
588  {
590  info.Gather(object->GetInstanceTypeId());
591  }
592 
593  return info;
594 
595 } // GetTypicalAggregations ()
596 
598 typedef std::map<std::string, int32_t> NameMap;
599 typedef NameMap::const_iterator NameMapIterator;
600 
607 NameMap
609 {
611 
612  static NameMap nameMap;
613  static bool mapped = false;
614 
615  if (mapped)
616  {
617  return nameMap;
618  }
619 
620  // Short circuit next call
621  mapped = true;
622 
623  // Get typical aggregation relationships.
625 
626  // Registered types
627  for (uint32_t i = 0; i < TypeId::GetRegisteredN(); i++)
628  {
629  TypeId tid = TypeId::GetRegistered(i);
630  if (tid.MustHideFromDocumentation())
631  {
632  continue;
633  }
634 
635  // Capitalize all of letters in the name so that it sorts
636  // correctly in the map.
637  std::string name = tid.GetName();
638  std::transform(name.begin(), name.end(), name.begin(), ::toupper);
639 
640  // Save this name's index.
641  nameMap[name] = i;
642  }
643 
644  // Type names without TypeIds
645  std::vector<std::string> noTids = info.GetNoTypeIds();
646  for (const auto& item : noTids)
647  {
648  nameMap[item] = -1;
649  }
650 
651  return nameMap;
652 } // GetNameMap ()
653 
654 /***************************************************************
655  * Docs for a single TypeId
656  ***************************************************************/
657 
663 void
664 PrintConfigPaths(std::ostream& os, const TypeId tid)
665 {
666  NS_LOG_FUNCTION(tid);
667  std::vector<std::string> paths = GetTypicalAggregations().Get(tid);
668 
669  // Config --------------
670  if (paths.empty())
671  {
672  os << "Introspection did not find any typical Config paths." << breakBoth << std::endl;
673  }
674  else
675  {
676  os << headingStart << "Config Paths" << headingStop << std::endl;
677  os << std::endl;
678  os << tid.GetName() << " is accessible through the following paths"
679  << " with Config::Set and Config::Connect:" << std::endl;
680  os << listStart << std::endl;
681  for (const auto& path : paths)
682  {
683  os << listLineStart << "\"" << path << "\"" << listLineStop << breakTextOnly
684  << std::endl;
685  }
686  os << listStop << std::endl;
687  }
688 } // PrintConfigPaths ()
689 
698 void
699 PrintAttributesTid(std::ostream& os, const TypeId tid)
700 {
701  NS_LOG_FUNCTION(tid);
702 
703  auto index = SortedAttributeInfo(tid);
704 
705  os << listStart << std::endl;
706  for (const auto& [name, info] : index)
707  {
708  os << listLineStart << boldStart << name << boldStop << ": " << info.help << std::endl;
709  os << indentHtmlOnly << listStart << std::endl;
710  os << " " << listLineStart << "Set with class: " << reference
711  << info.checker->GetValueTypeName() << listLineStop << std::endl;
712 
713  std::string underType;
714  if (info.checker->HasUnderlyingTypeInformation())
715  {
716  os << " " << listLineStart << "Underlying type: ";
717 
718  std::string valType = info.checker->GetValueTypeName();
719  underType = info.checker->GetUnderlyingTypeInformation();
720  bool handled = false;
721  if ((valType != "ns3::EnumValue") && (underType != "std::string"))
722  {
723  // Indirect cases to handle
724  if (valType == "ns3::PointerValue")
725  {
726  const PointerChecker* ptrChecker =
727  dynamic_cast<const PointerChecker*>(PeekPointer(info.checker));
728  if (ptrChecker != nullptr)
729  {
730  os << reference << "ns3::Ptr"
731  << "< " << reference << ptrChecker->GetPointeeTypeId().GetName() << ">";
732  handled = true;
733  }
734  }
735  else if (valType == "ns3::ObjectPtrContainerValue")
736  {
737  const ObjectPtrContainerChecker* ptrChecker =
738  dynamic_cast<const ObjectPtrContainerChecker*>(PeekPointer(info.checker));
739  if (ptrChecker != nullptr)
740  {
741  os << reference << "ns3::Ptr"
742  << "< " << reference << ptrChecker->GetItemTypeId().GetName() << ">";
743  handled = true;
744  }
745  }
746 
747  // Helper to match first part of string
748  auto match = [&uType = std::as_const(underType)](const std::string& s) {
749  return uType.rfind(s, 0) == 0; // only checks position 0
750  };
751 
752  if (match("bool") || match("double") || match("int8_t") || match("uint8_t") ||
753  match("int16_t") || match("uint16_t") || match("int32_t") ||
754  match("uint32_t") || match("int64_t") || match("uint64_t"))
755  {
756  os << underType;
757  handled = true;
758  }
759  }
760  if (!handled)
761  {
762  os << codeWord << underType;
763  }
764  os << listLineStop << std::endl;
765  }
766  if (info.flags & TypeId::ATTR_CONSTRUCT && info.accessor->HasSetter())
767  {
768  std::string value = info.initialValue->SerializeToString(info.checker);
769  if (underType == "std::string" && value.empty())
770  {
771  value = "\"\"";
772  }
773  os << " " << listLineStart << "Initial value: " << value << listLineStop
774  << std::endl;
775  }
776  bool moreFlags{false};
777  os << " " << listLineStart << "Flags: ";
778  if (info.flags & TypeId::ATTR_CONSTRUCT && info.accessor->HasSetter())
779  {
780  os << flagSpanStart << "construct" << flagSpanStop;
781  moreFlags = true;
782  }
783  if (info.flags & TypeId::ATTR_SET && info.accessor->HasSetter())
784  {
785  os << (outputText && moreFlags ? ", " : "") << flagSpanStart << "write" << flagSpanStop;
786  moreFlags = true;
787  }
788  if (info.flags & TypeId::ATTR_GET && info.accessor->HasGetter())
789  {
790  os << (outputText && moreFlags ? ", " : "") << flagSpanStart << "read" << flagSpanStop;
791  moreFlags = true;
792  }
793  os << listLineStop << std::endl;
794  os << indentHtmlOnly << listStop << std::endl;
795  }
796  os << listStop << std::endl;
797 } // PrintAttributesTid ()
798 
809 void
810 PrintAttributes(std::ostream& os, const TypeId tid)
811 {
812  NS_LOG_FUNCTION(tid);
813  if (tid.GetAttributeN() == 0)
814  {
815  os << "No Attributes are defined for this type." << breakBoth << std::endl;
816  }
817  else
818  {
819  os << headingStart << "Attributes" << headingStop << std::endl;
820  PrintAttributesTid(os, tid);
821  }
822 
823  // Attributes from base classes
824  TypeId tmp = tid.GetParent();
825  while (tmp.GetParent() != tmp)
826  {
827  if (tmp.GetAttributeN() != 0)
828  {
829  os << headingStart << "Attributes defined in parent class " << tmp.GetName()
830  << headingStop << std::endl;
831  PrintAttributesTid(os, tmp);
832  }
833  tmp = tmp.GetParent();
834 
835  } // Attributes
836 } // PrintAttributes ()
837 
846 void
847 PrintTraceSourcesTid(std::ostream& os, const TypeId tid)
848 {
849  NS_LOG_FUNCTION(tid);
850 
851  auto index = SortedTraceSourceInfo(tid);
852 
853  os << listStart << std::endl;
854  for (const auto& [name, info] : index)
855  {
856  os << listLineStart << boldStart << name << boldStop << ": " << info.help << breakBoth;
857  if (!outputText)
858  {
859  // '%' prevents doxygen from linking to the Callback class...
860  os << "%";
861  }
862  os << "Callback signature: " << info.callback << std::endl;
863  os << listLineStop << std::endl;
864  }
865  os << listStop << std::endl;
866 } // PrintTraceSourcesTid ()
867 
878 void
879 PrintTraceSources(std::ostream& os, const TypeId tid)
880 {
881  NS_LOG_FUNCTION(tid);
882  if (tid.GetTraceSourceN() == 0)
883  {
884  os << "No TraceSources are defined for this type." << breakBoth << std::endl;
885  }
886  else
887  {
888  os << headingStart << "TraceSources" << headingStop << std::endl;
889  PrintTraceSourcesTid(os, tid);
890  }
891 
892  // Trace sources from base classes
893  TypeId tmp = tid.GetParent();
894  while (tmp.GetParent() != tmp)
895  {
896  if (tmp.GetTraceSourceN() != 0)
897  {
898  os << headingStart << "TraceSources defined in parent class " << tmp.GetName()
899  << headingStop << std::endl;
900  PrintTraceSourcesTid(os, tmp);
901  }
902  tmp = tmp.GetParent();
903  }
904 
905 } // PrintTraceSources ()
906 
913 void
914 PrintSize(std::ostream& os, const TypeId tid)
915 {
916  NS_LOG_FUNCTION(tid);
917  NS_ASSERT_MSG(CHAR_BIT != 0, "CHAR_BIT is zero");
918 
919  std::size_t arch = (sizeof(void*) * CHAR_BIT);
920 
921  os << boldStart << "Size" << boldStop << " of this type is " << tid.GetSize() << " bytes (on a "
922  << arch << "-bit architecture)." << std::endl;
923 } // PrintSize ()
924 
930 void
931 PrintTypeIdBlocks(std::ostream& os)
932 {
934 
935  NameMap nameMap = GetNameMap();
936 
937  // Iterate over the map, which will print the class names in
938  // alphabetical order.
939  for (const auto& item : nameMap)
940  {
941  // Handle only real TypeIds
942  if (item.second < 0)
943  {
944  continue;
945  }
946  // Get the class's index out of the map;
947  TypeId tid = TypeId::GetRegistered(item.second);
948  std::string name = tid.GetName();
949 
950  std::cout << commentStart << std::endl;
951 
952  std::cout << classStart << name << std::endl;
953  std::cout << std::endl;
954 
955  PrintConfigPaths(std::cout, tid);
956  PrintAttributes(std::cout, tid);
957  PrintTraceSources(std::cout, tid);
958  PrintSize(std::cout, tid);
959 
960  std::cout << commentStop << std::endl;
961  } // for class documentation
962 
963 } // PrintTypeIdBlocks
964 
965 /***************************************************************
966  * Lists of All things
967  ***************************************************************/
968 
974 void
975 PrintAllTypeIds(std::ostream& os)
976 {
978  os << commentStart << page << "TypeIdList All ns3::TypeId's\n" << std::endl;
979  os << "This is a list of all" << reference << "ns3::TypeId's.\n"
980  << "For more information see the" << reference << "ns3::TypeId "
981  << "section of this API documentation and the" << referenceNo << "TypeId section "
982  << "in the Configuration and " << referenceNo << "Attributes chapter of the Manual.\n"
983  << std::endl;
984 
985  os << listStart << std::endl;
986 
987  NameMap nameMap = GetNameMap();
988  // Iterate over the map, which will print the class names in
989  // alphabetical order.
990  for (const auto& item : nameMap)
991  {
992  // Handle only real TypeIds
993  if (item.second < 0)
994  {
995  continue;
996  }
997  // Get the class's index out of the map;
998  TypeId tid = TypeId::GetRegistered(item.second);
999 
1000  os << indentHtmlOnly << listLineStart << boldStart << tid.GetName() << boldStop
1001  << listLineStop << std::endl;
1002  }
1003  os << listStop << std::endl;
1004  os << commentStop << std::endl;
1005 
1006 } // PrintAllTypeIds ()
1007 
1016 void
1017 PrintAllAttributes(std::ostream& os)
1018 {
1020  os << commentStart << page << "AttributeList All Attributes\n" << std::endl;
1021  os << "This is a list of all" << reference << "attributes classes. "
1022  << "For more information see the" << reference << "attributes "
1023  << "section of this API documentation and the Attributes sections "
1024  << "in the Tutorial and Manual.\n"
1025  << std::endl;
1026 
1027  NameMap nameMap = GetNameMap();
1028  // Iterate over the map, which will print the class names in
1029  // alphabetical order.
1030  for (const auto& item : nameMap)
1031  {
1032  // Handle only real TypeIds
1033  if (item.second < 0)
1034  {
1035  continue;
1036  }
1037  // Get the class's index out of the map;
1038  TypeId tid = TypeId::GetRegistered(item.second);
1039 
1040  if (tid.GetAttributeN() == 0)
1041  {
1042  continue;
1043  }
1044 
1045  auto index = SortedAttributeInfo(tid);
1046 
1047  os << boldStart << tid.GetName() << boldStop << breakHtmlOnly << std::endl;
1048  os << listStart << std::endl;
1049  for (const auto& [name, info] : index)
1050  {
1051  os << listLineStart << boldStart << name << boldStop << ": " << info.help
1052  << listLineStop << std::endl;
1053  }
1054  os << listStop << std::endl;
1055  }
1056  os << commentStop << std::endl;
1057 
1058 } // PrintAllAttributes ()
1059 
1065 void
1066 PrintAllGlobals(std::ostream& os)
1067 {
1069  os << commentStart << page << "GlobalValueList All GlobalValues\n" << std::endl;
1070  os << "This is a list of all" << reference << "ns3::GlobalValue instances.\n"
1071  << "See ns3::GlobalValue for how to set these." << std::endl;
1072 
1073  os << listStart << std::endl;
1075  {
1076  StringValue val;
1077  (*i)->GetValue(val);
1078  os << indentHtmlOnly << listLineStart << boldStart << hrefStart << (*i)->GetName()
1079  << hrefMid << "GlobalValue" << (*i)->GetName() << hrefStop << boldStop << ": "
1080  << (*i)->GetHelp() << ". Default value: " << val.Get() << "." << listLineStop
1081  << std::endl;
1082  }
1083  os << listStop << std::endl;
1084  os << commentStop << std::endl;
1085 
1086 } // PrintAllGlobals ()
1087 
1093 void
1094 PrintAllLogComponents(std::ostream& os)
1095 {
1097  os << commentStart << page << "LogComponentList All LogComponents\n" << std::endl;
1098  os << "This is a list of all" << reference << "ns3::LogComponent instances.\n" << std::endl;
1099 
1105  // Find longest log name
1106  std::size_t widthL = std::string("Log Component").size();
1107  std::size_t widthR = std::string("file").size();
1108  for (const auto& it : (*logs))
1109  {
1110  widthL = std::max(widthL, it.first.size());
1111  std::string file = it.second->File();
1112  // Strip leading "../" related to depth in build directory
1113  // since doxygen only sees the path starting with "src/", etc.
1114  while (file.find("../") == 0)
1115  {
1116  file = file.substr(3);
1117  }
1118  widthR = std::max(widthR, file.size());
1119  }
1120  const std::string tLeft("| ");
1121  const std::string tMid(" | ");
1122  const std::string tRight(" |");
1123 
1124  // Header line has to be padded to same length as separator line
1125  os << tLeft << std::setw(widthL) << std::left << "Log Component" << tMid << std::setw(widthR)
1126  << std::left << "File" << tRight << std::endl;
1127  os << tLeft << ":" << std::string(widthL - 1, '-') << tMid << ":"
1128  << std::string(widthR - 1, '-') << tRight << std::endl;
1129 
1130  LogComponent::ComponentList::const_iterator it;
1131  for (const auto& it : (*logs))
1132  {
1133  std::string file = it.second->File();
1134  // Strip leading "../" related to depth in build directory
1135  // since doxygen only sees the path starting with "src/", etc.
1136  while (file.find("../") == 0)
1137  {
1138  file = file.substr(3);
1139  }
1140 
1141  os << tLeft << std::setw(widthL) << std::left << it.first << tMid << std::setw(widthR)
1142  << file << tRight << std::endl;
1143  }
1144  os << std::right << std::endl;
1145  os << commentStop << std::endl;
1146 } // PrintAllLogComponents ()
1147 
1156 void
1157 PrintAllTraceSources(std::ostream& os)
1158 {
1160  os << commentStart << page << "TraceSourceList All TraceSources\n" << std::endl;
1161  os << "This is a list of all" << reference << "tracing sources. "
1162  << "For more information see the " << reference << "tracing "
1163  << "section of this API documentation and the Tracing sections "
1164  << "in the Tutorial and Manual.\n"
1165  << std::endl;
1166 
1167  NameMap nameMap = GetNameMap();
1168 
1169  // Iterate over the map, which will print the class names in
1170  // alphabetical order.
1171  for (const auto& item : nameMap)
1172  {
1173  // Handle only real TypeIds
1174  if (item.second < 0)
1175  {
1176  continue;
1177  }
1178  // Get the class's index out of the map;
1179  TypeId tid = TypeId::GetRegistered(item.second);
1180 
1181  if (tid.GetTraceSourceN() == 0)
1182  {
1183  continue;
1184  }
1185 
1186  auto index = SortedTraceSourceInfo(tid);
1187 
1188  os << boldStart << tid.GetName() << boldStop << breakHtmlOnly << std::endl;
1189 
1190  os << listStart << std::endl;
1191  for (const auto& [name, info] : index)
1192  {
1193  os << listLineStart << boldStart << name << boldStop << ": " << info.help
1194  << listLineStop << std::endl;
1195  }
1196  os << listStop << std::endl;
1197  }
1198  os << commentStop << std::endl;
1199 
1200 } // PrintAllTraceSources ()
1201 
1202 /***************************************************************
1203  * Docs for Attribute classes
1204  ***************************************************************/
1205 
1219 void
1220 PrintAttributeValueSection(std::ostream& os, const std::string& name, const bool seeBase = true)
1221 {
1222  NS_LOG_FUNCTION(name);
1223  std::string section = "attribute_" + name;
1224 
1225  // \ingroup attributes
1226  // \defgroup attribute_<name>Value <name> Attribute
1227  os << commentStart << sectionStart << "attributes\n"
1228  << subSectionStart << "attribute_" << name << " " << name << " Attribute\n"
1229  << "AttributeValue implementation for " << name << "\n";
1230  if (seeBase)
1231  {
1232  // Some classes don't live in ns3::. Yuck
1233  if (name != "IeMeshId")
1234  {
1235  os << seeAlso << "ns3::" << name << "\n";
1236  }
1237  else
1238  {
1239  os << seeAlso << "ns3::dot11s::" << name << "\n";
1240  }
1241  }
1242  os << commentStop;
1243 
1244 } // PrintAttributeValueSection ()
1245 
1256 void
1258  const std::string& name,
1259  const std::string& type,
1260  const std::string& header)
1261 {
1262  NS_LOG_FUNCTION(name << type << header);
1263  std::string sectAttr = sectionStart + "attribute_" + name;
1264 
1265  // \ingroup attribute_<name>Value
1266  // \class ns3::<name>Value "header"
1267  std::string valClass = name + "Value";
1268  std::string qualClass = " ns3::" + valClass;
1269 
1270  os << commentStart << sectAttr << std::endl;
1271  os << classStart << qualClass << " \"" << header << "\"" << std::endl;
1272  os << "AttributeValue implementation for " << name << "." << std::endl;
1273  os << seeAlso << "AttributeValue" << std::endl;
1274  os << commentStop;
1275 
1276  // Copy ctor: <name>Value::<name>Value
1277  os << commentStart << functionStart << name << qualClass << "::" << valClass;
1278  if ((name == "EmptyAttribute") || (name == "ObjectPtrContainer"))
1279  {
1280  // Just default constructors.
1281  os << "()\n";
1282  }
1283  else
1284  {
1285  // Copy constructors
1286  os << "(const " << type << " & value)\n"
1287  << "Copy constructor.\n"
1288  << argument << "[in] value The " << name << " value to copy.\n";
1289  }
1290  os << commentStop;
1291 
1292  // <name>Value::Get () const
1293  os << commentStart << functionStart << type << qualClass << "::Get () const\n"
1294  << returns << "The " << name << " value.\n"
1295  << commentStop;
1296 
1297  // <name>Value::GetAccessor (T & value) const
1298  os << commentStart << functionStart << "bool" << qualClass
1299  << "::GetAccessor (T & value) const\n"
1300  << "Access the " << name << " value as type " << codeWord << "T.\n"
1301  << templateArgument << "T " << templArgExplicit << "The type to cast to.\n"
1302  << argument << "[out] value The " << name << " value, as type " << codeWord << "T.\n"
1303  << returns << "true.\n"
1304  << commentStop;
1305 
1306  // <name>Value::Set (const name & value)
1307  if (type != "Callback") // Yuck
1308  {
1309  os << commentStart << functionStart << "void" << qualClass << "::Set (const " << type
1310  << " & value)\n"
1311  << "Set the value.\n"
1312  << argument << "[in] value The value to adopt.\n"
1313  << commentStop;
1314  }
1315 
1316  // <name>Value::m_value
1317  os << commentStart << variable << type << qualClass << "::m_value\n"
1318  << "The stored " << name << " instance.\n"
1319  << commentStop << std::endl;
1320 
1321 } // PrintAttributeValueWithName ()
1322 
1331 void
1332 PrintMakeAccessors(std::ostream& os, const std::string& name)
1333 {
1334  NS_LOG_FUNCTION(name);
1335  std::string sectAttr = sectionStart + "attribute_" + name + "\n";
1336  std::string make = "ns3::Make" + name + "Accessor ";
1337 
1338  // \ingroup attribute_<name>Value
1339  // Make<name>Accessor (T1 a1)
1340  os << commentStart << sectAttr << functionStart << "ns3::Ptr<const ns3::AttributeAccessor> "
1341  << make << "(T1 a1)\n"
1342  << copyDoc << "ns3::MakeAccessorHelper(T1)\n"
1343  << seeAlso << "AttributeAccessor\n"
1344  << commentStop;
1345 
1346  // \ingroup attribute_<name>Value
1347  // Make<name>Accessor (T1 a1)
1348  os << commentStart << sectAttr << functionStart << "ns3::Ptr<const ns3::AttributeAccessor> "
1349  << make << "(T1 a1, T2 a2)\n"
1350  << copyDoc << "ns3::MakeAccessorHelper(T1,T2)\n"
1351  << seeAlso << "AttributeAccessor\n"
1352  << commentStop;
1353 } // PrintMakeAccessors ()
1354 
1364 void
1365 PrintMakeChecker(std::ostream& os, const std::string& name, const std::string& header)
1366 {
1367  NS_LOG_FUNCTION(name << header);
1368  std::string sectAttr = sectionStart + "attribute_" + name + "\n";
1369  std::string make = "ns3::Make" + name + "Checker ";
1370 
1371  // \ingroup attribute_<name>Value
1372  // class <name>Checker
1373  os << commentStart << sectAttr << std::endl;
1374  os << classStart << " ns3::" << name << "Checker"
1375  << " \"" << header << "\"" << std::endl;
1376  os << "AttributeChecker implementation for " << name << "Value." << std::endl;
1377  os << seeAlso << "AttributeChecker" << std::endl;
1378  os << commentStop;
1379 
1380  // \ingroup attribute_<name>Value
1381  // Make<name>Checker ()
1382  os << commentStart << sectAttr << functionStart << "ns3::Ptr<const ns3::AttributeChecker> "
1383  << make << "()\n"
1384  << returns << "The AttributeChecker.\n"
1385  << seeAlso << "AttributeChecker\n"
1386  << commentStop;
1387 } // PrintMakeChecker ()
1388 
1391 {
1392  const std::string m_name;
1393  const std::string m_type;
1394  const bool m_seeBase;
1395  const std::string m_header;
1396 };
1397 
1406 void
1407 PrintAttributeHelper(std::ostream& os, const AttributeDescriptor& attr)
1408 {
1409  NS_LOG_FUNCTION(attr.m_name << attr.m_type << attr.m_seeBase << attr.m_header);
1411  PrintAttributeValueWithName(os, attr.m_name, attr.m_type, attr.m_header);
1412  PrintMakeAccessors(os, attr.m_name);
1413  PrintMakeChecker(os, attr.m_name, attr.m_header);
1414 } // PrintAttributeHelper ()
1415 
1420 void
1422 {
1424 
1425  // clang-format off
1426  const AttributeDescriptor attributes [] =
1427  {
1428  // Name Type see Base header-file
1429  // Users of ATTRIBUTE_HELPER_HEADER
1430  //
1431  { "Address", "Address", true, "address.h" },
1432  { "Box", "Box", true, "box.h" },
1433  { "DataRate", "DataRate", true, "data-rate.h" },
1434  { "Length", "Length", true, "length.h" },
1435  { "IeMeshId", "IeMeshId", true, "ie-dot11s-id.h" },
1436  { "Ipv4Address", "Ipv4Address", true, "ipv4-address.h" },
1437  { "Ipv4Mask", "Ipv4Mask", true, "ipv4-address.h" },
1438  { "Ipv6Address", "Ipv6Address", true, "ipv6-address.h" },
1439  { "Ipv6Prefix", "Ipv6Prefix", true, "ipv6-address.h" },
1440  { "Mac16Address", "Mac16Address", true, "mac16-address.h" },
1441  { "Mac48Address", "Mac48Address", true, "mac48-address.h" },
1442  { "Mac64Address", "Mac64Address", true, "mac64-address.h" },
1443  { "ObjectFactory", "ObjectFactory", true, "object-factory.h" },
1444  { "OrganizationIdentifier",
1445  "OrganizationIdentifier",
1446  true, "vendor-specific-action.h" },
1447  { "Priomap", "Priomap", true, "prio-queue-disc.h" },
1448  { "QueueSize", "QueueSize", true, "queue-size.h" },
1449  { "Rectangle", "Rectangle", true, "rectangle.h" },
1450  { "Ssid", "Ssid", true, "ssid.h" },
1451  { "TypeId", "TypeId", true, "type-id.h" },
1452  { "UanModesList", "UanModesList", true, "uan-tx-mode.h" },
1453  { "ValueClassTest", "ValueClassTest", false, "attribute-test-suite.cc" /* core/test/ */ },
1454  { "Vector", "Vector", true, "vector.h" },
1455  { "Vector2D", "Vector2D", true, "vector.h" },
1456  { "Vector3D", "Vector3D", true, "vector.h" },
1457  { "Waypoint", "Waypoint", true, "waypoint.h" },
1458  { "WifiMode", "WifiMode", true, "wifi-mode.h" },
1459 
1460  // All three (Value, Access and Checkers) defined, but custom
1461  { "Boolean", "bool", false, "boolean.h" },
1462  { "Callback", "Callback", true, "callback.h" },
1463  { "Double", "double", false, "double.h" },
1464  { "Enum", "int", false, "enum.h" },
1465  { "Integer", "int64_t", false, "integer.h" },
1466  { "Pointer", "Pointer", false, "pointer.h" },
1467  { "String", "std::string", false, "string.h" },
1468  { "Time", "Time", true, "nstime.h" },
1469  { "Uinteger", "uint64_t", false, "uinteger.h" },
1470  { "", "", false, "last placeholder" }
1471  };
1472  // clang-format on
1473 
1474  int i = 0;
1475  while (!attributes[i].m_name.empty())
1476  {
1477  PrintAttributeHelper(os, attributes[i]);
1478  ++i;
1479  }
1480 
1481  // Special cases
1482  PrintAttributeValueSection(os, "EmptyAttribute", false);
1483  PrintAttributeValueWithName(os, "EmptyAttribute", "EmptyAttribute", "attribute.h");
1484 
1485  PrintAttributeValueSection(os, "ObjectPtrContainer", false);
1487  "ObjectPtrContainer",
1488  "ObjectPtrContainer",
1489  "object-ptr-container.h");
1490  PrintMakeChecker(os, "ObjectPtrContainer", "object-ptr-container.h");
1491 
1492  PrintAttributeValueSection(os, "ObjectVector", false);
1493  PrintMakeAccessors(os, "ObjectVector");
1494  PrintMakeChecker(os, "ObjectVector", "object-vector.h");
1495 
1496  PrintAttributeValueSection(os, "ObjectMap", false);
1497  PrintMakeAccessors(os, "ObjectMap");
1498  PrintMakeChecker(os, "ObjectMap", "object-map.h");
1499 
1500  PrintAttributeValueSection(os, "Pair", false);
1501  PrintAttributeValueWithName(os, "Pair", "std::pair<A, B>", "pair.h");
1502  PrintMakeChecker(os, "Pair", "pair.h");
1503 
1504  PrintAttributeValueSection(os, "Tuple", false);
1505  PrintAttributeValueWithName(os, "Tuple", "std::tuple<Args...>", "tuple.h");
1506  PrintMakeChecker(os, "Tuple", "tuple.h");
1507 
1508  // AttributeContainer is already documented.
1509  // PrintAttributeValueSection (os, "AttributeContainer", false);
1510  // PrintAttributeValueWithName (os, "AttributeContainer", "AttributeContainer",
1511  // "attribute-container.h");
1512  PrintMakeChecker(os, "AttributeContainer", "attribute-container.h");
1513 } // PrintAttributeImplementations ()
1514 
1515 /***************************************************************
1516  * Main
1517  ***************************************************************/
1518 
1519 int
1520 main(int argc, char* argv[])
1521 {
1523 
1524  CommandLine cmd(__FILE__);
1525  cmd.Usage("Generate documentation for all ns-3 registered types, "
1526  "trace sources, attributes and global variables.");
1527  cmd.AddValue("output-text", "format output as plain text", outputText);
1528  cmd.Parse(argc, argv);
1529 
1530  SetMarkup();
1531 
1532  // Create a Node, to force linking and instantiation of our TypeIds
1533  NodeContainer c;
1534  c.Create(1);
1535 
1536  std::cout << std::endl;
1537  std::cout << commentStart << file << "\n"
1538  << sectionStart << "utils\n"
1539  << "Doxygen docs generated from the TypeId database.\n"
1540  << note << "This file is automatically generated by " << codeWord
1541  << "print-introspected-doxygen.cc. Do not edit this file! "
1542  << "Edit that file instead.\n"
1543  << commentStop << std::endl;
1544 
1545  PrintTypeIdBlocks(std::cout);
1546 
1547  PrintAllTypeIds(std::cout);
1548  PrintAllAttributes(std::cout);
1549  PrintAllGlobals(std::cout);
1550  PrintAllLogComponents(std::cout);
1551  PrintAllTraceSources(std::cout);
1552  PrintAttributeImplementations(std::cout);
1553 
1554  return 0;
1555 }
#define max(a, b)
Definition: 80211b.c:43
Gather aggregation and configuration path information from registered types.
void DoGather(TypeId tid)
Gather attribute, configuration path information for tid.
std::vector< std::pair< TypeId, std::string > > m_output
Configuration path for each TypeId.
std::vector< TypeId > m_alreadyProcessed
List of TypeIds we've already processed.
std::vector< std::string > m_noTids
List of type names without TypeIds, because those modules aren't enabled.
std::vector< std::string > m_currentPath
Current configuration path.
std::vector< std::string > GetNoTypeIds() const
bool HasAlreadyBeenProcessed(TypeId tid) const
void RecordAggregationInfo(std::string a, std::string b)
Record the a -> b aggregation relation.
std::vector< std::pair< TypeId, TypeId > > m_aggregates
List of aggregation relationships.
std::string GetCurrentPath() const
void Print() const
Print output in "a -> b" form on std::cout.
void Gather(TypeId tid)
Gather aggregation and configuration path information for tid.
std::vector< std::string > Get(TypeId tid) const
void RecordOutput(TypeId tid)
Record the current config path for tid.
Parse command-line arguments.
Definition: command-line.h:232
Vector::const_iterator Iterator
Iterator type for the list of all global values.
Definition: global-value.h:82
static Iterator Begin()
The Begin iterator.
static Iterator End()
The End iterator.
static ComponentList * GetComponentList()
Get the list of LogComponents.
Definition: log.cc:143
std::map< std::string, LogComponent * > ComponentList
LogComponent name map.
Definition: log.h:398
keep track of a set of node pointers.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
AttributeChecker implementation for ObjectPtrContainerValue.
virtual TypeId GetItemTypeId() const =0
Get the TypeId of the container class type.
AttributeChecker implementation for PointerValue.
Definition: pointer.h:97
virtual TypeId GetPointeeTypeId() const =0
Get the TypeId of the base type.
Hold variables of type string.
Definition: string.h:56
std::string Get() const
Definition: string.cc:31
a unique identifier for an interface.
Definition: type-id.h:60
bool IsChildOf(TypeId other) const
Check if this TypeId is a child of another.
Definition: type-id.cc:975
std::size_t GetTraceSourceN() const
Get the number of Trace sources.
Definition: type-id.cc:1127
struct TypeId::TraceSourceInformation GetTraceSource(std::size_t i) const
Get the trace source by index.
Definition: type-id.cc:1134
bool MustHideFromDocumentation() const
Check if this TypeId should not be listed in documentation.
Definition: type-id.cc:1096
@ ATTR_GET
The attribute can be read.
Definition: type-id.h:65
@ ATTR_SET
The attribute can be written.
Definition: type-id.h:66
@ ATTR_CONSTRUCT
The attribute can be written at construction-time.
Definition: type-id.h:67
static uint16_t GetRegisteredN()
Get the number of registered TypeIds.
Definition: type-id.cc:883
struct TypeId::AttributeInformation GetAttribute(std::size_t i) const
Get Attribute information by index.
Definition: type-id.cc:1112
std::size_t GetAttributeN() const
Get the number of attributes.
Definition: type-id.cc:1104
TypeId GetParent() const
Get the parent of this TypeId.
Definition: type-id.cc:959
static TypeId GetRegistered(uint16_t i)
Get a TypeId by index.
Definition: type-id.cc:890
std::size_t GetSize() const
Get the size of this object.
Definition: type-id.cc:1010
static bool LookupByNameFailSafe(std::string name, TypeId *tid)
Get a TypeId by name.
Definition: type-id.cc:848
std::string GetName() const
Get the name.
Definition: type-id.cc:995
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition: assert.h:86
Ptr< Object > GetRootNamespaceObject(uint32_t i)
Definition: config.cc:1027
std::size_t GetRootNamespaceObjectN()
Definition: config.cc:1020
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
void Print(ComponentCarrier cc)
std::string headingStart
start of section heading (h3)
std::string copyDoc
copy (or refer) to docs elsewhere
std::string breakHtmlOnly
linebreak for html output only
std::string codeWord
format next word as source code
std::map< std::string, ns3::TypeId::AttributeInformation > SortedAttributeInfo(const TypeId tid)
Alphabetize the AttributeInformation for a TypeId by the Attribute name.
std::string breakTextOnly
linebreak for text output only
std::string flagSpanStart
start of Attribute flag value
std::string templArgDeduced
template argument deduced from function
std::map< std::string, ns3::TypeId::TraceSourceInformation > SortedTraceSourceInfo(const TypeId tid)
Alphabetize the TraceSourceInformation for a TypeId by the TraceSource name.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
U * PeekPointer(const Ptr< U > &p)
Definition: ptr.h:488
value
Definition: second.py:41
cmd
Definition: second.py:33
StaticInformation GetTypicalAggregations()
Register aggregation relationships that are not automatically detected by this introspection program.
void PrintTraceSourcesTid(std::ostream &os, const TypeId tid)
Print direct Trace sources for this TypeId.
std::map< std::string, int32_t > NameMap
Map from TypeId name to tid.
void PrintMakeAccessors(std::ostream &os, const std::string &name)
Print the AttributeValue MakeAccessor documentation for a class.
void PrintAllTraceSources(std::ostream &os)
Print the list of all Trace sources.
void PrintAllLogComponents(std::ostream &os)
Print the list of all LogComponents.
void PrintAttributeHelper(std::ostream &os, const AttributeDescriptor &attr)
Print documentation corresponding to use of the ATTRIBUTE_HELPER_HEADER macro or ATTRIBUTE_VALUE_DEFI...
void PrintTypeIdBlocks(std::ostream &os)
Print the doxy block for each TypeId.
void PrintAllAttributes(std::ostream &os)
Print the list of all Attributes.
void PrintAttributeValueWithName(std::ostream &os, const std::string &name, const std::string &type, const std::string &header)
Print the AttributeValue documentation for a class.
void PrintSize(std::ostream &os, const TypeId tid)
Print the size of the type represented by this tid.
void Uniquefy(T t)
Helper to keep only the unique items in a container.
void PrintAttributeImplementations(std::ostream &os)
Print documentation for Attribute implementations.
NameMap GetNameMap()
Create a map from the class names to their index in the vector of TypeId's so that the names will end...
void PrintTraceSources(std::ostream &os, const TypeId tid)
Print the Trace sources block for tid, including Trace sources declared in base classes.
void SetMarkup()
Initialize the markup strings, for either doxygen or text.
NameMap::const_iterator NameMapIterator
NameMap iterator.
void PrintConfigPaths(std::ostream &os, const TypeId tid)
Print config paths.
void PrintAllTypeIds(std::ostream &os)
Print the list of all TypeIds.
void PrintAttributes(std::ostream &os, const TypeId tid)
Print the Attributes block for tid, including Attributes declared in base classes.
void PrintAllGlobals(std::ostream &os)
Print the list of all global variables.
void PrintMakeChecker(std::ostream &os, const std::string &name, const std::string &header)
Print the AttributeValue MakeChecker documentation for a class.
void PrintAttributeValueSection(std::ostream &os, const std::string &name, const bool seeBase=true)
Print the section definition for an AttributeValue.
void PrintAttributesTid(std::ostream &os, const TypeId tid)
Print direct Attributes for this TypeId.
Descriptor for an AttributeValue.
const std::string m_header
The header file name.
const std::string m_type
The name of the underlying type.
const std::string m_name
The base name of the resulting AttributeValue type.
const bool m_seeBase
Print a "see also" pointing to the base class.
Attribute implementation.
Definition: type-id.h:82
std::string name
Attribute name.
Definition: type-id.h:84
Ptr< const AttributeChecker > checker
Checker object.
Definition: type-id.h:96
TraceSource implementation.
Definition: type-id.h:105
std::string name
Trace name.
Definition: type-id.h:107