A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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.
 
virtual ~Resolver ()
 Destructor.
 
void Resolve (Ptr< Object > root)
 Parse the stored Config path into an object reference, beginning at the indicated root object.
 

Private Member Functions

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

Private Attributes

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

Detailed Description

Abstract class to parse Config paths into object references.

Definition at line 307 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 373 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 380 of file config.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ Canonicalize()

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

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

Definition at line 386 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 597 of file config.cc.

References DoResolve(), 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 436 of file config.cc.

References ns3::TypeId::AttributeInformation::checker, DoArrayResolve(), DoResolve(), DoResolveOne(), ns3::Names::Find(), ns3::PointerValue::Get(), ns3::TypeId::GetAttribute(), ns3::TypeId::GetAttributeN(), ns3::TypeId::GetParent(), GetResolvedPath(), ns3::TypeId::LookupByName(), m_workStack, ns3::TypeId::AttributeInformation::name, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_ERROR, NS_LOG_FUNCTION, and ns3::PeekPointer().

Referenced by DoArrayResolve(), DoResolve(), 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 427 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 ( ) const
private

Get the current Config path.

Returns
The current Config path.

Definition at line 414 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 406 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 369 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 367 of file config.cc.

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


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