src/core/trace-context-element.cc
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Thu, 30 Aug 2007 13:58:15 +0200
changeset 1399 5945e92014e2
parent 1364 7866d4dd9e64
child 1401 96a21130865c
permissions -rw-r--r--
move printing to client code

#include "trace-context-element.h"

namespace ns3 {

std::string 
ElementRegistry::GetName (uint16_t uid)
{
  InfoVector *vec = GetInfoVector ();
  struct Info info = (*vec)[uid - 1];
  return info.getName ();
}
uint32_t 
ElementRegistry::GetSize (uint16_t uid)
{
  InfoVector *vec = GetInfoVector ();
  struct Info info = (*vec)[uid - 1];
  return info.size;
}
void 
ElementRegistry::Print (uint16_t uid, uint8_t *instance, std::ostream &os)
{
  InfoVector *vec = GetInfoVector ();
  struct Info info = (*vec)[uid - 1];
  info.print (instance, os);
}
void 
ElementRegistry::Destroy (uint16_t uid, uint8_t *instance)
{
  InfoVector *vec = GetInfoVector ();
  struct Info info = (*vec)[uid - 1];
  info.destroy (instance);
}
ElementRegistry::InfoVector *
ElementRegistry::GetInfoVector (void)
{
  static InfoVector vector;
  return &vector;
}


} // namespace ns3