utils/print-introspected-doxygen.cc
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Thu, 10 Apr 2008 12:24:36 -0700
changeset 2945 8e9f4dc59d8b
parent 2944 d8806baadedb
child 2951 2a3db8645225
permissions -rw-r--r--
print list of trace sources
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);
2931
5bee690ea6b6 improve type linking behavior.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2693
diff changeset
    22
      os << "  <ul>" << std::endl << "    <li>Type: \\ref " <<  checker->GetType ();
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    23
      if (checker->HasTypeConstraints ())
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    24
	{
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    25
	  os << " -> " << checker->GetTypeConstraints ();
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    26
	}
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    27
      os << "</li>" << std::endl;
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);
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    29
      os << "    <li>Flags: ";
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    30
      if (flags & TypeId::ATTR_SET)
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    31
	{
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    32
	  os << "write ";
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    33
	}
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    34
      if (flags & TypeId::ATTR_GET)
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    35
	{
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    36
	  os << "read ";
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    37
	}
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    38
      if (flags & TypeId::ATTR_CONSTRUCT)
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    39
	{
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    40
	  os << "construct ";
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    41
	}
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    42
      os << "</li>" << std::endl;
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    43
      os << "  </ul> " << std::endl;
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    44
      
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 << "</ul>" << std::endl;
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
    47
}
1399
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
    48
2945
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
    49
void
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
    50
PrintTraceSources (TypeId tid, std::ostream &os)
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
    51
{
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
    52
  os << "<ul>"<<std::endl;
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
    53
  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
    54
    {
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
    55
      os << "<li><b>" << tid.GetTraceSourceName (i) << "</b>: "
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
    56
	 << tid.GetTraceSourceHelp (i)
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
    57
	 << std::endl;
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
    58
      os << "</li>" << std::endl;
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
    59
    }
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
    60
  os << "</ul>"<<std::endl;
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
    61
}
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
    62
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
    63
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    64
class StaticInformation
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    65
{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    66
public:
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    67
  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
    68
  void Gather (TypeId tid);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    69
  void Print (void) const;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    70
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    71
  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
    72
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    73
private:
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    74
  std::string GetCurrentPath (void) const;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    75
  void DoGather (TypeId tid);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    76
  void RecordOutput (TypeId tid);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    77
  bool HasAlreadyBeenProcessed (TypeId tid) const;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    78
  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
    79
  std::vector<std::string> m_currentPath;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    80
  std::vector<TypeId> m_alreadyProcessed;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    81
  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
    82
};
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    83
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    84
void 
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    85
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
    86
{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    87
  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
    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::Print (void) const
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
  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
    94
    {
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
    95
      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
    96
      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
    97
    }
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
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   100
std::string
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   101
StaticInformation::GetCurrentPath (void) const
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   102
{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   103
  std::ostringstream oss;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   104
  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
   105
    {
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   106
      std::string item = *i;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   107
      oss << "/" << item;
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
  return oss.str ();
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   110
}
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
void
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   113
StaticInformation::RecordOutput (TypeId tid)
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
  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
   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
bool
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   119
StaticInformation::HasAlreadyBeenProcessed (TypeId tid) const
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
  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
   122
    {
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   123
      if (m_alreadyProcessed[i] == tid)
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   124
	{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   125
	  return true;
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
    }
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   128
  return false;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   129
}
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
std::vector<std::string> 
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   132
StaticInformation::Get (TypeId tid)
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
  std::vector<std::string> paths;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   135
  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
   136
    {
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   137
      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
   138
      if (tmp.first == 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
	  paths.push_back (tmp.second);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   141
	}
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
  return paths;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   144
}
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
void
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   147
StaticInformation::Gather (TypeId tid)
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
  DoGather (tid);
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
  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
   152
  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
   153
}
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
void 
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   156
StaticInformation::DoGather (TypeId tid)
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   157
{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   158
  NS_LOG_FUNCTION;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   159
  if (HasAlreadyBeenProcessed (tid))
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
      return;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   162
    }
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   163
  RecordOutput (tid);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   164
  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
   165
    {
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   166
      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
   167
      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
   168
      if (ptrChecker != 0)
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   169
	{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   170
	  TypeId pointee = ptrChecker->GetPointeeTypeId ();
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   171
	  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
   172
	  m_alreadyProcessed.push_back (tid);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   173
	  DoGather (pointee);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   174
	  m_alreadyProcessed.pop_back ();
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   175
	  m_currentPath.pop_back ();
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   176
	  continue;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   177
	}
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   178
      // 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
   179
      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
   180
      if (vectorChecker != 0)
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   181
	{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   182
	  TypeId item = vectorChecker->GetItemTypeId ();
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   183
	  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
   184
	  m_alreadyProcessed.push_back (tid);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   185
	  DoGather (item);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   186
	  m_alreadyProcessed.pop_back ();
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   187
	  m_currentPath.pop_back ();
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   188
	  continue;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   189
	}
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   190
    }
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   191
  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
   192
    {
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   193
      TypeId child = TypeId::GetRegistered (j);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   194
      if (child.IsChildOf (tid))
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
	  m_currentPath.push_back ("$%" + child.GetName ());
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   197
	  m_alreadyProcessed.push_back (tid);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   198
	  DoGather (child);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   199
	  m_alreadyProcessed.pop_back ();
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   200
	  m_currentPath.pop_back ();
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
    }
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   203
  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
   204
    {
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   205
      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
   206
      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
   207
	{
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   208
	  TypeId other;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   209
	  if (tmp.first == tid)
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
	      other = tmp.second;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   212
	    }
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   213
	  if (tmp.second == tid)
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   214
	    {
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   215
	      other = tmp.first;
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
	  // 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
   218
	  // 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
   219
	  m_currentPath.push_back ("$%" + other.GetName ());
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   220
	  m_alreadyProcessed.push_back (tid);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   221
	  DoGather (other);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   222
	  m_alreadyProcessed.pop_back ();
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   223
	  m_currentPath.pop_back ();	  
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   224
	}
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
}
1399
5945e92014e2 move printing to client code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1376
diff changeset
   227
1368
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   228
int main (int argc, char *argv[])
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   229
{
2944
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   230
  NodeContainer c; c.Create (1);
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
  StaticInformation info;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   233
  info.RecordAggregationInfo ("ns3::Node", "ns3::Tcp");
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   234
  info.RecordAggregationInfo ("ns3::Node", "ns3::Udp");
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   235
  info.RecordAggregationInfo ("ns3::Node", "ns3::PacketSocketFactory");
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   236
  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
   237
  info.RecordAggregationInfo ("ns3::Node", "ns3::MobilityModel");
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   238
  info.RecordAggregationInfo ("ns3::Node", "ns3::Ipv4L4Demux");
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   239
  info.RecordAggregationInfo ("ns3::Node", "ns3::Ipv4L3Protocol");
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   240
  info.RecordAggregationInfo ("ns3::Node", "ns3::ArpL3Protocol");
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
  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
   243
    {
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   244
      Ptr<Object> object = Config::GetRootNamespaceObject (i);
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   245
      info.Gather (object->GetInstanceTypeId ());
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   246
    }
1368
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   247
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   248
  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
   249
    {
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   250
      std::cout << "/*!" << std::endl;
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   251
      TypeId tid = TypeId::GetRegistered (i);
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   252
      if (tid.MustHideFromDocumentation ())
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   253
	{
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   254
	  continue;
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 << "\\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
   257
      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
   258
		<< std::endl << std::endl;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   259
      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
   260
      if (!paths.empty ())
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::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
   263
		    << std::endl;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   264
	  std::cout << "<ul>" << std::endl;
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   265
	  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
   266
	    {
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   267
	      std::string path = paths[k];
d8806baadedb generate path information for each type.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2931
diff changeset
   268
	      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
   269
	    }
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
	}
2693
56e28e34e109 TypeId::GetAttributeListN -> TypeId::GetAttributeN
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
   272
      if (tid.GetAttributeN () == 0)
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   273
	{
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   274
	  std::cout << "No Attributes defined for this type." << std::endl;
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   275
	}
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   276
      else
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   277
	{
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   278
	  std::cout << "Attributes defined for this type:" << std::endl;
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   279
	  PrintAttributes (tid, std::cout);
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   280
	}
2945
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   281
      {
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   282
	TypeId tmp = tid.GetParent ();
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   283
	while (tmp.GetParent () != tmp)
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   284
	  {
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   285
	    if (tmp.GetAttributeN () != 0)
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   286
	      {
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   287
		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
   288
		PrintAttributes (tmp, std::cout);
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   289
	      }
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   290
	    tmp = tmp.GetParent ();
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   291
	  }
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
      if (tid.GetTraceSourceN () == 0)
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   294
	{
2945
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   295
	  std::cout << "No TraceSources defined for this type." << std::endl;
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   296
	}
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   297
      else
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
	  std::cout << "TraceSources defined for this type:" << std::endl;
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   300
	  PrintTraceSources (tid, std::cout);
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   301
	}
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
	TypeId tmp = tid.GetParent ();
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   304
	while (tmp.GetParent () != tmp)
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   305
	  {
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   306
	    if (tmp.GetTraceSourceN () != 0)
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   307
	      {
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   308
		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
   309
		PrintTraceSources (tmp, std::cout);
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   310
	      }
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   311
	    tmp = tmp.GetParent ();
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   312
	  }
8e9f4dc59d8b print list of trace sources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2944
diff changeset
   313
      }
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   314
      std::cout << "*/" << std::endl;
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2600
diff changeset
   315
    }
1368
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   316
1853
e2d7985a5938 print default value list in trace source list doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1538
diff changeset
   317
1368
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   318
  return 0;
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   319
}