use new API, kill old one.

This commit is contained in:
Mathieu Lacage
2011-08-03 10:17:01 -04:00
parent f8e1230105
commit 2a77dd3641
3 changed files with 9 additions and 52 deletions

View File

@@ -618,12 +618,6 @@ TypeId::GetAttribute(uint32_t i) const
return Singleton<IidManager>::Get ()->GetAttribute(m_tid, i);
}
std::string
TypeId::GetAttributeHelp (uint32_t i) const
{
std::string help = Singleton<IidManager>::Get ()->GetAttributeHelp (m_tid, i);
return help;
}
std::string
TypeId::GetAttributeFullName (uint32_t i) const
{
struct TypeId::AttributeInformation info = GetAttribute(i);
@@ -647,22 +641,6 @@ TypeId::GetTraceSource(uint32_t i) const
return Singleton<IidManager>::Get ()->GetTraceSource(m_tid, i);
}
std::string
TypeId::GetTraceSourceName (uint32_t i) const
{
return Singleton<IidManager>::Get ()->GetTraceSourceName (m_tid, i);
}
std::string
TypeId::GetTraceSourceHelp (uint32_t i) const
{
return Singleton<IidManager>::Get ()->GetTraceSourceHelp (m_tid, i);
}
Ptr<const TraceSourceAccessor>
TypeId::GetTraceSourceAccessor (uint32_t i) const
{
return Singleton<IidManager>::Get ()->GetTraceSourceAccessor (m_tid, i);
}
TypeId
TypeId::AddTraceSource (std::string name,
std::string help,
@@ -689,10 +667,10 @@ TypeId::LookupTraceSourceByName (std::string name) const
tid = nextTid;
for (uint32_t i = 0; i < tid.GetTraceSourceN (); i++)
{
std::string srcName = tid.GetTraceSourceName (i);
if (srcName == name)
struct TypeId::TraceSourceInformation info = tid.GetTraceSource (i);
if (info.name == name)
{
return tid.GetTraceSourceAccessor (i);
return info.accessor;
}
}
nextTid = tid.GetParent ();

View File

@@ -22,6 +22,7 @@
#include "attribute.h"
#include "attribute-accessor-helper.h"
#include "trace-source-accessor.h"
#include "attribute-helper.h"
#include "callback.h"
#include <string>
@@ -30,7 +31,6 @@
namespace ns3 {
class ObjectBase;
class TraceSourceAccessor;
/**
* \brief a unique identifier for an interface.
@@ -151,12 +151,6 @@ public:
* index is i.
*/
struct TypeId::AttributeInformation GetAttribute(uint32_t i) const;
/**
* \param i index into attribute array.
* \returns the help text associated to the attribute whose
* index is i.
*/
std::string GetAttributeHelp (uint32_t i) const;
/**
* \param i index into attribute array
* \returns the full name associated to the attribute whose
@@ -193,23 +187,6 @@ public:
* \returns detailed information about the requested trace source.
*/
struct TypeId::TraceSourceInformation GetTraceSource(uint32_t i) const;
/**
* \param i index into trace source array.
* \returns the name of the requested trace source.
*/
std::string GetTraceSourceName (uint32_t i) const;
/**
* \param i index into trace source array.
* \returns the help text of the requested trace source.
*/
std::string GetTraceSourceHelp (uint32_t i) const;
/**
* \param i index into trace source array.
* \returns the accessor used to get access to the requested
* trace source.
*/
Ptr<const TraceSourceAccessor> GetTraceSourceAccessor (uint32_t i) const;
/**
* \param tid the TypeId of the base class.

View File

@@ -58,8 +58,9 @@ PrintTraceSources (TypeId tid, std::ostream &os)
os << "<ul>"<<std::endl;
for (uint32_t i = 0; i < tid.GetTraceSourceN (); ++i)
{
os << "<li><b>" << tid.GetTraceSourceName (i) << "</b>: "
<< tid.GetTraceSourceHelp (i)
struct TypeId::TraceSourceInformation info = tid.GetTraceSource (i);
os << "<li><b>" << info.name << "</b>: "
<< info.help
<< std::endl;
os << "</li>" << std::endl;
}
@@ -362,7 +363,8 @@ int main (int argc, char *argv[])
<< "<ul>" << std::endl;
for (uint32_t j = 0; j < tid.GetTraceSourceN (); ++j)
{
std::cout << "<li>" << tid.GetTraceSourceName (j) << ": " << tid.GetTraceSourceHelp (j) << "</li>" << std::endl;
struct TypeId::TraceSourceInformation info = tid.GetTraceSource(j);
std::cout << "<li>" << info.name << ": " << info.help << "</li>" << std::endl;
}
std::cout << "</ul>" << std::endl;
}