A Discrete-Event Network Simulator
API
print-introspected-doxygen.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2007 INRIA
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18 */
19
26#include "ns3/command-line.h"
27#include "ns3/config.h"
28#include "ns3/global-value.h"
29#include "ns3/log.h"
30#include "ns3/node-container.h"
31#include "ns3/object-vector.h"
32#include "ns3/object.h"
33#include "ns3/pointer.h"
34#include "ns3/simple-channel.h"
35#include "ns3/string.h"
36#include "ns3/system-path.h"
37
38#include <algorithm>
39#include <climits> // CHAR_BIT
40#include <iomanip>
41#include <iostream>
42#include <map>
43
44using namespace ns3;
45
46NS_LOG_COMPONENT_DEFINE("PrintIntrospectedDoxygen");
47
48namespace
49{
51bool outputText = false;
52
57std::string anchor;
58std::string argument;
59std::string boldStart;
60std::string boldStop;
61std::string breakBoth;
62std::string breakHtmlOnly;
63std::string breakTextOnly;
64std::string brief;
65std::string classStart;
66std::string classStop;
67std::string codeWord;
68std::string commentStart;
69std::string commentStop;
70std::string copyDoc;
71std::string file;
72std::string flagSpanStart;
73std::string flagSpanStop;
74std::string functionStart;
75std::string functionStop;
76std::string headingStart;
77std::string headingStop;
78// Linking: [The link text displayed](\ref TheTarget)
79std::string hrefStart;
80std::string hrefMid;
81std::string hrefStop;
82std::string indentHtmlOnly;
83std::string listLineStart;
84std::string listLineStop;
85std::string listStart;
86std::string listStop;
87std::string note;
88std::string page;
89std::string reference;
90std::string referenceNo;
91std::string returns;
92std::string sectionStart;
93std::string seeAlso;
94std::string subSectionStart;
95std::string templArgDeduced;
96std::string templArgExplicit;
97std::string templateArgument;
98std::string variable;
101} // unnamed namespace
102
108void
110{
112 if (outputText)
113 {
114 anchor = "";
115 argument = " Arg: ";
116 boldStart = "";
117 boldStop = "";
118 breakBoth = "\n";
119 breakHtmlOnly = "";
120 breakTextOnly = "\n";
121 brief = "";
122 classStart = "";
123 classStop = "\n\n";
124 codeWord = " ";
125 commentStart = "===============================================================\n";
126 commentStop = "";
127 copyDoc = " See: ";
128 file = "File: introspected-doxygen.txt";
129 flagSpanStart = "";
130 flagSpanStop = "";
131 functionStart = "";
132 functionStop = "\n\n";
133 headingStart = "";
134 headingStop = "";
135 // Linking: The link text displayed (see TheTarget)
136 hrefStart = "";
137 hrefMid = "(see ";
138 hrefStop = ")";
139 indentHtmlOnly = "";
140 listLineStart = " * ";
141 listLineStop = "";
142 listStart = "";
143 listStop = "";
144 note = "Note: ";
145 page = "Page ";
146 reference = " ";
147 referenceNo = " ";
148 returns = " Returns: ";
149 sectionStart = "Section: ";
150 seeAlso = " See: ";
151 subSectionStart = "Subsection ";
152 templArgDeduced = "[deduced] ";
153 templArgExplicit = "[explicit] ";
154 templateArgument = "Template Arg: ";
155 variable = "Variable: ";
156 }
157 else
158 {
159 anchor = "\\anchor ";
160 argument = "\\param ";
161 boldStart = "<b>";
162 boldStop = "</b>";
163 breakBoth = "<br>";
164 breakHtmlOnly = "<br>";
165 breakTextOnly = "";
166 brief = "\\brief ";
167 classStart = "\\class ";
168 classStop = "";
169 codeWord = "\\p ";
170 commentStart = "/*!\n";
171 commentStop = "*/\n";
172 copyDoc = "\\copydoc ";
173 file = "\\file";
174 flagSpanStart = "<span class=\"mlabel\">";
175 flagSpanStop = "</span>";
176 functionStart = "\\fn ";
177 functionStop = "";
178 headingStart = "<h3>";
179 headingStop = "</h3>";
180 // Linking: [The link text displayed](\ref TheTarget)
181 hrefStart = "[";
182 hrefMid = "](\\ref ";
183 hrefStop = ")";
184 indentHtmlOnly = " ";
185 listLineStart = "<li>";
186 listLineStop = "</li>";
187 listStart = "<ul>";
188 listStop = "</ul>";
189 note = "\\note ";
190 page = "\\page ";
191 reference = " \\ref ";
192 referenceNo = " %";
193 returns = "\\returns ";
194 sectionStart = "\\ingroup ";
195 seeAlso = "\\see ";
196 subSectionStart = "\\addtogroup ";
197 templArgDeduced = "\\deduced ";
198 templArgExplicit = "\\explicit ";
199 templateArgument = "\\tparam ";
200 variable = "\\var ";
201 }
202} // SetMarkup ()
203
204/***************************************************************
205 * Aggregation and configuration paths
206 ***************************************************************/
207
212{
213 public:
220 void RecordAggregationInfo(std::string a, std::string b);
226 void Gather(TypeId tid);
230 void Print() const;
231
237 std::vector<std::string> Get(TypeId tid) const;
238
242 std::vector<std::string> GetNoTypeIds() const;
243
244 private:
248 std::string GetCurrentPath() const;
254 void DoGather(TypeId tid);
260 void RecordOutput(TypeId tid);
266 bool HasAlreadyBeenProcessed(TypeId tid) const;
270 std::vector<std::pair<TypeId, std::string>> m_output;
274 std::vector<std::string> m_currentPath;
278 std::vector<TypeId> m_alreadyProcessed;
282 std::vector<std::pair<TypeId, TypeId>> m_aggregates;
289 mutable std::vector<std::string> m_noTids;
290
291}; // class StaticInformation
292
293void
294StaticInformation::RecordAggregationInfo(std::string a, std::string b)
295{
296 NS_LOG_FUNCTION(this << a << b);
297 TypeId aTid;
298 bool found = TypeId::LookupByNameFailSafe(a, &aTid);
299 if (!found)
300 {
301 m_noTids.push_back(a);
302 return;
303 }
304 TypeId bTid;
305 found = TypeId::LookupByNameFailSafe(b, &bTid);
306 if (!found)
307 {
308 m_noTids.push_back(b);
309 return;
310 }
311
312 m_aggregates.emplace_back(aTid, bTid);
313}
314
315void
317{
318 NS_LOG_FUNCTION(this);
319 for (const auto& item : m_output)
320 {
321 std::cout << item.first.GetName() << " -> " << item.second << std::endl;
322 }
323}
324
325std::string
327{
328 NS_LOG_FUNCTION(this);
329 std::ostringstream oss;
330 for (const auto& item : m_currentPath)
331 {
332 oss << "/" << item;
333 }
334 return oss.str();
335}
336
337void
339{
340 NS_LOG_FUNCTION(this << tid);
341 m_output.emplace_back(tid, GetCurrentPath());
342}
343
344bool
346{
347 NS_LOG_FUNCTION(this << tid);
348 for (const auto& it : m_alreadyProcessed)
349 {
350 if (it == tid)
351 {
352 return true;
353 }
354 }
355 return false;
356}
357
358std::vector<std::string>
360{
361 NS_LOG_FUNCTION(this << tid);
362 std::vector<std::string> paths;
363 for (const auto& item : m_output)
364 {
365 if (item.first == tid)
366 {
367 paths.push_back(item.second);
368 }
369 }
370 return paths;
371}
372
388template <typename T>
389void
391{
392 std::sort(t.begin(), t.end());
393 t.erase(std::unique(t.begin(), t.end()), t.end());
394}
395
396std::vector<std::string>
398{
399 NS_LOG_FUNCTION(this);
401 return m_noTids;
402}
403
404void
406{
407 NS_LOG_FUNCTION(this << tid);
408 DoGather(tid);
410}
411
412void
414{
415 NS_LOG_FUNCTION(this << tid);
417 {
418 return;
419 }
420 RecordOutput(tid);
421 for (uint32_t i = 0; i < tid.GetAttributeN(); ++i)
422 {
423 struct TypeId::AttributeInformation info = tid.GetAttribute(i);
424 const PointerChecker* ptrChecker =
425 dynamic_cast<const PointerChecker*>(PeekPointer(info.checker));
426 if (ptrChecker != nullptr)
427 {
428 TypeId pointee = ptrChecker->GetPointeeTypeId();
429
430 // See if this is a pointer to an Object.
431 Ptr<Object> object = CreateObject<Object>();
432 TypeId objectTypeId = object->GetTypeId();
433 if (objectTypeId == pointee)
434 {
435 // Stop the recursion at this attribute if it is a
436 // pointer to an Object, which create too many spurious
437 // paths in the list of attribute paths because any
438 // Object can be in that part of the path.
439 continue;
440 }
441
442 m_currentPath.push_back(info.name);
443 m_alreadyProcessed.push_back(tid);
444 DoGather(pointee);
445 m_alreadyProcessed.pop_back();
446 m_currentPath.pop_back();
447 continue;
448 }
449 // attempt to cast to an object vector.
450 const ObjectPtrContainerChecker* vectorChecker =
451 dynamic_cast<const ObjectPtrContainerChecker*>(PeekPointer(info.checker));
452 if (vectorChecker != nullptr)
453 {
454 TypeId item = vectorChecker->GetItemTypeId();
455 m_currentPath.push_back(info.name + "/[i]");
456 m_alreadyProcessed.push_back(tid);
457 DoGather(item);
458 m_alreadyProcessed.pop_back();
459 m_currentPath.pop_back();
460 continue;
461 }
462 }
463 for (uint32_t j = 0; j < TypeId::GetRegisteredN(); j++)
464 {
465 TypeId child = TypeId::GetRegistered(j);
466 if (child.IsChildOf(tid))
467 {
468 std::string childName = "$" + child.GetName();
469 m_currentPath.push_back(childName);
470 m_alreadyProcessed.push_back(tid);
471 DoGather(child);
472 m_alreadyProcessed.pop_back();
473 m_currentPath.pop_back();
474 }
475 }
476 for (const auto& item : m_aggregates)
477 {
478 if (item.first == tid || item.second == tid)
479 {
480 TypeId other;
481 if (item.first == tid)
482 {
483 other = item.second;
484 }
485 if (item.second == tid)
486 {
487 other = item.first;
488 }
489 std::string name = "$" + other.GetName();
490 m_currentPath.push_back(name);
491 m_alreadyProcessed.push_back(tid);
492 DoGather(other);
493 m_alreadyProcessed.pop_back();
494 m_currentPath.pop_back();
495 }
496 }
497} // StaticInformation::DoGather ()
498
505{
507
508 static StaticInformation info;
509 static bool mapped = false;
510
511 if (mapped)
512 {
513 return info;
514 }
515
516 // Short circuit next call
517 mapped = true;
518
519 // The below statements register typical aggregation relationships
520 // in ns-3 programs, that otherwise aren't picked up automatically
521 // by the creation of the above node. To manually list other common
522 // aggregation relationships that you would like to see show up in
523 // the list of configuration paths in the doxygen, add additional
524 // statements below.
525 info.RecordAggregationInfo("ns3::Node", "ns3::TcpSocketFactory");
526 info.RecordAggregationInfo("ns3::Node", "ns3::UdpSocketFactory");
527 info.RecordAggregationInfo("ns3::Node", "ns3::PacketSocketFactory");
528 info.RecordAggregationInfo("ns3::Node", "ns3::MobilityModel");
529 info.RecordAggregationInfo("ns3::Node", "ns3::Ipv4L3Protocol");
530 info.RecordAggregationInfo("ns3::Node", "ns3::Ipv4NixVectorRouting");
531 info.RecordAggregationInfo("ns3::Node", "ns3::Icmpv4L4Protocol");
532 info.RecordAggregationInfo("ns3::Node", "ns3::ArpL3Protocol");
533 info.RecordAggregationInfo("ns3::Node", "ns3::Icmpv4L4Protocol");
534 info.RecordAggregationInfo("ns3::Node", "ns3::UdpL4Protocol");
535 info.RecordAggregationInfo("ns3::Node", "ns3::Ipv6L3Protocol");
536 info.RecordAggregationInfo("ns3::Node", "ns3::Icmpv6L4Protocol");
537 info.RecordAggregationInfo("ns3::Node", "ns3::TcpL4Protocol");
538 info.RecordAggregationInfo("ns3::Node", "ns3::RipNg");
539 info.RecordAggregationInfo("ns3::Node", "ns3::GlobalRouter");
540 info.RecordAggregationInfo("ns3::Node", "ns3::aodv::RoutingProtocol");
541 info.RecordAggregationInfo("ns3::Node", "ns3::dsdv::RoutingProtocol");
542 info.RecordAggregationInfo("ns3::Node", "ns3::dsr::DsrRouting");
543 info.RecordAggregationInfo("ns3::Node", "ns3::olsr::RoutingProtocol");
544 info.RecordAggregationInfo("ns3::Node", "ns3::EnergyHarvesterContainer");
545 info.RecordAggregationInfo("ns3::Node", "ns3::EnergySourceContainer");
546
547 // Create a channel object so that channels appear in the namespace
548 // paths that will be generated here.
549 Ptr<SimpleChannel> simpleChannel;
550 simpleChannel = CreateObject<SimpleChannel>();
551
552 for (uint32_t i = 0; i < Config::GetRootNamespaceObjectN(); ++i)
553 {
555 info.Gather(object->GetInstanceTypeId());
556 }
557
558 return info;
559
560} // GetTypicalAggregations ()
561
563typedef std::map<std::string, int32_t> NameMap;
564typedef NameMap::const_iterator NameMapIterator;
565
574{
576
577 static NameMap nameMap;
578 static bool mapped = false;
579
580 if (mapped)
581 {
582 return nameMap;
583 }
584
585 // Short circuit next call
586 mapped = true;
587
588 // Get typical aggregation relationships.
590
591 // Registered types
592 for (uint32_t i = 0; i < TypeId::GetRegisteredN(); i++)
593 {
594 TypeId tid = TypeId::GetRegistered(i);
596 {
597 continue;
598 }
599
600 // Capitalize all of letters in the name so that it sorts
601 // correctly in the map.
602 std::string name = tid.GetName();
603 std::transform(name.begin(), name.end(), name.begin(), ::toupper);
604
605 // Save this name's index.
606 nameMap[name] = i;
607 }
608
609 // Type names without TypeIds
610 std::vector<std::string> noTids = info.GetNoTypeIds();
611 for (const auto& item : noTids)
612 {
613 nameMap[item] = -1;
614 }
615
616 return nameMap;
617} // GetNameMap ()
618
619/***************************************************************
620 * Docs for a single TypeId
621 ***************************************************************/
622
628void
629PrintConfigPaths(std::ostream& os, const TypeId tid)
630{
631 NS_LOG_FUNCTION(tid);
632 std::vector<std::string> paths = GetTypicalAggregations().Get(tid);
633
634 // Config --------------
635 if (paths.empty())
636 {
637 os << "Introspection did not find any typical Config paths." << breakBoth << std::endl;
638 }
639 else
640 {
641 os << headingStart << "Config Paths" << headingStop << std::endl;
642 os << std::endl;
643 os << tid.GetName() << " is accessible through the following paths"
644 << " with Config::Set and Config::Connect:" << std::endl;
645 os << listStart << std::endl;
646 for (const auto& path : paths)
647 {
648 os << listLineStart << "\"" << path << "\"" << listLineStop << breakTextOnly
649 << std::endl;
650 }
651 os << listStop << std::endl;
652 }
653} // PrintConfigPaths ()
654
663void
664PrintAttributesTid(std::ostream& os, const TypeId tid)
665{
666 NS_LOG_FUNCTION(tid);
667 os << listStart << std::endl;
668 for (uint32_t j = 0; j < tid.GetAttributeN(); j++)
669 {
670 struct TypeId::AttributeInformation info = tid.GetAttribute(j);
671 os << listLineStart << boldStart << info.name << boldStop << ": " << info.help << std::endl;
672 os << indentHtmlOnly << listStart << std::endl;
673 os << " " << listLineStart << "Set with class: " << reference
674 << info.checker->GetValueTypeName() << listLineStop << std::endl;
675
676 std::string underType;
677 if (info.checker->HasUnderlyingTypeInformation())
678 {
679 os << " " << listLineStart << "Underlying type: ";
680
681 std::string valType = info.checker->GetValueTypeName();
682 underType = info.checker->GetUnderlyingTypeInformation();
683 bool handled = false;
684 if ((valType != "ns3::EnumValue") && (underType != "std::string"))
685 {
686 // Indirect cases to handle
687 if (valType == "ns3::PointerValue")
688 {
689 const PointerChecker* ptrChecker =
690 dynamic_cast<const PointerChecker*>(PeekPointer(info.checker));
691 if (ptrChecker != nullptr)
692 {
693 os << reference << "ns3::Ptr"
694 << "< " << reference << ptrChecker->GetPointeeTypeId().GetName() << ">";
695 handled = true;
696 }
697 }
698 else if (valType == "ns3::ObjectPtrContainerValue")
699 {
700 const ObjectPtrContainerChecker* ptrChecker =
701 dynamic_cast<const ObjectPtrContainerChecker*>(PeekPointer(info.checker));
702 if (ptrChecker != nullptr)
703 {
704 os << reference << "ns3::Ptr"
705 << "< " << reference << ptrChecker->GetItemTypeId().GetName() << ">";
706 handled = true;
707 }
708 }
709
710 // Helper to match first part of string
711 class StringBeginMatcher
712 {
713 public:
714 StringBeginMatcher(const std::string s)
715 : m_string(s){};
716
717 bool operator()(const std::string t)
718 {
719 std::size_t pos = m_string.find(t);
720 return pos == 0;
721 };
722
723 private:
724 std::string m_string;
725 };
726
727 StringBeginMatcher match(underType);
728
729 if (match("bool") || match("double") || match("int8_t") || match("uint8_t") ||
730 match("int16_t") || match("uint16_t") || match("int32_t") ||
731 match("uint32_t") || match("int64_t") || match("uint64_t"))
732 {
733 os << underType;
734 handled = true;
735 }
736 }
737 if (!handled)
738 {
739 os << codeWord << underType;
740 }
741 os << listLineStop << std::endl;
742 }
743 if (info.flags & TypeId::ATTR_CONSTRUCT && info.accessor->HasSetter())
744 {
745 std::string value = info.initialValue->SerializeToString(info.checker);
746 if (underType == "std::string" && value == "")
747 {
748 value = "\"\"";
749 }
750 os << " " << listLineStart << "Initial value: " << value << listLineStop
751 << std::endl;
752 }
753 bool moreFlags{false};
754 os << " " << listLineStart << "Flags: ";
755 if (info.flags & TypeId::ATTR_CONSTRUCT && info.accessor->HasSetter())
756 {
757 os << flagSpanStart << "construct" << flagSpanStop;
758 moreFlags = true;
759 }
760 if (info.flags & TypeId::ATTR_SET && info.accessor->HasSetter())
761 {
762 os << (outputText && moreFlags ? ", " : "") << flagSpanStart << "write" << flagSpanStop;
763 moreFlags = true;
764 }
765 if (info.flags & TypeId::ATTR_GET && info.accessor->HasGetter())
766 {
767 os << (outputText && moreFlags ? ", " : "") << flagSpanStart << "read" << flagSpanStop;
768 moreFlags = true;
769 }
770 os << listLineStop << std::endl;
771 os << indentHtmlOnly << listStop << std::endl;
772 }
773 os << listStop << std::endl;
774} // PrintAttributesTid ()
775
786void
787PrintAttributes(std::ostream& os, const TypeId tid)
788{
789 NS_LOG_FUNCTION(tid);
790 if (tid.GetAttributeN() == 0)
791 {
792 os << "No Attributes are defined for this type." << breakBoth << std::endl;
793 }
794 else
795 {
796 os << headingStart << "Attributes" << headingStop << std::endl;
797 PrintAttributesTid(os, tid);
798 }
799
800 // Attributes from base classes
801 TypeId tmp = tid.GetParent();
802 while (tmp.GetParent() != tmp)
803 {
804 if (tmp.GetAttributeN() != 0)
805 {
806 os << headingStart << "Attributes defined in parent class " << tmp.GetName()
807 << headingStop << std::endl;
808 PrintAttributesTid(os, tmp);
809 }
810 tmp = tmp.GetParent();
811
812 } // Attributes
813} // PrintAttributes ()
814
823void
824PrintTraceSourcesTid(std::ostream& os, const TypeId tid)
825{
826 NS_LOG_FUNCTION(tid);
827 os << listStart << std::endl;
828 for (uint32_t i = 0; i < tid.GetTraceSourceN(); ++i)
829 {
831 os << listLineStart << boldStart << info.name << boldStop << ": " << info.help << breakBoth;
832 if (!outputText)
833 {
834 // '%' prevents doxygen from linking to the Callback class...
835 os << "%";
836 }
837 os << "Callback signature: " << info.callback << std::endl;
838 os << listLineStop << std::endl;
839 }
840 os << listStop << std::endl;
841} // PrintTraceSourcesTid ()
842
853void
854PrintTraceSources(std::ostream& os, const TypeId tid)
855{
856 NS_LOG_FUNCTION(tid);
857 if (tid.GetTraceSourceN() == 0)
858 {
859 os << "No TraceSources are defined for this type." << breakBoth << std::endl;
860 }
861 else
862 {
863 os << headingStart << "TraceSources" << headingStop << std::endl;
864 PrintTraceSourcesTid(os, tid);
865 }
866
867 // Trace sources from base classes
868 TypeId tmp = tid.GetParent();
869 while (tmp.GetParent() != tmp)
870 {
871 if (tmp.GetTraceSourceN() != 0)
872 {
873 os << headingStart << "TraceSources defined in parent class " << tmp.GetName()
874 << headingStop << std::endl;
875 PrintTraceSourcesTid(os, tmp);
876 }
877 tmp = tmp.GetParent();
878 }
879
880} // PrintTraceSources ()
881
888void
889PrintSize(std::ostream& os, const TypeId tid)
890{
891 NS_LOG_FUNCTION(tid);
892 NS_ASSERT_MSG(CHAR_BIT != 0, "CHAR_BIT is zero");
893
894 std::size_t arch = (sizeof(void*) * CHAR_BIT);
895
896 os << boldStart << "Size" << boldStop << " of this type is " << tid.GetSize() << " bytes (on a "
897 << arch << "-bit architecture)." << std::endl;
898} // PrintSize ()
899
905void
906PrintTypeIdBlocks(std::ostream& os)
907{
909
910 NameMap nameMap = GetNameMap();
911
912 // Iterate over the map, which will print the class names in
913 // alphabetical order.
914 for (const auto& item : nameMap)
915 {
916 // Handle only real TypeIds
917 if (item.second < 0)
918 {
919 continue;
920 }
921 // Get the class's index out of the map;
922 TypeId tid = TypeId::GetRegistered(item.second);
923 std::string name = tid.GetName();
924
925 std::cout << commentStart << std::endl;
926
927 std::cout << classStart << name << std::endl;
928 std::cout << std::endl;
929
930 PrintConfigPaths(std::cout, tid);
931 PrintAttributes(std::cout, tid);
932 PrintTraceSources(std::cout, tid);
933 PrintSize(std::cout, tid);
934
935 std::cout << commentStop << std::endl;
936 } // for class documentation
937
938} // PrintTypeIdBlocks
939
940/***************************************************************
941 * Lists of All things
942 ***************************************************************/
943
949void
950PrintAllTypeIds(std::ostream& os)
951{
953 os << commentStart << page << "TypeIdList All ns3::TypeId's\n" << std::endl;
954 os << "This is a list of all" << reference << "ns3::TypeId's.\n"
955 << "For more information see the" << reference << "ns3::TypeId "
956 << "section of this API documentation and the" << referenceNo << "TypeId section "
957 << "in the Configuration and " << referenceNo << "Attributes chapter of the Manual.\n"
958 << std::endl;
959
960 os << listStart << std::endl;
961
962 NameMap nameMap = GetNameMap();
963 // Iterate over the map, which will print the class names in
964 // alphabetical order.
965 for (const auto& item : nameMap)
966 {
967 // Handle only real TypeIds
968 if (item.second < 0)
969 {
970 continue;
971 }
972 // Get the class's index out of the map;
973 TypeId tid = TypeId::GetRegistered(item.second);
974
976 << listLineStop << std::endl;
977 }
978 os << listStop << std::endl;
979 os << commentStop << std::endl;
980
981} // PrintAllTypeIds ()
982
991void
992PrintAllAttributes(std::ostream& os)
993{
995 os << commentStart << page << "AttributeList All Attributes\n" << std::endl;
996 os << "This is a list of all" << reference << "attributes classes. "
997 << "For more information see the" << reference << "attributes "
998 << "section of this API documentation and the Attributes sections "
999 << "in the Tutorial and Manual.\n"
1000 << std::endl;
1001
1002 NameMap nameMap = GetNameMap();
1003 // Iterate over the map, which will print the class names in
1004 // alphabetical order.
1005 for (const auto& item : nameMap)
1006 {
1007 // Handle only real TypeIds
1008 if (item.second < 0)
1009 {
1010 continue;
1011 }
1012 // Get the class's index out of the map;
1013 TypeId tid = TypeId::GetRegistered(item.second);
1014
1015 if (tid.GetAttributeN() == 0)
1016 {
1017 continue;
1018 }
1019 os << boldStart << tid.GetName() << boldStop << breakHtmlOnly << std::endl;
1020
1021 os << listStart << std::endl;
1022 for (uint32_t j = 0; j < tid.GetAttributeN(); ++j)
1023 {
1024 struct TypeId::AttributeInformation info = tid.GetAttribute(j);
1025 os << listLineStart << boldStart << info.name << boldStop << ": " << info.help
1026 << listLineStop << std::endl;
1027 }
1028 os << listStop << std::endl;
1029 }
1030 os << commentStop << std::endl;
1031
1032} // PrintAllAttributes ()
1033
1039void
1040PrintAllGlobals(std::ostream& os)
1041{
1043 os << commentStart << page << "GlobalValueList All GlobalValues\n" << std::endl;
1044 os << "This is a list of all" << reference << "ns3::GlobalValue instances.\n"
1045 << "See ns3::GlobalValue for how to set these." << std::endl;
1046
1047 os << listStart << std::endl;
1048 for (GlobalValue::Iterator i = GlobalValue::Begin(); i != GlobalValue::End(); ++i)
1049 {
1050 StringValue val;
1051 (*i)->GetValue(val);
1052 os << indentHtmlOnly << listLineStart << boldStart << hrefStart << (*i)->GetName()
1053 << hrefMid << "GlobalValue" << (*i)->GetName() << hrefStop << boldStop << ": "
1054 << (*i)->GetHelp() << ". Default value: " << val.Get() << "." << listLineStop
1055 << std::endl;
1056 }
1057 os << listStop << std::endl;
1058 os << commentStop << std::endl;
1059
1060} // PrintAllGlobals ()
1061
1067void
1068PrintAllLogComponents(std::ostream& os)
1069{
1071 os << commentStart << page << "LogComponentList All LogComponents\n" << std::endl;
1072 os << "This is a list of all" << reference << "ns3::LogComponent instances.\n" << std::endl;
1073
1078 LogComponent::ComponentList* logs = LogComponent::GetComponentList();
1079 // Find longest log name
1080 std::size_t widthL = std::string("Log Component").size();
1081 std::size_t widthR = std::string("file").size();
1082 for (const auto& it : (*logs))
1083 {
1084 widthL = std::max(widthL, it.first.size());
1085 std::string file = it.second->File();
1086 // Strip leading "../" related to depth in build directory
1087 // since doxygen only sees the path starting with "src/", etc.
1088 while (file.find("../") == 0)
1089 {
1090 file = file.substr(3);
1091 }
1092 widthR = std::max(widthR, file.size());
1093 }
1094 const std::string tLeft("| ");
1095 const std::string tMid(" | ");
1096 const std::string tRight(" |");
1097
1098 // Header line has to be padded to same length as separator line
1099 os << tLeft << std::setw(widthL) << std::left << "Log Component" << tMid << std::setw(widthR)
1100 << std::left << "File" << tRight << std::endl;
1101 os << tLeft << ":" << std::string(widthL - 1, '-') << tMid << ":"
1102 << std::string(widthR - 1, '-') << tRight << std::endl;
1103
1104 LogComponent::ComponentList::const_iterator it;
1105 for (const auto& it : (*logs))
1106 {
1107 std::string file = it.second->File();
1108 // Strip leading "../" related to depth in build directory
1109 // since doxygen only sees the path starting with "src/", etc.
1110 while (file.find("../") == 0)
1111 {
1112 file = file.substr(3);
1113 }
1114
1115 os << tLeft << std::setw(widthL) << std::left << it.first << tMid << std::setw(widthR)
1116 << file << tRight << std::endl;
1117 }
1118 os << std::right << std::endl;
1119 os << commentStop << std::endl;
1120} // PrintAllLogComponents ()
1121
1130void
1131PrintAllTraceSources(std::ostream& os)
1132{
1134 os << commentStart << page << "TraceSourceList All TraceSources\n" << std::endl;
1135 os << "This is a list of all" << reference << "tracing sources. "
1136 << "For more information see the " << reference << "tracing "
1137 << "section of this API documentation and the Tracing sections "
1138 << "in the Tutorial and Manual.\n"
1139 << std::endl;
1140
1141 NameMap nameMap = GetNameMap();
1142
1143 // Iterate over the map, which will print the class names in
1144 // alphabetical order.
1145 for (const auto& item : nameMap)
1146 {
1147 // Handle only real TypeIds
1148 if (item.second < 0)
1149 {
1150 continue;
1151 }
1152 // Get the class's index out of the map;
1153 TypeId tid = TypeId::GetRegistered(item.second);
1154
1155 if (tid.GetTraceSourceN() == 0)
1156 {
1157 continue;
1158 }
1159 os << boldStart << tid.GetName() << boldStop << breakHtmlOnly << std::endl;
1160
1161 os << listStart << std::endl;
1162 for (uint32_t j = 0; j < tid.GetTraceSourceN(); ++j)
1163 {
1165 os << listLineStart << boldStart << info.name << boldStop << ": " << info.help
1166 << listLineStop << std::endl;
1167 }
1168 os << listStop << std::endl;
1169 }
1170 os << commentStop << std::endl;
1171
1172} // PrintAllTraceSources ()
1173
1174/***************************************************************
1175 * Docs for Attribute classes
1176 ***************************************************************/
1177
1191void
1192PrintAttributeValueSection(std::ostream& os, const std::string& name, const bool seeBase = true)
1193{
1194 NS_LOG_FUNCTION(name);
1195 std::string section = "attribute_" + name;
1196
1197 // \ingroup attributes
1198 // \defgroup attribute_<name>Value <name> Attribute
1199 os << commentStart << sectionStart << "attributes\n"
1200 << subSectionStart << "attribute_" << name << " " << name << " Attribute\n"
1201 << "AttributeValue implementation for " << name << "\n";
1202 if (seeBase)
1203 {
1204 // Some classes don't live in ns3::. Yuck
1205 if (name != "IeMeshId")
1206 {
1207 os << seeAlso << "ns3::" << name << "\n";
1208 }
1209 else
1210 {
1211 os << seeAlso << "ns3::dot11s::" << name << "\n";
1212 }
1213 }
1214 os << commentStop;
1215
1216} // PrintAttributeValueSection ()
1217
1228void
1230 const std::string& name,
1231 const std::string& type,
1232 const std::string& header)
1233{
1234 NS_LOG_FUNCTION(name << type << header);
1235 std::string sectAttr = sectionStart + "attribute_" + name;
1236
1237 // \ingroup attribute_<name>Value
1238 // \class ns3::<name>Value "header"
1239 std::string valClass = name + "Value";
1240 std::string qualClass = " ns3::" + valClass;
1241
1242 os << commentStart << sectAttr << std::endl;
1243 os << classStart << qualClass << " \"" << header << "\"" << std::endl;
1244 os << "AttributeValue implementation for " << name << "." << std::endl;
1245 os << seeAlso << "AttributeValue" << std::endl;
1246 os << commentStop;
1247
1248 // Copy ctor: <name>Value::<name>Value
1249 os << commentStart << functionStart << name << qualClass << "::" << valClass;
1250 if ((name == "EmptyAttribute") || (name == "ObjectPtrContainer"))
1251 {
1252 // Just default constructors.
1253 os << "()\n";
1254 }
1255 else
1256 {
1257 // Copy constructors
1258 os << "(const " << type << " & value)\n"
1259 << "Copy constructor.\n"
1260 << argument << "[in] value The " << name << " value to copy.\n";
1261 }
1262 os << commentStop;
1263
1264 // <name>Value::Get () const
1265 os << commentStart << functionStart << type << qualClass << "::Get () const\n"
1266 << returns << "The " << name << " value.\n"
1267 << commentStop;
1268
1269 // <name>Value::GetAccessor (T & value) const
1270 os << commentStart << functionStart << "bool" << qualClass
1271 << "::GetAccessor (T & value) const\n"
1272 << "Access the " << name << " value as type " << codeWord << "T.\n"
1273 << templateArgument << "T " << templArgExplicit << "The type to cast to.\n"
1274 << argument << "[out] value The " << name << " value, as type " << codeWord << "T.\n"
1275 << returns << "true.\n"
1276 << commentStop;
1277
1278 // <name>Value::Set (const name & value)
1279 if (type != "Callback") // Yuck
1280 {
1281 os << commentStart << functionStart << "void" << qualClass << "::Set (const " << type
1282 << " & value)\n"
1283 << "Set the value.\n"
1284 << argument << "[in] value The value to adopt.\n"
1285 << commentStop;
1286 }
1287
1288 // <name>Value::m_value
1289 os << commentStart << variable << type << qualClass << "::m_value\n"
1290 << "The stored " << name << " instance.\n"
1291 << commentStop << std::endl;
1292
1293} // PrintAttributeValueWithName ()
1294
1303void
1304PrintMakeAccessors(std::ostream& os, const std::string& name)
1305{
1306 NS_LOG_FUNCTION(name);
1307 std::string sectAttr = sectionStart + "attribute_" + name + "\n";
1308 std::string make = "ns3::Make" + name + "Accessor ";
1309
1310 // \ingroup attribute_<name>Value
1311 // Make<name>Accessor (T1 a1)
1312 os << commentStart << sectAttr << functionStart << "ns3::Ptr<const ns3::AttributeAccessor> "
1313 << make << "(T1 a1)\n"
1314 << copyDoc << "ns3::MakeAccessorHelper(T1)\n"
1315 << seeAlso << "AttributeAccessor\n"
1316 << commentStop;
1317
1318 // \ingroup attribute_<name>Value
1319 // Make<name>Accessor (T1 a1)
1320 os << commentStart << sectAttr << functionStart << "ns3::Ptr<const ns3::AttributeAccessor> "
1321 << make << "(T1 a1, T2 a2)\n"
1322 << copyDoc << "ns3::MakeAccessorHelper(T1,T2)\n"
1323 << seeAlso << "AttributeAccessor\n"
1324 << commentStop;
1325} // PrintMakeAccessors ()
1326
1336void
1337PrintMakeChecker(std::ostream& os, const std::string& name, const std::string& header)
1338{
1339 NS_LOG_FUNCTION(name << header);
1340 std::string sectAttr = sectionStart + "attribute_" + name + "\n";
1341 std::string make = "ns3::Make" + name + "Checker ";
1342
1343 // \ingroup attribute_<name>Value
1344 // class <name>Checker
1345 os << commentStart << sectAttr << std::endl;
1346 os << classStart << " ns3::" << name << "Checker"
1347 << " \"" << header << "\"" << std::endl;
1348 os << "AttributeChecker implementation for " << name << "Value." << std::endl;
1349 os << seeAlso << "AttributeChecker" << std::endl;
1350 os << commentStop;
1351
1352 // \ingroup attribute_<name>Value
1353 // Make<name>Checker ()
1354 os << commentStart << sectAttr << functionStart << "ns3::Ptr<const ns3::AttributeChecker> "
1355 << make << "()\n"
1356 << returns << "The AttributeChecker.\n"
1357 << seeAlso << "AttributeChecker\n"
1358 << commentStop;
1359} // PrintMakeChecker ()
1360
1362typedef struct
1363{
1364 const std::string m_name;
1365 const std::string m_type;
1366 const bool m_seeBase;
1367 const std::string m_header;
1369
1378void
1379PrintAttributeHelper(std::ostream& os, const AttributeDescriptor& attr)
1380{
1381 NS_LOG_FUNCTION(attr.m_name << attr.m_type << attr.m_seeBase << attr.m_header);
1383 PrintAttributeValueWithName(os, attr.m_name, attr.m_type, attr.m_header);
1384 PrintMakeAccessors(os, attr.m_name);
1385 PrintMakeChecker(os, attr.m_name, attr.m_header);
1386} // PrintAttributeHelper ()
1387
1392void
1394{
1396
1397 // clang-format off
1398 const AttributeDescriptor attributes [] =
1399 {
1400 // Name Type see Base header-file
1401 // Users of ATTRIBUTE_HELPER_HEADER
1402 //
1403 { "Address", "Address", true, "address.h" },
1404 { "Box", "Box", true, "box.h" },
1405 { "DataRate", "DataRate", true, "data-rate.h" },
1406 { "Length", "Length", true, "length.h" },
1407 { "IeMeshId", "IeMeshId", true, "ie-dot11s-id.h" },
1408 { "Ipv4Address", "Ipv4Address", true, "ipv4-address.h" },
1409 { "Ipv4Mask", "Ipv4Mask", true, "ipv4-address.h" },
1410 { "Ipv6Address", "Ipv6Address", true, "ipv6-address.h" },
1411 { "Ipv6Prefix", "Ipv6Prefix", true, "ipv6-address.h" },
1412 { "Mac16Address", "Mac16Address", true, "mac16-address.h" },
1413 { "Mac48Address", "Mac48Address", true, "mac48-address.h" },
1414 { "Mac64Address", "Mac64Address", true, "mac64-address.h" },
1415 { "ObjectFactory", "ObjectFactory", true, "object-factory.h" },
1416 { "OrganizationIdentifier",
1417 "OrganizationIdentifier",
1418 true, "vendor-specific-action.h" },
1419 { "Priomap", "Priomap", true, "prio-queue-disc.h" },
1420 { "QueueSize", "QueueSize", true, "queue-size.h" },
1421 { "Rectangle", "Rectangle", true, "rectangle.h" },
1422 { "Ssid", "Ssid", true, "ssid.h" },
1423 { "TypeId", "TypeId", true, "type-id.h" },
1424 { "UanModesList", "UanModesList", true, "uan-tx-mode.h" },
1425 { "ValueClassTest", "ValueClassTest", false, "attribute-test-suite.cc" /* core/test/ */ },
1426 { "Vector", "Vector", true, "vector.h" },
1427 { "Vector2D", "Vector2D", true, "vector.h" },
1428 { "Vector3D", "Vector3D", true, "vector.h" },
1429 { "Waypoint", "Waypoint", true, "waypoint.h" },
1430 { "WifiMode", "WifiMode", true, "wifi-mode.h" },
1431
1432 // All three (Value, Access and Checkers) defined, but custom
1433 { "Boolean", "bool", false, "boolean.h" },
1434 { "Callback", "Callback", true, "callback.h" },
1435 { "Double", "double", false, "double.h" },
1436 { "Enum", "int", false, "enum.h" },
1437 { "Integer", "int64_t", false, "integer.h" },
1438 { "Pointer", "Pointer", false, "pointer.h" },
1439 { "String", "std::string", false, "string.h" },
1440 { "Time", "Time", true, "nstime.h" },
1441 { "Uinteger", "uint64_t", false, "uinteger.h" },
1442 { "", "", false, "last placeholder" }
1443 };
1444 // clang-format on
1445
1446 int i = 0;
1447 while (attributes[i].m_name != "")
1448 {
1449 PrintAttributeHelper(os, attributes[i]);
1450 ++i;
1451 }
1452
1453 // Special cases
1454 PrintAttributeValueSection(os, "EmptyAttribute", false);
1455 PrintAttributeValueWithName(os, "EmptyAttribute", "EmptyAttribute", "attribute.h");
1456
1457 PrintAttributeValueSection(os, "ObjectPtrContainer", false);
1459 "ObjectPtrContainer",
1460 "ObjectPtrContainer",
1461 "object-ptr-container.h");
1462 PrintMakeChecker(os, "ObjectPtrContainer", "object-ptr-container.h");
1463
1464 PrintAttributeValueSection(os, "ObjectVector", false);
1465 PrintMakeAccessors(os, "ObjectVector");
1466 PrintMakeChecker(os, "ObjectVector", "object-vector.h");
1467
1468 PrintAttributeValueSection(os, "ObjectMap", false);
1469 PrintMakeAccessors(os, "ObjectMap");
1470 PrintMakeChecker(os, "ObjectMap", "object-map.h");
1471
1472 PrintAttributeValueSection(os, "Pair", false);
1473 PrintAttributeValueWithName(os, "Pair", "std::pair<A, B>", "pair.h");
1474 PrintMakeChecker(os, "Pair", "pair.h");
1475
1476 PrintAttributeValueSection(os, "Tuple", false);
1477 PrintAttributeValueWithName(os, "Tuple", "std::tuple<Args...>", "tuple.h");
1478 PrintMakeChecker(os, "Tuple", "tuple.h");
1479
1480 // AttributeContainer is already documented.
1481 // PrintAttributeValueSection (os, "AttributeContainer", false);
1482 // PrintAttributeValueWithName (os, "AttributeContainer", "AttributeContainer",
1483 // "attribute-container.h");
1484 PrintMakeChecker(os, "AttributeContainer", "attribute-container.h");
1485} // PrintAttributeImplementations ()
1486
1487/***************************************************************
1488 * Main
1489 ***************************************************************/
1490
1491int
1492main(int argc, char* argv[])
1493{
1495
1496 CommandLine cmd(__FILE__);
1497 cmd.Usage("Generate documentation for all ns-3 registered types, "
1498 "trace sources, attributes and global variables.");
1499 cmd.AddValue("output-text", "format output as plain text", outputText);
1500 cmd.Parse(argc, argv);
1501
1502 SetMarkup();
1503
1504 // Create a Node, to force linking and instantiation of our TypeIds
1505 NodeContainer c;
1506 c.Create(1);
1507
1508 std::cout << std::endl;
1509 std::cout << commentStart << file << "\n"
1510 << sectionStart << "utils\n"
1511 << "Doxygen docs generated from the TypeId database.\n"
1512 << note << "This file is automatically generated by " << codeWord
1513 << "print-introspected-doxygen.cc. Do not edit this file! "
1514 << "Edit that file instead.\n"
1515 << commentStop << std::endl;
1516
1517 PrintTypeIdBlocks(std::cout);
1518
1519 PrintAllTypeIds(std::cout);
1520 PrintAllAttributes(std::cout);
1521 PrintAllGlobals(std::cout);
1522 PrintAllLogComponents(std::cout);
1523 PrintAllTraceSources(std::cout);
1525
1526 return 0;
1527}
#define max(a, b)
Definition: 80211b.c:43
Gather aggregation and configuration path information from registered types.
void DoGather(TypeId tid)
Gather attribute, configuration path information for tid.
std::vector< std::pair< TypeId, std::string > > m_output
Configuration path for each TypeId.
std::vector< TypeId > m_alreadyProcessed
List of TypeIds we've already processed.
std::vector< std::string > m_noTids
List of type names without TypeIds, because those modules aren't enabled.
std::vector< std::string > m_currentPath
Current configuration path.
std::vector< std::string > GetNoTypeIds() const
bool HasAlreadyBeenProcessed(TypeId tid) const
void RecordAggregationInfo(std::string a, std::string b)
Record the a -> b aggregation relation.
std::vector< std::pair< TypeId, TypeId > > m_aggregates
List of aggregation relationships.
std::string GetCurrentPath() const
void Print() const
Print output in "a -> b" form on std::cout.
void Gather(TypeId tid)
Gather aggregation and configuration path information for tid.
std::vector< std::string > Get(TypeId tid) const
void RecordOutput(TypeId tid)
Record the current config path for tid.
Parse command-line arguments.
Definition: command-line.h:232
Vector::const_iterator Iterator
Iterator type for the list of all global values.
Definition: global-value.h:82
std::map< std::string, LogComponent * > ComponentList
LogComponent name map.
Definition: log.h:400
keep track of a set of node pointers.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
AttributeChecker implementation for ObjectPtrContainerValue.
virtual TypeId GetItemTypeId() const =0
Get the TypeId of the container class type.
AttributeChecker implementation for PointerValue.
Definition: pointer.h:97
virtual TypeId GetPointeeTypeId() const =0
Get the TypeId of the base type.
Hold variables of type string.
Definition: string.h:42
std::string Get() const
Definition: string.cc:31
a unique identifier for an interface.
Definition: type-id.h:60
bool IsChildOf(TypeId other) const
Check if this TypeId is a child of another.
Definition: type-id.cc:975
std::size_t GetTraceSourceN() const
Get the number of Trace sources.
Definition: type-id.cc:1127
struct TypeId::TraceSourceInformation GetTraceSource(std::size_t i) const
Get the trace source by index.
Definition: type-id.cc:1134
bool MustHideFromDocumentation() const
Check if this TypeId should not be listed in documentation.
Definition: type-id.cc:1096
struct TypeId::AttributeInformation GetAttribute(std::size_t i) const
Get Attribute information by index.
Definition: type-id.cc:1112
std::size_t GetAttributeN() const
Get the number of attributes.
Definition: type-id.cc:1104
TypeId GetParent() const
Get the parent of this TypeId.
Definition: type-id.cc:959
std::size_t GetSize() const
Get the size of this object.
Definition: type-id.cc:1010
std::string GetName() const
Get the name.
Definition: type-id.cc:995
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition: assert.h:86
Ptr< Object > GetRootNamespaceObject(uint32_t i)
Definition: config.cc:1027
std::size_t GetRootNamespaceObjectN()
Definition: config.cc:1020
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
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:488
value
Definition: second.py:41
cmd
Definition: second.py:33
StaticInformation GetTypicalAggregations()
Register aggregation relationships that are not automatically detected by this introspection program.
void PrintTraceSourcesTid(std::ostream &os, const TypeId tid)
Print direct Trace sources for this TypeId.
std::map< std::string, int32_t > NameMap
Map from TypeId name to tid.
void PrintMakeAccessors(std::ostream &os, const std::string &name)
Print the AttributeValue MakeAccessor documentation for a class.
void PrintAllTraceSources(std::ostream &os)
Print the list of all Trace sources.
void PrintAllLogComponents(std::ostream &os)
Print the list of all LogComponents.
void PrintAttributeHelper(std::ostream &os, const AttributeDescriptor &attr)
Print documentation corresponding to use of the ATTRIBUTE_HELPER_HEADER macro or ATTRIBUTE_VALUE_DEFI...
void PrintTypeIdBlocks(std::ostream &os)
Print the doxy block for each TypeId.
void PrintAllAttributes(std::ostream &os)
Print the list of all Attributes.
void PrintAttributeValueWithName(std::ostream &os, const std::string &name, const std::string &type, const std::string &header)
Print the AttributeValue documentation for a class.
void PrintSize(std::ostream &os, const TypeId tid)
Print the size of the type represented by this tid.
void Uniquefy(T t)
Helper to keep only the unique items in a container.
void PrintAttributeImplementations(std::ostream &os)
Print documentation for Attribute implementations.
NameMap GetNameMap()
Create a map from the class names to their index in the vector of TypeId's so that the names will end...
void PrintTraceSources(std::ostream &os, const TypeId tid)
Print the Trace sources block for tid, including Trace sources declared in base classes.
void SetMarkup()
Initialize the markup strings, for either doxygen or text.
NameMap::const_iterator NameMapIterator
NameMap iterator.
void PrintConfigPaths(std::ostream &os, const TypeId tid)
Print config paths.
void PrintAllTypeIds(std::ostream &os)
Print the list of all TypeIds.
void PrintAttributes(std::ostream &os, const TypeId tid)
Print the Attributes block for tid, including Attributes declared in base classes.
void PrintAllGlobals(std::ostream &os)
Print the list of all global variables.
void PrintMakeChecker(std::ostream &os, const std::string &name, const std::string &header)
Print the AttributeValue MakeChecker documentation for a class.
void PrintAttributeValueSection(std::ostream &os, const std::string &name, const bool seeBase=true)
Print the section definition for an AttributeValue.
void PrintAttributesTid(std::ostream &os, const TypeId tid)
Print direct Attributes for this TypeId.
Descriptor for an AttributeValue.
const std::string m_header
The header file name.
const std::string m_type
The name of the underlying type.
const std::string m_name
The base name of the resulting AttributeValue type.
const bool m_seeBase
Print a "see also" pointing to the base class.
Attribute implementation.
Definition: type-id.h:82
std::string name
Attribute name.
Definition: type-id.h:84
Ptr< const AttributeAccessor > accessor
Accessor object.
Definition: type-id.h:94
uint32_t flags
AttributeFlags value.
Definition: type-id.h:88
Ptr< const AttributeChecker > checker
Checker object.
Definition: type-id.h:96
Ptr< const AttributeValue > initialValue
Configured initial value.
Definition: type-id.h:92
std::string help
Attribute help string.
Definition: type-id.h:86
TraceSource implementation.
Definition: type-id.h:105
std::string name
Trace name.
Definition: type-id.h:107
std::string help
Trace help string.
Definition: type-id.h:109
std::string callback
Callback function signature type.
Definition: type-id.h:111