utils/print-introspected-doxygen.cc
author Tom Henderson <tomh@tomh.org>
Tue, 20 May 2008 12:16:55 -0700
changeset 3132 b0b0abb911cd
parent 3125 d2d8a36cfd23
child 3588 ad0a36bfdb62
permissions -rw-r--r--
move Tcp to TcpSocketFactory
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>
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
     2
#include "ns3/object.h"
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
     3
#include "ns3/pointer.h"
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
     4
#include "ns3/object-vector.h"
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
     5
#include "ns3/config.h"
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
     6
#include "ns3/log.h"
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
     7
#include "ns3/helper-module.h"
1368
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     8
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     9
using namespace ns3;
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    10
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    11
NS_LOG_COMPONENT_DEFINE ("Main");
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    12
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    13
void
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    14
PrintAttributes (TypeId tid, std::ostream &os)
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    15
{
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    16
  os << "<ul>"<<std::endl;
2693
56e28e34e109 TypeId::GetAttributeListN -> TypeId::GetAttributeN
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
    17
  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
    18
    {
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    19
      os << "<li><b>" << tid.GetAttributeName (j) << "</b>: "
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    20
		<< tid.GetAttributeHelp (j) << std::endl;
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    21
      Ptr<const AttributeChecker> checker = tid.GetAttributeChecker (j);
2971
75780f899be3 output the initial value of the attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2969
diff changeset
    22
      os << "  <ul>" << std::endl 
75780f899be3 output the initial value of the attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2969
diff changeset
    23
	 << "    <li>Set with class: \\ref " <<  checker->GetValueTypeName () << "</li>" << std::endl;
2969
9d05d2a95dfa improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2964
diff changeset
    24
      if (checker->HasUnderlyingTypeInformation ())
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    25
	{
2969
9d05d2a95dfa improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2964
diff changeset
    26
	  os << "    <li>Underlying type: \\ref " << checker->GetUnderlyingTypeInformation () << "</li>" << std::endl;
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    27
	}
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    28
      uint32_t flags = tid.GetAttributeFlags (j);
2951
2a3db8645225 use HasSetter/HasGetter to improve doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2945
diff changeset
    29
      Ptr<const AttributeAccessor> accessor = tid.GetAttributeAccessor (j);
2971
75780f899be3 output the initial value of the attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2969
diff changeset
    30
      if (flags & TypeId::ATTR_CONSTRUCT && accessor->HasSetter ())
75780f899be3 output the initial value of the attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2969
diff changeset
    31
	{
75780f899be3 output the initial value of the attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2969
diff changeset
    32
	  Ptr<const AttributeValue> initial = tid.GetAttributeInitialValue (j);
75780f899be3 output the initial value of the attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2969
diff changeset
    33
	  os << "    <li>Initial value: " << initial->SerializeToString (checker) << "</li>" << std::endl;
75780f899be3 output the initial value of the attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2969
diff changeset
    34
	}
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    35
      os << "    <li>Flags: ";
2971
75780f899be3 output the initial value of the attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2969
diff changeset
    36
      if (flags & TypeId::ATTR_CONSTRUCT && accessor->HasSetter ())
75780f899be3 output the initial value of the attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2969
diff changeset
    37
	{
75780f899be3 output the initial value of the attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2969
diff changeset
    38
	  os << "construct ";
75780f899be3 output the initial value of the attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2969
diff changeset
    39
	}
2951
2a3db8645225 use HasSetter/HasGetter to improve doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2945
diff changeset
    40
      if (flags & TypeId::ATTR_SET && accessor->HasSetter ())
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    41
	{
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    42
	  os << "write ";
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    43
	}
2951
2a3db8645225 use HasSetter/HasGetter to improve doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2945
diff changeset
    44
      if (flags & TypeId::ATTR_GET && accessor->HasGetter ())
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    45
	{
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    46
	  os << "read ";
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    47
	}
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    48
      os << "</li>" << std::endl;
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    49
      os << "  </ul> " << std::endl;
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    50
      
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    51
    }
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    52
  os << "</ul>" << std::endl;
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    53
}
1399
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    54
2945
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
    55
void
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
    56
PrintTraceSources (TypeId tid, std::ostream &os)
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
    57
{
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
    58
  os << "<ul>"<<std::endl;
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
    59
  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
    60
    {
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
    61
      os << "<li><b>" << tid.GetTraceSourceName (i) << "</b>: "
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
    62
	 << tid.GetTraceSourceHelp (i)
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
    63
	 << std::endl;
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
    64
      os << "</li>" << std::endl;
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
    65
    }
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
    66
  os << "</ul>"<<std::endl;
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
    67
}
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
    68
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
    69
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    70
class StaticInformation
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    71
{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    72
public:
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    73
  void 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
    74
  void Gather (TypeId tid);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    75
  void Print (void) const;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    76
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    77
  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
    78
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    79
private:
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    80
  std::string GetCurrentPath (void) const;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    81
  void DoGather (TypeId tid);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    82
  void RecordOutput (TypeId tid);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    83
  bool HasAlreadyBeenProcessed (TypeId tid) const;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    84
  std::vector<std::pair<TypeId,std::string> > m_output;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    85
  std::vector<std::string> m_currentPath;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    86
  std::vector<TypeId> m_alreadyProcessed;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    87
  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
    88
};
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    89
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    90
void 
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    91
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
    92
{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    93
  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
    94
}
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    95
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    96
void 
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    97
StaticInformation::Print (void) const
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    98
{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    99
  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
   100
    {
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   101
      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
   102
      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
   103
    }
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   104
}
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   105
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   106
std::string
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   107
StaticInformation::GetCurrentPath (void) const
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   108
{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   109
  std::ostringstream oss;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   110
  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
   111
    {
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   112
      std::string item = *i;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   113
      oss << "/" << item;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   114
    }
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   115
  return oss.str ();
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   116
}
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   117
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   118
void
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   119
StaticInformation::RecordOutput (TypeId tid)
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   120
{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   121
  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
   122
}
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   123
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   124
bool
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   125
StaticInformation::HasAlreadyBeenProcessed (TypeId tid) const
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   126
{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   127
  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
   128
    {
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   129
      if (m_alreadyProcessed[i] == tid)
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   130
	{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   131
	  return true;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   132
	}
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   133
    }
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   134
  return false;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   135
}
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   136
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   137
std::vector<std::string> 
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   138
StaticInformation::Get (TypeId tid)
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   139
{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   140
  std::vector<std::string> paths;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   141
  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
   142
    {
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   143
      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
   144
      if (tmp.first == 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
	  paths.push_back (tmp.second);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   147
	}
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   148
    }
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   149
  return paths;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   150
}
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   151
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   152
void
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   153
StaticInformation::Gather (TypeId tid)
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   154
{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   155
  DoGather (tid);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   156
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   157
  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
   158
  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
   159
}
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   160
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   161
void 
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   162
StaticInformation::DoGather (TypeId tid)
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   163
{
2989
b7eb3929096c merge with HEAD
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2971
diff changeset
   164
  NS_LOG_FUNCTION (this);
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   165
  if (HasAlreadyBeenProcessed (tid))
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   166
    {
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   167
      return;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   168
    }
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   169
  RecordOutput (tid);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   170
  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
   171
    {
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   172
      Ptr<const AttributeChecker> checker = tid.GetAttributeChecker (i);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   173
      const PointerChecker *ptrChecker = dynamic_cast<const PointerChecker *> (PeekPointer (checker));
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   174
      if (ptrChecker != 0)
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   175
	{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   176
	  TypeId pointee = ptrChecker->GetPointeeTypeId ();
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   177
	  m_currentPath.push_back (tid.GetAttributeName (i));
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   178
	  m_alreadyProcessed.push_back (tid);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   179
	  DoGather (pointee);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   180
	  m_alreadyProcessed.pop_back ();
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   181
	  m_currentPath.pop_back ();
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   182
	  continue;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   183
	}
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   184
      // attempt to cast to an object vector.
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   185
      const ObjectVectorChecker *vectorChecker = dynamic_cast<const ObjectVectorChecker *> (PeekPointer (checker));
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   186
      if (vectorChecker != 0)
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   187
	{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   188
	  TypeId item = vectorChecker->GetItemTypeId ();
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   189
	  m_currentPath.push_back (tid.GetAttributeName (i) + "/[i]");
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   190
	  m_alreadyProcessed.push_back (tid);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   191
	  DoGather (item);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   192
	  m_alreadyProcessed.pop_back ();
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   193
	  m_currentPath.pop_back ();
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   194
	  continue;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   195
	}
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   196
    }
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   197
  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
   198
    {
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   199
      TypeId child = TypeId::GetRegistered (j);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   200
      if (child.IsChildOf (tid))
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   201
	{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   202
	  m_currentPath.push_back ("$%" + child.GetName ());
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   203
	  m_alreadyProcessed.push_back (tid);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   204
	  DoGather (child);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   205
	  m_alreadyProcessed.pop_back ();
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   206
	  m_currentPath.pop_back ();
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   207
	}
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
  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
   210
    {
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   211
      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
   212
      if (tmp.first == tid || tmp.second == tid)
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
	  TypeId other;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   215
	  if (tmp.first == tid)
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
	      other = tmp.second;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   218
	    }
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   219
	  if (tmp.second == tid)
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   220
	    {
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   221
	      other = tmp.first;
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
	  // Note: we insert a % in the path below to ensure that doxygen does not
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   224
	  // attempt to resolve the typeid names included in the string.
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   225
	  m_currentPath.push_back ("$%" + other.GetName ());
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   226
	  m_alreadyProcessed.push_back (tid);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   227
	  DoGather (other);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   228
	  m_alreadyProcessed.pop_back ();
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   229
	  m_currentPath.pop_back ();	  
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   230
	}
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
}
1399
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
   233
1368
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   234
int main (int argc, char *argv[])
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   235
{
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   236
  NodeContainer c; c.Create (1);
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
  StaticInformation info;
3132
b0b0abb911cd move Tcp to TcpSocketFactory
Tom Henderson <tomh@tomh.org>
parents: 3125
diff changeset
   239
  info.RecordAggregationInfo ("ns3::Node", "ns3::TcpSocketFactory");
3125
d2d8a36cfd23 s/ns3::Udp/ns3::UdpSocketFactory
Tom Henderson <tomh@tomh.org>
parents: 2989
diff changeset
   240
  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
   241
  info.RecordAggregationInfo ("ns3::Node", "ns3::PacketSocketFactory");
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   242
  info.RecordAggregationInfo ("ns3::Node", "ns3::olsr::Agent");
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   243
  info.RecordAggregationInfo ("ns3::Node", "ns3::MobilityModel");
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   244
  info.RecordAggregationInfo ("ns3::Node", "ns3::Ipv4L4Demux");
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   245
  info.RecordAggregationInfo ("ns3::Node", "ns3::Ipv4L3Protocol");
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   246
  info.RecordAggregationInfo ("ns3::Node", "ns3::ArpL3Protocol");
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
  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
   249
    {
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   250
      Ptr<Object> object = Config::GetRootNamespaceObject (i);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   251
      info.Gather (object->GetInstanceTypeId ());
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   252
    }
1368
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   253
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   254
  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
   255
    {
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   256
      std::cout << "/*!" << std::endl;
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   257
      TypeId tid = TypeId::GetRegistered (i);
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   258
      if (tid.MustHideFromDocumentation ())
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   259
	{
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   260
	  continue;
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   261
	}
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   262
      std::cout << "\\fn static TypeId " << tid.GetName () << "::GetTypeId (void)" << std::endl;
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   263
      std::cout << "\\brief This method returns the TypeId associated to \\ref " << tid.GetName () 
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   264
		<< std::endl << std::endl;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   265
      std::vector<std::string> paths = info.Get (tid);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   266
      if (!paths.empty ())
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   267
	{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   268
	  std::cout << "This object is accessible through the following paths with Config::Set and Config::Connect:" 
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   269
		    << std::endl;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   270
	  std::cout << "<ul>" << std::endl;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   271
	  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
   272
	    {
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   273
	      std::string path = paths[k];
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   274
	      std::cout << "<li>" << path << "</li>" << std::endl;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   275
	    }
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   276
	  std::cout << "</ul>" << std::endl;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   277
	}
2693
56e28e34e109 TypeId::GetAttributeListN -> TypeId::GetAttributeN
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
   278
      if (tid.GetAttributeN () == 0)
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   279
	{
2971
75780f899be3 output the initial value of the attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2969
diff changeset
   280
	  std::cout << "No Attributes defined for this type.<br>" << std::endl;
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   281
	}
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   282
      else
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   283
	{
2971
75780f899be3 output the initial value of the attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2969
diff changeset
   284
	  std::cout << "Attributes defined for this type:<br>" << std::endl;
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   285
	  PrintAttributes (tid, std::cout);
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   286
	}
2945
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   287
      {
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   288
	TypeId tmp = tid.GetParent ();
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   289
	while (tmp.GetParent () != tmp)
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   290
	  {
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   291
	    if (tmp.GetAttributeN () != 0)
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   292
	      {
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   293
		std::cout << "Attributes defined in parent class " << tmp.GetName () << ":<br>" << std::endl;
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   294
		PrintAttributes (tmp, std::cout);
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   295
	      }
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   296
	    tmp = tmp.GetParent ();
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   297
	  }
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   298
      }
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   299
      if (tid.GetTraceSourceN () == 0)
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   300
	{
2971
75780f899be3 output the initial value of the attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2969
diff changeset
   301
	  std::cout << "No TraceSources defined for this type.<br>" << std::endl;
2945
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   302
	}
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   303
      else
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   304
	{
2971
75780f899be3 output the initial value of the attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2969
diff changeset
   305
	  std::cout << "TraceSources defined for this type:<br>" << std::endl;
2945
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   306
	  PrintTraceSources (tid, std::cout);
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   307
	}
2945
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   308
      {
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   309
	TypeId tmp = tid.GetParent ();
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   310
	while (tmp.GetParent () != tmp)
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   311
	  {
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   312
	    if (tmp.GetTraceSourceN () != 0)
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   313
	      {
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   314
		std::cout << "TraceSources defined in parent class " << tmp.GetName () << ":<br>" << std::endl;
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   315
		PrintTraceSources (tmp, std::cout);
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   316
	      }
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   317
	    tmp = tmp.GetParent ();
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   318
	  }
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   319
      }
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   320
      std::cout << "*/" << std::endl;
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   321
    }
1368
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   322
1853
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
   323
2964
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   324
  std::cout << "/*!" << std::endl
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   325
	    << "\\ingroup core" << std::endl
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   326
	    << "\\defgroup TraceSourceList The list of all trace sources." << std::endl;
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   327
  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
   328
    {
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   329
      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
   330
      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
   331
	  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
   332
	{
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   333
	  continue;
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   334
	}
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   335
      std::cout << "<b>" << tid.GetName () << "</b><br>" << std::endl
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   336
		<< "<ul>" << std::endl;
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   337
      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
   338
	{
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   339
	  std::cout << "<li>" << tid.GetTraceSourceName (j) << ": " << tid.GetTraceSourceHelp (j) << "</li>" << std::endl;
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   340
	}
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   341
      std::cout << "</ul>" << std::endl;
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   342
    }
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   343
  std::cout << "*/" << std::endl;
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   344
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   345
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   346
  std::cout << "/*!" << std::endl
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   347
	    << "\\ingroup core" << std::endl
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   348
	    << "\\defgroup AttributeList The list of all attributes." << std::endl;
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   349
  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
   350
    {
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   351
      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
   352
      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
   353
	  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
   354
	{
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   355
	  continue;
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   356
	}
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   357
      std::cout << "<b>" << tid.GetName () << "</b><br>" << std::endl
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   358
		<< "<ul>" << std::endl;
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   359
      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
   360
	{
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   361
	  std::cout << "<li>" << tid.GetAttributeName (j) << ": " << tid.GetAttributeHelp (j) << "</li>" << std::endl;
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   362
	}
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   363
      std::cout << "</ul>" << std::endl;
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   364
    }
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   365
  std::cout << "*/" << std::endl;
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   366
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   367
4e8cb1577144 generate list of trace sources and attributes in separate dox groups.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2951
diff changeset
   368
1368
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   369
  return 0;
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   370
}