A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::NamesPriv Class Reference

The singleton root Names object. More...

+ Inheritance diagram for ns3::NamesPriv:
+ Collaboration diagram for ns3::NamesPriv:

Public Member Functions

 NamesPriv ()
 Constructor.
 
 ~NamesPriv () override
 Destructor.
 
bool Add (Ptr< Object > context, std::string name, Ptr< Object > object)
 Internal implementation for Names::Add(Ptr<Object>,std::string,Ptr<Object>)
 
bool Add (std::string name, Ptr< Object > object)
 Internal implementation for Names::Add(std::string,Ptr<Object>)
 
bool Add (std::string path, std::string name, Ptr< Object > object)
 Internal implementation for Names::Add(std::string,std::string,Ptr<Object>)
 
void Clear ()
 Internal implementation for Names::Clear()
 
Ptr< ObjectFind (Ptr< Object > context, std::string name)
 Internal implementation for ns3::Names::Find(Ptr<Object>,std::string)
 
Ptr< ObjectFind (std::string path)
 Internal implementation for ns3::Names::Find(std::string)
 
Ptr< ObjectFind (std::string path, std::string name)
 Internal implementation for ns3::Names::Find(std::string,std::string)
 
std::string FindName (Ptr< Object > object)
 Internal implementation for Names::FindName()
 
std::string FindPath (Ptr< Object > object)
 Internal implementation of Names::FindPath()
 
bool Rename (Ptr< Object > context, std::string oldname, std::string newname)
 Internal implementation for Names::Rename(Ptr<Object>,std::string,std::string)
 
bool Rename (std::string oldpath, std::string newname)
 Internal implementation for Names::Rename(std::string,std::string)
 
bool Rename (std::string path, std::string oldname, std::string newname)
 Internal implementation for Names::Rename(std::string,std::string,std::string)
 
- Public Member Functions inherited from ns3::Singleton< NamesPriv >
 Singleton (const Singleton< NamesPriv > &)=delete
 
Singletonoperator= (const Singleton< NamesPriv > &)=delete
 

Private Member Functions

bool IsDuplicateName (NameNode *node, std::string name)
 Check if a name already exists as a child of a NameNode.
 
NameNodeIsNamed (Ptr< Object > object)
 Check if an object has a name.
 

Private Attributes

std::map< Ptr< Object >, NameNode * > m_objectMap
 Map from object pointers to their NameNodes.
 
NameNode m_root
 The root NameNode.
 

Additional Inherited Members

- Static Public Member Functions inherited from ns3::Singleton< NamesPriv >
static NamesPrivGet ()
 Get a pointer to the singleton instance.
 
- Protected Member Functions inherited from ns3::Singleton< NamesPriv >
 Singleton ()
 Constructor.
 
virtual ~Singleton ()
 Destructor.
 

Detailed Description

The singleton root Names object.

Definition at line 126 of file names.cc.

Constructor & Destructor Documentation

◆ NamesPriv()

ns3::NamesPriv::NamesPriv ( )

Constructor.

Definition at line 282 of file names.cc.

References ns3::NameNode::m_name, ns3::NameNode::m_object, ns3::NameNode::m_parent, m_root, and NS_LOG_FUNCTION.

◆ ~NamesPriv()

ns3::NamesPriv::~NamesPriv ( )
override

Destructor.

Definition at line 291 of file names.cc.

References Clear(), ns3::NameNode::m_name, m_root, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

Member Function Documentation

◆ Add() [1/3]

bool ns3::NamesPriv::Add ( Ptr< Object context,
std::string  name,
Ptr< Object object 
)

Internal implementation for Names::Add(Ptr<Object>,std::string,Ptr<Object>)

Parameters
[in]contextA smart pointer to an object that is used in place of the path under which you want this new name to be defined.
[in]nameThe name of the object you want to associate.
[in]objectA smart pointer to the object itself.
Returns
true if the object was named successfully.

Definition at line 395 of file names.cc.

References IsDuplicateName(), IsNamed(), ns3::NameNode::m_nameMap, m_objectMap, m_root, NS_ASSERT_MSG, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

+ Here is the call graph for this function:

◆ Add() [2/3]

bool ns3::NamesPriv::Add ( std::string  name,
Ptr< Object object 
)

Internal implementation for Names::Add(std::string,Ptr<Object>)

Parameters
[in]nameThe name of the object you want to associate; which may be prepended with a path to that object.
[in]objectA smart pointer to the object itself.
Returns
true if the object was named successfully.

Definition at line 321 of file names.cc.

References Add(), NS_ASSERT_MSG, and NS_LOG_FUNCTION.

Referenced by Add(), and ns3::Names::Add().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Add() [3/3]

bool ns3::NamesPriv::Add ( std::string  path,
std::string  name,
Ptr< Object object 
)

Internal implementation for Names::Add(std::string,std::string,Ptr<Object>)

Parameters
[in]pathA path name describing a previously named object under which you want this new name to be defined.
[in]nameThe name of the object you want to associate.
[in]objectA smart pointer to the object itself.
Returns
true if the object was named successfully.

Definition at line 384 of file names.cc.

References Add(), Find(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ Clear()

void ns3::NamesPriv::Clear ( )

Internal implementation for Names::Clear()

Definition at line 299 of file names.cc.

References ns3::NameNode::m_name, ns3::NameNode::m_nameMap, ns3::NameNode::m_object, m_objectMap, ns3::NameNode::m_parent, m_root, and NS_LOG_FUNCTION.

Referenced by ~NamesPriv(), and ns3::Names::Clear().

+ Here is the caller graph for this function:

◆ Find() [1/3]

Ptr< Object > ns3::NamesPriv::Find ( Ptr< Object context,
std::string  name 
)

Internal implementation for ns3::Names::Find(Ptr<Object>,std::string)

Parameters
[in]contextA smart pointer to an object that is used in place of the path under which you want this new name to be defined.
[in]nameA string containing a name to search for.
Returns
A smart pointer to the named object converted to the requested type.

Definition at line 704 of file names.cc.

References IsNamed(), ns3::NameNode::m_nameMap, m_root, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

+ Here is the call graph for this function:

◆ Find() [2/3]

Ptr< Object > ns3::NamesPriv::Find ( std::string  path)

Internal implementation for ns3::Names::Find(std::string)

Parameters
[in]pathA string containing a name space path used to locate the object.
Returns
A smart pointer to the named object converted to the requested type.

Definition at line 598 of file names.cc.

References ns3::NameNode::m_nameMap, m_root, NS_ASSERT_MSG, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Referenced by Add(), Find(), ns3::Names::FindInternal(), and Rename().

+ Here is the caller graph for this function:

◆ Find() [3/3]

Ptr< Object > ns3::NamesPriv::Find ( std::string  path,
std::string  name 
)

Internal implementation for ns3::Names::Find(std::string,std::string)

Parameters
[in]pathA path name describing a previously named object under which you want to look for the specified name.
[in]nameA string containing a name to search for.
Returns
A smart pointer to the named object converted to the requested type.

Definition at line 692 of file names.cc.

References Find(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ FindName()

std::string ns3::NamesPriv::FindName ( Ptr< Object object)

Internal implementation for Names::FindName()

Parameters
[in]objectA smart pointer to an object for which you want to find its name.
Returns
A string containing the name of the object if found, otherwise the empty string.

Definition at line 553 of file names.cc.

References m_objectMap, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Referenced by ns3::Names::FindName().

+ Here is the caller graph for this function:

◆ FindPath()

std::string ns3::NamesPriv::FindPath ( Ptr< Object object)

Internal implementation of Names::FindPath()

Parameters
[in]objectA smart pointer to an object for which you want to find its fullname.
Returns
A string containing the name path of the object, otherwise the empty string.

Definition at line 571 of file names.cc.

References ns3::NameNode::m_name, m_objectMap, ns3::NameNode::m_parent, NS_ASSERT_MSG, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Referenced by ns3::Names::FindPath().

+ Here is the caller graph for this function:

◆ IsDuplicateName()

bool ns3::NamesPriv::IsDuplicateName ( NameNode node,
std::string  name 
)
private

Check if a name already exists as a child of a NameNode.

Parameters
[in]nodeThe node to search.
[in]nameThe name to search for.
Returns
true if name already exists as a child of node.

Definition at line 757 of file names.cc.

References ns3::NameNode::m_nameMap, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Referenced by Add(), and Rename().

+ Here is the caller graph for this function:

◆ IsNamed()

NameNode * ns3::NamesPriv::IsNamed ( Ptr< Object object)
private

Check if an object has a name.

Parameters
[in]objectThe object to check.
Returns
The corresponding NameNode, if it exists.

Definition at line 739 of file names.cc.

References m_objectMap, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Referenced by Add(), Find(), and Rename().

+ Here is the caller graph for this function:

◆ Rename() [1/3]

bool ns3::NamesPriv::Rename ( Ptr< Object context,
std::string  oldname,
std::string  newname 
)

Internal implementation for Names::Rename(Ptr<Object>,std::string,std::string)

Parameters
[in]contextA smart pointer to an object that is used in place of the path under which you want this new name to be defined.
[in]oldnameThe current shortname of the object you want to change.
[in]newnameThe new shortname of the object you want to change.
Returns
true if the object was renamed successfully.

Definition at line 506 of file names.cc.

References IsDuplicateName(), IsNamed(), ns3::NameNode::m_name, ns3::NameNode::m_nameMap, m_root, NS_ASSERT_MSG, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

+ Here is the call graph for this function:

◆ Rename() [2/3]

bool ns3::NamesPriv::Rename ( std::string  oldpath,
std::string  newname 
)

Internal implementation for Names::Rename(std::string,std::string)

Parameters
[in]oldpathThe current path name to the object you want to change.
[in]newnameThe new name of the object you want to change.
Returns
true if the object was renamed successfully.

Definition at line 430 of file names.cc.

References NS_ASSERT_MSG, NS_LOG_FUNCTION, and Rename().

Referenced by Rename(), and ns3::Names::Rename().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Rename() [3/3]

bool ns3::NamesPriv::Rename ( std::string  path,
std::string  oldname,
std::string  newname 
)

Internal implementation for Names::Rename(std::string,std::string,std::string)

Parameters
[in]pathA path name describing a previously named object under which you want this name change to occur (cf. directory).
[in]oldnameThe currently defined name of the object.
[in]newnameThe new name you want the object to have.
Returns
true if the object was renamed successfully.

Definition at line 495 of file names.cc.

References Find(), NS_LOG_FUNCTION, and Rename().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_objectMap

std::map<Ptr<Object>, NameNode*> ns3::NamesPriv::m_objectMap
private

Map from object pointers to their NameNodes.

Definition at line 279 of file names.cc.

Referenced by Add(), Clear(), FindName(), FindPath(), and IsNamed().

◆ m_root

NameNode ns3::NamesPriv::m_root
private

The root NameNode.

Definition at line 276 of file names.cc.

Referenced by NamesPriv(), ~NamesPriv(), Add(), Clear(), Find(), and Rename().


The documentation for this class was generated from the following file: