A Discrete-Event Network Simulator
API
ns3::Config::MatchContainer Class Reference

hold a set of objects which match a specific search string. More...

#include "config.h"

+ Collaboration diagram for ns3::Config::MatchContainer:

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< ObjectGet (std::size_t i) const
 
std::string GetMatchedPath (uint32_t i) const
 
std::string GetPath () const
 
void Set (std::string name, const AttributeValue &value)
 
bool SetFailSafe (std::string name, const AttributeValue &value)
 
MatchContainer::Iterator Begin () const
 
MatchContainer::Iterator begin () const
 
MatchContainer::Iterator End () const
 
MatchContainer::Iterator end () const
 
std::size_t GetN () const
 
std::size_t size () 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...
 

Detailed Description

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.

Definition at line 194 of file config.h.

Member Typedef Documentation

◆ Iterator

typedef std::vector<Ptr<Object> >::const_iterator ns3::Config::MatchContainer::Iterator

Const iterator over the objects in this container.

Definition at line 198 of file config.h.

Constructor & Destructor Documentation

◆ MatchContainer() [1/2]

ns3::Config::MatchContainer::MatchContainer ( )

Definition at line 45 of file config.cc.

References NS_LOG_FUNCTION.

◆ MatchContainer() [2/2]

ns3::Config::MatchContainer::MatchContainer ( const std::vector< Ptr< Object >> &  objects,
const std::vector< std::string > &  contexts,
std::string  path 
)

Constructor used only by implementation.

Parameters
[in]objectsThe vector of objects to store in this container.
[in]contextsThe corresponding contexts.
[in]pathThe path used for object matching.

Definition at line 50 of file config.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ Begin()

MatchContainer::Iterator ns3::Config::MatchContainer::Begin ( ) const
Returns
An iterator which points to the first item in the container

Definition at line 61 of file config.cc.

References m_objects, and NS_LOG_FUNCTION.

Referenced by begin(), ConnectWithoutContextFailSafe(), DisconnectWithoutContext(), Set(), and SetFailSafe().

+ Here is the caller graph for this function:

◆ begin()

MatchContainer::Iterator ns3::Config::MatchContainer::begin ( ) const
inline
Returns
An iterator which points to the first item in the container

Definition at line 217 of file config.h.

References Begin().

+ Here is the call graph for this function:

◆ Connect()

void ns3::Config::MatchContainer::Connect ( std::string  name,
const CallbackBase cb 
)
Parameters
[in]nameThe name of the trace source to connect to
[in]cbThe 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.

See also
ns3::Config::Connect

Definition at line 128 of file config.cc.

References ConnectFailSafe(), and NS_FATAL_ERROR.

+ Here is the call graph for this function:

◆ ConnectFailSafe()

bool ns3::Config::MatchContainer::ConnectFailSafe ( std::string  name,
const CallbackBase cb 
)
Parameters
[in]nameThe name of the trace source to connect to
[in]cbThe 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.

Returns
true if any trace sources could be connected.

Definition at line 137 of file config.cc.

References m_contexts, m_objects, NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by Connect().

+ Here is the caller graph for this function:

◆ ConnectWithoutContext()

void ns3::Config::MatchContainer::ConnectWithoutContext ( std::string  name,
const CallbackBase cb 
)
Parameters
[in]nameThe name of the trace source to connect to
[in]cbThe 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.

See also
ns3::Config::ConnectWithoutContext

Definition at line 152 of file config.cc.

References ConnectWithoutContextFailSafe(), and NS_FATAL_ERROR.

+ Here is the call graph for this function:

◆ ConnectWithoutContextFailSafe()

bool ns3::Config::MatchContainer::ConnectWithoutContextFailSafe ( std::string  name,
const CallbackBase cb 
)
Parameters
[in]nameThe name of the trace source to connect to
[in]cbThe 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.

Returns
true if any trace sources could be connected.

Definition at line 161 of file config.cc.

References Begin(), End(), NS_LOG_FUNCTION, and ns3::ObjectBase::TraceConnectWithoutContext().

Referenced by ConnectWithoutContext().

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

◆ Disconnect()

void ns3::Config::MatchContainer::Disconnect ( std::string  name,
const CallbackBase cb 
)
Parameters
[in]nameThe name of the trace source to disconnect from
[in]cbThe sink to disconnect from the trace source

Disconnect the specified sink from all the objects stored in this container.

See also
ns3::Config::Disconnect

Definition at line 174 of file config.cc.

References m_contexts, m_objects, NS_ASSERT, and NS_LOG_FUNCTION.

◆ DisconnectWithoutContext()

void ns3::Config::MatchContainer::DisconnectWithoutContext ( std::string  name,
const CallbackBase cb 
)
Parameters
[in]nameThe name of the trace source to disconnect from
[in]cbThe sink to disconnect from the trace source

Disconnect the specified sink from all the objects stored in this container.

See also
ns3::Config::DisconnectWithoutContext

Definition at line 187 of file config.cc.

References Begin(), End(), NS_LOG_FUNCTION, and ns3::ObjectBase::TraceDisconnectWithoutContext().

+ Here is the call graph for this function:

◆ End()

MatchContainer::Iterator ns3::Config::MatchContainer::End ( ) const
Returns
An iterator which points to the last item in the container

Definition at line 68 of file config.cc.

References m_objects, and NS_LOG_FUNCTION.

Referenced by ConnectWithoutContextFailSafe(), DisconnectWithoutContext(), end(), Set(), and SetFailSafe().

+ Here is the caller graph for this function:

◆ end()

MatchContainer::Iterator ns3::Config::MatchContainer::end ( ) const
inline
Returns
An iterator which points to the last item in the container

Definition at line 229 of file config.h.

References End().

Referenced by grid.TimelinesRenderer::draw_events(), and grid.TimelinesRenderer::draw_ranges().

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

◆ Get()

Ptr< Object > ns3::Config::MatchContainer::Get ( std::size_t  i) const

◆ GetMatchedPath()

std::string ns3::Config::MatchContainer::GetMatchedPath ( uint32_t  i) const
Parameters
[in]iIndex of item to lookup ([0,n[)
Returns
The fully-qualified matching path associated to the requested item.

The matching patch uniquely identifies the requested object.

Definition at line 89 of file config.cc.

References m_contexts, and NS_LOG_FUNCTION.

Referenced by ns3::GnuplotHelper::PlotProbe(), and ns3::FileHelper::WriteProbe().

+ Here is the caller graph for this function:

◆ GetN()

◆ GetPath()

std::string ns3::Config::MatchContainer::GetPath ( ) const
Returns
The path used to perform the object matching.

Definition at line 96 of file config.cc.

References m_path, and NS_LOG_FUNCTION.

◆ Set()

void ns3::Config::MatchContainer::Set ( std::string  name,
const AttributeValue value 
)
Parameters
[in]nameName of attribute to set
[in]valueValue 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.

See also
ns3::Config::Set

Definition at line 103 of file config.cc.

References Begin(), End(), NS_LOG_FUNCTION, and ns3::ObjectBase::SetAttribute().

+ Here is the call graph for this function:

◆ SetFailSafe()

bool ns3::Config::MatchContainer::SetFailSafe ( std::string  name,
const AttributeValue value 
)
Parameters
[in]nameName of attribute to set
[in]valueValue 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.

Returns
true if any attributes could be set.

Definition at line 115 of file config.cc.

References Begin(), End(), NS_LOG_FUNCTION, and ns3::ObjectBase::SetAttributeFailSafe().

+ Here is the call graph for this function:

◆ size()

std::size_t ns3::Config::MatchContainer::size ( ) const
inline
Returns
The number of items in the container

Definition at line 241 of file config.h.

References GetN().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_contexts

std::vector<std::string> ns3::Config::MatchContainer::m_contexts
private

The context for each object.

Definition at line 351 of file config.h.

Referenced by ConnectFailSafe(), Disconnect(), and GetMatchedPath().

◆ m_objects

std::vector<Ptr<Object> > ns3::Config::MatchContainer::m_objects
private

The list of objects in this container.

Definition at line 349 of file config.h.

Referenced by Begin(), ConnectFailSafe(), Disconnect(), End(), Get(), and GetN().

◆ m_path

std::string ns3::Config::MatchContainer::m_path
private

The path used to perform the object matching.

Definition at line 353 of file config.h.

Referenced by GetPath().


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