A Discrete-Event Network Simulator
API
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. More...
 
 ~NamesPriv ()
 Destructor. More...
 
bool Add (std::string name, Ptr< Object > object)
 Internal implementation for Names::Add(std::string,Ptr<Object>) More...
 
bool Add (std::string path, std::string name, Ptr< Object > object)
 Internal implementation for Names::Add(std::string,std::string,Ptr<Object>) More...
 
bool Add (Ptr< Object > context, std::string name, Ptr< Object > object)
 Internal implementation for Names::Add(Ptr<Object>,std::string,Ptr<Object>) More...
 
void Clear (void)
 Internal implementation for Names::Clear() More...
 
Ptr< ObjectFind (std::string path)
 Internal implementation for ns3::Names::Find(std::string) More...
 
Ptr< ObjectFind (std::string path, std::string name)
 Internal implementation for ns3::Names::Find(std::string,std::string) More...
 
Ptr< ObjectFind (Ptr< Object > context, std::string name)
 Internal implementation for ns3::Names::Find(Ptr<Object>,std::string) More...
 
std::string FindName (Ptr< Object > object)
 Internal implementation for Names::FindName() More...
 
std::string FindPath (Ptr< Object > object)
 Internal implementation of Names::FindPath() More...
 
bool Rename (std::string oldpath, std::string newname)
 Internal implementation for Names::Rename(std::string,std::string) More...
 
bool Rename (std::string path, std::string oldname, std::string newname)
 Internal implementation for Names::Rename(std::string,std::string,std::string) More...
 
bool Rename (Ptr< Object > context, std::string oldname, std::string newname)
 Internal implementation for Names::Rename(Ptr<Object>,std::string,std::string) More...
 

Private Member Functions

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

Private Attributes

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

Friends

class Names
 

Additional Inherited Members

- Static Public Member Functions inherited from ns3::Singleton< NamesPriv >
static NamesPrivGet (void)
 Get a pointer to the singleton instance. More...
 

Detailed Description

The singleton root Names object.

Definition at line 119 of file names.cc.

Constructor & Destructor Documentation

◆ NamesPriv()

ns3::NamesPriv::NamesPriv ( )

Constructor.

Definition at line 277 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 ( )

Destructor.

Definition at line 286 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 ( 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 316 of file names.cc.

References NS_ASSERT_MSG(), and NS_LOG_FUNCTION.

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

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

◆ Add() [2/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 378 of file names.cc.

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

+ Here is the call graph for this function:

◆ Add() [3/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 389 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:

◆ Clear()

void ns3::NamesPriv::Clear ( void  )

Internal implementation for Names::Clear()

Definition at line 294 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 ns3::Names::Clear(), and ~NamesPriv().

+ Here is the caller graph for this function:

◆ Find() [1/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 592 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 call graph for this function:
+ Here is the caller graph for this function:

◆ Find() [2/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 686 of file names.cc.

References Find(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ Find() [3/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 698 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:

◆ 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 546 of file names.cc.

References m_objectMap, NS_LOG_FUNCTION, and NS_LOG_LOGIC().

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

+ Here is the call graph for this function:
+ 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 564 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 call graph for this function:
+ 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 751 of file names.cc.

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

Referenced by Add(), and Rename().

+ Here is the call graph for this function:
+ 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 733 of file names.cc.

References m_objectMap, NS_LOG_FUNCTION, and NS_LOG_LOGIC().

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

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

◆ Rename() [1/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 424 of file names.cc.

References NS_ASSERT_MSG(), and NS_LOG_FUNCTION.

Referenced by Rename().

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

◆ Rename() [2/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 488 of file names.cc.

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

+ Here is the call graph for this function:

◆ Rename() [3/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 499 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:

Friends And Related Function Documentation

◆ Names

friend class Names
friend

Definition at line 252 of file names.cc.

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 274 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 271 of file names.cc.

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


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