Config system implementation class. More...
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< Object > | GetRootNamespaceObject (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... | |
|
private |
void ns3::Config::ConfigImpl::Connect | ( | std::string | path, |
const CallbackBase & | cb | ||
) |
[in] | path | A path to match trace sources. |
[in] | cb | The 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().
void ns3::Config::ConfigImpl::ConnectWithoutContext | ( | std::string | path, |
const CallbackBase & | cb | ||
) |
[in] | path | A path to match trace sources. |
[in] | cb | The 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().
void ns3::Config::ConfigImpl::Disconnect | ( | std::string | path, |
const CallbackBase & | cb | ||
) |
[in] | path | A path to match trace sources. |
[in] | cb | The 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().
void ns3::Config::ConfigImpl::DisconnectWithoutContext | ( | std::string | path, |
const CallbackBase & | cb | ||
) |
[in] | path | A path to match trace sources. |
[in] | cb | The 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().
[in] | i | The index of the requested object. |
Definition at line 750 of file config.cc.
References m_roots, and NS_LOG_FUNCTION.
Referenced by ns3::Config::GetRootNamespaceObject().
std::size_t ns3::Config::ConfigImpl::GetRootNamespaceObjectN | ( | void | ) | const |
Definition at line 744 of file config.cc.
References m_roots, and NS_LOG_FUNCTION.
Referenced by ns3::Config::GetRootNamespaceObjectN().
MatchContainer ns3::Config::ConfigImpl::LookupMatches | ( | std::string | path | ) |
[in] | path | The path to perform a match against |
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().
|
private |
Break a Config path into the leading path and the last leaf token.
[in] | path | The Config path. |
[in,out] | root | The leading part of the path , up to the final slash. |
[in,out] | leaf | The 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().
[in] | obj | A 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().
void ns3::Config::ConfigImpl::Set | ( | std::string | path, |
const AttributeValue & | value | ||
) |
[in] | path | A path to match attributes. |
[in] | value | The 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().
[in] | obj | A 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().
|
private |
The list of Config path roots.
Definition at line 623 of file config.cc.
Referenced by GetRootNamespaceObject(), GetRootNamespaceObjectN(), LookupMatches(), RegisterRootNamespaceObject(), and UnregisterRootNamespaceObject().