add functions to access list of root namespace objects
This commit is contained in:
@@ -290,6 +290,9 @@ public:
|
||||
|
||||
void RegisterRootNamespaceObject (Ptr<Object> obj);
|
||||
void UnregisterRootNamespaceObject (Ptr<Object> obj);
|
||||
|
||||
uint32_t GetRootNamespaceObjectN (void) const;
|
||||
Ptr<Object> GetRootNamespaceObject (uint32_t i) const;
|
||||
|
||||
private:
|
||||
typedef std::vector<Ptr<Object> > Roots;
|
||||
@@ -415,6 +418,16 @@ ConfigImpl::UnregisterRootNamespaceObject (Ptr<Object> obj)
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t
|
||||
ConfigImpl::GetRootNamespaceObjectN (void) const
|
||||
{
|
||||
return m_roots.size ();
|
||||
}
|
||||
Ptr<Object>
|
||||
ConfigImpl::GetRootNamespaceObject (uint32_t i) const
|
||||
{
|
||||
return m_roots[i];
|
||||
}
|
||||
|
||||
namespace Config {
|
||||
|
||||
@@ -467,6 +480,17 @@ void UnregisterRootNamespaceObject (Ptr<Object> obj)
|
||||
Singleton<ConfigImpl>::Get ()->UnregisterRootNamespaceObject (obj);
|
||||
}
|
||||
|
||||
uint32_t GetRootNamespaceObjectN (void)
|
||||
{
|
||||
return Singleton<ConfigImpl>::Get ()->GetRootNamespaceObjectN ();
|
||||
}
|
||||
|
||||
Ptr<Object> GetRootNamespaceObject (uint32_t i)
|
||||
{
|
||||
return Singleton<ConfigImpl>::Get ()->GetRootNamespaceObject (i);
|
||||
}
|
||||
|
||||
|
||||
} // namespace Config
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
@@ -118,6 +118,17 @@ void RegisterRootNamespaceObject (Ptr<Object> obj);
|
||||
*/
|
||||
void UnregisterRootNamespaceObject (Ptr<Object> obj);
|
||||
|
||||
/**
|
||||
* \returns the number of registered root namespace objects.
|
||||
*/
|
||||
uint32_t GetRootNamespaceObjectN (void);
|
||||
|
||||
/**
|
||||
* \param i the index of the requested object.
|
||||
* \returns the requested root namespace object
|
||||
*/
|
||||
Ptr<Object> GetRootNamespaceObject (uint32_t i);
|
||||
|
||||
} // namespace Config
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
Reference in New Issue
Block a user