register and unregister the NodeList as a config root namespace
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Sun, 02 Mar 2008 21:12:21 +0100
changeset 253286a40c7cbfe9
parent 2531 b451b5fc8b57
child 2533 80cdc3eec057
register and unregister the NodeList as a config root namespace
src/core/config.cc
src/core/config.h
src/node/node-list.cc
     1.1 --- a/src/core/config.cc	Sun Mar 02 21:00:37 2008 +0100
     1.2 +++ b/src/core/config.cc	Sun Mar 02 21:12:21 2008 +0100
     1.3 @@ -411,7 +411,7 @@
     1.4    Singleton<ConfigImpl>::Get ()->RegisterRootNamespaceObject (obj);
     1.5  }
     1.6  
     1.7 -void Unregister (Ptr<Object> obj)
     1.8 +void UnregisterRootNamespaceObject (Ptr<Object> obj)
     1.9  {
    1.10    Singleton<ConfigImpl>::Get ()->UnregisterRootNamespaceObject (obj);
    1.11  }
     2.1 --- a/src/core/config.h	Sun Mar 02 21:00:37 2008 +0100
     2.2 +++ b/src/core/config.h	Sun Mar 02 21:12:21 2008 +0100
     2.3 @@ -18,6 +18,7 @@
     2.4  void ConnectWithContext (std::string path, const CallbackBase &cb);
     2.5  
     2.6  void RegisterRootNamespaceObject (Ptr<Object> obj);
     2.7 +void UnregisterRootNamespaceObject (Ptr<Object> obj);
     2.8  
     2.9  } // namespace Config
    2.10  
     3.1 --- a/src/node/node-list.cc	Sun Mar 02 21:00:37 2008 +0100
     3.2 +++ b/src/node/node-list.cc	Sun Mar 02 21:12:21 2008 +0100
     3.3 @@ -23,6 +23,7 @@
     3.4  #include "ns3/composite-trace-resolver.h"
     3.5  #include "ns3/simulator.h"
     3.6  #include "ns3/object-vector.h"
     3.7 +#include "ns3/config.h"
     3.8  #include "node-list.h"
     3.9  #include "node.h"
    3.10  
    3.11 @@ -107,6 +108,7 @@
    3.12    if (ptr == 0)
    3.13      {
    3.14        ptr = CreateObject<NodeListPriv> ();
    3.15 +      Config::RegisterRootNamespaceObject (ptr);
    3.16        Simulator::ScheduleDestroy (&NodeListPriv::Delete);
    3.17      }
    3.18    return &ptr;
    3.19 @@ -114,6 +116,7 @@
    3.20  void 
    3.21  NodeListPriv::Delete (void)
    3.22  {
    3.23 +  Config::UnregisterRootNamespaceObject (Get ());
    3.24    (*DoGet ()) = 0;
    3.25  }
    3.26