hold a set of objects which match a specific search string. More...
#include "config.h"
Public Types | |
typedef std::vector< Ptr< Object > >::const_iterator | Iterator |
Const iterator over the objects in this container. More... | |
Public Member Functions | |
MatchContainer () | |
MatchContainer (const std::vector< Ptr< Object > > &objects, const std::vector< std::string > &contexts, std::string path) | |
Constructor used only by implementation. More... | |
void | Connect (std::string name, const CallbackBase &cb) |
bool | ConnectFailSafe (std::string name, const CallbackBase &cb) |
void | ConnectWithoutContext (std::string name, const CallbackBase &cb) |
bool | ConnectWithoutContextFailSafe (std::string name, const CallbackBase &cb) |
void | Disconnect (std::string name, const CallbackBase &cb) |
void | DisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Ptr< Object > | Get (std::size_t i) const |
std::string | GetMatchedPath (uint32_t i) const |
std::string | GetPath (void) const |
void | Set (std::string name, const AttributeValue &value) |
bool | SetFailSafe (std::string name, const AttributeValue &value) |
MatchContainer::Iterator | Begin (void) const |
MatchContainer::Iterator | begin (void) const |
MatchContainer::Iterator | End (void) const |
MatchContainer::Iterator | end (void) const |
std::size_t | GetN (void) const |
std::size_t | size (void) const |
Private Attributes | |
std::vector< std::string > | m_contexts |
The context for each object. More... | |
std::vector< Ptr< Object > > | m_objects |
The list of objects in this container. More... | |
std::string | m_path |
The path used to perform the object matching. More... | |
hold a set of objects which match a specific search string.
This class also allows you to perform a set of configuration operations on the set of matching objects stored in the container. Specifically, it is possible to perform bulk Connects and Sets.
typedef std::vector<Ptr<Object> >::const_iterator ns3::Config::MatchContainer::Iterator |
ns3::Config::MatchContainer::MatchContainer | ( | ) |
Definition at line 43 of file config.cc.
References NS_LOG_FUNCTION.
ns3::Config::MatchContainer::MatchContainer | ( | const std::vector< Ptr< Object > > & | objects, |
const std::vector< std::string > & | contexts, | ||
std::string | path | ||
) |
Constructor used only by implementation.
[in] | objects | The vector of objects to store in this container. |
[in] | contexts | The corresponding contexts. |
[in] | path | The path used for object matching. |
Definition at line 47 of file config.cc.
References NS_LOG_FUNCTION.
MatchContainer::Iterator ns3::Config::MatchContainer::Begin | ( | void | ) | const |
Definition at line 57 of file config.cc.
References m_objects, and NS_LOG_FUNCTION.
Referenced by begin(), ConnectWithoutContextFailSafe(), DisconnectWithoutContext(), Set(), and SetFailSafe().
|
inline |
void ns3::Config::MatchContainer::Connect | ( | std::string | name, |
const CallbackBase & | cb | ||
) |
[in] | name | The name of the trace source to connect to |
[in] | cb | The sink to connect to the trace source |
Connect the specified sink to all the objects stored in this container. This method will raise a fatal error if no objects could be connected; use ConnectFailSafe if no connections is a valid possible outcome.
Definition at line 117 of file config.cc.
References ConnectFailSafe(), and NS_FATAL_ERROR.
bool ns3::Config::MatchContainer::ConnectFailSafe | ( | std::string | name, |
const CallbackBase & | cb | ||
) |
[in] | name | The name of the trace source to connect to |
[in] | cb | The sink to connect to the trace source |
Connect the specified sink to all the objects stored in this container. This method will return true if any trace sources could be connected, and false otherwise.
true
if any trace sources could be connected. Definition at line 125 of file config.cc.
References m_contexts, m_objects, NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by Connect(), and ns3::Config::ConfigImpl::ConnectFailSafe().
void ns3::Config::MatchContainer::ConnectWithoutContext | ( | std::string | name, |
const CallbackBase & | cb | ||
) |
[in] | name | The name of the trace source to connect to |
[in] | cb | The sink to connect to the trace source |
Connect the specified sink to all the objects stored in this container. This method will raise a fatal error if no objects could be connected; use ConnectWithoutContextFailSafe if no connections is a valid possible outcome.
Definition at line 139 of file config.cc.
References ConnectWithoutContextFailSafe(), and NS_FATAL_ERROR.
bool ns3::Config::MatchContainer::ConnectWithoutContextFailSafe | ( | std::string | name, |
const CallbackBase & | cb | ||
) |
[in] | name | The name of the trace source to connect to |
[in] | cb | The sink to connect to the trace source |
Connect the specified sink to all the objects stored in this container. This method will return true if any trace sources could be connected, and false otherwise.
true
if any trace sources could be connected. Definition at line 147 of file config.cc.
References Begin(), End(), NS_LOG_FUNCTION, and ns3::ObjectBase::TraceConnectWithoutContext().
Referenced by ConnectWithoutContext(), and ns3::Config::ConfigImpl::ConnectWithoutContextFailSafe().
void ns3::Config::MatchContainer::Disconnect | ( | std::string | name, |
const CallbackBase & | cb | ||
) |
[in] | name | The name of the trace source to disconnect from |
[in] | cb | The sink to disconnect from the trace source |
Disconnect the specified sink from all the objects stored in this container.
Definition at line 159 of file config.cc.
References m_contexts, m_objects, NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by ns3::Config::ConfigImpl::Disconnect().
void ns3::Config::MatchContainer::DisconnectWithoutContext | ( | std::string | name, |
const CallbackBase & | cb | ||
) |
[in] | name | The name of the trace source to disconnect from |
[in] | cb | The sink to disconnect from the trace source |
Disconnect the specified sink from all the objects stored in this container.
Definition at line 171 of file config.cc.
References Begin(), End(), NS_LOG_FUNCTION, and ns3::ObjectBase::TraceDisconnectWithoutContext().
Referenced by ns3::Config::ConfigImpl::DisconnectWithoutContext().
MatchContainer::Iterator ns3::Config::MatchContainer::End | ( | void | ) | const |
Definition at line 63 of file config.cc.
References m_objects, and NS_LOG_FUNCTION.
Referenced by ConnectWithoutContextFailSafe(), DisconnectWithoutContext(), end(), Set(), and SetFailSafe().
|
inline |
Definition at line 221 of file config.h.
References End().
Referenced by grid.TimelinesRenderer::draw_events(), and grid.TimelinesRenderer::draw_ranges().
[in] | i | Index of item to lookup ([0,n[) |
Definition at line 75 of file config.cc.
References m_objects, and NS_LOG_FUNCTION.
Referenced by ns3::RandomVariableStreamHelper::AssignStreams(), ns3::LteStatsCalculator::FindCellIdFromEnbRlcPath(), ns3::LteStatsCalculator::FindImsiFromEnbRlcPath(), ns3::LteStatsCalculator::FindImsiFromLteNetDevice(), ns3::LteStatsCalculator::FindImsiFromUePhy(), and ns3::RadioEnvironmentMapHelper::Install().
std::string ns3::Config::MatchContainer::GetMatchedPath | ( | uint32_t | i | ) | const |
[in] | i | Index of item to lookup ([0,n[) |
The matching patch uniquely identifies the requested object.
Definition at line 81 of file config.cc.
References m_contexts, and NS_LOG_FUNCTION.
Referenced by ns3::GnuplotHelper::PlotProbe(), and ns3::FileHelper::WriteProbe().
std::size_t ns3::Config::MatchContainer::GetN | ( | void | ) | const |
Definition at line 69 of file config.cc.
References m_objects, and NS_LOG_FUNCTION.
Referenced by ns3::RandomVariableStreamHelper::AssignStreams(), ns3::Config::ConfigImpl::Disconnect(), ns3::Config::ConfigImpl::DisconnectWithoutContext(), ns3::LteStatsCalculator::FindCellIdFromEnbRlcPath(), ns3::LteStatsCalculator::FindImsiFromEnbRlcPath(), ns3::LteStatsCalculator::FindImsiFromLteNetDevice(), ns3::LteStatsCalculator::FindImsiFromUePhy(), ns3::RadioEnvironmentMapHelper::Install(), ns3::GnuplotHelper::PlotProbe(), size(), and ns3::FileHelper::WriteProbe().
std::string ns3::Config::MatchContainer::GetPath | ( | void | ) | const |
Definition at line 87 of file config.cc.
References m_path, and NS_LOG_FUNCTION.
void ns3::Config::MatchContainer::Set | ( | std::string | name, |
const AttributeValue & | value | ||
) |
[in] | name | Name of attribute to set |
[in] | value | Value to set to the attribute |
Set the specified attribute value to all the objects stored in this container. This method will raise a fatal error if no such attribute exists; use SetFailSafe if the absence of the attribute is to be permitted.
Definition at line 94 of file config.cc.
References Begin(), End(), NS_LOG_FUNCTION, and ns3::ObjectBase::SetAttribute().
Referenced by ns3::Config::ConfigImpl::Set().
bool ns3::Config::MatchContainer::SetFailSafe | ( | std::string | name, |
const AttributeValue & | value | ||
) |
[in] | name | Name of attribute to set |
[in] | value | Value to set to the attribute |
Set the specified attribute value to all the objects stored in this container. This method will return true if any attributes could be set, and false otherwise.
true
if any attributes could be set. Definition at line 105 of file config.cc.
References Begin(), End(), NS_LOG_FUNCTION, and ns3::ObjectBase::SetAttributeFailSafe().
Referenced by ns3::Config::ConfigImpl::SetFailSafe().
|
inline |
|
private |
The context for each object.
Definition at line 334 of file config.h.
Referenced by ConnectFailSafe(), Disconnect(), and GetMatchedPath().
The list of objects in this container.
Definition at line 332 of file config.h.
Referenced by Begin(), ConnectFailSafe(), Disconnect(), End(), Get(), and GetN().
|
private |