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
45using namespace ns3;
46
47NS_LOG_COMPONENT_DEFINE ("PrintIntrospectedDoxygen");
48
49namespace
50{
52 bool outputText = false;
53
58 std::string anchor;
59 std::string argument;
60 std::string boldStart;
61 std::string boldStop;
62 std::string breakBoth;
63 std::string breakHtmlOnly;
64 std::string breakTextOnly;
65 std::string brief;
66 std::string classStart;
67 std::string classStop;
68 std::string codeWord;
69 std::string commentStart;
70 std::string commentStop;
71 std::string copyDoc;
72 std::string file;
73 std::string flagSpanStart;
74 std::string flagSpanStop;
75 std::string functionStart;
76 std::string functionStop;
77 std::string headingStart;
78 std::string headingStop;
79 // Linking: [The link text displayed](\ref TheTarget)
80 std::string hrefStart;
81 std::string hrefMid;
82 std::string hrefStop;
83 std::string indentHtmlOnly;
84 std::string listLineStart;
85 std::string listLineStop;
86 std::string listStart;
87 std::string listStop;
88 std::string note;
89 std::string page;
90 std::string reference;
91 std::string referenceNo;
92 std::string returns;
93 std::string sectionStart;
94 std::string seeAlso;
95 std::string subSectionStart;
96 std::string templArgDeduced;
97 std::string templArgExplicit;
98 std::string templateArgument;
99 std::string variable;
102} // unnamed namespace
103
104
110void
112{
114 if (outputText)
115 {
116 anchor = "";
117 argument = " Arg: ";
118 boldStart = "";
119 boldStop = "";
120 breakBoth = "\n";
121 breakHtmlOnly = "";
122 breakTextOnly = "\n";
123 brief = "";
124 classStart = "";
125 classStop = "\n\n";
126 codeWord = " ";
127 commentStart = "===============================================================\n";
128 commentStop = "";
129 copyDoc = " See: ";
130 file = "File: introspected-doxygen.txt";
131 flagSpanStart = "";
132 flagSpanStop = "";
133 functionStart = "";
134 functionStop = "\n\n";
135 headingStart = "";
136 headingStop = "";
137 // Linking: The link text displayed (see TheTarget)
138 hrefStart = "";
139 hrefMid = "(see ";
140 hrefStop = ")";
141 indentHtmlOnly = "";
142 listLineStart = " * ";
143 listLineStop = "";
144 listStart = "";
145 listStop = "";
146 note = "Note: ";
147 page = "Page ";
148 reference = " ";
149 referenceNo = " ";
150 returns = " Returns: ";
151 sectionStart = "Section: ";
152 seeAlso = " See: ";
153 subSectionStart = "Subsection ";
154 templArgDeduced = "[deduced] ";
155 templArgExplicit = "[explicit] ";
156 templateArgument = "Template Arg: ";
157 variable = "Variable: ";
158 }
159 else
160 {
161 anchor = "\\anchor ";
162 argument = "\\param ";
163 boldStart = "<b>";
164 boldStop = "</b>";
165 breakBoth = "<br>";
166 breakHtmlOnly = "<br>";
167 breakTextOnly = "";
168 brief = "\\brief ";
169 classStart = "\\class ";
170 classStop = "";
171 codeWord = "\\p ";
172 commentStart = "/*!\n";
173 commentStop = "*/\n";
174 copyDoc = "\\copydoc ";
175 file = "\\file";
176 flagSpanStart = "<span class=\"mlabel\">";
177 flagSpanStop = "</span>";
178 functionStart = "\\fn ";
179 functionStop = "";
180 headingStart = "<h3>";
181 headingStop = "</h3>";
182 // Linking: [The link text displayed](\ref TheTarget)
183 hrefStart = "[";
184 hrefMid = "](\\ref ";
185 hrefStop = ")";
186 indentHtmlOnly = " ";
187 listLineStart = "<li>";
188 listLineStop = "</li>";
189 listStart = "<ul>";
190 listStop = "</ul>";
191 note = "\\note ";
192 page = "\\page ";
193 reference = " \\ref ";
194 referenceNo = " %";
195 returns = "\\returns ";
196 sectionStart = "\\ingroup ";
197 seeAlso = "\\see ";
198 subSectionStart = "\\addtogroup ";
199 templArgDeduced = "\\deduced ";
200 templArgExplicit = "\\explicit ";
201 templateArgument = "\\tparam ";
202 variable = "\\var ";
203 }
204} // SetMarkup ()
205
206
207/***************************************************************
208 * Aggregation and configuration paths
209 ***************************************************************/
210
215{
216public:
223 void RecordAggregationInfo (std::string a, std::string b);
229 void Gather (TypeId tid);
233 void Print (void) const;
234
240 std::vector<std::string> Get (TypeId tid) const;
241
245 std::vector<std::string> GetNoTypeIds (void) const;
246
247private:
251 std::string GetCurrentPath (void) const;
257 void DoGather (TypeId tid);
263 void RecordOutput (TypeId tid);
269 bool HasAlreadyBeenProcessed (TypeId tid) const;
273 std::vector<std::pair<TypeId,std::string> > m_output;
277 std::vector<std::string> m_currentPath;
281 std::vector<TypeId> m_alreadyProcessed;
285 std::vector<std::pair<TypeId,TypeId> > m_aggregates;
292 mutable std::vector<std::string> m_noTids;
293
294}; // class StaticInformation
295
296
297void
298StaticInformation::RecordAggregationInfo (std::string a, std::string b)
299{
300 NS_LOG_FUNCTION (this << a << b);
301 TypeId aTid;
302 bool found = TypeId::LookupByNameFailSafe (a, &aTid);
303 if (!found)
304 {
305 m_noTids.push_back (a);
306 return;
307 }
308 TypeId bTid;
309 found = TypeId::LookupByNameFailSafe (b, &bTid);
310 if (!found)
311 {
312 m_noTids.push_back (b);
313 return;
314 }
315
316 m_aggregates.push_back (std::make_pair (aTid, bTid));
317}
318
319
320void
322{
323 NS_LOG_FUNCTION (this);
324 for (auto item : m_output)
325 {
326 std::cout << item.first.GetName () << " -> " << item.second << std::endl;
327 }
328}
329
330
331std::string
333{
334 NS_LOG_FUNCTION (this);
335 std::ostringstream oss;
336 for (auto item : m_currentPath)
337 {
338 oss << "/" << item;
339 }
340 return oss.str ();
341}
342
343
344void
346{
347 NS_LOG_FUNCTION (this << tid);
348 m_output.push_back (std::make_pair (tid, GetCurrentPath ()));
349}
350
351
352bool
354{
355 NS_LOG_FUNCTION (this << tid);
356 for (auto it : m_alreadyProcessed)
357 {
358 if (it == tid)
359 {
360 return true;
361 }
362 }
363 return false;
364}
365
366
367std::vector<std::string>
369{
370 NS_LOG_FUNCTION (this << tid);
371 std::vector<std::string> paths;
372 for (auto item : m_output)
373 {
374 if (item.first == tid)
375 {
376 paths.push_back (item.second);
377 }
378 }
379 return paths;
380}
381
397template <typename T>
398void
400{
401 std::sort (t.begin (), t.end ());
402 t.erase (std::unique (t.begin (), t.end ()), t.end ());
403}
404
405std::vector<std::string>
407{
408 NS_LOG_FUNCTION (this);
410 return m_noTids;
411}
412
413
414void
416{
417 NS_LOG_FUNCTION (this << tid);
418 DoGather (tid);
420}
421
422
423void
425{
426 NS_LOG_FUNCTION (this << tid);
427 if (HasAlreadyBeenProcessed (tid))
428 {
429 return;
430 }
431 RecordOutput (tid);
432 for (uint32_t i = 0; i < tid.GetAttributeN (); ++i)
433 {
434 struct TypeId::AttributeInformation info = tid.GetAttribute(i);
435 const PointerChecker *ptrChecker = dynamic_cast<const PointerChecker *> (PeekPointer (info.checker));
436 if (ptrChecker != 0)
437 {
438 TypeId pointee = ptrChecker->GetPointeeTypeId ();
439
440 // See if this is a pointer to an Object.
441 Ptr<Object> object = CreateObject<Object> ();
442 TypeId objectTypeId = object->GetTypeId ();
443 if (objectTypeId == pointee)
444 {
445 // Stop the recursion at this attribute if it is a
446 // pointer to an Object, which create too many spurious
447 // paths in the list of attribute paths because any
448 // Object can be in that part of the path.
449 continue;
450 }
451
452 m_currentPath.push_back (info.name);
453 m_alreadyProcessed.push_back (tid);
454 DoGather (pointee);
455 m_alreadyProcessed.pop_back ();
456 m_currentPath.pop_back ();
457 continue;
458 }
459 // attempt to cast to an object vector.
460 const ObjectPtrContainerChecker *vectorChecker = dynamic_cast<const ObjectPtrContainerChecker *> (PeekPointer (info.checker));
461 if (vectorChecker != 0)
462 {
463 TypeId item = vectorChecker->GetItemTypeId ();
464 m_currentPath.push_back (info.name + "/[i]");
465 m_alreadyProcessed.push_back (tid);
466 DoGather (item);
467 m_alreadyProcessed.pop_back ();
468 m_currentPath.pop_back ();
469 continue;
470 }
471 }
472 for (uint32_t j = 0; j < TypeId::GetRegisteredN (); j++)
473 {
474 TypeId child = TypeId::GetRegistered (j);
475 if (child.IsChildOf (tid))
476 {
477 std::string childName = "$" + child.GetName ();
478 m_currentPath.push_back (childName);
479 m_alreadyProcessed.push_back (tid);
480 DoGather (child);
481 m_alreadyProcessed.pop_back ();
482 m_currentPath.pop_back ();
483 }
484 }
485 for (auto item : m_aggregates)
486 {
487 if (item.first == tid || item.second == tid)
488 {
489 TypeId other;
490 if (item.first == tid)
491 {
492 other = item.second;
493 }
494 if (item.second == tid)
495 {
496 other = item.first;
497 }
498 std::string name = "$" + other.GetName ();
499 m_currentPath.push_back (name);
500 m_alreadyProcessed.push_back (tid);
501 DoGather (other);
502 m_alreadyProcessed.pop_back ();
503 m_currentPath.pop_back ();
504 }
505 }
506} // StaticInformation::DoGather ()
507
508
514{
516
517 static StaticInformation info;
518 static bool mapped = false;
519
520 if (mapped)
521 {
522 return info;
523 }
524
525 // Short circuit next call
526 mapped = true;
527
528 // The below statements register typical aggregation relationships
529 // in ns-3 programs, that otherwise aren't picked up automatically
530 // by the creation of the above node. To manually list other common
531 // aggregation relationships that you would like to see show up in
532 // the list of configuration paths in the doxygen, add additional
533 // statements below.
534 info.RecordAggregationInfo ("ns3::Node", "ns3::TcpSocketFactory");
535 info.RecordAggregationInfo ("ns3::Node", "ns3::UdpSocketFactory");
536 info.RecordAggregationInfo ("ns3::Node", "ns3::PacketSocketFactory");
537 info.RecordAggregationInfo ("ns3::Node", "ns3::MobilityModel");
538 info.RecordAggregationInfo ("ns3::Node", "ns3::Ipv4L3Protocol");
539 info.RecordAggregationInfo ("ns3::Node", "ns3::Ipv4NixVectorRouting");
540 info.RecordAggregationInfo ("ns3::Node", "ns3::Icmpv4L4Protocol");
541 info.RecordAggregationInfo ("ns3::Node", "ns3::ArpL3Protocol");
542 info.RecordAggregationInfo ("ns3::Node", "ns3::Icmpv4L4Protocol");
543 info.RecordAggregationInfo ("ns3::Node", "ns3::UdpL4Protocol");
544 info.RecordAggregationInfo ("ns3::Node", "ns3::Ipv6L3Protocol");
545 info.RecordAggregationInfo ("ns3::Node", "ns3::Icmpv6L4Protocol");
546 info.RecordAggregationInfo ("ns3::Node", "ns3::TcpL4Protocol");
547 info.RecordAggregationInfo ("ns3::Node", "ns3::RipNg");
548 info.RecordAggregationInfo ("ns3::Node", "ns3::GlobalRouter");
549 info.RecordAggregationInfo ("ns3::Node", "ns3::aodv::RoutingProtocol");
550 info.RecordAggregationInfo ("ns3::Node", "ns3::dsdv::RoutingProtocol");
551 info.RecordAggregationInfo ("ns3::Node", "ns3::dsr::DsrRouting");
552 info.RecordAggregationInfo ("ns3::Node", "ns3::olsr::RoutingProtocol");
553 info.RecordAggregationInfo ("ns3::Node", "ns3::EnergyHarvesterContainer");
554 info.RecordAggregationInfo ("ns3::Node", "ns3::EnergySourceContainer");
555
556 // Create a channel object so that channels appear in the namespace
557 // paths that will be generated here.
558 Ptr<SimpleChannel> simpleChannel;
559 simpleChannel = CreateObject<SimpleChannel> ();
560
561 for (uint32_t i = 0; i < Config::GetRootNamespaceObjectN (); ++i)
562 {
564 info.Gather (object->GetInstanceTypeId ());
565 }
566
567 return info;
568
569} // GetTypicalAggregations ()
570
571
573typedef std::map< std::string, int32_t> NameMap;
574typedef NameMap::const_iterator NameMapIterator;
575
576
585{
587
588 static NameMap nameMap;
589 static bool mapped = false;
590
591 if (mapped)
592 {
593 return nameMap;
594 }
595
596 // Short circuit next call
597 mapped = true;
598
599 // Get typical aggregation relationships.
601
602 // Registered types
603 for (uint32_t i = 0; i < TypeId::GetRegisteredN (); i++)
604 {
605 TypeId tid = TypeId::GetRegistered (i);
606 if (tid.MustHideFromDocumentation ())
607 {
608 continue;
609 }
610
611 // Capitalize all of letters in the name so that it sorts
612 // correctly in the map.
613 std::string name = tid.GetName ();
614 std::transform (name.begin (), name.end (), name.begin (), ::toupper);
615
616 // Save this name's index.
617 nameMap[name] = i;
618 }
619
620 // Type names without TypeIds
621 std::vector<std::string> noTids = info.GetNoTypeIds ();
622 for (auto item : noTids)
623 {
624 nameMap[item] = -1;
625 }
626
627 return nameMap;
628} // GetNameMap ()
629
630
631/***************************************************************
632 * Docs for a single TypeId
633 ***************************************************************/
634
640void
641PrintConfigPaths (std::ostream & os, const TypeId tid)
642{
643 NS_LOG_FUNCTION (tid);
644 std::vector<std::string> paths = GetTypicalAggregations ().Get (tid);
645
646 // Config --------------
647 if (paths.empty ())
648 {
649 os << "Introspection did not find any typical Config paths."
650 << breakBoth
651 << std::endl;
652 }
653 else
654 {
655 os << headingStart
656 << "Config Paths"
657 << headingStop
658 << std::endl;
659 os << std::endl;
660 os << tid.GetName ()
661 << " is accessible through the following paths"
662 << " with Config::Set and Config::Connect:"
663 << std::endl;
664 os << listStart << std::endl;
665 for (auto path : paths)
666 {
667 os << listLineStart
668 << "\"" << path << "\""
669 << listLineStop
671 << std::endl;
672 }
673 os << listStop << std::endl;
674 }
675} // PrintConfigPaths ()
676
677
686void
687PrintAttributesTid (std::ostream &os, const TypeId tid)
688{
689 NS_LOG_FUNCTION (tid);
690 os << listStart << std::endl;
691 for (uint32_t j = 0; j < tid.GetAttributeN (); j++)
692 {
693 struct TypeId::AttributeInformation info = tid.GetAttribute(j);
694 os << listLineStart
695 << boldStart << info.name << boldStop << ": "
696 << info.help
697 << std::endl;
698 os << indentHtmlOnly
699 << listStart << std::endl;
700 os << " "
702 << "Set with class: " << reference
703 << info.checker->GetValueTypeName ()
704 << listLineStop
705 << std::endl;
706
707 std::string underType;
708 if (info.checker->HasUnderlyingTypeInformation ())
709 {
710 os << " "
712 << "Underlying type: ";
713
714 std::string valType = info.checker->GetValueTypeName ();
715 underType = info.checker->GetUnderlyingTypeInformation ();
716 bool handled = false;
717 if ((valType != "ns3::EnumValue") && (underType != "std::string"))
718 {
719 // Indirect cases to handle
720 if (valType == "ns3::PointerValue")
721 {
722 const PointerChecker *ptrChecker =
723 dynamic_cast<const PointerChecker *> (PeekPointer (info.checker));
724 if (ptrChecker != 0)
725 {
726 os << reference << "ns3::Ptr" << "< "
727 << reference << ptrChecker->GetPointeeTypeId ().GetName ()
728 << ">";
729 handled = true;
730 }
731 }
732 else if (valType == "ns3::ObjectPtrContainerValue")
733 {
734 const ObjectPtrContainerChecker * ptrChecker =
735 dynamic_cast<const ObjectPtrContainerChecker *> (PeekPointer (info.checker));
736 if (ptrChecker != 0)
737 {
738 os << reference << "ns3::Ptr" << "< "
739 << reference << ptrChecker->GetItemTypeId ().GetName ()
740 << ">";
741 handled = true;
742 }
743 }
744 // Helper to match first part of string
745 class StringBeginMatcher
746 {
747 public:
748 StringBeginMatcher (const std::string s)
749 : m_string (s) { };
750 bool operator () (const std::string t)
751 {
752 std::size_t pos = m_string.find (t);
753 return pos == 0;
754 };
755 private:
756 std::string m_string;
757 };
758 StringBeginMatcher match (underType);
759
760 if ( match ("bool") || match ("double") ||
761 match ("int8_t") || match ("uint8_t") ||
762 match ("int16_t") || match ("uint16_t") ||
763 match ("int32_t") || match ("uint32_t") ||
764 match ("int64_t") || match ("uint64_t")
765 )
766 {
767 os << underType;
768 handled = true;
769 }
770 }
771 if (! handled)
772 {
773 os << codeWord << underType;
774 }
775 os << listLineStop << std::endl;
776 }
777 if (info.flags & TypeId::ATTR_CONSTRUCT && info.accessor->HasSetter ())
778 {
779 std::string value = info.initialValue->SerializeToString (info.checker);
780 if (underType == "std::string" && value == "")
781 {
782 value = "\"\"";
783 }
784 os << " "
786 << "Initial value: "
787 << value
788 << listLineStop
789 << std::endl;
790 }
791 bool moreFlags {false};
792 os << " " << listLineStart << "Flags: ";
793 if (info.flags & TypeId::ATTR_CONSTRUCT && info.accessor->HasSetter ())
794 {
795 os << flagSpanStart << "construct" << flagSpanStop;
796 moreFlags = true;
797 }
798 if (info.flags & TypeId::ATTR_SET && info.accessor->HasSetter ())
799 {
800 os << (outputText && moreFlags ? ", " : "")
801 << flagSpanStart << "write" << flagSpanStop;
802 moreFlags = true;
803 }
804 if (info.flags & TypeId::ATTR_GET && info.accessor->HasGetter ())
805 {
806 os << (outputText && moreFlags ? ", " : "")
807 << flagSpanStart << "read" << flagSpanStop;
808 moreFlags = true;
809 }
810 os << listLineStop << std::endl;
811 os << indentHtmlOnly
812 << listStop
813 << std::endl;
814
815 }
816 os << listStop << std::endl;
817} // PrintAttributesTid ()
818
819
830void
831PrintAttributes (std::ostream & os, const TypeId tid)
832{
833 NS_LOG_FUNCTION (tid);
834 if (tid.GetAttributeN () == 0)
835 {
836 os << "No Attributes are defined for this type."
837 << breakBoth
838 << std::endl;
839 }
840 else
841 {
842 os << headingStart
843 << "Attributes"
844 << headingStop
845 << std::endl;
846 PrintAttributesTid (os, tid);
847 }
848
849 // Attributes from base classes
850 TypeId tmp = tid.GetParent ();
851 while (tmp.GetParent () != tmp)
852 {
853 if (tmp.GetAttributeN () != 0)
854 {
855 os << headingStart
856 << "Attributes defined in parent class "
857 << tmp.GetName ()
858 << headingStop
859 << std::endl;
860 PrintAttributesTid (os, tmp);
861 }
862 tmp = tmp.GetParent ();
863
864 } // Attributes
865} // PrintAttributes ()
866
867
876void
877PrintTraceSourcesTid (std::ostream & os, const TypeId tid)
878{
879 NS_LOG_FUNCTION (tid);
880 os << listStart << std::endl;
881 for (uint32_t i = 0; i < tid.GetTraceSourceN (); ++i)
882 {
884 os << listLineStart
885 << boldStart << info.name << boldStop << ": "
886 << info.help << breakBoth;
887 if (!outputText)
888 {
889 // '%' prevents doxygen from linking to the Callback class...
890 os << "%";
891 }
892 os << "Callback signature: "
893 << info.callback
894 << std::endl;
895 os << listLineStop << std::endl;
896 }
897 os << listStop << std::endl;
898} // PrintTraceSourcesTid ()
899
900
911void
912PrintTraceSources (std::ostream & os, const TypeId tid)
913{
914 NS_LOG_FUNCTION (tid);
915 if (tid.GetTraceSourceN () == 0)
916 {
917 os << "No TraceSources are defined for this type."
918 << breakBoth
919 << std::endl;
920 }
921 else
922 {
923 os << headingStart
924 << "TraceSources"
925 << headingStop << std::endl;
926 PrintTraceSourcesTid (os, tid);
927 }
928
929 // Trace sources from base classes
930 TypeId tmp = tid.GetParent ();
931 while (tmp.GetParent () != tmp)
932 {
933 if (tmp.GetTraceSourceN () != 0)
934 {
935 os << headingStart
936 << "TraceSources defined in parent class "
937 << tmp.GetName ()
938 << headingStop << std::endl;
939 PrintTraceSourcesTid (os, tmp);
940 }
941 tmp = tmp.GetParent ();
942 }
943
944} // PrintTraceSources ()
945
952void PrintSize (std::ostream & os, const TypeId tid)
953{
954 NS_LOG_FUNCTION (tid);
955 NS_ASSERT_MSG (CHAR_BIT != 0, "CHAR_BIT is zero");
956
957 std::size_t arch = (sizeof (void *) * CHAR_BIT);
958
959 os << boldStart << "Size" << boldStop
960 << " of this type is " << tid.GetSize ()
961 << " bytes (on a " << arch << "-bit architecture)."
962 << std::endl;
963} // PrintSize ()
964
965
971void
972PrintTypeIdBlocks (std::ostream & os)
973{
975
976 NameMap nameMap = GetNameMap ();
977
978 // Iterate over the map, which will print the class names in
979 // alphabetical order.
980 for (auto item : nameMap)
981 {
982 // Handle only real TypeIds
983 if (item.second < 0)
984 {
985 continue ;
986 }
987 // Get the class's index out of the map;
988 TypeId tid = TypeId::GetRegistered (item.second);
989 std::string name = tid.GetName ();
990
991 std::cout << commentStart << std::endl;
992
993 std::cout << classStart << name << std::endl;
994 std::cout << std::endl;
995
996 PrintConfigPaths (std::cout, tid);
997 PrintAttributes (std::cout, tid);
998 PrintTraceSources (std::cout, tid);
999 PrintSize (std::cout, tid);
1000
1001 std::cout << commentStop << std::endl;
1002 } // for class documentation
1003
1004} // PrintTypeIdBlocks
1005
1006
1007/***************************************************************
1008 * Lists of All things
1009 ***************************************************************/
1010
1016void
1017PrintAllTypeIds (std::ostream & os)
1018{
1020 os << commentStart << page << "TypeIdList All ns3::TypeId's\n"
1021 << std::endl;
1022 os << "This is a list of all" << reference << "ns3::TypeId's.\n"
1023 << "For more information see the" << reference << "ns3::TypeId "
1024 << "section of this API documentation and the"
1025 << referenceNo << "TypeId section "
1026 << "in the Configuration and "
1027 << referenceNo << "Attributes chapter of the Manual.\n"
1028 << std::endl;
1029
1030 os << listStart << std::endl;
1031
1032 NameMap nameMap = GetNameMap ();
1033 // Iterate over the map, which will print the class names in
1034 // alphabetical order.
1035 for (auto item : nameMap)
1036 {
1037 // Handle only real TypeIds
1038 if (item.second < 0)
1039 {
1040 continue ;
1041 }
1042 // Get the class's index out of the map;
1043 TypeId tid = TypeId::GetRegistered (item.second);
1044
1045 os << indentHtmlOnly
1046 << listLineStart
1047 << boldStart
1048 << tid.GetName ()
1049 << boldStop
1050 << listLineStop
1051 << std::endl;
1052
1053 }
1054 os << listStop << std::endl;
1055 os << commentStop << std::endl;
1056
1057} // PrintAllTypeIds ()
1058
1059
1068void
1069PrintAllAttributes (std::ostream & os)
1070{
1072 os << commentStart << page << "AttributeList All Attributes\n"
1073 << std::endl;
1074 os << "This is a list of all" << reference << "attributes classes. "
1075 << "For more information see the" << reference << "attributes "
1076 << "section of this API documentation and the Attributes sections "
1077 << "in the Tutorial and Manual.\n"
1078 << std::endl;
1079
1080 NameMap nameMap = GetNameMap ();
1081 // Iterate over the map, which will print the class names in
1082 // alphabetical order.
1083 for (auto item: nameMap)
1084 {
1085 // Handle only real TypeIds
1086 if (item.second < 0)
1087 {
1088 continue ;
1089 }
1090 // Get the class's index out of the map;
1091 TypeId tid = TypeId::GetRegistered (item.second);
1092
1093 if (tid.GetAttributeN () == 0 )
1094 {
1095 continue;
1096 }
1097 os << boldStart << tid.GetName () << boldStop << breakHtmlOnly
1098 << std::endl;
1099
1100 os << listStart << std::endl;
1101 for (uint32_t j = 0; j < tid.GetAttributeN (); ++j)
1102 {
1103 struct TypeId::AttributeInformation info = tid.GetAttribute(j);
1104 os << listLineStart
1105 << boldStart << info.name << boldStop
1106 << ": " << info.help
1107 << listLineStop
1108 << std::endl;
1109 }
1110 os << listStop << std::endl;
1111 }
1112 os << commentStop << std::endl;
1113
1114} // PrintAllAttributes ()
1115
1116
1122void
1123PrintAllGlobals (std::ostream & os)
1124{
1126 os << commentStart << page << "GlobalValueList All GlobalValues\n"
1127 << std::endl;
1128 os << "This is a list of all" << reference << "ns3::GlobalValue instances.\n"
1129 << "See ns3::GlobalValue for how to set these."
1130 << std::endl;
1131
1132 os << listStart << std::endl;
1133 for (GlobalValue::Iterator i = GlobalValue::Begin ();
1134 i != GlobalValue::End ();
1135 ++i)
1136 {
1137 StringValue val;
1138 (*i)->GetValue (val);
1139 os << indentHtmlOnly
1140 << listLineStart
1141 << boldStart
1142 << hrefStart << (*i)->GetName ()
1143 << hrefMid << "GlobalValue" << (*i)->GetName ()
1144 << hrefStop
1145 << boldStop
1146 << ": " << (*i)->GetHelp ()
1147 << ". Default value: " << val.Get () << "."
1148 << listLineStop
1149 << std::endl;
1150 }
1151 os << listStop << std::endl;
1152 os << commentStop << std::endl;
1153
1154} // PrintAllGlobals ()
1155
1156
1162void
1163PrintAllLogComponents (std::ostream & os)
1164{
1166 os << commentStart << page << "LogComponentList All LogComponents\n"
1167 << std::endl;
1168 os << "This is a list of all" << reference << "ns3::LogComponent instances.\n"
1169 << std::endl;
1170
1175 LogComponent::ComponentList * logs = LogComponent::GetComponentList ();
1176 // Find longest log name
1177 std::size_t widthL = std::string ("Log Component").size ();
1178 std::size_t widthR = std::string ("file").size ();
1179 for (auto it : (*logs))
1180 {
1181 widthL = std::max (widthL, it.first.size ());
1182 std::string file = it.second->File ();
1183 // Strip leading "../" related to depth in build directory
1184 // since doxygen only sees the path starting with "src/", etc.
1185 while (file.find ("../") == 0)
1186 {
1187 file = file.substr (3);
1188 }
1189 widthR = std::max (widthR, file.size ());
1190 }
1191 const std::string tLeft ("| ");
1192 const std::string tMid (" | ");
1193 const std::string tRight (" |");
1194
1195 // Header line has to be padded to same length as separator line
1196 os << tLeft << std::setw (widthL) << std::left << "Log Component"
1197 << tMid << std::setw (widthR) << std::left << "File" << tRight
1198 << std::endl;
1199 os << tLeft << ":" << std::string (widthL - 1, '-')
1200 << tMid << ":" << std::string (widthR - 1, '-') << tRight
1201 << std::endl;
1202
1203 LogComponent::ComponentList::const_iterator it;
1204 for (auto it : (*logs))
1205 {
1206 std::string file = it.second->File ();
1207 // Strip leading "../" related to depth in build directory
1208 // since doxygen only sees the path starting with "src/", etc.
1209 while (file.find ("../") == 0)
1210 {
1211 file = file.substr (3);
1212 }
1213
1214 os << tLeft << std::setw (widthL) << std::left << it.first
1215 << tMid << std::setw (widthR) << file << tRight
1216 << std::endl;
1217 }
1218 os << std::right << std::endl;
1219 os << commentStop << std::endl;
1220} // PrintAllLogComponents ()
1221
1222
1231void
1232PrintAllTraceSources (std::ostream & os)
1233{
1235 os << commentStart << page << "TraceSourceList All TraceSources\n"
1236 << std::endl;
1237 os << "This is a list of all" << reference << "tracing sources. "
1238 << "For more information see the " << reference << "tracing "
1239 << "section of this API documentation and the Tracing sections "
1240 << "in the Tutorial and Manual.\n"
1241 << std::endl;
1242
1243 NameMap nameMap = GetNameMap ();
1244
1245 // Iterate over the map, which will print the class names in
1246 // alphabetical order.
1247 for (auto item : nameMap)
1248 {
1249 // Handle only real TypeIds
1250 if (item.second < 0)
1251 {
1252 continue ;
1253 }
1254 // Get the class's index out of the map;
1255 TypeId tid = TypeId::GetRegistered (item.second);
1256
1257 if (tid.GetTraceSourceN () == 0 )
1258 {
1259 continue;
1260 }
1261 os << boldStart << tid.GetName () << boldStop << breakHtmlOnly
1262 << std::endl;
1263
1264 os << listStart << std::endl;
1265 for (uint32_t j = 0; j < tid.GetTraceSourceN (); ++j)
1266 {
1268 os << listLineStart
1269 << boldStart << info.name << boldStop
1270 << ": " << info.help
1271 << listLineStop
1272 << std::endl;
1273 }
1274 os << listStop << std::endl;
1275 }
1276 os << commentStop << std::endl;
1277
1278} // PrintAllTraceSources ()
1279
1280
1281/***************************************************************
1282 * Docs for Attribute classes
1283 ***************************************************************/
1284
1285
1299void
1301 const std::string & name,
1302 const bool seeBase = true)
1303{
1304 NS_LOG_FUNCTION (name);
1305 std::string section = "attribute_" + name;
1306
1307 // \ingroup attributes
1308 // \defgroup attribute_<name>Value <name> Attribute
1309 os << commentStart << sectionStart << "attributes\n"
1310 << subSectionStart << "attribute_" << name << " "
1311 << name << " Attribute\n"
1312 << "AttributeValue implementation for " << name << "\n";
1313 if (seeBase)
1314 {
1315 // Some classes don't live in ns3::. Yuck
1316 if (name != "IeMeshId")
1317 {
1318 os << seeAlso << "ns3::" << name << "\n";
1319 }
1320 else
1321 {
1322 os << seeAlso << "ns3::dot11s::" << name << "\n";
1323 }
1324 }
1325 os << commentStop;
1326
1327} // PrintAttributeValueSection ()
1328
1329
1340void
1342 const std::string & name,
1343 const std::string & type,
1344 const std::string & header)
1345{
1346 NS_LOG_FUNCTION (name << type << header);
1347 std::string sectAttr = sectionStart + "attribute_" + name;
1348
1349 // \ingroup attribute_<name>Value
1350 // \class ns3::<name>Value "header"
1351 std::string valClass = name + "Value";
1352 std::string qualClass = " ns3::" + valClass;
1353
1354 os << commentStart << sectAttr << std::endl;
1355 os << classStart << qualClass << " \"" << header << "\"" << std::endl;
1356 os << "AttributeValue implementation for " << name << "." << std::endl;
1357 os << seeAlso << "AttributeValue" << std::endl;
1358 os << commentStop;
1359
1360 // Copy ctor: <name>Value::<name>Value
1361 os << commentStart
1362 << functionStart << name
1363 << qualClass << "::" << valClass;
1364 if ( (name == "EmptyAttribute") ||
1365 (name == "ObjectPtrContainer") )
1366 {
1367 // Just default constructors.
1368 os << "(void)\n";
1369 }
1370 else
1371 {
1372 // Copy constructors
1373 os << "(const " << type << " & value)\n"
1374 << "Copy constructor.\n"
1375 << argument << "[in] value The " << name << " value to copy.\n";
1376 }
1377 os << commentStop;
1378
1379 // <name>Value::Get (void) const
1380 os << commentStart
1381 << functionStart << type
1382 << qualClass << "::Get (void) const\n"
1383 << returns << "The " << name << " value.\n"
1384 << commentStop;
1385
1386 // <name>Value::GetAccessor (T & value) const
1387 os << commentStart
1388 << functionStart << "bool"
1389 << qualClass << "::GetAccessor (T & value) const\n"
1390 << "Access the " << name << " value as type " << codeWord << "T.\n"
1391 << templateArgument << "T " << templArgExplicit << "The type to cast to.\n"
1392 << argument << "[out] value The " << name << " value, as type "
1393 << codeWord << "T.\n"
1394 << returns << "true.\n"
1395 << commentStop;
1396
1397 // <name>Value::Set (const name & value)
1398 if (type != "Callback") // Yuck
1399 {
1400 os << commentStart
1401 << functionStart << "void"
1402 << qualClass << "::Set (const " << type << " & value)\n"
1403 << "Set the value.\n"
1404 << argument << "[in] value The value to adopt.\n"
1405 << commentStop;
1406 }
1407
1408 // <name>Value::m_value
1409 os << commentStart
1410 << variable << type
1411 << qualClass << "::m_value\n"
1412 << "The stored " << name << " instance.\n"
1413 << commentStop
1414 << std::endl;
1415
1416} // PrintAttributeValueWithName ()
1417
1418
1427void
1428PrintMakeAccessors (std::ostream & os, const std::string & name)
1429{
1430 NS_LOG_FUNCTION (name);
1431 std::string sectAttr = sectionStart + "attribute_" + name + "\n";
1432 std::string make = "ns3::Make" + name + "Accessor ";
1433
1434 // \ingroup attribute_<name>Value
1435 // Make<name>Accessor (T1 a1)
1436 os << commentStart << sectAttr
1437 << functionStart << "ns3::Ptr<const ns3::AttributeAccessor> "
1438 << make << "(T1 a1)\n"
1439 << copyDoc << "ns3::MakeAccessorHelper(T1)\n"
1440 << seeAlso << "AttributeAccessor\n"
1441 << commentStop;
1442
1443 // \ingroup attribute_<name>Value
1444 // Make<name>Accessor (T1 a1)
1445 os << commentStart << sectAttr
1446 << functionStart << "ns3::Ptr<const ns3::AttributeAccessor> "
1447 << make << "(T1 a1, T2 a2)\n"
1448 << copyDoc << "ns3::MakeAccessorHelper(T1,T2)\n"
1449 << seeAlso << "AttributeAccessor\n"
1450 << commentStop;
1451} // PrintMakeAccessors ()
1452
1453
1463void
1464PrintMakeChecker (std::ostream & os,
1465 const std::string & name,
1466 const std::string & header)
1467{
1468 NS_LOG_FUNCTION (name << header);
1469 std::string sectAttr = sectionStart + "attribute_" + name + "\n";
1470 std::string make = "ns3::Make" + name + "Checker ";
1471
1472 // \ingroup attribute_<name>Value
1473 // class <name>Checker
1474 os << commentStart << sectAttr << std::endl;
1475 os << classStart << " ns3::" << name << "Checker"
1476 << " \"" << header << "\"" << std::endl;
1477 os << "AttributeChecker implementation for " << name << "Value." << std::endl;
1478 os << seeAlso << "AttributeChecker" << std::endl;
1479 os << commentStop;
1480
1481 // \ingroup attribute_<name>Value
1482 // Make<name>Checker (void)
1483 os << commentStart << sectAttr
1484 << functionStart << "ns3::Ptr<const ns3::AttributeChecker> "
1485 << make << "(void)\n"
1486 << returns << "The AttributeChecker.\n"
1487 << seeAlso << "AttributeChecker\n"
1488 << commentStop;
1489} // PrintMakeChecker ()
1490
1491
1493typedef struct {
1494 const std::string m_name;
1495 const std::string m_type;
1496 const bool m_seeBase;
1497 const std::string m_header;
1499
1500
1509void
1510PrintAttributeHelper (std::ostream & os,
1511 const AttributeDescriptor & attr)
1512{
1513 NS_LOG_FUNCTION (attr.m_name << attr.m_type << attr.m_seeBase <<
1514 attr.m_header);
1516 PrintAttributeValueWithName (os, attr.m_name, attr.m_type, attr.m_header);
1517 PrintMakeAccessors (os, attr.m_name);
1518 PrintMakeChecker (os, attr.m_name, attr.m_header);
1519} // PrintAttributeHelper ()
1520
1521
1526void
1528{
1530
1531 const AttributeDescriptor attributes [] =
1532 {
1533 // Name Type see Base header-file
1534 // Users of ATTRIBUTE_HELPER_HEADER
1535 //
1536 { "Address", "Address", true, "address.h" },
1537 { "Box", "Box", true, "box.h" },
1538 { "DataRate", "DataRate", true, "data-rate.h" },
1539 { "Length", "Length", true, "length.h" },
1540 { "IeMeshId", "IeMeshId", true, "ie-dot11s-id.h" },
1541 { "Ipv4Address", "Ipv4Address", true, "ipv4-address.h" },
1542 { "Ipv4Mask", "Ipv4Mask", true, "ipv4-address.h" },
1543 { "Ipv6Address", "Ipv6Address", true, "ipv6-address.h" },
1544 { "Ipv6Prefix", "Ipv6Prefix", true, "ipv6-address.h" },
1545 { "Mac16Address", "Mac16Address", true, "mac16-address.h" },
1546 { "Mac48Address", "Mac48Address", true, "mac48-address.h" },
1547 { "Mac64Address", "Mac64Address", true, "mac64-address.h" },
1548 { "ObjectFactory", "ObjectFactory", true, "object-factory.h" },
1549 { "OrganizationIdentifier",
1550 "OrganizationIdentifier",
1551 true, "vendor-specific-action.h" },
1552 { "Priomap", "Priomap", true, "prio-queue-disc.h" },
1553 { "QueueSize", "QueueSize", true, "queue-size.h" },
1554 { "Rectangle", "Rectangle", true, "rectangle.h" },
1555 { "Ssid", "Ssid", true, "ssid.h" },
1556 { "TypeId", "TypeId", true, "type-id.h" },
1557 { "UanModesList", "UanModesList", true, "uan-tx-mode.h" },
1558 { "ValueClassTest", "ValueClassTest", false, "attribute-test-suite.cc" /* core/test/ */ },
1559 { "Vector", "Vector", true, "vector.h" },
1560 { "Vector2D", "Vector2D", true, "vector.h" },
1561 { "Vector3D", "Vector3D", true, "vector.h" },
1562 { "Waypoint", "Waypoint", true, "waypoint.h" },
1563 { "WifiMode", "WifiMode", true, "wifi-mode.h" },
1564
1565 // All three (Value, Access and Checkers) defined, but custom
1566 { "Boolean", "bool", false, "boolean.h" },
1567 { "Callback", "Callback", true, "callback.h" },
1568 { "Double", "double", false, "double.h" },
1569 { "Enum", "int", false, "enum.h" },
1570 { "Integer", "int64_t", false, "integer.h" },
1571 { "Pointer", "Pointer", false, "pointer.h" },
1572 { "String", "std::string", false, "string.h" },
1573 { "Time", "Time", true, "nstime.h" },
1574 { "Uinteger", "uint64_t", false, "uinteger.h" },
1575 { "", "", false, "last placeholder" }
1576 };
1577
1578 int i = 0;
1579 while (attributes[i].m_name != "")
1580 {
1581 PrintAttributeHelper (os, attributes[i]);
1582 ++i;
1583 }
1584
1585 // Special cases
1586 PrintAttributeValueSection (os, "EmptyAttribute", false);
1587 PrintAttributeValueWithName (os, "EmptyAttribute", "EmptyAttribute",
1588 "attribute.h");
1589
1590 PrintAttributeValueSection (os, "ObjectPtrContainer", false);
1591 PrintAttributeValueWithName (os, "ObjectPtrContainer", "ObjectPtrContainer", "object-ptr-container.h");
1592 PrintMakeChecker (os, "ObjectPtrContainer", "object-ptr-container.h");
1593
1594 PrintAttributeValueSection (os, "ObjectVector", false);
1595 PrintMakeAccessors (os, "ObjectVector");
1596 PrintMakeChecker (os, "ObjectVector", "object-vector.h");
1597
1598 PrintAttributeValueSection (os, "ObjectMap", false);
1599 PrintMakeAccessors (os, "ObjectMap");
1600 PrintMakeChecker (os, "ObjectMap", "object-map.h");
1601
1602 PrintAttributeValueSection (os, "Pair", false);
1603 PrintAttributeValueWithName (os, "Pair", "std::pair<A, B>", "pair.h");
1604 PrintMakeChecker (os, "Pair", "pair.h");
1605
1606 PrintAttributeValueSection (os, "Tuple", false);
1607 PrintAttributeValueWithName (os, "Tuple", "std::tuple<Args...>", "tuple.h");
1608 PrintMakeChecker (os, "Tuple", "tuple.h");
1609
1610 // AttributeContainer is already documented.
1611 // PrintAttributeValueSection (os, "AttributeContainer", false);
1612 // PrintAttributeValueWithName (os, "AttributeContainer", "AttributeContainer", "attribute-container.h");
1613 PrintMakeChecker (os, "AttributeContainer", "attribute-container.h");
1614} // PrintAttributeImplementations ()
1615
1616
1617/***************************************************************
1618 * Main
1619 ***************************************************************/
1620
1621int main (int argc, char *argv[])
1622{
1624
1625 CommandLine cmd (__FILE__);
1626 cmd.Usage ("Generate documentation for all ns-3 registered types, "
1627 "trace sources, attributes and global variables.");
1628 cmd.AddValue ("output-text", "format output as plain text", outputText);
1629 cmd.Parse (argc, argv);
1630
1631 SetMarkup ();
1632
1633
1634 // Create a Node, to force linking and instantiation of our TypeIds
1635 NodeContainer c;
1636 c.Create (1);
1637
1638 // mode-line: helpful when debugging introspected-doxygen.h
1639 if (!outputText)
1640 {
1641 std::cout << "/* -*- Mode:C++; c-file-style:\"gnu\"; "
1642 "indent-tabs-mode:nil; -*- */\n"
1643 << std::endl;
1644 }
1645
1646 std::cout << std::endl;
1647 std::cout << commentStart
1648 << file << "\n"
1649 << sectionStart << "utils\n"
1650 << "Doxygen docs generated from the TypeId database.\n"
1651 << note << "This file is automatically generated by "
1652 << codeWord << "print-introspected-doxygen.cc. Do not edit this file! "
1653 << "Edit that file instead.\n"
1654 << commentStop
1655 << std::endl;
1656
1657 PrintTypeIdBlocks (std::cout);
1658
1659 PrintAllTypeIds (std::cout);
1660 PrintAllAttributes (std::cout);
1661 PrintAllGlobals (std::cout);
1662 PrintAllLogComponents (std::cout);
1663 PrintAllTraceSources (std::cout);
1665
1666 return 0;
1667}
#define max(a, b)
Definition: 80211b.c:43
Gather aggregation and configuration path information from registered types.
void DoGather(TypeId tid)
Gather attribute, configuration path information for tid.
std::string GetCurrentPath(void) const
std::vector< std::string > GetNoTypeIds(void) const
std::vector< TypeId > m_alreadyProcessed
List of TypeIds we've already processed.
std::vector< std::string > m_noTids
List of type names without TypeIds, because those modules aren't enabled.
std::vector< std::string > m_currentPath
Current configuration path.
std::vector< std::pair< TypeId, std::string > > m_output
Configuration path for each TypeId.
std::vector< std::pair< TypeId, TypeId > > m_aggregates
List of aggregation relationships.
bool HasAlreadyBeenProcessed(TypeId tid) const
void Print(void) const
Print output in "a -> b" form on std::cout.
void RecordAggregationInfo(std::string a, std::string b)
Record the a -> b aggregation relation.
void Gather(TypeId tid)
Gather aggregation and configuration path information for tid.
std::vector< std::string > Get(TypeId tid) const
void RecordOutput(TypeId tid)
Record the current config path for tid.
Parse command-line arguments.
Definition: command-line.h:229
Vector::const_iterator Iterator
Iterator type for the list of all global values.
Definition: global-value.h:80
std::map< std::string, LogComponent * > ComponentList
LogComponent name map.
Definition: log.h:410
keep track of a set of node pointers.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
AttributeChecker implementation for ObjectPtrContainerValue.
virtual TypeId GetItemTypeId(void) const =0
Get the TypeId of the container class type.
AttributeChecker implementation for PointerValue.
Definition: pointer.h:98
virtual TypeId GetPointeeTypeId(void) const =0
Get the TypeId of the base type.
Hold variables of type string.
Definition: string.h:41
std::string Get(void) const
Definition: string.cc:31
a unique identifier for an interface.
Definition: type-id.h:59
bool IsChildOf(TypeId other) const
Check if this TypeId is a child of another.
Definition: type-id.cc:957
std::size_t GetTraceSourceN(void) const
Get the number of Trace sources.
Definition: type-id.cc:1097
std::size_t GetAttributeN(void) const
Get the number of attributes.
Definition: type-id.cc:1076
struct TypeId::TraceSourceInformation GetTraceSource(std::size_t i) const
Get the trace source by index.
Definition: type-id.cc:1103
struct TypeId::AttributeInformation GetAttribute(std::size_t i) const
Get Attribute information by index.
Definition: type-id.cc:1083
bool MustHideFromDocumentation(void) const
Check if this TypeId should not be listed in documentation.
Definition: type-id.cc:1068
TypeId GetParent(void) const
Get the parent of this TypeId.
Definition: type-id.cc:943
std::string GetName(void) const
Get the name.
Definition: type-id.cc:976
std::size_t GetSize(void) const
Get the size of this object.
Definition: type-id.cc:990
#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
Ptr< Object > GetRootNamespaceObject(uint32_t i)
Definition: config.cc:964
std::size_t GetRootNamespaceObjectN(void)
Definition: config.cc:958
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:206
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
std::string headingStart
start of section heading (h3)
std::string copyDoc
copy (or refer) to docs elsewhere
std::string breakHtmlOnly
linebreak for html output only
std::string codeWord
format next word as source code
std::string breakTextOnly
linebreak for text output only
std::string flagSpanStart
start of Attribute flag value
std::string templArgDeduced
template argument deduced from function
Every class exported by the ns3 library is enclosed in the ns3 namespace.
U * PeekPointer(const Ptr< U > &p)
Definition: ptr.h:489
cmd
Definition: second.py:43
StaticInformation GetTypicalAggregations()
Register aggregation relationships that are not automatically detected by this introspection program.
void PrintTraceSourcesTid(std::ostream &os, const TypeId tid)
Print direct Trace sources for this TypeId.
void PrintMakeAccessors(std::ostream &os, const std::string &name)
Print the AttributeValue MakeAccessor documentation for a class.
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...
void PrintAllTraceSources(std::ostream &os)
Print the list of all Trace sources.
void PrintAllLogComponents(std::ostream &os)
Print the list of all LogComponents.
void PrintAttributeHelper(std::ostream &os, const AttributeDescriptor &attr)
Print documentation corresponding to use of the ATTRIBUTE_HELPER_HEADER macro or ATTRIBUTE_VALUE_DEFI...
void PrintTypeIdBlocks(std::ostream &os)
Print the doxy block for each TypeId.
void PrintAllAttributes(std::ostream &os)
Print the list of all Attributes.
void PrintAttributeValueWithName(std::ostream &os, const std::string &name, const std::string &type, const std::string &header)
Print the AttributeValue documentation for a class.
std::map< std::string, int32_t > NameMap
Map from TypeId name to tid.
void PrintSize(std::ostream &os, const TypeId tid)
Print the size of the type represented by this tid.
void Uniquefy(T t)
Helper to keep only the unique items in a container.
void PrintAttributeImplementations(std::ostream &os)
Print documentation for Attribute implementations.
void PrintTraceSources(std::ostream &os, const TypeId tid)
Print the Trace sources block for tid, including Trace sources declared in base classes.
void SetMarkup()
Initialize the markup strings, for either doxygen or text.
NameMap::const_iterator NameMapIterator
NameMap iterator.
void PrintConfigPaths(std::ostream &os, const TypeId tid)
Print config paths.
void PrintAllTypeIds(std::ostream &os)
Print the list of all TypeIds.
void PrintAttributes(std::ostream &os, const TypeId tid)
Print the Attributes block for tid, including Attributes declared in base classes.
void PrintAllGlobals(std::ostream &os)
Print the list of all global variables.
void PrintMakeChecker(std::ostream &os, const std::string &name, const std::string &header)
Print the AttributeValue MakeChecker documentation for a class.
void PrintAttributeValueSection(std::ostream &os, const std::string &name, const bool seeBase=true)
Print the section definition for an AttributeValue.
void PrintAttributesTid(std::ostream &os, const TypeId tid)
Print direct Attributes for this TypeId.
Descriptor for an AttributeValue.
const std::string m_header
The header file name.
const std::string m_type
The name of the underlying type.
const std::string m_name
The base name of the resulting AttributeValue type.
const bool m_seeBase
Print a "see also" pointing to the base class.
Attribute implementation.
Definition: type-id.h:78
std::string name
Attribute name.
Definition: type-id.h:80
Ptr< const AttributeAccessor > accessor
Accessor object.
Definition: type-id.h:90
uint32_t flags
AttributeFlags value.
Definition: type-id.h:84
Ptr< const AttributeChecker > checker
Checker object.
Definition: type-id.h:92
Ptr< const AttributeValue > initialValue
Configured initial value.
Definition: type-id.h:88
std::string help
Attribute help string.
Definition: type-id.h:82
TraceSource implementation.
Definition: type-id.h:100
std::string name
Trace name.
Definition: type-id.h:102
std::string help
Trace help string.
Definition: type-id.h:104
std::string callback
Callback function signature type.
Definition: type-id.h:106