src/common/trace-context-element.cc
changeset 1421 df273f351a4c
parent 1323 08174b13d76f
parent 1420 3feedd3e4f5f
child 1422 d40dfd686fc3
equal deleted inserted replaced
1323:08174b13d76f 1421:df273f351a4c
     1 #include "trace-context-element.h"
       
     2 
       
     3 namespace ns3 {
       
     4 
       
     5 uint32_t 
       
     6 ElementRegistry::GetSize (uint16_t uid)
       
     7 {
       
     8   InfoVector *vec = GetInfoVector ();
       
     9   struct Info info = (*vec)[uid - 1];
       
    10   return info.size;
       
    11 }
       
    12 void 
       
    13 ElementRegistry::Print (uint16_t uid, uint8_t *instance, std::ostream &os)
       
    14 {
       
    15   InfoVector *vec = GetInfoVector ();
       
    16   struct Info info = (*vec)[uid - 1];
       
    17   info.print (instance, os);
       
    18 }
       
    19 void 
       
    20 ElementRegistry::Destroy (uint16_t uid, uint8_t *instance)
       
    21 {
       
    22   InfoVector *vec = GetInfoVector ();
       
    23   struct Info info = (*vec)[uid - 1];
       
    24   info.destroy (instance);
       
    25 }
       
    26 ElementRegistry::InfoVector *
       
    27 ElementRegistry::GetInfoVector (void)
       
    28 {
       
    29   static InfoVector vector;
       
    30   return &vector;
       
    31 }
       
    32 
       
    33 
       
    34 } // namespace ns3