A Discrete-Event Network Simulator
API
ns3::Config::Resolver Class Referenceabstract

Abstract class to parse Config paths into object references. More...

+ Collaboration diagram for ns3::Config::Resolver:

Public Member Functions

 Resolver (std::string path)
 Construct from a base Config path. More...
 
virtual ~Resolver ()
 Destructor. More...
 
void Resolve (Ptr< Object > root)
 Parse the stored Config path into an object reference, beginning at the indicated root object. More...
 

Private Member Functions

void Canonicalize (void)
 Ensure the Config path starts and ends with a '/'. More...
 
void DoArrayResolve (std::string path, const ObjectPtrContainerValue &vector)
 Parse an index on the Config path. More...
 
virtual void DoOne (Ptr< Object > object, std::string path)=0
 Handle one found object. More...
 
void DoResolve (std::string path, Ptr< Object > root)
 Parse the next element in the Config path. More...
 
void DoResolveOne (Ptr< Object > object)
 Handle one object found on the path. More...
 
std::string GetResolvedPath (void) const
 Get the current Config path. More...
 

Private Attributes

std::string m_path
 The Config path. More...
 
std::vector< std::string > m_workStack
 Current list of path tokens. More...
 

Detailed Description

Abstract class to parse Config paths into object references.

Definition at line 268 of file config.cc.

Constructor & Destructor Documentation

◆ Resolver()

ns3::Config::Resolver::Resolver ( std::string  path)

Construct from a base Config path.

Parameters
[in]pathThe Config path.

Definition at line 334 of file config.cc.

References Canonicalize(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ ~Resolver()

ns3::Config::Resolver::~Resolver ( )
virtual

Destructor.

Definition at line 340 of file config.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ Canonicalize()

void ns3::Config::Resolver::Canonicalize ( void  )
private

Ensure the Config path starts and ends with a '/'.

Definition at line 345 of file config.cc.

References m_path, and NS_LOG_FUNCTION.

Referenced by Resolver().

+ Here is the caller graph for this function:

◆ DoArrayResolve()

void ns3::Config::Resolver::DoArrayResolve ( std::string  path,
const ObjectPtrContainerValue vector 
)
private

Parse an index on the Config path.

Parameters
[in]pathThe remaining Config path.
[in,out]vectorThe resulting list of matching objects.

Definition at line 551 of file config.cc.

References ns3::ObjectPtrContainerValue::Begin(), DoResolve(), ns3::ObjectPtrContainerValue::End(), m_workStack, ns3::Config::ArrayMatcher::Matches(), NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by DoResolve().

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

◆ DoOne()

virtual void ns3::Config::Resolver::DoOne ( Ptr< Object object,
std::string  path 
)
privatepure virtual

Handle one found object.

Parameters
[in]objectThe found object.
[in]pathThe matching Config path context.

Referenced by DoResolveOne().

+ Here is the caller graph for this function:

◆ DoResolve()

void ns3::Config::Resolver::DoResolve ( std::string  path,
Ptr< Object root 
)
private

Parse the next element in the Config path.

Parameters
[in]pathThe remaining portion of the Config path.
[in]rootThe object corresponding to the current position in the Config path.

Definition at line 395 of file config.cc.

References DoArrayResolve(), DoResolveOne(), ns3::PointerValue::Get(), ns3::TypeId::GetAttribute(), ns3::TypeId::GetAttributeN(), ns3::Object::GetObject(), ns3::TypeId::GetParent(), GetResolvedPath(), ns3::TypeId::LookupByName(), m_workStack, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_ERROR, NS_LOG_FUNCTION, and ns3::PeekPointer().

Referenced by DoArrayResolve(), and Resolve().

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

◆ DoResolveOne()

void ns3::Config::Resolver::DoResolveOne ( Ptr< Object object)
private

Handle one object found on the path.

Parameters
[in]objectThe current object on the Config path.

Definition at line 386 of file config.cc.

References DoOne(), GetResolvedPath(), NS_LOG_DEBUG, and NS_LOG_FUNCTION.

Referenced by DoResolve().

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

◆ GetResolvedPath()

std::string ns3::Config::Resolver::GetResolvedPath ( void  ) const
private

Get the current Config path.

Returns
The current Config path.

Definition at line 373 of file config.cc.

References m_workStack, and NS_LOG_FUNCTION.

Referenced by DoResolve(), and DoResolveOne().

+ Here is the caller graph for this function:

◆ Resolve()

void ns3::Config::Resolver::Resolve ( Ptr< Object root)

Parse the stored Config path into an object reference, beginning at the indicated root object.

Parameters
[in]rootThe object corresponding to the current position in in the Config path.

Definition at line 365 of file config.cc.

References DoResolve(), m_path, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_path

std::string ns3::Config::Resolver::m_path
private

The Config path.

Definition at line 330 of file config.cc.

Referenced by Canonicalize(), and Resolve().

◆ m_workStack

std::vector<std::string> ns3::Config::Resolver::m_workStack
private

Current list of path tokens.

Definition at line 328 of file config.cc.

Referenced by DoArrayResolve(), DoResolve(), and GetResolvedPath().


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