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

Constructor & Destructor Documentation

ns3::NamesPriv::NamesPriv ( )

Constructor.

Definition at line 278 of file names.cc.

References NS_LOG_FUNCTION.

ns3::NamesPriv::~NamesPriv ( )

Destructor.

Definition at line 287 of file names.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

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

References NS_ASSERT_MSG(), and NS_LOG_FUNCTION.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

References NS_LOG_FUNCTION.

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

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

+ Here is the call graph for this function:

void ns3::NamesPriv::Clear ( void  )

Internal implementation for Names::Clear()

Definition at line 295 of file names.cc.

References NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

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

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

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

References NS_LOG_FUNCTION.

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

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

+ Here is the call graph for this function:

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

References 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:

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

References ns3::NameNode::m_name, 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:

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

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

+ Here is the call graph for this function:

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

References NS_LOG_FUNCTION, and NS_LOG_LOGIC().

+ Here is the call graph for this function:

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

References NS_ASSERT_MSG(), and NS_LOG_FUNCTION.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

References NS_LOG_FUNCTION.

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

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

+ Here is the call graph for this function:

Friends And Related Function Documentation

friend class Names
friend

Definition at line 253 of file names.cc.

Member Data Documentation

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

Map from object pointers to their NameNodes.

Definition at line 275 of file names.cc.

NameNode ns3::NamesPriv::m_root
private

The root NameNode.

Definition at line 272 of file names.cc.


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