utils/print-introspected-doxygen.cc
author Vedran Miletić <rivanvx@gmail.com>
Sat, 06 Jul 2013 16:55:33 +0200
changeset 9906 46fc267f8b23
parent 9899 2816cb6d8abd
child 10654 0148f9c47331
permissions -rw-r--r--
Replace <limits.h> include by <climits>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
     1
#include <iostream>
6848
1f453ad50ef3 Converts csma, emu, tap-bridge, point-to-point, wifi and wimax modules into modular format
Lalith Suresh <suresh.lalith@gmail.com>
parents: 4641
diff changeset
     2
#include <algorithm>
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
     3
#include <map>
9899
2816cb6d8abd Add missing limits.h include to nstime.h and print-introspected-doxygen.cc
Vedran Miletić <rivanvx@gmail.com>
parents: 9873
diff changeset
     4
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
     5
#include "ns3/object.h"
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
     6
#include "ns3/pointer.h"
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
     7
#include "ns3/object-vector.h"
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
     8
#include "ns3/config.h"
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
     9
#include "ns3/log.h"
4513
544c9d637ff1 bug 580: doxygen introspection does not document global values
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4364
diff changeset
    10
#include "ns3/global-value.h"
544c9d637ff1 bug 580: doxygen introspection does not document global values
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4364
diff changeset
    11
#include "ns3/string.h"
6994
4ab8b23631fd repair print-introspected-doxygen
Tom Henderson <tomh@tomh.org>
parents: 6865
diff changeset
    12
#include "ns3/node-container.h"
9166
1d2a0119e60c Bug 152 (Partially)- config paths not documented
Mitch Watrous <watrous@u.washington.edu>
parents: 9140
diff changeset
    13
#include "ns3/csma-channel.h"
1368
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    14
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    15
using namespace ns3;
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    16
6994
4ab8b23631fd repair print-introspected-doxygen
Tom Henderson <tomh@tomh.org>
parents: 6865
diff changeset
    17
NS_LOG_COMPONENT_DEFINE ("PrintIntrospectedDoxygen");
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    18
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
    19
namespace
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
    20
{
9127
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
    21
  std::string anchor;                        ///< hyperlink anchor
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
    22
  std::string boldStart;                     ///< start of bold span
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
    23
  std::string boldStop;                      ///< end of bold span
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
    24
  std::string breakBoth;                     ///< linebreak
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
    25
  std::string breakHtmlOnly;                 ///< linebreak for html output only
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
    26
  std::string breakTextOnly;                 ///< linebreak for text output only
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
    27
  std::string brief;                         ///< brief tag
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
    28
  std::string commentStart;                  ///< start of code comment
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
    29
  std::string commentStop;                   ///< end of code comment
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
    30
  std::string defgroupAttributeListStart;    ///< start of AttributeList group
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
    31
  std::string defgroupAttributeListStop;     ///< end of AttributeList group
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
    32
  std::string defgroupGlobalValueListStart;  ///< start of GlobalValueList group
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
    33
  std::string defgroupGlobalValueListStop;   ///< end of GlobalValueList group
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
    34
  std::string defgroupTraceSourceListStart;  ///< start of TraceSourceList group
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
    35
  std::string defgroupTraceSourceListStop;   ///< end of TraceSourceList group
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
    36
  std::string flagSpanStart;                 ///< start of Attribute flag value
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
    37
  std::string flagSpanStop;                  ///< end of Attribute flag value
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
    38
  std::string functionStart;                 ///< start of a class/function
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
    39
  std::string functionStop;                  ///< end of a class/function
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
    40
  std::string headingStart;                  ///< start of section heading (h3)
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
    41
  std::string headingStop;                   ///< end of section heading (h3)
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
    42
  std::string indentHtmlOnly;                ///< small indent
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
    43
  std::string ingroupConstructs;             ///< add to constructs group
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
    44
  std::string listStart;                     ///< start unordered list
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
    45
  std::string listStop;                      ///< end unordered list
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
    46
  std::string listLineStart;                 ///< start unordered list item
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
    47
  std::string listLineStop;                  ///< end unordered list item
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
    48
  std::string reference;                     ///< reference tag
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
    49
  std::string temporaryCharacter;            ///< "%" placeholder
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
    50
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
    51
} // anonymous namespace
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
    52
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    53
void
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    54
PrintAttributes (TypeId tid, std::ostream &os)
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    55
{
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
    56
  os << listStart << std::endl;
2693
56e28e34e109 TypeId::GetAttributeListN -> TypeId::GetAttributeN
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
    57
  for (uint32_t j = 0; j < tid.GetAttributeN (); j++)
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    58
    {
7393
8c3dfe0be54d use new API. kill old one.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents: 7233
diff changeset
    59
      struct TypeId::AttributeInformation info = tid.GetAttribute(j);
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
    60
      os << listLineStart << boldStart << info.name << boldStop << ": "
7393
8c3dfe0be54d use new API. kill old one.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents: 7233
diff changeset
    61
		<< info.help << std::endl;
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
    62
      os << "  " << listStart << std::endl 
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
    63
	 << "    " << listLineStart << "Set with class: " << reference << info.checker->GetValueTypeName () << listLineStop << std::endl;
7393
8c3dfe0be54d use new API. kill old one.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents: 7233
diff changeset
    64
      if (info.checker->HasUnderlyingTypeInformation ())
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    65
	{
9140
e4e4a089b802 Fix oxygen errors in doc/introspected-doxygen.h
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9127
diff changeset
    66
	  os << "    " << listLineStart << "Underlying type: ";
e4e4a089b802 Fix oxygen errors in doc/introspected-doxygen.h
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9127
diff changeset
    67
	  if (    (info.checker->GetValueTypeName () != "ns3::EnumValue")
e4e4a089b802 Fix oxygen errors in doc/introspected-doxygen.h
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9127
diff changeset
    68
	       && (info.checker->GetUnderlyingTypeInformation () != "std::string")
e4e4a089b802 Fix oxygen errors in doc/introspected-doxygen.h
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9127
diff changeset
    69
	      )
e4e4a089b802 Fix oxygen errors in doc/introspected-doxygen.h
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9127
diff changeset
    70
	    {
e4e4a089b802 Fix oxygen errors in doc/introspected-doxygen.h
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9127
diff changeset
    71
	      os << reference;
e4e4a089b802 Fix oxygen errors in doc/introspected-doxygen.h
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9127
diff changeset
    72
	    }
e4e4a089b802 Fix oxygen errors in doc/introspected-doxygen.h
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9127
diff changeset
    73
	  os << info.checker->GetUnderlyingTypeInformation () << listLineStop << std::endl;
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    74
	}
7393
8c3dfe0be54d use new API. kill old one.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents: 7233
diff changeset
    75
      if (info.flags & TypeId::ATTR_CONSTRUCT && info.accessor->HasSetter ())
2971
75780f899be3 output the initial value of the attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2969
diff changeset
    76
	{
9140
e4e4a089b802 Fix oxygen errors in doc/introspected-doxygen.h
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9127
diff changeset
    77
	  os << "    " << listLineStart << "Initial value: " << info.initialValue->SerializeToString (info.checker) << listLineStop << std::endl;
2971
75780f899be3 output the initial value of the attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2969
diff changeset
    78
	}
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
    79
      os << "    " << listLineStart << "Flags: ";
7393
8c3dfe0be54d use new API. kill old one.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents: 7233
diff changeset
    80
      if (info.flags & TypeId::ATTR_CONSTRUCT && info.accessor->HasSetter ())
2971
75780f899be3 output the initial value of the attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2969
diff changeset
    81
	{
9124
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
    82
	  os << flagSpanStart << "construct " << flagSpanStop;
2971
75780f899be3 output the initial value of the attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2969
diff changeset
    83
	}
7393
8c3dfe0be54d use new API. kill old one.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents: 7233
diff changeset
    84
      if (info.flags & TypeId::ATTR_SET && info.accessor->HasSetter ())
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    85
	{
9124
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
    86
	  os << flagSpanStart << "write " << flagSpanStop;
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    87
	}
7393
8c3dfe0be54d use new API. kill old one.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents: 7233
diff changeset
    88
      if (info.flags & TypeId::ATTR_GET && info.accessor->HasGetter ())
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    89
	{
9124
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
    90
	  os << flagSpanStart << "read " << flagSpanStop;
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    91
	}
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
    92
      os << listLineStop << std::endl;
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
    93
      os << "  " << listStop << " " << std::endl;
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    94
      
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    95
    }
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
    96
  os << listStop << std::endl;
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    97
}
1399
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    98
2945
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
    99
void
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   100
PrintTraceSources (TypeId tid, std::ostream &os)
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   101
{
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   102
  os << listStart << std::endl;
2945
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   103
  for (uint32_t i = 0; i < tid.GetTraceSourceN (); ++i)
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   104
    {
7395
a1bb24a8ae25 use new API, kill old one.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents: 7394
diff changeset
   105
      struct TypeId::TraceSourceInformation info = tid.GetTraceSource (i);
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   106
      os << listLineStart << boldStart << info.name << boldStop << ": "
7395
a1bb24a8ae25 use new API, kill old one.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents: 7394
diff changeset
   107
	 << info.help
2945
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   108
	 << std::endl;
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   109
      os << listLineStop << std::endl;
2945
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   110
    }
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   111
  os << listStop << std::endl;
2945
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   112
}
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   113
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   114
9127
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   115
/**
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   116
 * Gather aggregation and configuration path information from registered types.
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   117
 */
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   118
class StaticInformation
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   119
{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   120
public:
9127
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   121
  /**
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   122
   * Record the a -> b aggregation relation.
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   123
   *
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   124
   * \param a [in] the source(?) TypeId name
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   125
   * \param b [in] the destination(?) TypeId name
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   126
   */
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   127
  void RecordAggregationInfo (std::string a, std::string b);
9127
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   128
  /**
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   129
   * Gather aggregation and configuration path information for tid
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   130
   *
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   131
   * \param tid [in] the TypeId to gather information from
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   132
   */
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   133
  void Gather (TypeId tid);
9127
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   134
  /**
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   135
   * Print output in "a -> b" form on std::cout
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   136
   */
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   137
  void Print (void) const;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   138
9127
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   139
  /**
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   140
   * \return the configuration paths for tid
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   141
   *
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   142
   * \param tid [in] the TypeId to return information for
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   143
   */
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   144
  std::vector<std::string> Get (TypeId tid);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   145
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   146
private:
9127
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   147
  /**
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   148
   * \return the current configuration path
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   149
   */
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   150
  std::string GetCurrentPath (void) const;
9127
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   151
  /**
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   152
   * Gather attribute, configuration path information for tid
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   153
   *
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   154
   * \param tid [in] the TypeId to gather information from
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   155
   */
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   156
  void DoGather (TypeId tid);
9127
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   157
  /**
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   158
   *  Record the current config path for tid.
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   159
   *
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   160
   * \param tid [in] the TypeId to record.
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   161
   */
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   162
  void RecordOutput (TypeId tid);
9127
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   163
  /**
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   164
   * \return whether the tid has already been processed
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   165
   *
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   166
   * \param tid [in] the TypeId to check.
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   167
   */
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   168
  bool HasAlreadyBeenProcessed (TypeId tid) const;
9127
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   169
  /**
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   170
   * (Inplace) find and replace all instances of string
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   171
   *
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   172
   * \param source [inout] string to search and replace in
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   173
   * \param find [in] string to search for
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   174
   * \param replace [in] string to insert in place of find
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   175
   */
4580
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   176
  void find_and_replace (std::string &source, const std::string find, std::string replace );
9127
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   177
  /**
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   178
   * Configuration path for each TypeId
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   179
   */
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   180
  std::vector<std::pair<TypeId,std::string> > m_output;
9127
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   181
  /**
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   182
   * Current configuration path
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   183
   */
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   184
  std::vector<std::string> m_currentPath;
9127
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   185
  /**
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   186
   * List of TypeIds we've already processed
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   187
   */
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   188
  std::vector<TypeId> m_alreadyProcessed;
9127
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   189
  /**
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   190
   * List of aggregation relationships.
a35540de51a0 Doxygenate print-introspected-doxygen.cc
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9124
diff changeset
   191
   */
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   192
  std::vector<std::pair<TypeId,TypeId> > m_aggregates;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   193
};
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   194
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   195
void 
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   196
StaticInformation::RecordAggregationInfo (std::string a, std::string b)
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   197
{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   198
  m_aggregates.push_back (std::make_pair (TypeId::LookupByName (a), TypeId::LookupByName (b)));
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   199
}
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   200
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   201
void 
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   202
StaticInformation::Print (void) const
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   203
{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   204
  for (std::vector<std::pair<TypeId,std::string> >::const_iterator i = m_output.begin (); i != m_output.end (); ++i)
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   205
    {
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   206
      std::pair<TypeId,std::string> item = *i;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   207
      std::cout << item.first.GetName () << " -> " << item.second << std::endl;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   208
    }
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   209
}
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   210
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   211
std::string
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   212
StaticInformation::GetCurrentPath (void) const
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   213
{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   214
  std::ostringstream oss;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   215
  for (std::vector<std::string>::const_iterator i = m_currentPath.begin (); i != m_currentPath.end (); ++i)
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   216
    {
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   217
      std::string item = *i;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   218
      oss << "/" << item;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   219
    }
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   220
  return oss.str ();
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   221
}
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   222
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   223
void
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   224
StaticInformation::RecordOutput (TypeId tid)
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   225
{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   226
  m_output.push_back (std::make_pair (tid, GetCurrentPath ()));
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   227
}
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   228
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   229
bool
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   230
StaticInformation::HasAlreadyBeenProcessed (TypeId tid) const
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   231
{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   232
  for (uint32_t i = 0; i < m_alreadyProcessed.size (); ++i)
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   233
    {
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   234
      if (m_alreadyProcessed[i] == tid)
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   235
	{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   236
	  return true;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   237
	}
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   238
    }
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   239
  return false;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   240
}
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   241
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   242
std::vector<std::string> 
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   243
StaticInformation::Get (TypeId tid)
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   244
{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   245
  std::vector<std::string> paths;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   246
  for (uint32_t i = 0; i < m_output.size (); ++i)
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   247
    {
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   248
      std::pair<TypeId,std::string> tmp = m_output[i];
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   249
      if (tmp.first == tid)
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   250
	{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   251
	  paths.push_back (tmp.second);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   252
	}
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   253
    }
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   254
  return paths;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   255
}
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   256
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   257
void
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   258
StaticInformation::Gather (TypeId tid)
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   259
{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   260
  DoGather (tid);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   261
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   262
  std::sort (m_output.begin (), m_output.end ());
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   263
  m_output.erase (std::unique (m_output.begin (), m_output.end ()), m_output.end ());
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   264
}
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   265
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   266
void 
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   267
StaticInformation::DoGather (TypeId tid)
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   268
{
2989
b7eb3929096c merge with HEAD
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2971
diff changeset
   269
  NS_LOG_FUNCTION (this);
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   270
  if (HasAlreadyBeenProcessed (tid))
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   271
    {
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   272
      return;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   273
    }
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   274
  RecordOutput (tid);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   275
  for (uint32_t i = 0; i < tid.GetAttributeN (); ++i)
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   276
    {
7393
8c3dfe0be54d use new API. kill old one.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents: 7233
diff changeset
   277
      struct TypeId::AttributeInformation info = tid.GetAttribute(i);
8c3dfe0be54d use new API. kill old one.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents: 7233
diff changeset
   278
      const PointerChecker *ptrChecker = dynamic_cast<const PointerChecker *> (PeekPointer (info.checker));
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   279
      if (ptrChecker != 0)
4580
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   280
        {
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   281
          TypeId pointee = ptrChecker->GetPointeeTypeId ();
7870
059b1b83e29b Bug 962 - list of paths to reach objects contains bogus entries
Mitch Watrous <watrous@u.washington.edu>
parents: 7575
diff changeset
   282
059b1b83e29b Bug 962 - list of paths to reach objects contains bogus entries
Mitch Watrous <watrous@u.washington.edu>
parents: 7575
diff changeset
   283
	  // See if this is a pointer to an Object.
059b1b83e29b Bug 962 - list of paths to reach objects contains bogus entries
Mitch Watrous <watrous@u.washington.edu>
parents: 7575
diff changeset
   284
	  Ptr<Object> object = CreateObject<Object> ();
059b1b83e29b Bug 962 - list of paths to reach objects contains bogus entries
Mitch Watrous <watrous@u.washington.edu>
parents: 7575
diff changeset
   285
	  TypeId objectTypeId = object->GetTypeId ();
059b1b83e29b Bug 962 - list of paths to reach objects contains bogus entries
Mitch Watrous <watrous@u.washington.edu>
parents: 7575
diff changeset
   286
	  if (objectTypeId == pointee)
059b1b83e29b Bug 962 - list of paths to reach objects contains bogus entries
Mitch Watrous <watrous@u.washington.edu>
parents: 7575
diff changeset
   287
	    {
059b1b83e29b Bug 962 - list of paths to reach objects contains bogus entries
Mitch Watrous <watrous@u.washington.edu>
parents: 7575
diff changeset
   288
	      // Stop the recursion at this attribute if it is a
059b1b83e29b Bug 962 - list of paths to reach objects contains bogus entries
Mitch Watrous <watrous@u.washington.edu>
parents: 7575
diff changeset
   289
	      // pointer to an Object, which create too many spurious
059b1b83e29b Bug 962 - list of paths to reach objects contains bogus entries
Mitch Watrous <watrous@u.washington.edu>
parents: 7575
diff changeset
   290
	      // paths in the list of attribute paths because any
059b1b83e29b Bug 962 - list of paths to reach objects contains bogus entries
Mitch Watrous <watrous@u.washington.edu>
parents: 7575
diff changeset
   291
	      // Object can be in that part of the path.
059b1b83e29b Bug 962 - list of paths to reach objects contains bogus entries
Mitch Watrous <watrous@u.washington.edu>
parents: 7575
diff changeset
   292
	      continue;
059b1b83e29b Bug 962 - list of paths to reach objects contains bogus entries
Mitch Watrous <watrous@u.washington.edu>
parents: 7575
diff changeset
   293
	    }
059b1b83e29b Bug 962 - list of paths to reach objects contains bogus entries
Mitch Watrous <watrous@u.washington.edu>
parents: 7575
diff changeset
   294
7393
8c3dfe0be54d use new API. kill old one.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents: 7233
diff changeset
   295
          m_currentPath.push_back (info.name);
4580
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   296
          m_alreadyProcessed.push_back (tid);
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   297
          DoGather (pointee);
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   298
          m_alreadyProcessed.pop_back ();
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   299
          m_currentPath.pop_back ();
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   300
          continue;
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   301
        }
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   302
      // attempt to cast to an object vector.
7412
d79278c6e51c refactor ObjectVector generic code into a separate file and introduce ObjectMap.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents: 7395
diff changeset
   303
      const ObjectPtrContainerChecker *vectorChecker = dynamic_cast<const ObjectPtrContainerChecker *> (PeekPointer (info.checker));
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   304
      if (vectorChecker != 0)
4580
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   305
        {
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   306
          TypeId item = vectorChecker->GetItemTypeId ();
7393
8c3dfe0be54d use new API. kill old one.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents: 7233
diff changeset
   307
          m_currentPath.push_back (info.name + "/[i]");
4580
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   308
          m_alreadyProcessed.push_back (tid);
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   309
          DoGather (item);
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   310
          m_alreadyProcessed.pop_back ();
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   311
          m_currentPath.pop_back ();
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   312
          continue;
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   313
        }
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   314
    }
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   315
  for (uint32_t j = 0; j < TypeId::GetRegisteredN (); j++)
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   316
    {
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   317
      TypeId child = TypeId::GetRegistered (j);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   318
      if (child.IsChildOf (tid))
4580
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   319
        {
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   320
          //please take a look at the following note for an explanation 
7575
deaf734002d2 Remove % characters showing up in introspected text file
Mitch Watrous <watrous@u.washington.edu>
parents: 7519
diff changeset
   321
          std::string childName = "$" + temporaryCharacter + child.GetName ();
deaf734002d2 Remove % characters showing up in introspected text file
Mitch Watrous <watrous@u.washington.edu>
parents: 7519
diff changeset
   322
          std::string replaceWith = "::" + temporaryCharacter;
deaf734002d2 Remove % characters showing up in introspected text file
Mitch Watrous <watrous@u.washington.edu>
parents: 7519
diff changeset
   323
          find_and_replace(childName,"::",replaceWith);
4580
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   324
          m_currentPath.push_back (childName);
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   325
          m_alreadyProcessed.push_back (tid);
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   326
          DoGather (child);
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   327
          m_alreadyProcessed.pop_back ();
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   328
          m_currentPath.pop_back ();
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   329
        }
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   330
    }
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   331
  for (uint32_t k = 0; k < m_aggregates.size (); ++k)
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   332
    {
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   333
      std::pair<TypeId,TypeId> tmp = m_aggregates[k];
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   334
      if (tmp.first == tid || tmp.second == tid)
4580
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   335
        {
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   336
          TypeId other;
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   337
          if (tmp.first == tid)
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   338
            {
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   339
              other = tmp.second;
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   340
            }
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   341
          if (tmp.second == tid)
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   342
            {
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   343
              other = tmp.first;
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   344
            }
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   345
          /**
7575
deaf734002d2 Remove % characters showing up in introspected text file
Mitch Watrous <watrous@u.washington.edu>
parents: 7519
diff changeset
   346
           * Note: for the Doxygen version only, we insert a % in the
deaf734002d2 Remove % characters showing up in introspected text file
Mitch Watrous <watrous@u.washington.edu>
parents: 7519
diff changeset
   347
           * path below to ensure that doxygen does not attempt to
deaf734002d2 Remove % characters showing up in introspected text file
Mitch Watrous <watrous@u.washington.edu>
parents: 7519
diff changeset
   348
           * resolve the typeid names included in the string.  if the
deaf734002d2 Remove % characters showing up in introspected text file
Mitch Watrous <watrous@u.washington.edu>
parents: 7519
diff changeset
   349
           * name contains ::, using the % sign will remove that sign
deaf734002d2 Remove % characters showing up in introspected text file
Mitch Watrous <watrous@u.washington.edu>
parents: 7519
diff changeset
   350
           * resulting for instance in $ns3MobilityModel instead of
deaf734002d2 Remove % characters showing up in introspected text file
Mitch Watrous <watrous@u.washington.edu>
parents: 7519
diff changeset
   351
           * $ns3::MobilityModel hence the output must be in the form
deaf734002d2 Remove % characters showing up in introspected text file
Mitch Watrous <watrous@u.washington.edu>
parents: 7519
diff changeset
   352
           * $%ns3::%MobilityModel in order to show correctly
deaf734002d2 Remove % characters showing up in introspected text file
Mitch Watrous <watrous@u.washington.edu>
parents: 7519
diff changeset
   353
           * $ns3::MobilityModel We add at the beginning of the name
deaf734002d2 Remove % characters showing up in introspected text file
Mitch Watrous <watrous@u.washington.edu>
parents: 7519
diff changeset
   354
           * $% and we replace all the :: in the string by ::%.
4580
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   355
           */  
7575
deaf734002d2 Remove % characters showing up in introspected text file
Mitch Watrous <watrous@u.washington.edu>
parents: 7519
diff changeset
   356
          std::string name = "$" + temporaryCharacter + other.GetName ();
deaf734002d2 Remove % characters showing up in introspected text file
Mitch Watrous <watrous@u.washington.edu>
parents: 7519
diff changeset
   357
          //finding and replacing :: by ::% (for Doxygen version only).
deaf734002d2 Remove % characters showing up in introspected text file
Mitch Watrous <watrous@u.washington.edu>
parents: 7519
diff changeset
   358
          std::string replaceWith = "::" + temporaryCharacter;
deaf734002d2 Remove % characters showing up in introspected text file
Mitch Watrous <watrous@u.washington.edu>
parents: 7519
diff changeset
   359
          find_and_replace(name,"::",replaceWith);
4580
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   360
          m_currentPath.push_back (name);
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   361
          m_alreadyProcessed.push_back (tid);
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   362
          DoGather (other);
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   363
          m_alreadyProcessed.pop_back ();
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   364
          m_currentPath.pop_back ();	  
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   365
        }
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   366
    }
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   367
}
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   368
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   369
void 
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   370
StaticInformation::find_and_replace( std::string &source, const std::string find, std::string replace )
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   371
{
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   372
  size_t j; 
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   373
  j = source.find (find);
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   374
  while (j != std::string::npos ) 
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   375
    {
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   376
      source.replace (j, find.length (),replace);
8092e3e83487 Bug 456: doxygen introspection for trace source config paths is wrong
fmoatamr
parents: 4513
diff changeset
   377
      j = source.find (find,j+1);
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   378
    }
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   379
}
1399
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
   380
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   381
void
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   382
PrintHelp (const char *program_name)
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   383
{
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   384
  std::cout << "Usage: " << program_name << " [options]" << std::endl
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   385
            << std::endl
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   386
            << "Options:" << std::endl
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   387
            << "  --help        : print these options" << std::endl
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   388
            << "  --output-text : format output as plain text" << std::endl;  
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   389
}
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   390
1368
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   391
int main (int argc, char *argv[])
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   392
{
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   393
  bool outputText = false;
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   394
  char *programName = argv[0];
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   395
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   396
  argv++;
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   397
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   398
  while (*argv != 0)
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   399
    {
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   400
      char *arg = *argv;
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   401
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   402
      if (strcmp (arg, "--help") == 0)
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   403
        {
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   404
          PrintHelp (programName);
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   405
          return 0;
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   406
        }
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   407
      else if (strcmp(arg, "--output-text") == 0)
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   408
        {
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   409
          outputText = true;
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   410
        }
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   411
      else
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   412
        {
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   413
          // un-recognized command-line argument
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   414
          PrintHelp (programName);
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   415
          return 0;
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   416
        }
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   417
      argv++;
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   418
    }
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   419
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   420
  if (outputText)
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   421
    {
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   422
      anchor                       = "";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   423
      boldStart                    = "";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   424
      boldStop                     = "";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   425
      breakBoth                    = "\n";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   426
      breakHtmlOnly                = "";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   427
      breakTextOnly                = "\n";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   428
      brief                        = "";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   429
      commentStart                 = "===============================================================\n";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   430
      commentStop                  = "";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   431
      defgroupAttributeListStart   = "";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   432
      defgroupAttributeListStop    = "\n";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   433
      defgroupGlobalValueListStart = "";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   434
      defgroupGlobalValueListStop  = "";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   435
      defgroupTraceSourceListStart = "";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   436
      defgroupTraceSourceListStop  = "\n";
9124
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   437
      flagSpanStart                = "";
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   438
      flagSpanStop                 = "";
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   439
      functionStart                = "";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   440
      functionStop                 = "\n\n";
9116
c2c846c432d2 Move attribute, config, trace docs to class description.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 8749
diff changeset
   441
      headingStart                 = "";
c2c846c432d2 Move attribute, config, trace docs to class description.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 8749
diff changeset
   442
      headingStop                  = "";
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   443
      indentHtmlOnly               = "";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   444
      ingroupConstructs            = "";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   445
      listStart                    = "";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   446
      listStop                     = "";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   447
      listLineStart                = "    * ";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   448
      listLineStop                 = "";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   449
      reference                    = "";
7575
deaf734002d2 Remove % characters showing up in introspected text file
Mitch Watrous <watrous@u.washington.edu>
parents: 7519
diff changeset
   450
      temporaryCharacter           = "";
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   451
    }
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   452
  else
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   453
    {
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   454
      anchor                       = "\\anchor ";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   455
      boldStart                    = "<b>";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   456
      boldStop                     = "</b>";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   457
      breakBoth                    = "<br>";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   458
      breakHtmlOnly                = "<br>";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   459
      breakTextOnly                = "";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   460
      brief                        = "\\brief ";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   461
      commentStart                 = "/*!";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   462
      commentStop                  = "*/";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   463
      defgroupAttributeListStart   = "\\defgroup AttributeList ";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   464
      defgroupAttributeListStop    = "";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   465
      defgroupGlobalValueListStart = "\\defgroup GlobalValueList ";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   466
      defgroupGlobalValueListStop  = "";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   467
      defgroupTraceSourceListStart = "\\defgroup TraceSourceList ";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   468
      defgroupTraceSourceListStop  = "";
9124
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   469
      flagSpanStart                = "<span class=\"mlabel\">";
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   470
      flagSpanStop                 = "</span>";
9116
c2c846c432d2 Move attribute, config, trace docs to class description.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 8749
diff changeset
   471
      functionStart                = "\\class ";
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   472
      functionStop                 = "";
9116
c2c846c432d2 Move attribute, config, trace docs to class description.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 8749
diff changeset
   473
      headingStart                 = "<h3>";
c2c846c432d2 Move attribute, config, trace docs to class description.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 8749
diff changeset
   474
      headingStop                  = "</h3>";
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   475
      indentHtmlOnly               = "  ";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   476
      ingroupConstructs            = "\\ingroup constructs\n";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   477
      listStart                    = "<ul>";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   478
      listStop                     = "</ul>";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   479
      listLineStart                = "<li>";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   480
      listLineStop                 = "</li>";
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   481
      reference                    = "\\ref ";
7575
deaf734002d2 Remove % characters showing up in introspected text file
Mitch Watrous <watrous@u.washington.edu>
parents: 7519
diff changeset
   482
      temporaryCharacter           = "%";
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   483
    }
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   484
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   485
  NodeContainer c; c.Create (1);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   486
9222
b72fd6e6a4b5 Bug 1520 - config paths not documented in Doxygen for CsmaChannel
Mitch Watrous <watrous@u.washington.edu>
parents: 9208
diff changeset
   487
  // The below statements register typical aggregation relationships
b72fd6e6a4b5 Bug 1520 - config paths not documented in Doxygen for CsmaChannel
Mitch Watrous <watrous@u.washington.edu>
parents: 9208
diff changeset
   488
  // in ns-3 programs, that otherwise aren't picked up automatically
b72fd6e6a4b5 Bug 1520 - config paths not documented in Doxygen for CsmaChannel
Mitch Watrous <watrous@u.washington.edu>
parents: 9208
diff changeset
   489
  // by the creation of the above node.  To manually list other common
b72fd6e6a4b5 Bug 1520 - config paths not documented in Doxygen for CsmaChannel
Mitch Watrous <watrous@u.washington.edu>
parents: 9208
diff changeset
   490
  // aggregation relationships that you would like to see show up in
b72fd6e6a4b5 Bug 1520 - config paths not documented in Doxygen for CsmaChannel
Mitch Watrous <watrous@u.washington.edu>
parents: 9208
diff changeset
   491
  // the list of configuration paths in the doxygen, add additional
b72fd6e6a4b5 Bug 1520 - config paths not documented in Doxygen for CsmaChannel
Mitch Watrous <watrous@u.washington.edu>
parents: 9208
diff changeset
   492
  // statements below.
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   493
  StaticInformation info;
3132
b0b0abb911cd move Tcp to TcpSocketFactory
Tom Henderson <tomh@tomh.org>
parents: 3125
diff changeset
   494
  info.RecordAggregationInfo ("ns3::Node", "ns3::TcpSocketFactory");
3125
d2d8a36cfd23 s/ns3::Udp/ns3::UdpSocketFactory
Tom Henderson <tomh@tomh.org>
parents: 2989
diff changeset
   495
  info.RecordAggregationInfo ("ns3::Node", "ns3::UdpSocketFactory");
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   496
  info.RecordAggregationInfo ("ns3::Node", "ns3::PacketSocketFactory");
4364
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3588
diff changeset
   497
  info.RecordAggregationInfo ("ns3::Node", "ns3::olsr::RoutingProtocol");
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   498
  info.RecordAggregationInfo ("ns3::Node", "ns3::MobilityModel");
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   499
  info.RecordAggregationInfo ("ns3::Node", "ns3::Ipv4L3Protocol");
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   500
  info.RecordAggregationInfo ("ns3::Node", "ns3::ArpL3Protocol");
9174
bb6bbda68e97 Bug 1520 (More partially) - config paths not documented
Mitch Watrous <watrous@u.washington.edu>
parents: 9166
diff changeset
   501
  info.RecordAggregationInfo ("ns3::Node", "ns3::Icmpv4L4Protocol");
bb6bbda68e97 Bug 1520 (More partially) - config paths not documented
Mitch Watrous <watrous@u.washington.edu>
parents: 9166
diff changeset
   502
  info.RecordAggregationInfo ("ns3::Node", "ns3::UdpL4Protocol");
bb6bbda68e97 Bug 1520 (More partially) - config paths not documented
Mitch Watrous <watrous@u.washington.edu>
parents: 9166
diff changeset
   503
  info.RecordAggregationInfo ("ns3::Node", "ns3::Ipv6L3Protocol");
bb6bbda68e97 Bug 1520 (More partially) - config paths not documented
Mitch Watrous <watrous@u.washington.edu>
parents: 9166
diff changeset
   504
  info.RecordAggregationInfo ("ns3::Node", "ns3::Icmpv6L4Protocol");
bb6bbda68e97 Bug 1520 (More partially) - config paths not documented
Mitch Watrous <watrous@u.washington.edu>
parents: 9166
diff changeset
   505
  info.RecordAggregationInfo ("ns3::Node", "ns3::TcpL4Protocol");
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   506
9166
1d2a0119e60c Bug 152 (Partially)- config paths not documented
Mitch Watrous <watrous@u.washington.edu>
parents: 9140
diff changeset
   507
  // Create a channel object so that channels appear in the namespace
1d2a0119e60c Bug 152 (Partially)- config paths not documented
Mitch Watrous <watrous@u.washington.edu>
parents: 9140
diff changeset
   508
  // paths that will be generated here.
1d2a0119e60c Bug 152 (Partially)- config paths not documented
Mitch Watrous <watrous@u.washington.edu>
parents: 9140
diff changeset
   509
  Ptr<CsmaChannel> csma;
1d2a0119e60c Bug 152 (Partially)- config paths not documented
Mitch Watrous <watrous@u.washington.edu>
parents: 9140
diff changeset
   510
  csma = CreateObject<CsmaChannel> ();
1d2a0119e60c Bug 152 (Partially)- config paths not documented
Mitch Watrous <watrous@u.washington.edu>
parents: 9140
diff changeset
   511
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   512
  for (uint32_t i = 0; i < Config::GetRootNamespaceObjectN (); ++i)
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   513
    {
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   514
      Ptr<Object> object = Config::GetRootNamespaceObject (i);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   515
      info.Gather (object->GetInstanceTypeId ());
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   516
    }
1368
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   517
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   518
  std::map< std::string, uint32_t> nameMap;
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   519
  std::map< std::string, uint32_t>::const_iterator nameMapIterator;
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   520
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   521
  // Create a map from the class names to their index in the vector of
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   522
  // TypeId's so that the names will end up in alphabetical order.
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   523
  for (uint32_t i = 0; i < TypeId::GetRegisteredN (); i++)
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   524
    {
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   525
      TypeId tid = TypeId::GetRegistered (i);
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   526
      if (tid.MustHideFromDocumentation ())
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   527
	{
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   528
	  continue;
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   529
	}
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   530
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   531
      // Capitalize all of letters in the name so that it sorts
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   532
      // correctly in the map.
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   533
      std::string name = tid.GetName ();
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   534
      for (uint32_t j = 0; j < name.length (); j++)
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   535
	{
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   536
	  name[j] = toupper (name[j]);
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   537
	}
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   538
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   539
      // Save this name's index.
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   540
      nameMap[name] = i;
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   541
    }
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   542
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   543
  // Iterate over the map, which will print the class names in
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   544
  // alphabetical order.
9124
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   545
  for (nameMapIterator = nameMap.begin ();
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   546
       nameMapIterator != nameMap.end ();
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   547
       nameMapIterator++)
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   548
    {
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   549
      // Get the class's index out of the map;
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   550
      uint32_t i = nameMapIterator->second;
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   551
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   552
      std::cout << commentStart << std::endl;
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   553
      TypeId tid = TypeId::GetRegistered (i);
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   554
      if (tid.MustHideFromDocumentation ())
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   555
	{
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   556
	  continue;
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   557
	}
9116
c2c846c432d2 Move attribute, config, trace docs to class description.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 8749
diff changeset
   558
      std::cout << functionStart << tid.GetName () << std::endl;
c2c846c432d2 Move attribute, config, trace docs to class description.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 8749
diff changeset
   559
      std::cout << std::endl;
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   560
      std::vector<std::string> paths = info.Get (tid);
9124
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   561
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   562
      // Config --------------
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   563
      if (paths.empty ())
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   564
	{
9222
b72fd6e6a4b5 Bug 1520 - config paths not documented in Doxygen for CsmaChannel
Mitch Watrous <watrous@u.washington.edu>
parents: 9208
diff changeset
   565
	  std::cout << "Doxygen introspection did not find any typical Config paths."
9124
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   566
		    << breakBoth << std::endl;
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   567
	}
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   568
      else
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   569
	{
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   570
	  std::cout << headingStart
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   571
		    << "Config Paths"
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   572
		    << headingStop << std::endl;
9116
c2c846c432d2 Move attribute, config, trace docs to class description.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 8749
diff changeset
   573
	  std::cout << std::endl;
9124
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   574
	  std::cout << tid.GetName ()
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   575
		    << " is accessible through the following paths"
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   576
		    << " with Config::Set and Config::Connect:"
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   577
		    << std::endl;
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   578
	  std::cout << listStart << std::endl;
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   579
	  for (uint32_t k = 0; k < paths.size (); ++k)
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   580
	    {
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   581
	      std::string path = paths[k];
9124
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   582
	      std::cout << listLineStart << path
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   583
			<< listLineStop  << breakTextOnly << std::endl;
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   584
	    }
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   585
	  std::cout << listStop << std::endl;
9124
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   586
	}  // Config
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   587
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   588
      // Attributes ----------
2693
56e28e34e109 TypeId::GetAttributeListN -> TypeId::GetAttributeN
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
   589
      if (tid.GetAttributeN () == 0)
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   590
	{
9124
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   591
	  std::cout << "No Attributes are defined for this type."
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   592
		    << breakBoth << std::endl;
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   593
	}
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   594
      else
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   595
	{
9124
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   596
	  std::cout << headingStart << "Attributes"
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   597
		    << headingStop  << std::endl;
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   598
	  PrintAttributes (tid, std::cout);
9124
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   599
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   600
	  TypeId tmp = tid.GetParent ();
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   601
	  while (tmp.GetParent () != tmp)
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   602
	    {
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   603
	      if (tmp.GetAttributeN () != 0)
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   604
		{
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   605
		  std::cout << headingStart
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   606
			    << "Attributes defined in parent class "
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   607
			    << tmp.GetName ()
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   608
			    << headingStop << std::endl;
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   609
		  PrintAttributes (tmp, std::cout);
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   610
		}
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   611
	      tmp = tmp.GetParent ();
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   612
	    }
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   613
	}  // Attributes
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   614
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   615
      // Tracing -------------
2945
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   616
      if (tid.GetTraceSourceN () == 0)
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   617
	{
9124
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   618
	  std::cout << "No TraceSources are defined for this type."
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   619
		    << breakBoth << std::endl;
2945
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   620
	}
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   621
      else
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   622
	{
9124
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   623
	  std::cout << headingStart << "TraceSources"
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   624
		    << headingStop  << std::endl;
2945
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   625
	  PrintTraceSources (tid, std::cout);
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   626
	}
2945
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   627
      {
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   628
	TypeId tmp = tid.GetParent ();
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   629
	while (tmp.GetParent () != tmp)
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   630
	  {
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   631
	    if (tmp.GetTraceSourceN () != 0)
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   632
	      {
9124
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   633
		std::cout << headingStart
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   634
			  << "TraceSources defined in parent class "
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   635
			  << tmp.GetName ()
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   636
			  << headingStop << std::endl;
2945
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   637
		PrintTraceSources (tmp, std::cout);
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   638
	      }
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   639
	    tmp = tmp.GetParent ();
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   640
	  }
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   641
      }
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   642
      std::cout << commentStop << std::endl;
9124
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   643
    }  // class documentation
1368
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   644
1853
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
   645
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   646
  std::cout << commentStart << std::endl
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   647
            << ingroupConstructs
9124
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   648
            << defgroupTraceSourceListStart << "The list of all trace sources."
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   649
	    << defgroupTraceSourceListStop << std::endl;
2964
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   650
  for (uint32_t i = 0; i < TypeId::GetRegisteredN (); ++i)
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   651
    {
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   652
      TypeId tid = TypeId::GetRegistered (i);
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   653
      if (tid.GetTraceSourceN () == 0 ||
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   654
	  tid.MustHideFromDocumentation ())
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   655
	{
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   656
	  continue;
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   657
	}
9124
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   658
      std::cout << boldStart << tid.GetName ()
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   659
		<< boldStop  << breakHtmlOnly << std::endl
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   660
		<< listStart << std::endl;
2964
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   661
      for (uint32_t j = 0; j < tid.GetTraceSourceN (); ++j)
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   662
	{
7395
a1bb24a8ae25 use new API, kill old one.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents: 7394
diff changeset
   663
	  struct TypeId::TraceSourceInformation info = tid.GetTraceSource(j);
9124
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   664
	  std::cout << listLineStart << info.name << ": " << info.help
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   665
		    << listLineStop  << std::endl;
2964
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   666
	}
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   667
      std::cout << listStop << std::endl;
2964
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   668
    }
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   669
  std::cout << commentStop << std::endl;
2964
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   670
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   671
  std::cout << commentStart << std::endl
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   672
            << ingroupConstructs
9124
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   673
            << defgroupAttributeListStart << "The list of all attributes."
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   674
	    << defgroupAttributeListStop  << std::endl;
2964
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   675
  for (uint32_t i = 0; i < TypeId::GetRegisteredN (); ++i)
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   676
    {
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   677
      TypeId tid = TypeId::GetRegistered (i);
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   678
      if (tid.GetAttributeN () == 0 ||
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   679
	  tid.MustHideFromDocumentation ())
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   680
	{
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   681
	  continue;
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   682
	}
9124
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   683
      std::cout << boldStart << tid.GetName ()
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   684
		<< boldStop  << breakHtmlOnly << std::endl
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   685
		<< listStart << std::endl;
2964
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   686
      for (uint32_t j = 0; j < tid.GetAttributeN (); ++j)
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   687
	{
7394
48475b398d9d kill old API
Mathieu Lacage <mathieu.lacage@gmail.com>
parents: 7393
diff changeset
   688
	  struct TypeId::AttributeInformation info = tid.GetAttribute(j);
9124
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   689
	  std::cout << listLineStart << info.name << ": " << info.help
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   690
		    << listLineStop  << std::endl;
2964
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   691
	}
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   692
      std::cout << listStop << std::endl;
2964
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   693
    }
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   694
  std::cout << commentStop << std::endl;
2964
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   695
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   696
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   697
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   698
  std::cout << commentStart << std::endl
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   699
            << ingroupConstructs
9124
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   700
            << defgroupGlobalValueListStart << "The list of all global values."
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   701
	    << defgroupGlobalValueListStop  << std::endl
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   702
            << listStart << std::endl;
9124
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   703
  for (GlobalValue::Iterator i = GlobalValue::Begin ();
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   704
       i != GlobalValue::End ();
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   705
       ++i)
4513
544c9d637ff1 bug 580: doxygen introspection does not document global values
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4364
diff changeset
   706
    {
544c9d637ff1 bug 580: doxygen introspection does not document global values
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4364
diff changeset
   707
      StringValue val;
544c9d637ff1 bug 580: doxygen introspection does not document global values
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4364
diff changeset
   708
      (*i)->GetValue (val);
9124
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   709
      std::cout << indentHtmlOnly
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   710
		<<   listLineStart
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   711
		<<     boldStart
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   712
		<<       anchor
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   713
		<< "GlobalValue" << (*i)->GetName () << " " << (*i)->GetName ()
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   714
		<<     boldStop
9873
2020713bbfa4 Show defaults for global values.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9222
diff changeset
   715
		<< ": " << (*i)->GetHelp () << ".  Default value: " << val.Get () << "."
9124
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   716
		<<   listLineStop << std::endl;
4513
544c9d637ff1 bug 580: doxygen introspection does not document global values
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4364
diff changeset
   717
    }
9124
4ee743993c0a Highlight attribute flags in doxygen html
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 9116
diff changeset
   718
  std::cout << listStop    << std::endl
7519
77e27ba9b9a1 Make the source code introspection program output text
Mitch Watrous <watrous@u.washington.edu>
parents: 7412
diff changeset
   719
	    << commentStop << std::endl;
4513
544c9d637ff1 bug 580: doxygen introspection does not document global values
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4364
diff changeset
   720
544c9d637ff1 bug 580: doxygen introspection does not document global values
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4364
diff changeset
   721
1368
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   722
  return 0;
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   723
}