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  std::string indentHtmlOnly;
77  std::string listLineStart;
78  std::string listLineStop;
79  std::string listStart;
80  std::string listStop;
81  std::string note;
82  std::string page;
83  std::string reference;
84  std::string returns;
85  std::string sectionStart;
86  std::string seeAlso;
87  std::string subSectionStart;
88  std::string templArgDeduced;
89  std::string templArgExplicit;
90  std::string templateArgument;
91  std::string variable;
92 
94 } // unnamed namespace
95 
96 
102 void
103 SetMarkup (bool outputText)
104 {
105  NS_LOG_FUNCTION (outputText);
106  if (outputText)
107  {
108  anchor = "";
109  argument = " Arg: ";
110  boldStart = "";
111  boldStop = "";
112  breakBoth = "\n";
113  breakHtmlOnly = "";
114  breakTextOnly = "\n";
115  brief = "";
116  classStart = "";
117  classStop = "\n\n";
118  codeWord = " ";
119  commentStart = "===============================================================\n";
120  commentStop = "";
121  copyDoc = " See: ";
122  file = "File: ";
123  flagSpanStart = "";
124  flagSpanStop = "";
125  functionStart = "";
126  functionStop = "\n\n";
127  headingStart = "";
128  headingStop = "";
129  indentHtmlOnly = "";
130  listLineStart = " * ";
131  listLineStop = "";
132  listStart = "";
133  listStop = "";
134  note = "Note: ";
135  page = "Page ";
136  reference = " ";
137  returns = " Returns: ";
138  sectionStart = "Section ";
139  seeAlso = " See: ";
140  subSectionStart = "Subsection ";
141  templArgDeduced = "[deduced] ";
142  templArgExplicit = "[explicit] ";
143  templateArgument = "Template Arg: ";
144  variable = "Variable: ";
145  }
146  else
147  {
148  anchor = "\\anchor ";
149  argument = "\\param ";
150  boldStart = "<b>";
151  boldStop = "</b>";
152  breakBoth = "<br>";
153  breakHtmlOnly = "<br>";
154  breakTextOnly = "";
155  brief = "\\brief ";
156  classStart = "\\class ";
157  classStop = "";
158  codeWord = "\\p ";
159  commentStart = "/*!\n";
160  commentStop = "*/\n";
161  copyDoc = "\\copydoc ";
162  file = "\\file ";
163  flagSpanStart = "<span class=\"mlabel\">";
164  flagSpanStop = "</span>";
165  functionStart = "\\fn ";
166  functionStop = "";
167  headingStart = "<h3>";
168  headingStop = "</h3>";
169  indentHtmlOnly = " ";
170  listLineStart = "<li>";
171  listLineStop = "</li>";
172  listStart = "<ul>";
173  listStop = "</ul>";
174  note = "\\note ";
175  page = "\\page ";
176  reference = " \\ref ";
177  returns = "\\returns ";
178  sectionStart = "\\ingroup ";
179  seeAlso = "\\see ";
180  subSectionStart = "\\addtogroup ";
181  templArgDeduced = "\\deduced ";
182  templArgExplicit = "\\explicit ";
183  templateArgument = "\\tparam ";
184  variable = "\\var ";
185  }
186 } // SetMarkup ()
187 
188 
189 /***************************************************************
190  * Aggregation and configuration paths
191  ***************************************************************/
192 
197 {
198 public:
205  void RecordAggregationInfo (std::string a, std::string b);
211  void Gather (TypeId tid);
215  void Print (void) const;
216 
222  std::vector<std::string> Get (TypeId tid) const;
223 
227  std::vector<std::string> GetNoTypeIds (void) const;
228 
229 private:
233  std::string GetCurrentPath (void) const;
239  void DoGather (TypeId tid);
245  void RecordOutput (TypeId tid);
251  bool HasAlreadyBeenProcessed (TypeId tid) const;
255  std::vector<std::pair<TypeId,std::string> > m_output;
259  std::vector<std::string> m_currentPath;
263  std::vector<TypeId> m_alreadyProcessed;
267  std::vector<std::pair<TypeId,TypeId> > m_aggregates;
274  mutable std::vector<std::string> m_noTids;
275 
276 }; // class StaticInformation
277 
278 
279 void
280 StaticInformation::RecordAggregationInfo (std::string a, std::string b)
281 {
282  NS_LOG_FUNCTION (this << a << b);
283  TypeId aTid;
284  bool found = TypeId::LookupByNameFailSafe (a, &aTid);
285  if (!found)
286  {
287  m_noTids.push_back (a);
288  return;
289  }
290  TypeId bTid;
291  found = TypeId::LookupByNameFailSafe (b, &bTid);
292  if (!found)
293  {
294  m_noTids.push_back (b);
295  return;
296  }
297 
298  m_aggregates.push_back (std::make_pair (aTid, bTid));
299 }
300 
301 
302 void
304 {
305  NS_LOG_FUNCTION (this);
306  for (auto item : m_output)
307  {
308  std::cout << item.first.GetName () << " -> " << item.second << std::endl;
309  }
310 }
311 
312 
313 std::string
315 {
316  NS_LOG_FUNCTION (this);
317  std::ostringstream oss;
318  for (auto item : m_currentPath)
319  {
320  oss << "/" << item;
321  }
322  return oss.str ();
323 }
324 
325 
326 void
328 {
329  NS_LOG_FUNCTION (this << tid);
330  m_output.push_back (std::make_pair (tid, GetCurrentPath ()));
331 }
332 
333 
334 bool
336 {
337  NS_LOG_FUNCTION (this << tid);
338  for (auto it : m_alreadyProcessed)
339  {
340  if (it == tid)
341  {
342  return true;
343  }
344  }
345  return false;
346 }
347 
348 
349 std::vector<std::string>
351 {
352  NS_LOG_FUNCTION (this << tid);
353  std::vector<std::string> paths;
354  for (auto item : m_output)
355  {
356  if (item.first == tid)
357  {
358  paths.push_back (item.second);
359  }
360  }
361  return paths;
362 }
363 
379 template <typename T>
380 void
381 Uniquefy (T t)
382 {
383  std::sort (t.begin (), t.end ());
384  t.erase (std::unique (t.begin (), t.end ()), t.end ());
385 }
386 
387 std::vector<std::string>
389 {
390  NS_LOG_FUNCTION (this);
391  Uniquefy (m_noTids);
392  return m_noTids;
393 }
394 
395 
396 void
398 {
399  NS_LOG_FUNCTION (this << tid);
400  DoGather (tid);
401  Uniquefy (m_output);
402 }
403 
404 
405 void
407 {
408  NS_LOG_FUNCTION (this << tid);
409  if (HasAlreadyBeenProcessed (tid))
410  {
411  return;
412  }
413  RecordOutput (tid);
414  for (uint32_t i = 0; i < tid.GetAttributeN (); ++i)
415  {
416  struct TypeId::AttributeInformation info = tid.GetAttribute(i);
417  const PointerChecker *ptrChecker = dynamic_cast<const PointerChecker *> (PeekPointer (info.checker));
418  if (ptrChecker != 0)
419  {
420  TypeId pointee = ptrChecker->GetPointeeTypeId ();
421 
422  // See if this is a pointer to an Object.
423  Ptr<Object> object = CreateObject<Object> ();
424  TypeId objectTypeId = object->GetTypeId ();
425  if (objectTypeId == pointee)
426  {
427  // Stop the recursion at this attribute if it is a
428  // pointer to an Object, which create too many spurious
429  // paths in the list of attribute paths because any
430  // Object can be in that part of the path.
431  continue;
432  }
433 
434  m_currentPath.push_back (info.name);
435  m_alreadyProcessed.push_back (tid);
436  DoGather (pointee);
437  m_alreadyProcessed.pop_back ();
438  m_currentPath.pop_back ();
439  continue;
440  }
441  // attempt to cast to an object vector.
442  const ObjectPtrContainerChecker *vectorChecker = dynamic_cast<const ObjectPtrContainerChecker *> (PeekPointer (info.checker));
443  if (vectorChecker != 0)
444  {
445  TypeId item = vectorChecker->GetItemTypeId ();
446  m_currentPath.push_back (info.name + "/[i]");
447  m_alreadyProcessed.push_back (tid);
448  DoGather (item);
449  m_alreadyProcessed.pop_back ();
450  m_currentPath.pop_back ();
451  continue;
452  }
453  }
454  for (uint32_t j = 0; j < TypeId::GetRegisteredN (); j++)
455  {
456  TypeId child = TypeId::GetRegistered (j);
457  if (child.IsChildOf (tid))
458  {
459  std::string childName = "$" + child.GetName ();
460  m_currentPath.push_back (childName);
461  m_alreadyProcessed.push_back (tid);
462  DoGather (child);
463  m_alreadyProcessed.pop_back ();
464  m_currentPath.pop_back ();
465  }
466  }
467  for (auto item : m_aggregates)
468  {
469  if (item.first == tid || item.second == tid)
470  {
471  TypeId other;
472  if (item.first == tid)
473  {
474  other = item.second;
475  }
476  if (item.second == tid)
477  {
478  other = item.first;
479  }
480  std::string name = "$" + other.GetName ();
481  m_currentPath.push_back (name);
482  m_alreadyProcessed.push_back (tid);
483  DoGather (other);
484  m_alreadyProcessed.pop_back ();
485  m_currentPath.pop_back ();
486  }
487  }
488 } // StaticInformation::DoGather ()
489 
490 
496 {
498 
499  static StaticInformation info;
500  static bool mapped = false;
501 
502  if (mapped)
503  {
504  return info;
505  }
506 
507  // Short circuit next call
508  mapped = true;
509 
510  // The below statements register typical aggregation relationships
511  // in ns-3 programs, that otherwise aren't picked up automatically
512  // by the creation of the above node. To manually list other common
513  // aggregation relationships that you would like to see show up in
514  // the list of configuration paths in the doxygen, add additional
515  // statements below.
516  info.RecordAggregationInfo ("ns3::Node", "ns3::TcpSocketFactory");
517  info.RecordAggregationInfo ("ns3::Node", "ns3::UdpSocketFactory");
518  info.RecordAggregationInfo ("ns3::Node", "ns3::PacketSocketFactory");
519  info.RecordAggregationInfo ("ns3::Node", "ns3::MobilityModel");
520  info.RecordAggregationInfo ("ns3::Node", "ns3::Ipv4L3Protocol");
521  info.RecordAggregationInfo ("ns3::Node", "ns3::Ipv4NixVectorRouting");
522  info.RecordAggregationInfo ("ns3::Node", "ns3::Icmpv4L4Protocol");
523  info.RecordAggregationInfo ("ns3::Node", "ns3::ArpL3Protocol");
524  info.RecordAggregationInfo ("ns3::Node", "ns3::Icmpv4L4Protocol");
525  info.RecordAggregationInfo ("ns3::Node", "ns3::UdpL4Protocol");
526  info.RecordAggregationInfo ("ns3::Node", "ns3::Ipv6L3Protocol");
527  info.RecordAggregationInfo ("ns3::Node", "ns3::Icmpv6L4Protocol");
528  info.RecordAggregationInfo ("ns3::Node", "ns3::TcpL4Protocol");
529  info.RecordAggregationInfo ("ns3::Node", "ns3::RipNg");
530  info.RecordAggregationInfo ("ns3::Node", "ns3::GlobalRouter");
531  info.RecordAggregationInfo ("ns3::Node", "ns3::aodv::RoutingProtocol");
532  info.RecordAggregationInfo ("ns3::Node", "ns3::dsdv::RoutingProtocol");
533  info.RecordAggregationInfo ("ns3::Node", "ns3::dsr::DsrRouting");
534  info.RecordAggregationInfo ("ns3::Node", "ns3::olsr::RoutingProtocol");
535  info.RecordAggregationInfo ("ns3::Node", "ns3::EnergyHarvesterContainer");
536  info.RecordAggregationInfo ("ns3::Node", "ns3::EnergySourceContainer");
537 
538  // Create a channel object so that channels appear in the namespace
539  // paths that will be generated here.
540  Ptr<SimpleChannel> simpleChannel;
541  simpleChannel = CreateObject<SimpleChannel> ();
542 
543  for (uint32_t i = 0; i < Config::GetRootNamespaceObjectN (); ++i)
544  {
546  info.Gather (object->GetInstanceTypeId ());
547  }
548 
549  return info;
550 
551 } // GetTypicalAggregations ()
552 
553 
555 typedef std::map< std::string, int32_t> NameMap;
556 typedef NameMap::const_iterator NameMapIterator;
557 
558 
565 NameMap
567 {
569 
570  static NameMap nameMap;
571  static bool mapped = false;
572 
573  if (mapped)
574  {
575  return nameMap;
576  }
577 
578  // Short circuit next call
579  mapped = true;
580 
581  // Get typical aggregation relationships.
583 
584  // Registered types
585  for (uint32_t i = 0; i < TypeId::GetRegisteredN (); i++)
586  {
587  TypeId tid = TypeId::GetRegistered (i);
588  if (tid.MustHideFromDocumentation ())
589  {
590  continue;
591  }
592 
593  // Capitalize all of letters in the name so that it sorts
594  // correctly in the map.
595  std::string name = tid.GetName ();
596  std::transform (name.begin (), name.end (), name.begin (), ::toupper);
597 
598  // Save this name's index.
599  nameMap[name] = i;
600  }
601 
602  // Type names without TypeIds
603  std::vector<std::string> noTids = info.GetNoTypeIds ();
604  for (auto item : noTids)
605  {
606  nameMap[item] = -1;
607  }
608 
609  return nameMap;
610 } // GetNameMap ()
611 
612 
613 /***************************************************************
614  * Docs for a single TypeId
615  ***************************************************************/
616 
622 void
623 PrintConfigPaths (std::ostream & os, const TypeId tid)
624 {
625  NS_LOG_FUNCTION (tid);
626  std::vector<std::string> paths = GetTypicalAggregations ().Get (tid);
627 
628  // Config --------------
629  if (paths.empty ())
630  {
631  os << "Introspection did not find any typical Config paths."
632  << breakBoth
633  << std::endl;
634  }
635  else
636  {
637  os << headingStart
638  << "Config Paths"
639  << headingStop
640  << std::endl;
641  os << std::endl;
642  os << tid.GetName ()
643  << " is accessible through the following paths"
644  << " with Config::Set and Config::Connect:"
645  << std::endl;
646  os << listStart << std::endl;
647  for (auto path : paths)
648  {
649  os << listLineStart
650  << "\"" << path << "\""
651  << listLineStop
652  << breakTextOnly
653  << std::endl;
654  }
655  os << listStop << std::endl;
656  }
657 } // PrintConfigPaths ()
658 
659 
668 void
669 PrintAttributesTid (std::ostream &os, const TypeId tid)
670 {
671  NS_LOG_FUNCTION (tid);
672  os << listStart << std::endl;
673  for (uint32_t j = 0; j < tid.GetAttributeN (); j++)
674  {
675  struct TypeId::AttributeInformation info = tid.GetAttribute(j);
676  os << listLineStart
677  << boldStart << info.name << boldStop << ": "
678  << info.help
679  << std::endl;
680  os << " "
681  << listStart << std::endl;
682  os << " "
683  << listLineStart
684  << "Set with class: " << reference
685  << info.checker->GetValueTypeName ()
686  << listLineStop
687  << std::endl;
688  if (info.checker->HasUnderlyingTypeInformation ())
689  {
690  os << " "
691  << listLineStart
692  << "Underlying type: ";
693 
694  std::string valType = info.checker->GetValueTypeName ();
695  std::string underType = info.checker->GetUnderlyingTypeInformation ();
696  if ((valType != "ns3::EnumValue") && (underType != "std::string"))
697  {
698  // Indirect cases to handle
699  bool handled = false;
700 
701  if (valType == "ns3::PointerValue")
702  {
703  const PointerChecker *ptrChecker =
704  dynamic_cast<const PointerChecker *> (PeekPointer (info.checker));
705  if (ptrChecker != 0)
706  {
707  os << reference << "ns3::Ptr" << "< "
708  << reference << ptrChecker->GetPointeeTypeId ().GetName ()
709  << ">";
710  handled = true;
711  }
712  }
713  else if (valType == "ns3::ObjectPtrContainerValue")
714  {
715  const ObjectPtrContainerChecker * ptrChecker =
716  dynamic_cast<const ObjectPtrContainerChecker *> (PeekPointer (info.checker));
717  if (ptrChecker != 0)
718  {
719  os << reference << "ns3::Ptr" << "< "
720  << reference << ptrChecker->GetItemTypeId ().GetName ()
721  << ">";
722  handled = true;
723  }
724  }
725  // Helper to match first part of string
726  class StringBeginMatcher
727  {
728  public:
729  StringBeginMatcher (const std::string s)
730  : m_string (s) { };
731  bool operator () (const std::string t)
732  {
733  std::size_t pos = m_string.find (t);
734  return pos == 0;
735  };
736  private:
737  std::string m_string;
738  };
739  StringBeginMatcher match (underType);
740 
741  if ( match ("bool") || match ("double") ||
742  match ("int8_t") || match ("uint8_t") ||
743  match ("int16_t") || match ("uint16_t") ||
744  match ("int32_t") || match ("uint32_t") ||
745  match ("int64_t") || match ("uint64_t")
746  )
747  {
748  os << underType;
749  handled = true;
750  }
751  if (! handled)
752  {
753  os << reference << underType;
754  }
755  }
756  os << listLineStop << std::endl;
757  }
758  if (info.flags & TypeId::ATTR_CONSTRUCT && info.accessor->HasSetter ())
759  {
760  os << " "
761  << listLineStart
762  << "Initial value: "
763  << info.initialValue->SerializeToString (info.checker)
764  << listLineStop
765  << std::endl;
766  }
767  os << " " << listLineStart << "Flags: ";
768  if (info.flags & TypeId::ATTR_CONSTRUCT && info.accessor->HasSetter ())
769  {
770  os << flagSpanStart << "construct " << flagSpanStop;
771  }
772  if (info.flags & TypeId::ATTR_SET && info.accessor->HasSetter ())
773  {
774  os << flagSpanStart << "write " << flagSpanStop;
775  }
776  if (info.flags & TypeId::ATTR_GET && info.accessor->HasGetter ())
777  {
778  os << flagSpanStart << "read " << flagSpanStop;
779  }
780  os << listLineStop << std::endl;
781  os << " "
782  << listStop
783  << " " << std::endl;
784 
785  }
786  os << listStop << std::endl;
787 } // PrintAttributesTid ()
788 
789 
800 void
801 PrintAttributes (std::ostream & os, const TypeId tid)
802 {
803  NS_LOG_FUNCTION (tid);
804  if (tid.GetAttributeN () == 0)
805  {
806  os << "No Attributes are defined for this type."
807  << breakBoth
808  << std::endl;
809  }
810  else
811  {
812  os << headingStart
813  << "Attributes"
814  << headingStop
815  << std::endl;
816  PrintAttributesTid (os, tid);
817  }
818 
819  // Attributes from base classes
820  TypeId tmp = tid.GetParent ();
821  while (tmp.GetParent () != tmp)
822  {
823  if (tmp.GetAttributeN () != 0)
824  {
825  os << headingStart
826  << "Attributes defined in parent class "
827  << tmp.GetName ()
828  << headingStop
829  << std::endl;
830  PrintAttributesTid (os, tmp);
831  }
832  tmp = tmp.GetParent ();
833 
834  } // Attributes
835 } // PrintAttributes ()
836 
837 
846 void
847 PrintTraceSourcesTid (std::ostream & os, const TypeId tid)
848 {
849  NS_LOG_FUNCTION (tid);
850  os << listStart << std::endl;
851  for (uint32_t i = 0; i < tid.GetTraceSourceN (); ++i)
852  {
853  struct TypeId::TraceSourceInformation info = tid.GetTraceSource (i);
854  os << listLineStart
855  << boldStart << info.name << boldStop << ": "
856  << info.help << breakBoth
857  // '%' prevents doxygen from linking to the Callback class...
858  << "%Callback signature: "
859  << info.callback
860  << std::endl;
861  os << listLineStop << std::endl;
862  }
863  os << listStop << std::endl;
864 } // PrintTraceSourcesTid ()
865 
866 
877 void
878 PrintTraceSources (std::ostream & os, const TypeId tid)
879 {
880  NS_LOG_FUNCTION (tid);
881  if (tid.GetTraceSourceN () == 0)
882  {
883  os << "No TraceSources are defined for this type."
884  << breakBoth
885  << std::endl;
886  }
887  else
888  {
889  os << headingStart
890  << "TraceSources"
891  << headingStop << std::endl;
892  PrintTraceSourcesTid (os, tid);
893  }
894 
895  // Trace sources from base classes
896  TypeId tmp = tid.GetParent ();
897  while (tmp.GetParent () != tmp)
898  {
899  if (tmp.GetTraceSourceN () != 0)
900  {
901  os << headingStart
902  << "TraceSources defined in parent class "
903  << tmp.GetName ()
904  << headingStop << std::endl;
905  PrintTraceSourcesTid (os, tmp);
906  }
907  tmp = tmp.GetParent ();
908  }
909 
910 } // PrintTraceSources ()
911 
918 void PrintSize (std::ostream & os, const TypeId tid)
919 {
920  NS_LOG_FUNCTION (tid);
921  NS_ASSERT_MSG (CHAR_BIT != 0, "CHAR_BIT is zero");
922 
923  std::size_t arch = (sizeof (void *) * CHAR_BIT);
924 
925  os << boldStart << "Size" << boldStop
926  << " of this type is " << tid.GetSize ()
927  << " bytes (on a " << arch << "-bit architecture)."
928  << std::endl;
929 } // PrintSize ()
930 
931 
937 void
938 PrintTypeIdBlocks (std::ostream & os)
939 {
941 
942  NameMap nameMap = GetNameMap ();
943 
944  // Iterate over the map, which will print the class names in
945  // alphabetical order.
946  for (auto item : nameMap)
947  {
948  // Handle only real TypeIds
949  if (item.second < 0)
950  {
951  continue ;
952  }
953  // Get the class's index out of the map;
954  TypeId tid = TypeId::GetRegistered (item.second);
955  std::string name = tid.GetName ();
956 
957  std::cout << commentStart << std::endl;
958 
959  std::cout << classStart << name << std::endl;
960  std::cout << std::endl;
961 
962  PrintConfigPaths (std::cout, tid);
963  PrintAttributes (std::cout, tid);
964  PrintTraceSources (std::cout, tid);
965  PrintSize (std::cout, tid);
966 
967  std::cout << commentStop << std::endl;
968  } // for class documentation
969 
970 } // PrintTypeIdBlocks
971 
972 
973 /***************************************************************
974  * Lists of All things
975  ***************************************************************/
976 
982 void
983 PrintAllTypeIds (std::ostream & os)
984 {
986  os << commentStart << page << "TypeIdList All TypeIds\n"
987  << std::endl;
988  os << "This is a list of all" << reference << "TypeIds.\n"
989  << "For more information see the" << reference << "TypeId "
990  << "section of this API documentation and the TypeId section "
991  << "in the Configuration and Attributes chapter of the Manual.\n"
992  << std::endl;
993 
994  os << listStart << std::endl;
995 
996  NameMap nameMap = GetNameMap ();
997  // Iterate over the map, which will print the class names in
998  // alphabetical order.
999  for (auto item : nameMap)
1000  {
1001  // Handle only real TypeIds
1002  if (item.second < 0)
1003  {
1004  continue ;
1005  }
1006  // Get the class's index out of the map;
1007  TypeId tid = TypeId::GetRegistered (item.second);
1008 
1009  os << indentHtmlOnly
1010  << listLineStart
1011  << boldStart
1012  << tid.GetName ()
1013  << boldStop
1014  << listLineStop
1015  << std::endl;
1016 
1017  }
1018  os << commentStop << std::endl;
1019 
1020 } // PrintAllTypeIds ()
1021 
1022 
1031 void
1032 PrintAllAttributes (std::ostream & os)
1033 {
1035  os << commentStart << page << "AttributeList All Attributes\n"
1036  << std::endl;
1037  os << "This is a list of all" << reference << "attribute by class. "
1038  << "For more information see the" << reference << "attribute "
1039  << "section of this API documentation and the Attributes sections "
1040  << "in the Tutorial and Manual.\n"
1041  << std::endl;
1042 
1043  NameMap nameMap = GetNameMap ();
1044  // Iterate over the map, which will print the class names in
1045  // alphabetical order.
1046  for (auto item: nameMap)
1047  {
1048  // Handle only real TypeIds
1049  if (item.second < 0)
1050  {
1051  continue ;
1052  }
1053  // Get the class's index out of the map;
1054  TypeId tid = TypeId::GetRegistered (item.second);
1055 
1056  if (tid.GetAttributeN () == 0 )
1057  {
1058  continue;
1059  }
1060  os << boldStart << tid.GetName () << boldStop << breakHtmlOnly
1061  << std::endl;
1062 
1063  os << listStart << std::endl;
1064  for (uint32_t j = 0; j < tid.GetAttributeN (); ++j)
1065  {
1066  struct TypeId::AttributeInformation info = tid.GetAttribute(j);
1067  os << listLineStart
1068  << boldStart << info.name << boldStop
1069  << ": " << info.help
1070  << listLineStop
1071  << std::endl;
1072  }
1073  os << listStop << std::endl;
1074  }
1075  os << commentStop << std::endl;
1076 
1077 } // PrintAllAttributes ()
1078 
1079 
1085 void
1086 PrintAllGlobals (std::ostream & os)
1087 {
1089  os << commentStart << page << "GlobalValueList All GlobalValues\n"
1090  << std::endl;
1091  os << "This is a list of all" << reference << "ns3::GlobalValue instances.\n"
1092  << std::endl;
1093 
1094  os << listStart << std::endl;
1096  i != GlobalValue::End ();
1097  ++i)
1098  {
1099  StringValue val;
1100  (*i)->GetValue (val);
1101  os << indentHtmlOnly
1102  << listLineStart
1103  << boldStart
1104  << anchor
1105  << "GlobalValue" << (*i)->GetName () << " " << (*i)->GetName ()
1106  << boldStop
1107  << ": " << (*i)->GetHelp ()
1108  << ". Default value: " << val.Get () << "."
1109  << listLineStop
1110  << std::endl;
1111  }
1112  os << listStop << std::endl;
1113  os << commentStop << std::endl;
1114 
1115 } // PrintAllGlobals ()
1116 
1117 
1123 void
1124 PrintAllLogComponents (std::ostream & os)
1125 {
1127  os << commentStart << page << "LogComponentList All LogComponents\n"
1128  << std::endl;
1129  os << "This is a list of all" << reference << "ns3::LogComponent instances.\n"
1130  << std::endl;
1131 
1137  // Find longest log name
1138  std::size_t widthL = std::string ("Log Component").size ();
1139  std::size_t widthR = std::string ("file").size ();
1140  for (auto it : (*logs))
1141  {
1142  widthL = std::max (widthL, it.first.size ());
1143  std::string file = it.second->File ();
1144  // Strip leading "../" related to depth in build directory
1145  // since doxygen only sees the path starting with "src/", etc.
1146  while (file.find ("../") == 0)
1147  {
1148  file = file.substr (3);
1149  }
1150  widthR = std::max (widthR, file.size ());
1151  }
1152  const std::string sep (" | ");
1153 
1154  os << std::setw (widthL) << std::left << "Log Component" << sep
1155  // Header line has to be padded to same length as separator line
1156  << std::setw (widthR) << std::left << "File " << std::endl;
1157  os << ":" << std::string (widthL - 1, '-') << sep
1158  << ":" << std::string (widthR - 1, '-') << std::endl;
1159 
1160  LogComponent::ComponentList::const_iterator it;
1161  for (auto it : (*logs))
1162  {
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 
1171  os << std::setw (widthL) << std::left << it.first << sep << file << std::endl;
1172  }
1173  os << std::right << std::endl;
1174  os << commentStop << std::endl;
1175 } // PrintAllLogComponents ()
1176 
1177 
1186 void
1187 PrintAllTraceSources (std::ostream & os)
1188 {
1190  os << commentStart << page << "TraceSourceList All TraceSources\n"
1191  << std::endl;
1192  os << "This is a list of all" << reference << "tracing sources. "
1193  << "For more information see the " << reference << "tracing "
1194  << "section of this API documentation and the Tracing sections "
1195  << "in the Tutorial and Manual.\n"
1196  << std::endl;
1197 
1198  NameMap nameMap = GetNameMap ();
1199 
1200  // Iterate over the map, which will print the class names in
1201  // alphabetical order.
1202  for (auto item : nameMap)
1203  {
1204  // Handle only real TypeIds
1205  if (item.second < 0)
1206  {
1207  continue ;
1208  }
1209  // Get the class's index out of the map;
1210  TypeId tid = TypeId::GetRegistered (item.second);
1211 
1212  if (tid.GetTraceSourceN () == 0 )
1213  {
1214  continue;
1215  }
1216  os << boldStart << tid.GetName () << boldStop << breakHtmlOnly
1217  << std::endl;
1218 
1219  os << listStart << std::endl;
1220  for (uint32_t j = 0; j < tid.GetTraceSourceN (); ++j)
1221  {
1222  struct TypeId::TraceSourceInformation info = tid.GetTraceSource(j);
1223  os << listLineStart
1224  << boldStart << info.name << boldStop
1225  << ": " << info.help
1226  << listLineStop
1227  << std::endl;
1228  }
1229  os << listStop << std::endl;
1230  }
1231  os << commentStop << std::endl;
1232 
1233 } // PrintAllTraceSources ()
1234 
1235 
1236 /***************************************************************
1237  * Docs for Attribute classes
1238  ***************************************************************/
1239 
1240 
1254 void
1255 PrintAttributeValueSection (std::ostream & os,
1256  const std::string & name,
1257  const bool seeBase = true)
1258 {
1259  NS_LOG_FUNCTION (name);
1260  std::string section = "attribute_" + name;
1261 
1262  // \ingroup attribute
1263  // \defgroup attribute_<name>Value <name> Attribute
1264  os << commentStart << sectionStart << "attribute\n"
1265  << subSectionStart << "attribute_" << name << " "
1266  << name << " Attribute\n"
1267  << "Attribute implementation for " << name << "\n";
1268  if (seeBase)
1269  {
1270  // Some classes don't live in ns3::. Yuck
1271  if (name != "IeMeshId")
1272  {
1273  os << seeAlso << "ns3::" << name << "\n";
1274  }
1275  else
1276  {
1277  os << seeAlso << "ns3::dot11s::" << name << "\n";
1278  }
1279  }
1280  os << commentStop;
1281 
1282 } // PrintAttributeValueSection ()
1283 
1284 
1295 void
1296 PrintAttributeValueWithName (std::ostream & os,
1297  const std::string & name,
1298  const std::string & type,
1299  const std::string & header)
1300 {
1301  NS_LOG_FUNCTION (name << type << header);
1302  std::string sectAttr = sectionStart + "attribute_" + name;
1303 
1304  // \ingroup attribute_<name>Value
1305  // \class ns3::<name>Value "header"
1306  std::string valClass = name + "Value";
1307  std::string qualClass = " ns3::" + valClass;
1308 
1309  os << commentStart << sectAttr << std::endl;
1310  os << classStart << qualClass << " \"" << header << "\"" << std::endl;
1311  os << "AttributeValue implementation for " << name << "." << std::endl;
1312  os << seeAlso << "AttributeValue" << std::endl;
1313  os << commentStop;
1314 
1315  // Copy ctor: <name>Value::<name>Value
1316  os << commentStart
1317  << functionStart << name
1318  << qualClass << "::" << valClass;
1319  if ( (name == "EmptyAttribute") ||
1320  (name == "ObjectPtrContainer") )
1321  {
1322  // Just default constructors.
1323  os << "(void)\n";
1324  }
1325  else
1326  {
1327  // Copy constructors
1328  os << "(const " << type << " & value)\n"
1329  << "Copy constructor.\n"
1330  << argument << "[in] value The " << name << " value to copy.\n";
1331  }
1332  os << commentStop;
1333 
1334  // <name>Value::Get (void) const
1335  os << commentStart
1336  << functionStart << type
1337  << qualClass << "::Get (void) const\n"
1338  << returns << "The " << name << " value.\n"
1339  << commentStop;
1340 
1341  // <name>Value::GetAccessor (T & value) const
1342  os << commentStart
1343  << functionStart << "bool"
1344  << qualClass << "::GetAccessor (T & value) const\n"
1345  << "Access the " << name << " value as type " << codeWord << "T.\n"
1346  << templateArgument << "T " << templArgExplicit << "The type to cast to.\n"
1347  << argument << "[out] value The " << name << " value, as type "
1348  << codeWord << "T.\n"
1349  << returns << "true.\n"
1350  << commentStop;
1351 
1352  // <name>Value::Set (const name & value)
1353  if (type != "Callback") // Yuck
1354  {
1355  os << commentStart
1356  << functionStart << "void"
1357  << qualClass << "::Set (const " << type << " & value)\n"
1358  << "Set the value.\n"
1359  << argument << "[in] value The value to adopt.\n"
1360  << commentStop;
1361  }
1362 
1363  // <name>Value::m_value
1364  os << commentStart
1365  << variable << type
1366  << qualClass << "::m_value\n"
1367  << "The stored " << name << " instance.\n"
1368  << commentStop
1369  << std::endl;
1370 
1371 } // PrintAttributeValueWithName ()
1372 
1373 
1382 void
1383 PrintMakeAccessors (std::ostream & os, const std::string & name)
1384 {
1385  NS_LOG_FUNCTION (name);
1386  std::string sectAttr = sectionStart + "attribute_" + name + "\n";
1387  std::string make = "ns3::Make" + name + "Accessor ";
1388 
1389  // \ingroup attribute_<name>Value
1390  // Make<name>Accessor (T1 a1)
1391  os << commentStart << sectAttr
1392  << functionStart << "ns3::Ptr<const ns3::AttributeAccessor> "
1393  << make << "(T1 a1)\n"
1394  << copyDoc << "ns3::MakeAccessorHelper(T1)\n"
1395  << seeAlso << "AttributeAccessor\n"
1396  << commentStop;
1397 
1398  // \ingroup attribute_<name>Value
1399  // Make<name>Accessor (T1 a1)
1400  os << commentStart << sectAttr
1401  << functionStart << "ns3::Ptr<const ns3::AttributeAccessor> "
1402  << make << "(T1 a1, T2 a2)\n"
1403  << copyDoc << "ns3::MakeAccessorHelper(T1,T2)\n"
1404  << seeAlso << "AttributeAccessor\n"
1405  << commentStop;
1406 } // PrintMakeAccessors ()
1407 
1408 
1418 void
1419 PrintMakeChecker (std::ostream & os,
1420  const std::string & name,
1421  const std::string & header)
1422 {
1423  NS_LOG_FUNCTION (name << header);
1424  std::string sectAttr = sectionStart + "attribute_" + name + "\n";
1425  std::string make = "ns3::Make" + name + "Checker ";
1426 
1427  // \ingroup attribute_<name>Value
1428  // class <name>Checker
1429  os << commentStart << sectAttr << std::endl;
1430  os << classStart << " ns3::" << name << "Checker"
1431  << " \"" << header << "\"" << std::endl;
1432  os << "AttributeChecker implementation for " << name << "Value." << std::endl;
1433  os << seeAlso << "AttributeChecker" << std::endl;
1434  os << commentStop;
1435 
1436  // \ingroup attribute_<name>Value
1437  // Make<name>Checker (void)
1438  os << commentStart << sectAttr
1439  << functionStart << "ns3::Ptr<const ns3::AttributeChecker> "
1440  << make << "(void)\n"
1441  << returns << "The AttributeChecker.\n"
1442  << seeAlso << "AttributeChecker\n"
1443  << commentStop;
1444 } // PrintMakeChecker ()
1445 
1446 
1448 typedef struct {
1449  const std::string m_name;
1450  const std::string m_type;
1451  const bool m_seeBase;
1452  const std::string m_header;
1454 
1455 
1464 void
1465 PrintAttributeHelper (std::ostream & os,
1466  const AttributeDescriptor & attr)
1467 {
1468  NS_LOG_FUNCTION (attr.m_name << attr.m_type << attr.m_seeBase <<
1469  attr.m_header);
1470  PrintAttributeValueSection (os, attr.m_name, attr.m_seeBase);
1471  PrintAttributeValueWithName (os, attr.m_name, attr.m_type, attr.m_header);
1472  PrintMakeAccessors (os, attr.m_name);
1473  PrintMakeChecker (os, attr.m_name, attr.m_header);
1474 } // PrintAttributeHelper ()
1475 
1476 
1481 void
1483 {
1485 
1486  const AttributeDescriptor attributes [] =
1487  {
1488  // Name Type see Base header-file
1489  // Users of ATTRIBUTE_HELPER_HEADER
1490  //
1491  { "Address", "Address", true, "address.h" },
1492  { "Box", "Box", true, "box.h" },
1493  { "DataRate", "DataRate", true, "data-rate.h" },
1494  { "DsssParameterSet",
1495  "DsssParameterSet",
1496  true, "dsss-parameter-set.h"},
1497  { "EdcaParameterSet",
1498  "EdcaParameterSet",
1499  true, "edca-parameter-set.h"},
1500  { "ErpInformation", "ErpInformation", true, "erp-information.h" },
1501  { "ExtendedCapabilities", "ExtendedCapabilities", true, "extended-capabilities.h" },
1502  { "HeCapabilities", "HeCapabilities", true, "he-capabilities.h" },
1503  { "VhtCapabilities","VhtCapabilities",true, "vht-capabilities.h" },
1504  { "HtCapabilities", "HtCapabilities", true, "ht-capabilities.h" },
1505  { "IeMeshId", "IeMeshId", true, "ie-dot11s-id.h" },
1506  { "Ipv4Address", "Ipv4Address", true, "ipv4-address.h" },
1507  { "Ipv4Mask", "Ipv4Mask", true, "ipv4-address.h" },
1508  { "Ipv6Address", "Ipv6Address", true, "ipv6-address.h" },
1509  { "Ipv6Prefix", "Ipv6Prefix", true, "ipv6-address.h" },
1510  { "Mac16Address", "Mac16Address", true, "mac16-address.h" },
1511  { "Mac48Address", "Mac48Address", true, "mac48-address.h" },
1512  { "Mac64Address", "Mac64Address", true, "mac64-address.h" },
1513  { "ObjectFactory", "ObjectFactory", true, "object-factory.h" },
1514  { "OrganizationIdentifier",
1515  "OrganizationIdentifier",
1516  true, "vendor-specific-action.h" },
1517  { "Rectangle", "Rectangle", true, "rectangle.h" },
1518  { "Ssid", "Ssid", true, "ssid.h" },
1519  { "TypeId", "TypeId", true, "type-id.h" },
1520  { "UanModesList", "UanModesList", true, "uan-tx-mode.h" },
1521  // { "ValueClassTest", "ValueClassTest", false, "" /* outside ns3 */ },
1522  { "Vector", "Vector", true, "vector.h" },
1523  { "Vector2D", "Vector2D", true, "vector.h" },
1524  { "Vector3D", "Vector3D", true, "vector.h" },
1525  { "HeOperation", "HeOperation", true, "he-operation.h" },
1526  { "VhtOperation", "VhtOperation", true, "vht-operation.h" },
1527  { "HtOperation", "HtOperation", true, "ht-operation.h" },
1528  { "Waypoint", "Waypoint", true, "waypoint.h" },
1529  { "WifiMode", "WifiMode", true, "wifi-mode.h" },
1530 
1531  // All three (Value, Access and Checkers) defined, but custom
1532  { "Boolean", "Boolean", false, "boolean.h" },
1533  { "Callback", "Callback", true, "callback.h" },
1534  { "Double", "double", false, "double.h" },
1535  { "Enum", "int", false, "enum.h" },
1536  { "Integer", "int64_t", false, "integer.h" },
1537  { "Pointer", "Pointer", false, "pointer.h" },
1538  { "RandomVariable", "RandomVariable", true, "random-variable-stream.h" },
1539  { "String", "std::string", false, "string.h" },
1540  { "Time", "Time", true, "nstime.h" },
1541  { "Uinteger", "uint64_t", false, "uinteger.h" },
1542  { "", "", false, "last placeholder" }
1543  };
1544 
1545  int i = 0;
1546  while (attributes[i].m_name != "")
1547  {
1548  PrintAttributeHelper (os, attributes[i]);
1549  ++i;
1550  }
1551 
1552  // Special cases
1553  PrintAttributeValueSection (os, "EmptyAttribute", false);
1554  PrintAttributeValueWithName (os, "EmptyAttribute", "EmptyAttribute",
1555  "attribute.h");
1556 
1557  PrintAttributeValueSection (os, "ObjectPtrContainer", false);
1558  PrintAttributeValueWithName (os, "ObjectPtrContainer", "ObjectPtrContainer", "object-ptr-container.h");
1559  PrintMakeChecker (os, "ObjectPtrContainer", "object-ptr-container.h");
1560 
1561  PrintAttributeValueSection (os, "ObjectVector", false);
1562  PrintMakeAccessors (os, "ObjectVector");
1563  PrintMakeChecker (os, "ObjectVector", "object-vector.h");
1564 
1565  PrintAttributeValueSection (os, "ObjectMap", false);
1566  PrintMakeAccessors (os, "ObjectMap");
1567  PrintMakeChecker (os, "ObjectMap", "object-map.h");
1568 
1569 } // PrintAttributeImplementations ()
1570 
1571 
1572 /***************************************************************
1573  * Main
1574  ***************************************************************/
1575 
1576 int main (int argc, char *argv[])
1577 {
1579  bool outputText = false;
1580 
1581  CommandLine cmd;
1582  cmd.Usage ("Generate documentation for all ns-3 registered types, "
1583  "trace sources, attributes and global variables.");
1584  cmd.AddValue ("output-text", "format output as plain text", outputText);
1585  cmd.Parse (argc, argv);
1586 
1587  SetMarkup (outputText);
1588 
1589 
1590  // Create a Node, to force linking and instantiation of our TypeIds
1591  NodeContainer c;
1592  c.Create (1);
1593 
1594  // mode-line: helpful when debugging introspected-doxygen.h
1595  if (!outputText)
1596  {
1597  std::cout << "/* -*- Mode:C++; c-file-style:\"gnu\"; "
1598  "indent-tabs-mode:nil; -*- */"
1599  << std::endl;
1600  }
1601 
1602  // Doxygen file header
1603  std::cout << std::endl;
1604  std::cout << commentStart
1605  << file << "\n"
1606  << sectionStart << "utils\n"
1607  << "Doxygen docs generated from the TypeId database.\n"
1608  << note << "This file is automatically generated by "
1609  << codeWord << "print-introspected-doxygen.cc. Do not edit this file! "
1610  << "Edit that file instead.\n"
1611  << commentStop
1612  << std::endl;
1613 
1614  PrintTypeIdBlocks (std::cout);
1615 
1616  PrintAllTypeIds (std::cout);
1617  PrintAllAttributes (std::cout);
1618  PrintAllGlobals (std::cout);
1619  PrintAllLogComponents (std::cout);
1620  PrintAllTraceSources (std::cout);
1621  PrintAttributeImplementations (std::cout);
1622 
1623  return 0;
1624 }
bool IsChildOf(TypeId other) const
Check if this TypeId is a child of another.
Definition: type-id.cc:958
std::string GetName(void) const
Get the name.
Definition: type-id.cc:977
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
std::string help
Trace help string.
Definition: type-id.h:104
const std::string m_header
The header file name.
bool HasAlreadyBeenProcessed(TypeId tid) const
void RecordOutput(TypeId tid)
Record the current config path for tid.
std::vector< std::pair< TypeId, std::string > > m_output
Configuration path for each TypeId.
NS_ASSERT_MSG(false, "Ipv4AddressGenerator::MaskToIndex(): Impossible")
Hold variables of type string.
Definition: string.h:41
std::string templArgDeduced
template argument deduced from function
TraceSource implementation.
Definition: type-id.h:99
std::string headingStart
start of section heading (h3)
U * PeekPointer(const Ptr< U > &p)
Definition: ptr.h:566
const std::string m_type
The name of the underlying type.
virtual TypeId GetPointeeTypeId(void) const =0
Get the TypeId of the base type.
std::string flagSpanStart
start of Attribute flag value
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
Vector::const_iterator Iterator
Iterator type for the list of all global values.
Definition: global-value.h:80
void Print(void) const
Print output in "a -> b" form on std::cout.
static TypeId GetRegistered(uint16_t i)
Get a TypeId by index.
Definition: type-id.cc:876
std::string templArgExplicit
template argument required
cmd
Definition: second.py:35
static bool LookupByNameFailSafe(std::string name, TypeId *tid)
Get a TypeId by name.
Definition: type-id.cc:838
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
The attribute can be written at construction-time.
Definition: type-id.h:66
virtual TypeId GetItemTypeId(void) const =0
Get the TypeId of the container class type.
std::size_t GetTraceSourceN(void) const
Get the number of Trace sources.
Definition: type-id.cc:1098
TypeId GetParent(void) const
Get the parent of this TypeId.
Definition: type-id.cc:944
std::string breakTextOnly
linebreak for text output only
void DoGather(TypeId tid)
Gather attribute, configuration path information for tid.
The attribute can be read.
Definition: type-id.h:64
Ptr< const AttributeAccessor > accessor
Accessor object.
Definition: type-id.h:90
std::string Get(void) const
Definition: string.cc:31
#define max(a, b)
Definition: 80211b.c:43
std::vector< std::string > Get(TypeId tid) const
const std::string m_name
The base name of the resulting AttributeValue type.
static Iterator Begin(void)
The Begin iterator.
Ptr< const AttributeValue > initialValue
Configured initial value.
Definition: type-id.h:88
std::string sectionStart
start of a section or group
Ptr< Object > GetRootNamespaceObject(uint32_t i)
Definition: config.cc:908
AttributeChecker implementation for ObjectPtrContainerValue.
bool MustHideFromDocumentation(void) const
Check if this TypeId should not be listed in documentation.
Definition: type-id.cc:1069
struct TypeId::TraceSourceInformation GetTraceSource(std::size_t i) const
Get the trace source by index.
Definition: type-id.cc:1104
Attribute implementation.
Definition: type-id.h:77
Parse command-line arguments.
Definition: command-line.h:212
uint32_t flags
AttributeFlags value.
Definition: type-id.h:84
std::string breakHtmlOnly
linebreak for html output only
std::map< std::string, LogComponent * > ComponentList
LogComponent name map.
Definition: log.h:409
Ptr< const AttributeChecker > checker
Checker object.
Definition: type-id.h:92
std::string codeWord
format next word as source code
std::vector< std::string > m_noTids
List of type names without TypeIds, because those modules aren&#39;t enabled.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
std::string name
Attribute name.
Definition: type-id.h:80
std::size_t GetSize(void) const
Get the size of this object.
Definition: type-id.cc:991
std::size_t GetRootNamespaceObjectN(void)
Definition: config.cc:902
The attribute can be written.
Definition: type-id.h:65
std::string name
Trace name.
Definition: type-id.h:102
static ComponentList * GetComponentList(void)
Get the list of LogComponnents.
Definition: log.cc:80
const bool m_seeBase
Print a "see also" pointing to the base class.
std::vector< TypeId > m_alreadyProcessed
List of TypeIds we&#39;ve already processed.
AttributeChecker implementation for PointerValue.
Definition: pointer.h:97
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
Definition: object.cc:79
Descriptor for an AttributeValue.
std::size_t GetAttributeN(void) const
Get the number of attributes.
Definition: type-id.cc:1077
static Iterator End(void)
The End iterator.
Gather aggregation and configuration path information from registered types.
void Print(ComponentCarrier cc)
struct TypeId::AttributeInformation GetAttribute(std::size_t i) const
Get Attribute information by index.
Definition: type-id.cc:1084
std::string copyDoc
copy (or refer) to docs elsewhere
std::string GetCurrentPath(void) const
std::vector< std::string > m_currentPath
Current configuration path.
std::string callback
Callback function signature type.
Definition: type-id.h:106
void Gather(TypeId tid)
Gather aggregation and configuration path information for tid.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
std::vector< std::pair< TypeId, TypeId > > m_aggregates
List of aggregation relationships.
static uint16_t GetRegisteredN(void)
Get the number of registered TypeIds.
Definition: type-id.cc:870
std::string flagSpanStop
end of Attribute flag value
a unique identifier for an interface.
Definition: type-id.h:58
std::vector< std::string > GetNoTypeIds(void) const
std::string help
Attribute help string.
Definition: type-id.h:82
void RecordAggregationInfo(std::string a, std::string b)
Record the a -> b aggregation relation.