A Discrete-Event Network Simulator
API
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
ns3::Config::ConfigImpl Class Reference

Config system implementation class. More...

+ Inheritance diagram for ns3::Config::ConfigImpl:

Public Member Functions

void Connect (std::string path, const CallbackBase &cb)
 
More...
 
void ConnectWithoutContext (std::string path, const CallbackBase &cb)
 
More...
 
void Disconnect (std::string path, const CallbackBase &cb)
 
More...
 
void DisconnectWithoutContext (std::string path, const CallbackBase &cb)
 
More...
 
Ptr< ObjectGetRootNamespaceObject (std::size_t i) const
 
More...
 
std::size_t GetRootNamespaceObjectN (void) const
 
More...
 
MatchContainer LookupMatches (std::string path)
 
More...
 
void RegisterRootNamespaceObject (Ptr< Object > obj)
 
More...
 
void Set (std::string path, const AttributeValue &value)
 
More...
 
void UnregisterRootNamespaceObject (Ptr< Object > obj)
 
More...
 

Private Types

typedef std::vector< Ptr< Object > > Roots
 Container type to hold the root Config path tokens. More...
 

Private Member Functions

void ParsePath (std::string path, std::string *root, std::string *leaf) const
 Break a Config path into the leading path and the last leaf token. More...
 

Private Attributes

Roots m_roots
 The list of Config path roots. More...
 

Additional Inherited Members

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

Detailed Description

Config system implementation class.

Definition at line 583 of file config.cc.

Member Typedef Documentation

◆ Roots

typedef std::vector<Ptr<Object> > ns3::Config::ConfigImpl::Roots
private

Container type to hold the root Config path tokens.

Definition at line 620 of file config.cc.

Member Function Documentation

◆ Connect()

void ns3::Config::ConfigImpl::Connect ( std::string  path,
const CallbackBase cb 
)


Parameters
[in]pathA path to match trace sources.
[in]cbThe callback to connect to the matching trace sources.

This function will attempt to find all trace sources which match the input path and will then connect the input callback to them in such a way that the callback will receive an extra context string upon trace event notification.

Definition at line 668 of file config.cc.

References ns3::Config::MatchContainer::Connect(), LookupMatches(), NS_LOG_FUNCTION, and ParsePath().

Referenced by ns3::Config::Connect().

◆ ConnectWithoutContext()

void ns3::Config::ConfigImpl::ConnectWithoutContext ( std::string  path,
const CallbackBase cb 
)


Parameters
[in]pathA path to match trace sources.
[in]cbThe callback to connect to the matching trace sources.

This function will attempt to find all trace sources which match the input path and will then connect the input callback to them.

Definition at line 650 of file config.cc.

References ns3::Config::MatchContainer::ConnectWithoutContext(), LookupMatches(), NS_LOG_FUNCTION, and ParsePath().

Referenced by ns3::Config::ConnectWithoutContext().

◆ Disconnect()

void ns3::Config::ConfigImpl::Disconnect ( std::string  path,
const CallbackBase cb 
)


Parameters
[in]pathA path to match trace sources.
[in]cbThe callback to connect to the matching trace sources.

This function undoes the work of Config::ConnectWithContext.

Definition at line 678 of file config.cc.

References ns3::Config::MatchContainer::Disconnect(), LookupMatches(), NS_LOG_FUNCTION, and ParsePath().

Referenced by ns3::Config::Disconnect().

◆ DisconnectWithoutContext()

void ns3::Config::ConfigImpl::DisconnectWithoutContext ( std::string  path,
const CallbackBase cb 
)


Parameters
[in]pathA path to match trace sources.
[in]cbThe callback to disconnect to the matching trace sources.

This function undoes the work of Config::Connect.

Definition at line 659 of file config.cc.

References ns3::Config::MatchContainer::DisconnectWithoutContext(), LookupMatches(), NS_LOG_FUNCTION, and ParsePath().

Referenced by ns3::Config::DisconnectWithoutContext().

◆ GetRootNamespaceObject()

Ptr< Object > ns3::Config::ConfigImpl::GetRootNamespaceObject ( std::size_t  i) const


Parameters
[in]iThe index of the requested object.
Returns
The requested root namespace object

Definition at line 750 of file config.cc.

References m_roots, and NS_LOG_FUNCTION.

Referenced by ns3::Config::GetRootNamespaceObject().

◆ GetRootNamespaceObjectN()

std::size_t ns3::Config::ConfigImpl::GetRootNamespaceObjectN ( void  ) const


Returns
The number of registered root namespace objects.

Definition at line 744 of file config.cc.

References m_roots, and NS_LOG_FUNCTION.

Referenced by ns3::Config::GetRootNamespaceObjectN().

◆ LookupMatches()

MatchContainer ns3::Config::ConfigImpl::LookupMatches ( std::string  path)


Parameters
[in]pathThe path to perform a match against
Returns
A container which contains all the objects which match the input path.

Definition at line 689 of file config.cc.

References m_roots, and NS_LOG_FUNCTION.

Referenced by Connect(), ConnectWithoutContext(), Disconnect(), DisconnectWithoutContext(), ns3::Config::LookupMatches(), and Set().

◆ ParsePath()

void ns3::Config::ConfigImpl::ParsePath ( std::string  path,
std::string *  root,
std::string *  leaf 
) const
private

Break a Config path into the leading path and the last leaf token.

Parameters
[in]pathThe Config path.
[in,out]rootThe leading part of the path, up to the final slash.
[in,out]leafThe trailing part of the path.

Definition at line 628 of file config.cc.

References NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by Connect(), ConnectWithoutContext(), Disconnect(), DisconnectWithoutContext(), and Set().

◆ RegisterRootNamespaceObject()

void ns3::Config::ConfigImpl::RegisterRootNamespaceObject ( Ptr< Object obj)


Parameters
[in]objA new root object

Each root object is used during path matching as the root of the path by Config::Connect, and Config::Set.

Definition at line 722 of file config.cc.

References m_roots, and NS_LOG_FUNCTION.

Referenced by ns3::Config::RegisterRootNamespaceObject().

◆ Set()

void ns3::Config::ConfigImpl::Set ( std::string  path,
const AttributeValue value 
)


Parameters
[in]pathA path to match attributes.
[in]valueThe value to set in all matching attributes.

This function will attempt to find attributes which match the input path and will then set their value to the input value.

Definition at line 640 of file config.cc.

References LookupMatches(), NS_LOG_FUNCTION, ParsePath(), and ns3::Config::MatchContainer::Set().

Referenced by ns3::Config::Set().

◆ UnregisterRootNamespaceObject()

void ns3::Config::ConfigImpl::UnregisterRootNamespaceObject ( Ptr< Object obj)


Parameters
[in]objA new root object

This function undoes the work of Config::RegisterRootNamespaceObject.

Definition at line 729 of file config.cc.

References m_roots, and NS_LOG_FUNCTION.

Referenced by ns3::Config::UnregisterRootNamespaceObject().

Member Data Documentation

◆ m_roots

Roots ns3::Config::ConfigImpl::m_roots
private

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