A Discrete-Event Network Simulator
API
ns3::TopologyReader::Link Class Reference

Inner class holding the details about a link between two nodes. More...

#include "topology-reader.h"

+ Collaboration diagram for ns3::TopologyReader::Link:

Public Types

typedef std::map< std::string, std::string >::const_iterator ConstAttributesIterator
 Constant iterator to scan the map of link attributes. More...
 

Public Member Functions

 Link (Ptr< Node > fromPtr, const std::string &fromName, Ptr< Node > toPtr, const std::string &toName)
 Constructor. More...
 
ConstAttributesIterator AttributesBegin () const
 Returns an iterator to the begin of the attributes. More...
 
ConstAttributesIterator AttributesEnd () const
 Returns an iterator to the end of the attributes. More...
 
std::string GetAttribute (const std::string &name) const
 Returns the value of a link attribute. More...
 
bool GetAttributeFailSafe (const std::string &name, std::string &value) const
 Returns the value of a link attribute. More...
 
Ptr< NodeGetFromNode () const
 Returns a Ptr<Node> to the "from" node of the link. More...
 
std::string GetFromNodeName () const
 Returns the name of the "from" node of the link. More...
 
Ptr< NodeGetToNode () const
 Returns a Ptr<Node> to the "to" node of the link. More...
 
std::string GetToNodeName () const
 Returns the name of the "to" node of the link. More...
 
void SetAttribute (const std::string &name, const std::string &value)
 Sets an arbitrary link attribute. More...
 

Private Member Functions

 Link ()
 

Private Attributes

std::string m_fromName
 Name of the node the links originates from. More...
 
Ptr< Nodem_fromPtr
 The node the links originates from. More...
 
std::map< std::string, std::string > m_linkAttr
 Container of the link attributes (if any). More...
 
std::string m_toName
 Name of the node the links is directed to. More...
 
Ptr< Nodem_toPtr
 The node the links is directed to. More...
 

Detailed Description

Inner class holding the details about a link between two nodes.

The link is not described in terms of technology. Rather it is only stating an association between two nodes. The nodes are characterized also with names reflecting how the nodes are called in the original topology file.

Definition at line 60 of file topology-reader.h.

Member Typedef Documentation

◆ ConstAttributesIterator

typedef std::map<std::string, std::string>::const_iterator ns3::TopologyReader::Link::ConstAttributesIterator

Constant iterator to scan the map of link attributes.

Definition at line 66 of file topology-reader.h.

Constructor & Destructor Documentation

◆ Link() [1/2]

ns3::TopologyReader::Link::Link ( Ptr< Node fromPtr,
const std::string &  fromName,
Ptr< Node toPtr,
const std::string &  toName 
)

Constructor.

Parameters
[in]fromPtrPtr to the node the link is originating from.
[in]fromNameName of the node the link is originating from.
[in]toPtrPtr to the node the link is directed to.
[in]toNameName of the node the link is directed to.

Definition at line 100 of file topology-reader.cc.

References m_fromName, m_fromPtr, m_toName, and m_toPtr.

◆ Link() [2/2]

ns3::TopologyReader::Link::Link ( )
private

Definition at line 111 of file topology-reader.cc.

Member Function Documentation

◆ AttributesBegin()

TopologyReader::Link::ConstAttributesIterator ns3::TopologyReader::Link::AttributesBegin ( ) const

Returns an iterator to the begin of the attributes.

Returns
A const iterator to the first attribute of a link.

Definition at line 165 of file topology-reader.cc.

◆ AttributesEnd()

TopologyReader::Link::ConstAttributesIterator ns3::TopologyReader::Link::AttributesEnd ( ) const

Returns an iterator to the end of the attributes.

Returns
A const iterator to the last attribute of a link.

Definition at line 171 of file topology-reader.cc.

◆ GetAttribute()

std::string ns3::TopologyReader::Link::GetAttribute ( const std::string &  name) const

Returns the value of a link attribute.

The attribute must exist.

Parameters
[in]namethe name of the attribute.
Returns
The value of the attribute.

Definition at line 140 of file topology-reader.cc.

References NS_ASSERT_MSG.

◆ GetAttributeFailSafe()

bool ns3::TopologyReader::Link::GetAttributeFailSafe ( const std::string &  name,
std::string &  value 
) const

Returns the value of a link attribute.

Parameters
[in]nameThe name of the attribute.
[out]valueThe value of the attribute.
Returns
True if the attribute was defined, false otherwise.

Definition at line 148 of file topology-reader.cc.

◆ GetFromNode()

Ptr< Node > ns3::TopologyReader::Link::GetFromNode ( ) const

Returns a Ptr<Node> to the "from" node of the link.

Returns
A Ptr<Node> to the "from" node of the link.

Definition at line 116 of file topology-reader.cc.

◆ GetFromNodeName()

std::string ns3::TopologyReader::Link::GetFromNodeName ( ) const

Returns the name of the "from" node of the link.

Returns
The name of the "from" node of the link.

Definition at line 122 of file topology-reader.cc.

◆ GetToNode()

Ptr< Node > ns3::TopologyReader::Link::GetToNode ( ) const

Returns a Ptr<Node> to the "to" node of the link.

Returns
A Ptr<Node> to the "to" node of the link.

Definition at line 128 of file topology-reader.cc.

◆ GetToNodeName()

std::string ns3::TopologyReader::Link::GetToNodeName ( ) const

Returns the name of the "to" node of the link.

Returns
The name of the "to" node of the link.

Definition at line 134 of file topology-reader.cc.

◆ SetAttribute()

void ns3::TopologyReader::Link::SetAttribute ( const std::string &  name,
const std::string &  value 
)

Sets an arbitrary link attribute.

Parameters
[in]nameThe name of the attribute.
[in]valueThe value of the attribute.

Definition at line 159 of file topology-reader.cc.

Member Data Documentation

◆ m_fromName

std::string ns3::TopologyReader::Link::m_fromName
private

Name of the node the links originates from.

Definition at line 133 of file topology-reader.h.

Referenced by Link().

◆ m_fromPtr

Ptr<Node> ns3::TopologyReader::Link::m_fromPtr
private

The node the links originates from.

Definition at line 134 of file topology-reader.h.

Referenced by Link().

◆ m_linkAttr

std::map<std::string, std::string> ns3::TopologyReader::Link::m_linkAttr
private

Container of the link attributes (if any).

Definition at line 138 of file topology-reader.h.

◆ m_toName

std::string ns3::TopologyReader::Link::m_toName
private

Name of the node the links is directed to.

Definition at line 135 of file topology-reader.h.

Referenced by Link().

◆ m_toPtr

Ptr<Node> ns3::TopologyReader::Link::m_toPtr
private

The node the links is directed to.

Definition at line 136 of file topology-reader.h.

Referenced by Link().


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