A Discrete-Event Network Simulator
API
print-introspected-doxygen.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2007 INRIA
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19  */
20 
27 #include <iostream>
28 #include <iomanip>
29 #include <algorithm>
30 #include <map>
31 #include <climits> // CHAR_BIT
32 
33 #include "ns3/command-line.h"
34 #include "ns3/config.h"
35 #include "ns3/global-value.h"
36 #include "ns3/log.h"
37 #include "ns3/object-vector.h"
38 #include "ns3/object.h"
39 #include "ns3/pointer.h"
40 #include "ns3/string.h"
41 #include "ns3/node-container.h"
42 #include "ns3/simple-channel.h"
43 #include "ns3/system-path.h"
44 
45 using namespace ns3;
46 
47 NS_LOG_COMPONENT_DEFINE ("PrintIntrospectedDoxygen");
48 
49 namespace
50 {
55  std::string anchor;
56  std::string argument;
57  std::string boldStart;
58  std::string boldStop;
59  std::string breakBoth;
60  std::string breakHtmlOnly;
61  std::string breakTextOnly;
62  std::string brief;
63  std::string classStart;
64  std::string classStop;
65  std::string codeWord;
66  std::string commentStart;
67  std::string commentStop;
68  std::string copyDoc;
69  std::string file;
70  std::string flagSpanStart;
71  std::string flagSpanStop;
72  std::string functionStart;
73  std::string functionStop;
74  std::string headingStart;
75  std::string headingStop;
76  // Linking: [The link text displayed](\ref TheTarget)
77  std::string hrefStart;
78  std::string hrefMid;
79  std::string hrefStop;
80  std::string indentHtmlOnly;
81  std::string listLineStart;
82  std::string listLineStop;
83  std::string listStart;
84  std::string listStop;
85  std::string note;
86  std::string page;
87  std::string reference;
88  std::string referenceNo;
89  std::string returns;
90  std::string sectionStart;
91  std::string seeAlso;
92  std::string subSectionStart;
93  std::string templArgDeduced;
94  std::string templArgExplicit;
95  std::string templateArgument;
96  std::string variable;
97 
99 } // unnamed namespace
100 
101 
107 void
108 SetMarkup (bool outputText)
109 {
110  NS_LOG_FUNCTION (outputText);
111  if (outputText)
112  {
113  anchor = "";
114  argument = " Arg: ";
115  boldStart = "";
116  boldStop = "";
117  breakBoth = "\n";
118  breakHtmlOnly = "";
119  breakTextOnly = "\n";
120  brief = "";
121  classStart = "";
122  classStop = "\n\n";
123  codeWord = " ";
124  commentStart = "===============================================================\n";
125  commentStop = "";
126  copyDoc = " See: ";
127  file = "File: ";
128  flagSpanStart = "";
129  flagSpanStop = "";
130  functionStart = "";
131  functionStop = "\n\n";
132  headingStart = "";
133  headingStop = "";
134  // Linking: The link text displayed (see TheTarget)
135  hrefStart = "";
136  hrefMid = "(see ";
137  hrefStop = ")";
138  indentHtmlOnly = "";
139  listLineStart = " * ";
140  listLineStop = "";
141  listStart = "";
142  listStop = "";
143  note = "Note: ";
144  page = "Page ";
145  reference = " ";
146  referenceNo = " ";
147  returns = " Returns: ";
148  sectionStart = "Section ";
149  seeAlso = " See: ";
150  subSectionStart = "Subsection ";
151  templArgDeduced = "[deduced] ";
152  templArgExplicit = "[explicit] ";
153  templateArgument = "Template Arg: ";
154  variable = "Variable: ";
155  }
156  else
157  {
158  anchor = "\\anchor ";
159  argument = "\\param ";
160  boldStart = "<b>";
161  boldStop = "</b>";
162  breakBoth = "<br>";
163  breakHtmlOnly = "<br>";
164  breakTextOnly = "";
165  brief = "\\brief ";
166  classStart = "\\class ";
167  classStop = "";
168  codeWord = "\\p ";
169  commentStart = "/*!\n";
170  commentStop = "*/\n";
171  copyDoc = "\\copydoc ";
172  file = "\\file ";
173  flagSpanStart = "<span class=\"mlabel\">";
174  flagSpanStop = "</span>";
175  functionStart = "\\fn ";
176  functionStop = "";
177  headingStart = "<h3>";
178  headingStop = "</h3>";
179  // Linking: [The link text displayed](\ref TheTarget)
180  hrefStart = "[";
181  hrefMid = "](\\ref ";
182  hrefStop = ")";
183  indentHtmlOnly = " ";
184  listLineStart = "<li>";
185  listLineStop = "</li>";
186  listStart = "<ul>";
187  listStop = "</ul>";
188  note = "\\note ";
189  page = "\\page ";
190  reference = " \\ref ";
191  referenceNo = " %";
192  returns = "\\returns ";
193  sectionStart = "\\ingroup ";
194  seeAlso = "\\see ";
195  subSectionStart = "\\addtogroup ";
196  templArgDeduced = "\\deduced ";
197  templArgExplicit = "\\explicit ";
198  templateArgument = "\\tparam ";
199  variable = "\\var ";
200  }
201 } // SetMarkup ()
202 
203 
204 /***************************************************************
205  * Aggregation and configuration paths
206  ***************************************************************/
207 
212 {
213 public:
220  void RecordAggregationInfo (std::string a, std::string b);
226  void Gather (TypeId tid);
230  void Print (void) const;
231 
237  std::vector<std::string> Get (TypeId tid) const;
238 
242  std::vector<std::string> GetNoTypeIds (void) const;
243 
244 private:
248  std::string GetCurrentPath (void) const;
254  void DoGather (TypeId tid);
260  void RecordOutput (TypeId tid);
266  bool HasAlreadyBeenProcessed (TypeId tid) const;
270  std::vector<std::pair<TypeId,std::string> > m_output;
274  std::vector<std::string> m_currentPath;
278  std::vector<TypeId> m_alreadyProcessed;
282  std::vector<std::pair<TypeId,TypeId> > m_aggregates;
289  mutable std::vector<std::string> m_noTids;
290 
291 }; // class StaticInformation
292 
293 
294 void
295 StaticInformation::RecordAggregationInfo (std::string a, std::string b)
296 {
297  NS_LOG_FUNCTION (this << a << b);
298  TypeId aTid;
299  bool found = TypeId::LookupByNameFailSafe (a, &aTid);
300  if (!found)
301  {
302  m_noTids.push_back (a);
303  return;
304  }
305  TypeId bTid;
306  found = TypeId::LookupByNameFailSafe (b, &bTid);
307  if (!found)
308  {
309  m_noTids.push_back (b);
310  return;
311  }
312 
313  m_aggregates.push_back (std::make_pair (aTid, bTid));
314 }
315 
316 
317 void
319 {
320  NS_LOG_FUNCTION (this);
321  for (auto item : m_output)
322  {
323  std::cout << item.first.GetName () << " -> " << item.second << std::endl;
324  }
325 }
326 
327 
328 std::string
330 {
331  NS_LOG_FUNCTION (this);
332  std::ostringstream oss;
333  for (auto item : m_currentPath)
334  {
335  oss << "/" << item;
336  }
337  return oss.str ();
338 }
339 
340 
341 void
343 {
344  NS_LOG_FUNCTION (this << tid);
345  m_output.push_back (std::make_pair (tid, GetCurrentPath ()));
346 }
347 
348 
349 bool
351 {
352  NS_LOG_FUNCTION (this << tid);
353  for (auto it : m_alreadyProcessed)
354  {
355  if (it == tid)
356  {
357  return true;
358  }
359  }
360  return false;
361 }
362 
363 
364 std::vector<std::string>
366 {
367  NS_LOG_FUNCTION (this << tid);
368  std::vector<std::string> paths;
369  for (auto item : m_output)
370  {
371  if (item.first == tid)
372  {
373  paths.push_back (item.second);
374  }
375  }
376  return paths;
377 }
378 
394 template <typename T>
395 void
396 Uniquefy (T t)
397 {
398  std::sort (t.begin (), t.end ());
399  t.erase (std::unique (t.begin (), t.end ()), t.end ());
400 }
401 
402 std::vector<std::string>
404 {
405  NS_LOG_FUNCTION (this);
406  Uniquefy (m_noTids);
407  return m_noTids;
408 }
409 
410 
411 void
413 {
414  NS_LOG_FUNCTION (this << tid);
415  DoGather (tid);
416  Uniquefy (m_output);
417 }
418 
419 
420 void
422 {
423  NS_LOG_FUNCTION (this << tid);
424  if (HasAlreadyBeenProcessed (tid))
425  {
426  return;
427  }
428  RecordOutput (tid);
429  for (uint32_t i = 0; i < tid.GetAttributeN (); ++i)
430  {
431  struct TypeId::AttributeInformation info = tid.GetAttribute(i);
432  const PointerChecker *ptrChecker = dynamic_cast<const PointerChecker *> (PeekPointer (info.checker));
433  if (ptrChecker != 0)
434  {
435  TypeId pointee = ptrChecker->GetPointeeTypeId ();
436 
437  // See if this is a pointer to an Object.
438  Ptr<Object> object = CreateObject<Object> ();
439  TypeId objectTypeId = object->GetTypeId ();
440  if (objectTypeId == pointee)
441  {
442  // Stop the recursion at this attribute if it is a
443  // pointer to an Object, which create too many spurious
444  // paths in the list of attribute paths because any
445  // Object can be in that part of the path.
446  continue;
447  }
448 
449  m_currentPath.push_back (info.name);
450  m_alreadyProcessed.push_back (tid);
451  DoGather (pointee);
452  m_alreadyProcessed.pop_back ();
453  m_currentPath.pop_back ();
454  continue;
455  }
456  // attempt to cast to an object vector.
457  const ObjectPtrContainerChecker *vectorChecker = dynamic_cast<const ObjectPtrContainerChecker *> (PeekPointer (info.checker));
458  if (vectorChecker != 0)
459  {
460  TypeId item = vectorChecker->GetItemTypeId ();
461  m_currentPath.push_back (info.name + "/[i]");
462  m_alreadyProcessed.push_back (tid);
463  DoGather (item);
464  m_alreadyProcessed.pop_back ();
465  m_currentPath.pop_back ();
466  continue;
467  }
468  }
469  for (uint32_t j = 0; j < TypeId::GetRegisteredN (); j++)
470  {
471  TypeId child = TypeId::GetRegistered (j);
472  if (child.IsChildOf (tid))
473  {
474  std::string childName = "$" + child.GetName ();
475  m_currentPath.push_back (childName);
476  m_alreadyProcessed.push_back (tid);
477  DoGather (child);
478  m_alreadyProcessed.pop_back ();
479  m_currentPath.pop_back ();
480  }
481  }
482  for (auto item : m_aggregates)
483  {
484  if (item.first == tid || item.second == tid)
485  {
486  TypeId other;
487  if (item.first == tid)
488  {
489  other = item.second;
490  }
491  if (item.second == tid)
492  {
493  other = item.first;
494  }
495  std::string name = "$" + other.GetName ();
496  m_currentPath.push_back (name);
497  m_alreadyProcessed.push_back (tid);
498  DoGather (other);
499  m_alreadyProcessed.pop_back ();
500  m_currentPath.pop_back ();
501  }
502  }
503 } // StaticInformation::DoGather ()
504 
505 
511 {
513 
514  static StaticInformation info;
515  static bool mapped = false;
516 
517  if (mapped)
518  {
519  return info;
520  }
521 
522  // Short circuit next call
523  mapped = true;
524 
525  // The below statements register typical aggregation relationships
526  // in ns-3 programs, that otherwise aren't picked up automatically
527  // by the creation of the above node. To manually list other common
528  // aggregation relationships that you would like to see show up in
529  // the list of configuration paths in the doxygen, add additional
530  // statements below.
531  info.RecordAggregationInfo ("ns3::Node", "ns3::TcpSocketFactory");
532  info.RecordAggregationInfo ("ns3::Node", "ns3::UdpSocketFactory");
533  info.RecordAggregationInfo ("ns3::Node", "ns3::PacketSocketFactory");
534  info.RecordAggregationInfo ("ns3::Node", "ns3::MobilityModel");
535  info.RecordAggregationInfo ("ns3::Node", "ns3::Ipv4L3Protocol");
536  info.RecordAggregationInfo ("ns3::Node", "ns3::Ipv4NixVectorRouting");
537  info.RecordAggregationInfo ("ns3::Node", "ns3::Icmpv4L4Protocol");
538  info.RecordAggregationInfo ("ns3::Node", "ns3::ArpL3Protocol");
539  info.RecordAggregationInfo ("ns3::Node", "ns3::Icmpv4L4Protocol");
540  info.RecordAggregationInfo ("ns3::Node", "ns3::UdpL4Protocol");
541  info.RecordAggregationInfo ("ns3::Node", "ns3::Ipv6L3Protocol");
542  info.RecordAggregationInfo ("ns3::Node", "ns3::Icmpv6L4Protocol");
543  info.RecordAggregationInfo ("ns3::Node", "ns3::TcpL4Protocol");
544  info.RecordAggregationInfo ("ns3::Node", "ns3::RipNg");
545  info.RecordAggregationInfo ("ns3::Node", "ns3::GlobalRouter");
546  info.RecordAggregationInfo ("ns3::Node", "ns3::aodv::RoutingProtocol");
547  info.RecordAggregationInfo ("ns3::Node", "ns3::dsdv::RoutingProtocol");
548  info.RecordAggregationInfo ("ns3::Node", "ns3::dsr::DsrRouting");
549  info.RecordAggregationInfo ("ns3::Node", "ns3::olsr::RoutingProtocol");
550  info.RecordAggregationInfo ("ns3::Node", "ns3::EnergyHarvesterContainer");
551  info.RecordAggregationInfo ("ns3::Node", "ns3::EnergySourceContainer");
552 
553  // Create a channel object so that channels appear in the namespace
554  // paths that will be generated here.
555  Ptr<SimpleChannel> simpleChannel;
556  simpleChannel = CreateObject<SimpleChannel> ();
557 
558  for (uint32_t i = 0; i < Config::GetRootNamespaceObjectN (); ++i)
559  {
561  info.Gather (object->GetInstanceTypeId ());
562  }
563 
564  return info;
565 
566 } // GetTypicalAggregations ()
567 
568 
570 typedef std::map< std::string, int32_t> NameMap;
571 typedef NameMap::const_iterator NameMapIterator;
572 
573 
580 NameMap
582 {
584 
585  static NameMap nameMap;
586  static bool mapped = false;
587 
588  if (mapped)
589  {
590  return nameMap;
591  }
592 
593  // Short circuit next call
594  mapped = true;
595 
596  // Get typical aggregation relationships.
598 
599  // Registered types
600  for (uint32_t i = 0; i < TypeId::GetRegisteredN (); i++)
601  {
602  TypeId tid = TypeId::GetRegistered (i);
603  if (tid.MustHideFromDocumentation ())
604  {
605  continue;
606  }
607 
608  // Capitalize all of letters in the name so that it sorts
609  // correctly in the map.
610  std::string name = tid.GetName ();
611  std::transform (name.begin (), name.end (), name.begin (), ::toupper);
612 
613  // Save this name's index.
614  nameMap[name] = i;
615  }
616 
617  // Type names without TypeIds
618  std::vector<std::string> noTids = info.GetNoTypeIds ();
619  for (auto item : noTids)
620  {
621  nameMap[item] = -1;
622  }
623 
624  return nameMap;
625 } // GetNameMap ()
626 
627 
628 /***************************************************************
629  * Docs for a single TypeId
630  ***************************************************************/
631 
637 void
638 PrintConfigPaths (std::ostream & os, const TypeId tid)
639 {
640  NS_LOG_FUNCTION (tid);
641  std::vector<std::string> paths = GetTypicalAggregations ().Get (tid);
642 
643  // Config --------------
644  if (paths.empty ())
645  {
646  os << "Introspection did not find any typical Config paths."
647  << breakBoth
648  << std::endl;
649  }
650  else
651  {
652  os << headingStart
653  << "Config Paths"
654  << headingStop
655  << std::endl;
656  os << std::endl;
657  os << tid.GetName ()
658  << " is accessible through the following paths"
659  << " with Config::Set and Config::Connect:"
660  << std::endl;
661  os << listStart << std::endl;
662  for (auto path : paths)
663  {
664  os << listLineStart
665  << "\"" << path << "\""
666  << listLineStop
667  << breakTextOnly
668  << std::endl;
669  }
670  os << listStop << std::endl;
671  }
672 } // PrintConfigPaths ()
673 
674 
683 void
684 PrintAttributesTid (std::ostream &os, const TypeId tid)
685 {
686  NS_LOG_FUNCTION (tid);
687  os << listStart << std::endl;
688  for (uint32_t j = 0; j < tid.GetAttributeN (); j++)
689  {
690  struct TypeId::AttributeInformation info = tid.GetAttribute(j);
691  os << listLineStart
692  << boldStart << info.name << boldStop << ": "
693  << info.help
694  << std::endl;
695  os << " "
696  << listStart << std::endl;
697  os << " "
698  << listLineStart
699  << "Set with class: " << reference
700  << info.checker->GetValueTypeName ()
701  << listLineStop
702  << std::endl;
703  if (info.checker->HasUnderlyingTypeInformation ())
704  {
705  os << " "
706  << listLineStart
707  << "Underlying type: ";
708 
709  std::string valType = info.checker->GetValueTypeName ();
710  std::string underType = info.checker->GetUnderlyingTypeInformation ();
711  if ((valType != "ns3::EnumValue") && (underType != "std::string"))
712  {
713  // Indirect cases to handle
714  bool handled = false;
715 
716  if (valType == "ns3::PointerValue")
717  {
718  const PointerChecker *ptrChecker =
719  dynamic_cast<const PointerChecker *> (PeekPointer (info.checker));
720  if (ptrChecker != 0)
721  {
722  os << reference << "ns3::Ptr" << "< "
723  << reference << ptrChecker->GetPointeeTypeId ().GetName ()
724  << ">";
725  handled = true;
726  }
727  }
728  else if (valType == "ns3::ObjectPtrContainerValue")
729  {
730  const ObjectPtrContainerChecker * ptrChecker =
731  dynamic_cast<const ObjectPtrContainerChecker *> (PeekPointer (info.checker));
732  if (ptrChecker != 0)
733  {
734  os << reference << "ns3::Ptr" << "< "
735  << reference << ptrChecker->GetItemTypeId ().GetName ()
736  << ">";
737  handled = true;
738  }
739  }
740  // Helper to match first part of string
741  class StringBeginMatcher
742  {
743  public:
744  StringBeginMatcher (const std::string s)
745  : m_string (s) { };
746  bool operator () (const std::string t)
747  {
748  std::size_t pos = m_string.find (t);
749  return pos == 0;
750  };
751  private:
752  std::string m_string;
753  };
754  StringBeginMatcher match (underType);
755 
756  if ( match ("bool") || match ("double") ||
757  match ("int8_t") || match ("uint8_t") ||
758  match ("int16_t") || match ("uint16_t") ||
759  match ("int32_t") || match ("uint32_t") ||
760  match ("int64_t") || match ("uint64_t")
761  )
762  {
763  os << underType;
764  handled = true;
765  }
766  if (! handled)
767  {
768  os << reference << underType;
769  }
770  }
771  os << listLineStop << std::endl;
772  }
773  if (info.flags & TypeId::ATTR_CONSTRUCT && info.accessor->HasSetter ())
774  {
775  os << " "
776  << listLineStart
777  << "Initial value: "
778  << info.initialValue->SerializeToString (info.checker)
779  << listLineStop
780  << std::endl;
781  }
782  os << " " << listLineStart << "Flags: ";
783  if (info.flags & TypeId::ATTR_CONSTRUCT && info.accessor->HasSetter ())
784  {
785  os << flagSpanStart << "construct " << flagSpanStop;
786  }
787  if (info.flags & TypeId::ATTR_SET && info.accessor->HasSetter ())
788  {
789  os << flagSpanStart << "write " << flagSpanStop;
790  }
791  if (info.flags & TypeId::ATTR_GET && info.accessor->HasGetter ())
792  {
793  os << flagSpanStart << "read " << flagSpanStop;
794  }
795  os << listLineStop << std::endl;
796  os << " "
797  << listStop
798  << " " << std::endl;
799 
800  }
801  os << listStop << std::endl;
802 } // PrintAttributesTid ()
803 
804 
815 void
816 PrintAttributes (std::ostream & os, const TypeId tid)
817 {
818  NS_LOG_FUNCTION (tid);
819  if (tid.GetAttributeN () == 0)
820  {
821  os << "No Attributes are defined for this type."
822  << breakBoth
823  << std::endl;
824  }
825  else
826  {
827  os << headingStart
828  << "Attributes"
829  << headingStop
830  << std::endl;
831  PrintAttributesTid (os, tid);
832  }
833 
834  // Attributes from base classes
835  TypeId tmp = tid.GetParent ();
836  while (tmp.GetParent () != tmp)
837  {
838  if (tmp.GetAttributeN () != 0)
839  {
840  os << headingStart
841  << "Attributes defined in parent class "
842  << tmp.GetName ()
843  << headingStop
844  << std::endl;
845  PrintAttributesTid (os, tmp);
846  }
847  tmp = tmp.GetParent ();
848 
849  } // Attributes
850 } // PrintAttributes ()
851 
852 
861 void
862 PrintTraceSourcesTid (std::ostream & os, const TypeId tid)
863 {
864  NS_LOG_FUNCTION (tid);
865  os << listStart << std::endl;
866  for (uint32_t i = 0; i < tid.GetTraceSourceN (); ++i)
867  {
868  struct TypeId::TraceSourceInformation info = tid.GetTraceSource (i);
869  os << listLineStart
870  << boldStart << info.name << boldStop << ": "
871  << info.help << breakBoth
872  // '%' prevents doxygen from linking to the Callback class...
873  << "%Callback signature: "
874  << info.callback
875  << std::endl;
876  os << listLineStop << std::endl;
877  }
878  os << listStop << std::endl;
879 } // PrintTraceSourcesTid ()
880 
881 
892 void
893 PrintTraceSources (std::ostream & os, const TypeId tid)
894 {
895  NS_LOG_FUNCTION (tid);
896  if (tid.GetTraceSourceN () == 0)
897  {
898  os << "No TraceSources are defined for this type."
899  << breakBoth
900  << std::endl;
901  }
902  else
903  {
904  os << headingStart
905  << "TraceSources"
906  << headingStop << std::endl;
907  PrintTraceSourcesTid (os, tid);
908  }
909 
910  // Trace sources from base classes
911  TypeId tmp = tid.GetParent ();
912  while (tmp.GetParent () != tmp)
913  {
914  if (tmp.GetTraceSourceN () != 0)
915  {
916  os << headingStart
917  << "TraceSources defined in parent class "
918  << tmp.GetName ()
919  << headingStop << std::endl;
920  PrintTraceSourcesTid (os, tmp);
921  }
922  tmp = tmp.GetParent ();
923  }
924 
925 } // PrintTraceSources ()
926 
933 void PrintSize (std::ostream & os, const TypeId tid)
934 {
935  NS_LOG_FUNCTION (tid);
936  NS_ASSERT_MSG (CHAR_BIT != 0, "CHAR_BIT is zero");
937 
938  std::size_t arch = (sizeof (void *) * CHAR_BIT);
939 
940  os << boldStart << "Size" << boldStop
941  << " of this type is " << tid.GetSize ()
942  << " bytes (on a " << arch << "-bit architecture)."
943  << std::endl;
944 } // PrintSize ()
945 
946 
952 void
953 PrintTypeIdBlocks (std::ostream & os)
954 {
956 
957  NameMap nameMap = GetNameMap ();
958 
959  // Iterate over the map, which will print the class names in
960  // alphabetical order.
961  for (auto item : nameMap)
962  {
963  // Handle only real TypeIds
964  if (item.second < 0)
965  {
966  continue ;
967  }
968  // Get the class's index out of the map;
969  TypeId tid = TypeId::GetRegistered (item.second);
970  std::string name = tid.GetName ();
971 
972  std::cout << commentStart << std::endl;
973 
974  std::cout << classStart << name << std::endl;
975  std::cout << std::endl;
976 
977  PrintConfigPaths (std::cout, tid);
978  PrintAttributes (std::cout, tid);
979  PrintTraceSources (std::cout, tid);
980  PrintSize (std::cout, tid);
981 
982  std::cout << commentStop << std::endl;
983  } // for class documentation
984 
985 } // PrintTypeIdBlocks
986 
987 
988 /***************************************************************
989  * Lists of All things
990  ***************************************************************/
991 
997 void
998 PrintAllTypeIds (std::ostream & os)
999 {
1001  os << commentStart << page << "TypeIdList All ns3::TypeId's\n"
1002  << std::endl;
1003  os << "This is a list of all" << reference << "ns3::TypeId's.\n"
1004  << "For more information see the" << reference << "ns3::TypeId "
1005  << "section of this API documentation and the"
1006  << referenceNo << "TypeId section "
1007  << "in the Configuration and "
1008  << referenceNo << "Attributes chapter of the Manual.\n"
1009  << std::endl;
1010 
1011  os << listStart << std::endl;
1012 
1013  NameMap nameMap = GetNameMap ();
1014  // Iterate over the map, which will print the class names in
1015  // alphabetical order.
1016  for (auto item : nameMap)
1017  {
1018  // Handle only real TypeIds
1019  if (item.second < 0)
1020  {
1021  continue ;
1022  }
1023  // Get the class's index out of the map;
1024  TypeId tid = TypeId::GetRegistered (item.second);
1025 
1026  os << indentHtmlOnly
1027  << listLineStart
1028  << boldStart
1029  << tid.GetName ()
1030  << boldStop
1031  << listLineStop
1032  << std::endl;
1033 
1034  }
1035  os << listStop << std::endl;
1036  os << commentStop << std::endl;
1037 
1038 } // PrintAllTypeIds ()
1039 
1040 
1049 void
1050 PrintAllAttributes (std::ostream & os)
1051 {
1053  os << commentStart << page << "AttributeList All Attributes\n"
1054  << std::endl;
1055  os << "This is a list of all" << reference << "ns3::Attributes by class. "
1056  << "For more information see the" << reference << "ns3:Attributes "
1057  << "section of this API documentation and the Attributes sections "
1058  << "in the Tutorial and Manual.\n"
1059  << std::endl;
1060 
1061  NameMap nameMap = GetNameMap ();
1062  // Iterate over the map, which will print the class names in
1063  // alphabetical order.
1064  for (auto item: nameMap)
1065  {
1066  // Handle only real TypeIds
1067  if (item.second < 0)
1068  {
1069  continue ;
1070  }
1071  // Get the class's index out of the map;
1072  TypeId tid = TypeId::GetRegistered (item.second);
1073 
1074  if (tid.GetAttributeN () == 0 )
1075  {
1076  continue;
1077  }
1078  os << boldStart << tid.GetName () << boldStop << breakHtmlOnly
1079  << std::endl;
1080 
1081  os << listStart << std::endl;
1082  for (uint32_t j = 0; j < tid.GetAttributeN (); ++j)
1083  {
1084  struct TypeId::AttributeInformation info = tid.GetAttribute(j);
1085  os << listLineStart
1086  << boldStart << info.name << boldStop
1087  << ": " << info.help
1088  << listLineStop
1089  << std::endl;
1090  }
1091  os << listStop << std::endl;
1092  }
1093  os << commentStop << std::endl;
1094 
1095 } // PrintAllAttributes ()
1096 
1097 
1103 void
1104 PrintAllGlobals (std::ostream & os)
1105 {
1107  os << commentStart << page << "GlobalValueList All GlobalValues\n"
1108  << std::endl;
1109  os << "This is a list of all" << reference << "ns3::GlobalValue instances.\n"
1110  << "See ns3::GlobalValue for how to set these."
1111  << std::endl;
1112 
1113  os << listStart << std::endl;
1115  i != GlobalValue::End ();
1116  ++i)
1117  {
1118  StringValue val;
1119  (*i)->GetValue (val);
1120  os << indentHtmlOnly
1121  << listLineStart
1122  << boldStart
1123  << hrefStart << (*i)->GetName ()
1124  << hrefMid << "GlobalValue" << (*i)->GetName ()
1125  << hrefStop
1126  << boldStop
1127  << ": " << (*i)->GetHelp ()
1128  << ". Default value: " << val.Get () << ". "
1129  << listLineStop
1130  << std::endl;
1131  }
1132  os << listStop << std::endl;
1133  os << commentStop << std::endl;
1134 
1135 } // PrintAllGlobals ()
1136 
1137 
1143 void
1144 PrintAllLogComponents (std::ostream & os)
1145 {
1147  os << commentStart << page << "LogComponentList All LogComponents\n"
1148  << std::endl;
1149  os << "This is a list of all" << reference << "ns3::LogComponent instances.\n"
1150  << std::endl;
1151 
1157  // Find longest log name
1158  std::size_t widthL = std::string ("Log Component").size ();
1159  std::size_t widthR = std::string ("file").size ();
1160  for (auto it : (*logs))
1161  {
1162  widthL = std::max (widthL, it.first.size ());
1163  std::string file = it.second->File ();
1164  // Strip leading "../" related to depth in build directory
1165  // since doxygen only sees the path starting with "src/", etc.
1166  while (file.find ("../") == 0)
1167  {
1168  file = file.substr (3);
1169  }
1170  widthR = std::max (widthR, file.size ());
1171  }
1172  const std::string sep (" | ");
1173 
1174  os << std::setw (widthL) << std::left << "Log Component" << sep
1175  // Header line has to be padded to same length as separator line
1176  << std::setw (widthR) << std::left << "File " << std::endl;
1177  os << ":" << std::string (widthL - 1, '-') << sep
1178  << ":" << std::string (widthR - 1, '-') << std::endl;
1179 
1180  LogComponent::ComponentList::const_iterator it;
1181  for (auto it : (*logs))
1182  {
1183  std::string file = it.second->File ();
1184  // Strip leading "../" related to depth in build directory
1185  // since doxygen only sees the path starting with "src/", etc.
1186  while (file.find ("../") == 0)
1187  {
1188  file = file.substr (3);
1189  }
1190 
1191  os << std::setw (widthL) << std::left << it.first << sep << file << std::endl;
1192  }
1193  os << std::right << std::endl;
1194  os << commentStop << std::endl;
1195 } // PrintAllLogComponents ()
1196 
1197 
1206 void
1207 PrintAllTraceSources (std::ostream & os)
1208 {
1210  os << commentStart << page << "TraceSourceList All TraceSources\n"
1211  << std::endl;
1212  os << "This is a list of all" << reference << "tracing sources. "
1213  << "For more information see the " << reference << "tracing "
1214  << "section of this API documentation and the Tracing sections "
1215  << "in the Tutorial and Manual.\n"
1216  << std::endl;
1217 
1218  NameMap nameMap = GetNameMap ();
1219 
1220  // Iterate over the map, which will print the class names in
1221  // alphabetical order.
1222  for (auto item : nameMap)
1223  {
1224  // Handle only real TypeIds
1225  if (item.second < 0)
1226  {
1227  continue ;
1228  }
1229  // Get the class's index out of the map;
1230  TypeId tid = TypeId::GetRegistered (item.second);
1231 
1232  if (tid.GetTraceSourceN () == 0 )
1233  {
1234  continue;
1235  }
1236  os << boldStart << tid.GetName () << boldStop << breakHtmlOnly
1237  << std::endl;
1238 
1239  os << listStart << std::endl;
1240  for (uint32_t j = 0; j < tid.GetTraceSourceN (); ++j)
1241  {
1242  struct TypeId::TraceSourceInformation info = tid.GetTraceSource(j);
1243  os << listLineStart
1244  << boldStart << info.name << boldStop
1245  << ": " << info.help
1246  << listLineStop
1247  << std::endl;
1248  }
1249  os << listStop << std::endl;
1250  }
1251  os << commentStop << std::endl;
1252 
1253 } // PrintAllTraceSources ()
1254 
1255 
1256 /***************************************************************
1257  * Docs for Attribute classes
1258  ***************************************************************/
1259 
1260 
1274 void
1275 PrintAttributeValueSection (std::ostream & os,
1276  const std::string & name,
1277  const bool seeBase = true)
1278 {
1279  NS_LOG_FUNCTION (name);
1280  std::string section = "attribute_" + name;
1281 
1282  // \ingroup attribute
1283  // \defgroup attribute_<name>Value <name> Attribute
1284  os << commentStart << sectionStart << "attribute\n"
1285  << subSectionStart << "attribute_" << name << " "
1286  << name << " Attribute\n"
1287  << "Attribute implementation for " << name << "\n";
1288  if (seeBase)
1289  {
1290  // Some classes don't live in ns3::. Yuck
1291  if (name != "IeMeshId")
1292  {
1293  os << seeAlso << "ns3::" << name << "\n";
1294  }
1295  else
1296  {
1297  os << seeAlso << "ns3::dot11s::" << name << "\n";
1298  }
1299  }
1300  os << commentStop;
1301 
1302 } // PrintAttributeValueSection ()
1303 
1304 
1315 void
1316 PrintAttributeValueWithName (std::ostream & os,
1317  const std::string & name,
1318  const std::string & type,
1319  const std::string & header)
1320 {
1321  NS_LOG_FUNCTION (name << type << header);
1322  std::string sectAttr = sectionStart + "attribute_" + name;
1323 
1324  // \ingroup attribute_<name>Value
1325  // \class ns3::<name>Value "header"
1326  std::string valClass = name + "Value";
1327  std::string qualClass = " ns3::" + valClass;
1328 
1329  os << commentStart << sectAttr << std::endl;
1330  os << classStart << qualClass << " \"" << header << "\"" << std::endl;
1331  os << "AttributeValue implementation for " << name << "." << std::endl;
1332  os << seeAlso << "AttributeValue" << std::endl;
1333  os << commentStop;
1334 
1335  // Copy ctor: <name>Value::<name>Value
1336  os << commentStart
1337  << functionStart << name
1338  << qualClass << "::" << valClass;
1339  if ( (name == "EmptyAttribute") ||
1340  (name == "ObjectPtrContainer") )
1341  {
1342  // Just default constructors.
1343  os << "(void)\n";
1344  }
1345  else
1346  {
1347  // Copy constructors
1348  os << "(const " << type << " & value)\n"
1349  << "Copy constructor.\n"
1350  << argument << "[in] value The " << name << " value to copy.\n";
1351  }
1352  os << commentStop;
1353 
1354  // <name>Value::Get (void) const
1355  os << commentStart
1356  << functionStart << type
1357  << qualClass << "::Get (void) const\n"
1358  << returns << "The " << name << " value.\n"
1359  << commentStop;
1360 
1361  // <name>Value::GetAccessor (T & value) const
1362  os << commentStart
1363  << functionStart << "bool"
1364  << qualClass << "::GetAccessor (T & value) const\n"
1365  << "Access the " << name << " value as type " << codeWord << "T.\n"
1366  << templateArgument << "T " << templArgExplicit << "The type to cast to.\n"
1367  << argument << "[out] value The " << name << " value, as type "
1368  << codeWord << "T.\n"
1369  << returns << "true.\n"
1370  << commentStop;
1371 
1372  // <name>Value::Set (const name & value)
1373  if (type != "Callback") // Yuck
1374  {
1375  os << commentStart
1376  << functionStart << "void"
1377  << qualClass << "::Set (const " << type << " & value)\n"
1378  << "Set the value.\n"
1379  << argument << "[in] value The value to adopt.\n"
1380  << commentStop;
1381  }
1382 
1383  // <name>Value::m_value
1384  os << commentStart
1385  << variable << type
1386  << qualClass << "::m_value\n"
1387  << "The stored " << name << " instance.\n"
1388  << commentStop
1389  << std::endl;
1390 
1391 } // PrintAttributeValueWithName ()
1392 
1393 
1402 void
1403 PrintMakeAccessors (std::ostream & os, const std::string & name)
1404 {
1405  NS_LOG_FUNCTION (name);
1406  std::string sectAttr = sectionStart + "attribute_" + name + "\n";
1407  std::string make = "ns3::Make" + name + "Accessor ";
1408 
1409  // \ingroup attribute_<name>Value
1410  // Make<name>Accessor (T1 a1)
1411  os << commentStart << sectAttr
1412  << functionStart << "ns3::Ptr<const ns3::AttributeAccessor> "
1413  << make << "(T1 a1)\n"
1414  << copyDoc << "ns3::MakeAccessorHelper(T1)\n"
1415  << seeAlso << "AttributeAccessor\n"
1416  << commentStop;
1417 
1418  // \ingroup attribute_<name>Value
1419  // Make<name>Accessor (T1 a1)
1420  os << commentStart << sectAttr
1421  << functionStart << "ns3::Ptr<const ns3::AttributeAccessor> "
1422  << make << "(T1 a1, T2 a2)\n"
1423  << copyDoc << "ns3::MakeAccessorHelper(T1,T2)\n"
1424  << seeAlso << "AttributeAccessor\n"
1425  << commentStop;
1426 } // PrintMakeAccessors ()
1427 
1428 
1438 void
1439 PrintMakeChecker (std::ostream & os,
1440  const std::string & name,
1441  const std::string & header)
1442 {
1443  NS_LOG_FUNCTION (name << header);
1444  std::string sectAttr = sectionStart + "attribute_" + name + "\n";
1445  std::string make = "ns3::Make" + name + "Checker ";
1446 
1447  // \ingroup attribute_<name>Value
1448  // class <name>Checker
1449  os << commentStart << sectAttr << std::endl;
1450  os << classStart << " ns3::" << name << "Checker"
1451  << " \"" << header << "\"" << std::endl;
1452  os << "AttributeChecker implementation for " << name << "Value." << std::endl;
1453  os << seeAlso << "AttributeChecker" << std::endl;
1454  os << commentStop;
1455 
1456  // \ingroup attribute_<name>Value
1457  // Make<name>Checker (void)
1458  os << commentStart << sectAttr
1459  << functionStart << "ns3::Ptr<const ns3::AttributeChecker> "
1460  << make << "(void)\n"
1461  << returns << "The AttributeChecker.\n"
1462  << seeAlso << "AttributeChecker\n"
1463  << commentStop;
1464 } // PrintMakeChecker ()
1465 
1466 
1468 typedef struct {
1469  const std::string m_name;
1470  const std::string m_type;
1471  const bool m_seeBase;
1472  const std::string m_header;
1474 
1475 
1484 void
1485 PrintAttributeHelper (std::ostream & os,
1486  const AttributeDescriptor & attr)
1487 {
1488  NS_LOG_FUNCTION (attr.m_name << attr.m_type << attr.m_seeBase <<
1489  attr.m_header);
1490  PrintAttributeValueSection (os, attr.m_name, attr.m_seeBase);
1491  PrintAttributeValueWithName (os, attr.m_name, attr.m_type, attr.m_header);
1492  PrintMakeAccessors (os, attr.m_name);
1493  PrintMakeChecker (os, attr.m_name, attr.m_header);
1494 } // PrintAttributeHelper ()
1495 
1496 
1501 void
1503 {
1505 
1506  const AttributeDescriptor attributes [] =
1507  {
1508  // Name Type see Base header-file
1509  // Users of ATTRIBUTE_HELPER_HEADER
1510  //
1511  { "Address", "Address", true, "address.h" },
1512  { "Box", "Box", true, "box.h" },
1513  { "DataRate", "DataRate", true, "data-rate.h" },
1514  { "Length", "Length", true, "length.h" },
1515  { "IeMeshId", "IeMeshId", true, "ie-dot11s-id.h" },
1516  { "Ipv4Address", "Ipv4Address", true, "ipv4-address.h" },
1517  { "Ipv4Mask", "Ipv4Mask", true, "ipv4-address.h" },
1518  { "Ipv6Address", "Ipv6Address", true, "ipv6-address.h" },
1519  { "Ipv6Prefix", "Ipv6Prefix", true, "ipv6-address.h" },
1520  { "Mac16Address", "Mac16Address", true, "mac16-address.h" },
1521  { "Mac48Address", "Mac48Address", true, "mac48-address.h" },
1522  { "Mac64Address", "Mac64Address", true, "mac64-address.h" },
1523  { "ObjectFactory", "ObjectFactory", true, "object-factory.h" },
1524  { "OrganizationIdentifier",
1525  "OrganizationIdentifier",
1526  true, "vendor-specific-action.h" },
1527  { "Rectangle", "Rectangle", true, "rectangle.h" },
1528  { "Ssid", "Ssid", true, "ssid.h" },
1529  { "TypeId", "TypeId", true, "type-id.h" },
1530  { "UanModesList", "UanModesList", true, "uan-tx-mode.h" },
1531  // { "ValueClassTest", "ValueClassTest", false, "" /* outside ns3 */ },
1532  { "Vector", "Vector", true, "vector.h" },
1533  { "Vector2D", "Vector2D", true, "vector.h" },
1534  { "Vector3D", "Vector3D", true, "vector.h" },
1535  { "Waypoint", "Waypoint", true, "waypoint.h" },
1536  { "WifiMode", "WifiMode", true, "wifi-mode.h" },
1537 
1538  // All three (Value, Access and Checkers) defined, but custom
1539  { "Boolean", "bool", false, "boolean.h" },
1540  { "Callback", "Callback", true, "callback.h" },
1541  { "Double", "double", false, "double.h" },
1542  { "Enum", "int", false, "enum.h" },
1543  { "Integer", "int64_t", false, "integer.h" },
1544  { "Pointer", "Pointer", false, "pointer.h" },
1545  { "String", "std::string", false, "string.h" },
1546  { "Time", "Time", true, "nstime.h" },
1547  { "Uinteger", "uint64_t", false, "uinteger.h" },
1548  { "", "", false, "last placeholder" }
1549  };
1550 
1551  int i = 0;
1552  while (attributes[i].m_name != "")
1553  {
1554  PrintAttributeHelper (os, attributes[i]);
1555  ++i;
1556  }
1557 
1558  // Special cases
1559  PrintAttributeValueSection (os, "EmptyAttribute", false);
1560  PrintAttributeValueWithName (os, "EmptyAttribute", "EmptyAttribute",
1561  "attribute.h");
1562 
1563  PrintAttributeValueSection (os, "ObjectPtrContainer", false);
1564  PrintAttributeValueWithName (os, "ObjectPtrContainer", "ObjectPtrContainer", "object-ptr-container.h");
1565  PrintMakeChecker (os, "ObjectPtrContainer", "object-ptr-container.h");
1566 
1567  PrintAttributeValueSection (os, "ObjectVector", false);
1568  PrintMakeAccessors (os, "ObjectVector");
1569  PrintMakeChecker (os, "ObjectVector", "object-vector.h");
1570 
1571  PrintAttributeValueSection (os, "ObjectMap", false);
1572  PrintMakeAccessors (os, "ObjectMap");
1573  PrintMakeChecker (os, "ObjectMap", "object-map.h");
1574 
1575  PrintAttributeValueSection (os, "Pair", false);
1576  PrintAttributeValueWithName (os, "Pair", "std::pair<A, B>", "pair.h");
1577  PrintMakeChecker (os, "Pair", "pair.h");
1578 
1579  PrintAttributeValueSection (os, "Tuple", false);
1580  PrintAttributeValueWithName (os, "Tuple", "std::tuple<Args...>", "tuple.h");
1581  PrintMakeChecker (os, "Tuple", "tuple.h");
1582 
1583  PrintAttributeValueSection (os, "AttributeContainer", false);
1584  PrintAttributeValueWithName (os, "AttributeContainer", "AttributeContainer", "attribute-container.h");
1585  PrintMakeChecker (os, "AttributeContainer", "attribute-container.h");
1586 } // PrintAttributeImplementations ()
1587 
1588 
1589 /***************************************************************
1590  * Main
1591  ***************************************************************/
1592 
1593 int main (int argc, char *argv[])
1594 {
1596  bool outputText = false;
1597 
1598  CommandLine cmd (__FILE__);
1599  cmd.Usage ("Generate documentation for all ns-3 registered types, "
1600  "trace sources, attributes and global variables.");
1601  cmd.AddValue ("output-text", "format output as plain text", outputText);
1602  cmd.Parse (argc, argv);
1603 
1604  SetMarkup (outputText);
1605 
1606 
1607  // Create a Node, to force linking and instantiation of our TypeIds
1608  NodeContainer c;
1609  c.Create (1);
1610 
1611  // mode-line: helpful when debugging introspected-doxygen.h
1612  if (!outputText)
1613  {
1614  std::cout << "/* -*- Mode:C++; c-file-style:\"gnu\"; "
1615  "indent-tabs-mode:nil; -*- */\n"
1616  << std::endl;
1617  }
1618 
1619  // Doxygen file header
1620  std::cout << std::endl;
1621  std::cout << commentStart
1622  << file << "\n"
1623  << sectionStart << "utils\n"
1624  << "Doxygen docs generated from the TypeId database.\n"
1625  << note << "This file is automatically generated by "
1626  << codeWord << "print-introspected-doxygen.cc. Do not edit this file! "
1627  << "Edit that file instead.\n"
1628  << commentStop
1629  << std::endl;
1630 
1631  PrintTypeIdBlocks (std::cout);
1632 
1633  PrintAllTypeIds (std::cout);
1634  PrintAllAttributes (std::cout);
1635  PrintAllGlobals (std::cout);
1636  PrintAllLogComponents (std::cout);
1637  PrintAllTraceSources (std::cout);
1638  PrintAttributeImplementations (std::cout);
1639 
1640  return 0;
1641 }
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
ns3::CommandLine
Parse command-line arguments.
Definition: command-line.h:228
anonymous_namespace{print-introspected-doxygen.cc}::indentHtmlOnly
std::string indentHtmlOnly
small indent
Definition: print-introspected-doxygen.cc:80
anonymous_namespace{print-introspected-doxygen.cc}::listStart
std::string listStart
start unordered list
Definition: print-introspected-doxygen.cc:83
anonymous_namespace{print-introspected-doxygen.cc}::subSectionStart
std::string subSectionStart
start a new subsection
Definition: print-introspected-doxygen.cc:92
anonymous_namespace{print-introspected-doxygen.cc}::functionStop
std::string functionStop
end of a method/function
Definition: print-introspected-doxygen.cc:73
PrintAttributeValueWithName
void PrintAttributeValueWithName(std::ostream &os, const std::string &name, const std::string &type, const std::string &header)
Print the AttributeValue documentation for a class.
Definition: print-introspected-doxygen.cc:1316
anonymous_namespace{print-introspected-doxygen.cc}::classStop
std::string classStop
end of a class
Definition: print-introspected-doxygen.cc:64
ns3::TypeId::ATTR_CONSTRUCT
@ ATTR_CONSTRUCT
The attribute can be written at construction-time.
Definition: type-id.h:66
ns3::ObjectPtrContainerChecker::GetItemTypeId
virtual TypeId GetItemTypeId(void) const =0
Get the TypeId of the container class type.
ns3::PointerChecker::GetPointeeTypeId
virtual TypeId GetPointeeTypeId(void) const =0
Get the TypeId of the base type.
anonymous_namespace{print-introspected-doxygen.cc}::page
std::string page
start a separate page
Definition: print-introspected-doxygen.cc:86
PrintTraceSources
void PrintTraceSources(std::ostream &os, const TypeId tid)
Print the Trace sources block for tid, including Trace sources declared in base classes.
Definition: print-introspected-doxygen.cc:893
anonymous_namespace{print-introspected-doxygen.cc}::brief
std::string brief
brief tag
Definition: print-introspected-doxygen.cc:62
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
anonymous_namespace{print-introspected-doxygen.cc}::anchor
std::string anchor
Markup tokens.
Definition: print-introspected-doxygen.cc:55
ns3::TypeId::GetTraceSource
struct TypeId::TraceSourceInformation GetTraceSource(std::size_t i) const
Get the trace source by index.
Definition: type-id.cc:1104
anonymous_namespace{print-introspected-doxygen.cc}::copyDoc
std::string copyDoc
copy (or refer) to docs elsewhere
Definition: print-introspected-doxygen.cc:68
anonymous_namespace{print-introspected-doxygen.cc}::hrefStart
std::string hrefStart
start of a link
Definition: print-introspected-doxygen.cc:77
anonymous_namespace{print-introspected-doxygen.cc}::breakBoth
std::string breakBoth
linebreak
Definition: print-introspected-doxygen.cc:59
anonymous_namespace{print-introspected-doxygen.cc}::flagSpanStart
std::string flagSpanStart
start of Attribute flag value
Definition: print-introspected-doxygen.cc:70
ns3::TypeId::AttributeInformation::flags
uint32_t flags
AttributeFlags value.
Definition: type-id.h:84
StaticInformation::m_output
std::vector< std::pair< TypeId, std::string > > m_output
Configuration path for each TypeId.
Definition: print-introspected-doxygen.cc:270
ns3::TypeId::ATTR_SET
@ ATTR_SET
The attribute can be written.
Definition: type-id.h:65
anonymous_namespace{print-introspected-doxygen.cc}::codeWord
std::string codeWord
format next word as source code
Definition: print-introspected-doxygen.cc:65
anonymous_namespace{print-introspected-doxygen.cc}::returns
std::string returns
the return value
Definition: print-introspected-doxygen.cc:89
anonymous_namespace{print-introspected-doxygen.cc}::variable
std::string variable
variable or class member
Definition: print-introspected-doxygen.cc:96
NameMap
std::map< std::string, int32_t > NameMap
Map from TypeId name to tid.
Definition: print-introspected-doxygen.cc:570
StaticInformation::GetNoTypeIds
std::vector< std::string > GetNoTypeIds(void) const
Definition: print-introspected-doxygen.cc:403
StaticInformation::m_aggregates
std::vector< std::pair< TypeId, TypeId > > m_aggregates
List of aggregation relationships.
Definition: print-introspected-doxygen.cc:282
ns3::TypeId::TraceSourceInformation
TraceSource implementation.
Definition: type-id.h:100
ns3::Config::GetRootNamespaceObject
Ptr< Object > GetRootNamespaceObject(uint32_t i)
Definition: config.cc:964
ns3::TypeId::AttributeInformation::name
std::string name
Attribute name.
Definition: type-id.h:80
anonymous_namespace{print-introspected-doxygen.cc}::classStart
std::string classStart
start of a class
Definition: print-introspected-doxygen.cc:63
ns3::TypeId::ATTR_GET
@ ATTR_GET
The attribute can be read.
Definition: type-id.h:64
AttributeDescriptor
Descriptor for an AttributeValue.
Definition: print-introspected-doxygen.cc:1468
StaticInformation::m_noTids
std::vector< std::string > m_noTids
List of type names without TypeIds, because those modules aren't enabled.
Definition: print-introspected-doxygen.cc:289
anonymous_namespace{print-introspected-doxygen.cc}::flagSpanStop
std::string flagSpanStop
end of Attribute flag value
Definition: print-introspected-doxygen.cc:71
ns3::PeekPointer
U * PeekPointer(const Ptr< U > &p)
Definition: ptr.h:415
ns3::TypeId::AttributeInformation::accessor
Ptr< const AttributeAccessor > accessor
Accessor object.
Definition: type-id.h:90
ns3::NodeContainer::Create
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Definition: node-container.cc:98
anonymous_namespace{print-introspected-doxygen.cc}::listLineStart
std::string listLineStart
start unordered list item
Definition: print-introspected-doxygen.cc:81
StaticInformation::Gather
void Gather(TypeId tid)
Gather aggregation and configuration path information for tid.
Definition: print-introspected-doxygen.cc:412
ns3::TypeId::AttributeInformation::help
std::string help
Attribute help string.
Definition: type-id.h:82
anonymous_namespace{print-introspected-doxygen.cc}::reference
std::string reference
reference tag
Definition: print-introspected-doxygen.cc:87
StaticInformation::HasAlreadyBeenProcessed
bool HasAlreadyBeenProcessed(TypeId tid) const
Definition: print-introspected-doxygen.cc:350
anonymous_namespace{print-introspected-doxygen.cc}::templArgDeduced
std::string templArgDeduced
template argument deduced from function
Definition: print-introspected-doxygen.cc:93
anonymous_namespace{print-introspected-doxygen.cc}::boldStop
std::string boldStop
end of bold span
Definition: print-introspected-doxygen.cc:58
ns3::TypeId::AttributeInformation::checker
Ptr< const AttributeChecker > checker
Checker object.
Definition: type-id.h:92
PrintAttributeImplementations
void PrintAttributeImplementations(std::ostream &os)
Print documentation for Attribute implementations.
Definition: print-introspected-doxygen.cc:1502
ns3::TypeId::GetAttributeN
std::size_t GetAttributeN(void) const
Get the number of attributes.
Definition: type-id.cc:1077
anonymous_namespace{print-introspected-doxygen.cc}::listLineStop
std::string listLineStop
end unordered list item
Definition: print-introspected-doxygen.cc:82
ns3::Ptr< Object >
anonymous_namespace{print-introspected-doxygen.cc}::sectionStart
std::string sectionStart
start of a section or group
Definition: print-introspected-doxygen.cc:90
ns3::TypeId::AttributeInformation
Attribute implementation.
Definition: type-id.h:78
ns3::GlobalValue::Begin
static Iterator Begin(void)
The Begin iterator.
Definition: global-value.cc:187
PrintAttributeValueSection
void PrintAttributeValueSection(std::ostream &os, const std::string &name, const bool seeBase=true)
Print the section definition for an AttributeValue.
Definition: print-introspected-doxygen.cc:1275
StaticInformation::m_alreadyProcessed
std::vector< TypeId > m_alreadyProcessed
List of TypeIds we've already processed.
Definition: print-introspected-doxygen.cc:278
StaticInformation::DoGather
void DoGather(TypeId tid)
Gather attribute, configuration path information for tid.
Definition: print-introspected-doxygen.cc:421
ns3::Config::GetRootNamespaceObjectN
std::size_t GetRootNamespaceObjectN(void)
Definition: config.cc:958
ns3::TypeId::GetTraceSourceN
std::size_t GetTraceSourceN(void) const
Get the number of Trace sources.
Definition: type-id.cc:1098
max
#define max(a, b)
Definition: 80211b.c:43
PrintMakeAccessors
void PrintMakeAccessors(std::ostream &os, const std::string &name)
Print the AttributeValue MakeAccessor documentation for a class.
Definition: print-introspected-doxygen.cc:1403
ns3::PointerChecker
AttributeChecker implementation for PointerValue.
Definition: pointer.h:98
PrintConfigPaths
void PrintConfigPaths(std::ostream &os, const TypeId tid)
Print config paths.
Definition: print-introspected-doxygen.cc:638
StaticInformation::Get
std::vector< std::string > Get(TypeId tid) const
Definition: print-introspected-doxygen.cc:365
anonymous_namespace{print-introspected-doxygen.cc}::seeAlso
std::string seeAlso
Reference to other docs.
Definition: print-introspected-doxygen.cc:91
ns3::GlobalValue::End
static Iterator End(void)
The End iterator.
Definition: global-value.cc:194
anonymous_namespace{print-introspected-doxygen.cc}::hrefMid
std::string hrefMid
middle part of a link
Definition: print-introspected-doxygen.cc:78
anonymous_namespace{print-introspected-doxygen.cc}::commentStop
std::string commentStop
end of code comment
Definition: print-introspected-doxygen.cc:67
ns3::TypeId::GetRegistered
static TypeId GetRegistered(uint16_t i)
Get a TypeId by index.
Definition: type-id.cc:876
ns3::TypeId::GetRegisteredN
static uint16_t GetRegisteredN(void)
Get the number of registered TypeIds.
Definition: type-id.cc:870
PrintMakeChecker
void PrintMakeChecker(std::ostream &os, const std::string &name, const std::string &header)
Print the AttributeValue MakeChecker documentation for a class.
Definition: print-introspected-doxygen.cc:1439
SetMarkup
void SetMarkup(bool outputText)
Initialize the markup strings, for either doxygen or text.
Definition: print-introspected-doxygen.cc:108
PrintAllTraceSources
void PrintAllTraceSources(std::ostream &os)
Print the list of all Trace sources.
Definition: print-introspected-doxygen.cc:1207
anonymous_namespace{print-introspected-doxygen.cc}::templArgExplicit
std::string templArgExplicit
template argument required
Definition: print-introspected-doxygen.cc:94
ns3::StringValue::Get
std::string Get(void) const
Definition: string.cc:31
second.cmd
cmd
Definition: second.py:35
ns3::TypeId::IsChildOf
bool IsChildOf(TypeId other) const
Check if this TypeId is a child of another.
Definition: type-id.cc:958
NS_ASSERT_MSG
#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:88
ns3::LogComponent::ComponentList
std::map< std::string, LogComponent * > ComponentList
LogComponent name map.
Definition: log.h:409
anonymous_namespace{print-introspected-doxygen.cc}::boldStart
std::string boldStart
start of bold span
Definition: print-introspected-doxygen.cc:57
PrintAttributes
void PrintAttributes(std::ostream &os, const TypeId tid)
Print the Attributes block for tid, including Attributes declared in base classes.
Definition: print-introspected-doxygen.cc:816
ns3::LogComponent::GetComponentList
static ComponentList * GetComponentList(void)
Get the list of LogComponnents.
Definition: log.cc:75
PrintAllGlobals
void PrintAllGlobals(std::ostream &os)
Print the list of all global variables.
Definition: print-introspected-doxygen.cc:1104
ns3::TypeId::LookupByNameFailSafe
static bool LookupByNameFailSafe(std::string name, TypeId *tid)
Get a TypeId by name.
Definition: type-id.cc:838
AttributeDescriptor::m_header
const std::string m_header
The header file name.
Definition: print-introspected-doxygen.cc:1472
PrintTraceSourcesTid
void PrintTraceSourcesTid(std::ostream &os, const TypeId tid)
Print direct Trace sources for this TypeId.
Definition: print-introspected-doxygen.cc:862
Uniquefy
void Uniquefy(T t)
Helper to keep only the unique items in a container.
Definition: print-introspected-doxygen.cc:396
ns3::StringValue
Hold variables of type string.
Definition: string.h:41
anonymous_namespace{print-introspected-doxygen.cc}::breakTextOnly
std::string breakTextOnly
linebreak for text output only
Definition: print-introspected-doxygen.cc:61
ns3::TypeId::MustHideFromDocumentation
bool MustHideFromDocumentation(void) const
Check if this TypeId should not be listed in documentation.
Definition: type-id.cc:1069
Print
void Print(ComponentCarrier cc)
Definition: lena-cc-helper.cc:69
anonymous_namespace{print-introspected-doxygen.cc}::commentStart
std::string commentStart
start of code comment
Definition: print-introspected-doxygen.cc:66
anonymous_namespace{print-introspected-doxygen.cc}::functionStart
std::string functionStart
start of a method/function
Definition: print-introspected-doxygen.cc:72
NS_LOG_FUNCTION_NOARGS
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
Definition: log-macros-enabled.h:209
StaticInformation::Print
void Print(void) const
Print output in "a -> b" form on std::cout.
Definition: print-introspected-doxygen.cc:318
StaticInformation::GetCurrentPath
std::string GetCurrentPath(void) const
Definition: print-introspected-doxygen.cc:329
ns3::TypeId::GetName
std::string GetName(void) const
Get the name.
Definition: type-id.cc:977
StaticInformation::m_currentPath
std::vector< std::string > m_currentPath
Current configuration path.
Definition: print-introspected-doxygen.cc:274
ns3::TypeId::TraceSourceInformation::name
std::string name
Trace name.
Definition: type-id.h:102
anonymous_namespace{print-introspected-doxygen.cc}::referenceNo
std::string referenceNo
block automatic references
Definition: print-introspected-doxygen.cc:88
anonymous_namespace{print-introspected-doxygen.cc}::headingStop
std::string headingStop
end of section heading (h3)
Definition: print-introspected-doxygen.cc:75
AttributeDescriptor::m_type
const std::string m_type
The name of the underlying type.
Definition: print-introspected-doxygen.cc:1470
anonymous_namespace{print-introspected-doxygen.cc}::templateArgument
std::string templateArgument
template argument
Definition: print-introspected-doxygen.cc:95
GetNameMap
NameMap GetNameMap(void)
Create a map from the class names to their index in the vector of TypeId's so that the names will end...
Definition: print-introspected-doxygen.cc:581
PrintTypeIdBlocks
void PrintTypeIdBlocks(std::ostream &os)
Print the doxy block for each TypeId.
Definition: print-introspected-doxygen.cc:953
StaticInformation::RecordAggregationInfo
void RecordAggregationInfo(std::string a, std::string b)
Record the a -> b aggregation relation.
Definition: print-introspected-doxygen.cc:295
anonymous_namespace{print-introspected-doxygen.cc}::hrefStop
std::string hrefStop
end of a link
Definition: print-introspected-doxygen.cc:79
anonymous_namespace{print-introspected-doxygen.cc}::note
std::string note
start a note section
Definition: print-introspected-doxygen.cc:85
ns3::Object::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
Definition: object.cc:79
PrintAllTypeIds
void PrintAllTypeIds(std::ostream &os)
Print the list of all TypeIds.
Definition: print-introspected-doxygen.cc:998
AttributeDescriptor::m_name
const std::string m_name
The base name of the resulting AttributeValue type.
Definition: print-introspected-doxygen.cc:1469
ns3::TypeId::GetSize
std::size_t GetSize(void) const
Get the size of this object.
Definition: type-id.cc:991
PrintSize
void PrintSize(std::ostream &os, const TypeId tid)
Print the size of the type represented by this tid.
Definition: print-introspected-doxygen.cc:933
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Definition: log-macros-enabled.h:244
anonymous_namespace{print-introspected-doxygen.cc}::argument
std::string argument
function argument
Definition: print-introspected-doxygen.cc:56
ns3::NodeContainer
keep track of a set of node pointers.
Definition: node-container.h:39
PrintAttributesTid
void PrintAttributesTid(std::ostream &os, const TypeId tid)
Print direct Attributes for this TypeId.
Definition: print-introspected-doxygen.cc:684
ns3::TypeId::AttributeInformation::initialValue
Ptr< const AttributeValue > initialValue
Configured initial value.
Definition: type-id.h:88
StaticInformation::RecordOutput
void RecordOutput(TypeId tid)
Record the current config path for tid.
Definition: print-introspected-doxygen.cc:342
anonymous_namespace{print-introspected-doxygen.cc}::headingStart
std::string headingStart
start of section heading (h3)
Definition: print-introspected-doxygen.cc:74
ns3::TypeId::TraceSourceInformation::help
std::string help
Trace help string.
Definition: type-id.h:104
ns3::ObjectPtrContainerChecker
AttributeChecker implementation for ObjectPtrContainerValue.
Definition: object-ptr-container.h:152
GetTypicalAggregations
StaticInformation GetTypicalAggregations()
Register aggregation relationships that are not automatically detected by this introspection program.
Definition: print-introspected-doxygen.cc:510
PrintAllAttributes
void PrintAllAttributes(std::ostream &os)
Print the list of all Attributes.
Definition: print-introspected-doxygen.cc:1050
anonymous_namespace{print-introspected-doxygen.cc}::breakHtmlOnly
std::string breakHtmlOnly
linebreak for html output only
Definition: print-introspected-doxygen.cc:60
anonymous_namespace{print-introspected-doxygen.cc}::listStop
std::string listStop
end unordered list
Definition: print-introspected-doxygen.cc:84
PrintAttributeHelper
void PrintAttributeHelper(std::ostream &os, const AttributeDescriptor &attr)
Print documentation corresponding to use of the ATTRIBUTE_HELPER_HEADER macro or ATTRIBUTE_VALUE_DEFI...
Definition: print-introspected-doxygen.cc:1485
ns3::GlobalValue::Iterator
Vector::const_iterator Iterator
Iterator type for the list of all global values.
Definition: global-value.h:80
StaticInformation
Gather aggregation and configuration path information from registered types.
Definition: print-introspected-doxygen.cc:212
ns3::TypeId::TraceSourceInformation::callback
std::string callback
Callback function signature type.
Definition: type-id.h:106
ns3::TypeId::GetParent
TypeId GetParent(void) const
Get the parent of this TypeId.
Definition: type-id.cc:944
PrintAllLogComponents
void PrintAllLogComponents(std::ostream &os)
Print the list of all LogComponents.
Definition: print-introspected-doxygen.cc:1144
NameMapIterator
NameMap::const_iterator NameMapIterator
NameMap iterator.
Definition: print-introspected-doxygen.cc:571
ns3::TypeId::GetAttribute
struct TypeId::AttributeInformation GetAttribute(std::size_t i) const
Get Attribute information by index.
Definition: type-id.cc:1084
AttributeDescriptor::m_seeBase
const bool m_seeBase
Print a "see also" pointing to the base class.
Definition: print-introspected-doxygen.cc:1471
anonymous_namespace{print-introspected-doxygen.cc}::file
std::string file
file
Definition: print-introspected-doxygen.cc:69