utils/print-introspected-doxygen.cc
changeset 2693 56e28e34e109
parent 2602 d9262bff6df2
child 2931 5bee690ea6b6
equal deleted inserted replaced
2692:e4387e19039d 2693:56e28e34e109
     5 
     5 
     6 void
     6 void
     7 PrintAttributes (TypeId tid, std::ostream &os)
     7 PrintAttributes (TypeId tid, std::ostream &os)
     8 {
     8 {
     9   os << "<ul>"<<std::endl;
     9   os << "<ul>"<<std::endl;
    10   for (uint32_t j = 0; j < tid.GetAttributeListN (); j++)
    10   for (uint32_t j = 0; j < tid.GetAttributeN (); j++)
    11     {
    11     {
    12       os << "<li><b>" << tid.GetAttributeName (j) << "</b>: "
    12       os << "<li><b>" << tid.GetAttributeName (j) << "</b>: "
    13 		<< tid.GetAttributeHelp (j) << std::endl;
    13 		<< tid.GetAttributeHelp (j) << std::endl;
    14       Ptr<const AttributeChecker> checker = tid.GetAttributeChecker (j);
    14       Ptr<const AttributeChecker> checker = tid.GetAttributeChecker (j);
    15       os << "  <ul>" << std::endl << "    <li>Type: " <<  checker->GetType ();
    15       os << "  <ul>" << std::endl << "    <li>Type: " <<  checker->GetType ();
    50 	{
    50 	{
    51 	  continue;
    51 	  continue;
    52 	}
    52 	}
    53       std::cout << "\\fn static TypeId " << tid.GetName () << "::GetTypeId (void)" << std::endl;
    53       std::cout << "\\fn static TypeId " << tid.GetName () << "::GetTypeId (void)" << std::endl;
    54       std::cout << "\\brief This method returns the TypeId associated to \\ref " << tid.GetName () << std::endl << std::endl;
    54       std::cout << "\\brief This method returns the TypeId associated to \\ref " << tid.GetName () << std::endl << std::endl;
    55       if (tid.GetAttributeListN () == 0)
    55       if (tid.GetAttributeN () == 0)
    56 	{
    56 	{
    57 	  std::cout << "No Attributes defined for this type." << std::endl;
    57 	  std::cout << "No Attributes defined for this type." << std::endl;
    58 	}
    58 	}
    59       else
    59       else
    60 	{
    60 	{
    63 	}
    63 	}
    64       bool hasAttributesInParent = false;
    64       bool hasAttributesInParent = false;
    65       TypeId tmp = tid.GetParent ();
    65       TypeId tmp = tid.GetParent ();
    66       while (tmp.GetParent () != tmp)
    66       while (tmp.GetParent () != tmp)
    67 	{
    67 	{
    68 	  if (tmp.GetAttributeListN () != 0)
    68 	  if (tmp.GetAttributeN () != 0)
    69 	    {
    69 	    {
    70 	      hasAttributesInParent = true;
    70 	      hasAttributesInParent = true;
    71 	    }
    71 	    }
    72 	  tmp = tmp.GetParent ();
    72 	  tmp = tmp.GetParent ();
    73 	}
    73 	}
    75 	{
    75 	{
    76 	  std::cout << "Attributes defined in parent classes:<br>" << std::endl;
    76 	  std::cout << "Attributes defined in parent classes:<br>" << std::endl;
    77 	  tmp = tid.GetParent ();
    77 	  tmp = tid.GetParent ();
    78 	  while (tmp.GetParent () != tmp)
    78 	  while (tmp.GetParent () != tmp)
    79 	    {
    79 	    {
    80 	      if (tmp.GetAttributeListN () != 0)
    80 	      if (tmp.GetAttributeN () != 0)
    81 		{
    81 		{
    82 		  std::cout << tmp.GetName () << std::endl;
    82 		  std::cout << tmp.GetName () << std::endl;
    83 		  PrintAttributes (tmp, std::cout);
    83 		  PrintAttributes (tmp, std::cout);
    84 		}
    84 		}
    85 	      tmp = tmp.GetParent ();
    85 	      tmp = tmp.GetParent ();