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

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 192 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 196 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 begin(), ConnectWithoutContextFailSafe(), DisconnectWithoutContext(), Set(), and SetFailSafe().

+ Here is the caller graph for this function:

◆ begin()

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

Definition at line 214 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 117 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 125 of file config.cc.

References m_contexts, m_objects, NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by Connect(), and ns3::Config::ConfigImpl::ConnectFailSafe().

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

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

Referenced by ConnectWithoutContext(), and ns3::Config::ConfigImpl::ConnectWithoutContextFailSafe().

+ 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 159 of file config.cc.

References m_contexts, m_objects, NS_ASSERT, and NS_LOG_FUNCTION.

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

+ Here is the caller graph for this 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 171 of file config.cc.

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

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

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

◆ 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 ConnectWithoutContextFailSafe(), DisconnectWithoutContext(), end(), Set(), and SetFailSafe().

+ Here is the caller graph for this function:

◆ end()

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

Definition at line 221 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 81 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 ( 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. 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 94 of file config.cc.

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

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

+ Here is the call graph for this function:
+ Here is the caller 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 105 of file config.cc.

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

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

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

◆ size()

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

Definition at line 228 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 334 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 332 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 336 of file config.h.

Referenced by GetPath().


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