move default value output to print-trace-sources utility

This commit is contained in:
Mathieu Lacage
2007-10-29 14:55:16 +01:00
parent aedad2ccb0
commit dbfc58c5ed
4 changed files with 36 additions and 40 deletions

View File

@@ -497,7 +497,6 @@ INPUT = src \
doc/main.txt \
doc/trace-source-list.h \
doc/tracing.h \
doc/default-value-list.h
# This tag can be used to specify the character encoding of the source files that
# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default

View File

@@ -1,35 +0,0 @@
#include "ns3/default-value.h"
using namespace ns3;
static void
PrintOne (DefaultValueBase *value, std::ostream &os)
{
os << "/// <li> \\anchor DefaultValue" << value->GetName ()
<< " " << value->GetName () << std::endl;
os << "/// <ul>" << std::endl;
os << "/// <li>Type: " << value->GetType () << "</td></tr>" << std::endl;
os << "/// <li>Default value: " << value->GetDefaultValue () << "</td></tr>" << std::endl;
os << "/// <li>Description: " << value->GetHelp () << "</td></tr>" << std::endl;
os << "/// </ul>" << std::endl;
os << "/// </li>" << std::endl;
}
int main (int argc, char *argv[])
{
std::ostream &os = std::cout;
os << "/// \\page ListOfDefaultValues The list of default values" << std::endl;
os << "/// \\defgroup ListOfDefaultValuesGroup The list of default values" << std::endl;
os << "/// <ul>" << std::endl;
for (DefaultValueList::Iterator i = DefaultValueList::Begin ();
i != DefaultValueList::End (); i++)
{
if ((*i)->GetName () == "help")
{
continue;
}
PrintOne (*i, os);
}
os << "/// </ul>" << std::endl;
return 0;
}

View File

@@ -6,6 +6,7 @@
#include "ns3/csma-net-device.h"
#include "ns3/queue.h"
#include "ns3/mobility-model-notifier.h"
#include "ns3/default-value.h"
using namespace ns3;
@@ -35,7 +36,7 @@ PrintSimpleText (const TraceResolver::SourceCollection *sources, std::ostream &o
os << std::endl;
}
}
void
static void
PrintDoxygenText (const TraceResolver::SourceCollection *sources, std::ostream &os)
{
uint32_t z = 0;
@@ -81,6 +82,37 @@ PrintDoxygenText (const TraceResolver::SourceCollection *sources, std::ostream &
}
}
static void
PrintOneDefaultValue (DefaultValueBase *value, std::ostream &os)
{
os << "/// <li> \\anchor DefaultValue" << value->GetName ()
<< " " << value->GetName () << std::endl;
os << "/// <ul>" << std::endl;
os << "/// <li>Type: " << value->GetType () << "</td></tr>" << std::endl;
os << "/// <li>Default value: " << value->GetDefaultValue () << "</td></tr>" << std::endl;
os << "/// <li>Description: " << value->GetHelp () << "</td></tr>" << std::endl;
os << "/// </ul>" << std::endl;
os << "/// </li>" << std::endl;
}
static void
PrintDefaultValuesDoxygen (std::ostream &os)
{
os << "/// \\page ListOfDefaultValues The list of default values" << std::endl;
os << "/// \\defgroup ListOfDefaultValuesGroup The list of default values" << std::endl;
os << "/// <ul>" << std::endl;
for (DefaultValueList::Iterator i = DefaultValueList::Begin ();
i != DefaultValueList::End (); i++)
{
if ((*i)->GetName () == "help")
{
continue;
}
PrintOneDefaultValue (*i, os);
}
os << "/// </ul>" << std::endl;
}
int main (int argc, char *argv[])
{
@@ -96,5 +128,8 @@ int main (int argc, char *argv[])
NodeList::GetTraceResolver ()->CollectSources ("", TraceContext (), &collection);
PrintDoxygenText (&collection, std::cout);
PrintDefaultValuesDoxygen (std::cout);
return 0;
}

View File

@@ -40,6 +40,3 @@ def build(bld):
if os.path.basename(obj.env['CXX']).startswith("g++"):
obj.env.append_value('CXXFLAGS', '-fno-strict-aliasing')
obj = bld.create_ns3_program('print-default-values',
['core'])
obj.source = 'print-default-values.cc'