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

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...
 
MatchContainer::Iterator Begin (void) const
 
void Connect (std::string name, const CallbackBase &cb)
 
void ConnectWithoutContext (std::string name, const CallbackBase &cb)
 
void Disconnect (std::string name, const CallbackBase &cb)
 
void DisconnectWithoutContext (std::string name, const CallbackBase &cb)
 
MatchContainer::Iterator End (void) const
 
Ptr< ObjectGet (std::size_t i) const
 
std::string GetMatchedPath (uint32_t i) const
 
std::size_t GetN (void) const
 
std::string GetPath (void) const
 
void Set (std::string name, const AttributeValue &value)
 

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 151 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 155 of file config.h.

Constructor & Destructor Documentation

◆ MatchContainer() [1/2]

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

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

References NS_LOG_FUNCTION.

Member Function Documentation

◆ Begin()

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

Definition at line 57 of file config.cc.

References m_objects, and NS_LOG_FUNCTION.

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

◆ 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.

See also
ns3::Config::Connect

Definition at line 104 of file config.cc.

References m_contexts, m_objects, NS_ASSERT, and NS_LOG_FUNCTION.

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

◆ 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.

See also
ns3::Config::ConnectWithoutContext

Definition at line 116 of file config.cc.

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

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

◆ 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 127 of file config.cc.

References m_contexts, m_objects, NS_ASSERT, and NS_LOG_FUNCTION.

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

◆ 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 139 of file config.cc.

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

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

◆ End()

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

Definition at line 63 of file config.cc.

References m_objects, and NS_LOG_FUNCTION.

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

◆ 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 81 of file config.cc.

References m_contexts, and NS_LOG_FUNCTION.

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

◆ GetN()

std::size_t ns3::Config::MatchContainer::GetN ( void  ) const

◆ GetPath()

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

Definition at line 87 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.

See also
ns3::Config::Set

Definition at line 94 of file config.cc.

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

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

Member Data Documentation

◆ m_contexts

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

The context for each object.

Definition at line 248 of file config.h.

Referenced by Connect(), 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 246 of file config.h.

Referenced by Begin(), Connect(), 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 250 of file config.h.

Referenced by GetPath().


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