src/core/trace-resolver.cc
changeset 1397 fdc239ba72a7
parent 1390 0ae2c2fb7f37
child 1399 5945e92014e2
equal deleted inserted replaced
1396:105d16b9bf04 1397:fdc239ba72a7
    92   source.path = path;
    92   source.path = path;
    93   source.context = context;
    93   source.context = context;
    94   source.doc = doc;
    94   source.doc = doc;
    95   m_sources.push_back (source);
    95   m_sources.push_back (source);
    96 }
    96 }
    97 void 
    97 void
    98 TraceResolver::SourceCollection::Print (std::ostream &os) const
    98 TraceResolver::SourceCollection::Print (std::ostream &os) const
    99 {
    99 {
   100   for (SourceVector::const_iterator i = m_sources.begin (); i != m_sources.end (); i++)
   100   for (SourceVector::const_iterator i = m_sources.begin (); i != m_sources.end (); i++)
   101     {
   101     {
   102       os << "source=" << i->path << std::endl;
   102       os << "source=" << i->path << std::endl;
   118           k++;
   118           k++;
   119         }
   119         }
   120       os << std::endl;
   120       os << std::endl;
   121     }
   121     }
   122 }
   122 }
       
   123 void 
       
   124 TraceResolver::SourceCollection::PrintDoxygen (std::ostream &os) const
       
   125 {
       
   126   uint32_t z = 0;
       
   127   for (SourceVector::const_iterator i = m_sources.begin (); i != m_sources.end (); i++)
       
   128     {
       
   129       os << "///" << std::endl;
       
   130       os << "/// \\ingroup TraceSourceList" << std::endl; 
       
   131       os << "/// \\brief " << i->doc.GetHelp () << std::endl;
       
   132       os << "/// \\param arg1 the trace context associated to the connected trace source." << std::endl;
       
   133       uint32_t j = 2;
       
   134       for (TraceDoc::Iterator l = i->doc.ArgsBegin (); l != i->doc.ArgsEnd (); l++)
       
   135         {
       
   136           os << "/// \\param arg" << j << " " << l->second << "." << std::endl;
       
   137           j++;
       
   138         }
       
   139       os << "///" << std::endl;
       
   140       os << "///" << std::endl;
       
   141       os << "/// The path to this trace source is: " << i->path << "." << std::endl;
       
   142       os << "///" << std::endl;
       
   143       if (i->context.AvailableBegin () == i->context.AvailableEnd ())
       
   144         {
       
   145           os << "/// No data can be extracted from \\p arg1 with ns3::TraceContext::GetElement." << std::endl;
       
   146         }
       
   147       else
       
   148         {
       
   149           os << "/// The following classes can be extracted from \\p arg1 with " << std::endl;
       
   150           os << "/// ns3::TraceContext::GetElement:" << std::endl;
       
   151           for (TraceContext::Iterator m = i->context.AvailableBegin (); m != i->context.AvailableEnd (); m++)
       
   152             {
       
   153               os << "///  - " << (*m) << std::endl;
       
   154             }
       
   155         }
       
   156       os << "void TraceSinkCallback" << z << " (const TraceContext & arg1" ;
       
   157       j = 2;
       
   158       for (TraceDoc::Iterator k = i->doc.ArgsBegin (); k != i->doc.ArgsEnd (); k++)
       
   159         {
       
   160           os << ", " << k->first << " arg" << j;
       
   161           j++;
       
   162         }
       
   163       os << ");" << std::endl;
       
   164       os << std::endl;
       
   165       z++;
       
   166     }
       
   167 }
   123 
   168 
   124 }//namespace ns3
   169 }//namespace ns3