src/core/trace-resolver.cc
changeset 1399 5945e92014e2
parent 1397 fdc239ba72a7
child 1504 36ecc970ba96
equal deleted inserted replaced
1398:607b6e86e143 1399:5945e92014e2
    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 TraceResolver::SourceCollection::Iterator
    98 TraceResolver::SourceCollection::Print (std::ostream &os) const
    98 TraceResolver::SourceCollection::Begin (void) const
    99 {
    99 {
   100   for (SourceVector::const_iterator i = m_sources.begin (); i != m_sources.end (); i++)
   100   return m_sources.begin ();
   101     {
       
   102       os << "source=" << i->path << std::endl;
       
   103       os << "TraceContext=[";
       
   104       i->context.PrintAvailable (os, ",");
       
   105       os << "]" << std::endl;
       
   106       os << "help=\"" << i->doc.GetHelp () << "\"" << std::endl;
       
   107       os << "void TraceSinkCallback (const TraceContext &";
       
   108       for (TraceDoc::Iterator k = i->doc.ArgsBegin (); k != i->doc.ArgsEnd (); k++)
       
   109         {
       
   110           os << ", " << k->first;
       
   111         }
       
   112       os << ")" << std::endl;
       
   113       os << "argument 1  --  the trace context associated to the connected trace source." << std::endl;
       
   114       uint32_t k = 2;
       
   115       for (TraceDoc::Iterator j = i->doc.ArgsBegin (); j != i->doc.ArgsEnd (); j++)
       
   116         {
       
   117           os << "argument " << k << "  --  " << j->second << "." << std::endl;
       
   118           k++;
       
   119         }
       
   120       os << std::endl;
       
   121     }
       
   122 }
   101 }
   123 void 
   102 TraceResolver::SourceCollection::Iterator
   124 TraceResolver::SourceCollection::PrintDoxygen (std::ostream &os) const
   103 TraceResolver::SourceCollection::End (void) const
   125 {
   104 {
   126   uint32_t z = 0;
   105   return m_sources.end ();
   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 }
   106 }
   168 
       
   169 }//namespace ns3
   107 }//namespace ns3