A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ns3::TopologyReader::Link Class Reference

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

#include <topology-reader.h>

Public Types

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

Public Member Functions

 Link (Ptr< Node > fromPtr, const std::string &fromName, Ptr< Node > toPtr, const std::string &toName)
 Constructor. More...
 
ConstAttributesIterator AttributesBegin (void)
 Returns an iterator to the begin of the attributes. More...
 
ConstAttributesIterator AttributesEnd (void)
 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. The attribute must exist. More...
 
bool GetAttributeFailSafe (const std::string &name, std::string &value) const
 Returns the value of a link attribute. More...
 
Ptr< NodeGetFromNode (void) const
 Returns a Ptr<Node> to the "from" node of the link. More...
 
std::string GetFromNodeName (void) const
 Returns the name of the "from" node of the link. More...
 
Ptr< NodeGetToNode (void) const
 Returns a Ptr<Node> to the "to" node of the link. More...
 
std::string GetToNodeName (void) 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 Attributes

std::string m_fromName
 
Ptr< Nodem_fromPtr
 
std::map< std::string,
std::string > 
m_linkAttr
 
std::string m_toName
 
Ptr< Nodem_toPtr
 

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 54 of file topology-reader.h.

Constructor & Destructor Documentation

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

Constructor.

Parameters
fromPtrPtr to the node the link is orginating from
fromNamename of the node the link is orginating from
toPtrPtr to the node the link is directed to
toNamename of the node the link is directed to

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

Member Function Documentation

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

Returns an iterator to the begin of the attributes.

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

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

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

Returns an iterator to the end of the attributes.

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

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

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

Returns the value of a link attribute. The attribute must exist.

Parameters
namethe name of the attribute
Returns
the value of the attribute

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

References NS_ASSERT_MSG.

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

Returns the value of a link attribute.

Parameters
namethe name of the attribute
valuethe value of the attribute
Returns
true if the attribute was defined, false otherwise.

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

Ptr< Node > ns3::TopologyReader::Link::GetFromNode ( void  ) 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 110 of file topology-reader.cc.

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

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

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

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

Ptr< Node > ns3::TopologyReader::Link::GetToNode ( void  ) 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 122 of file topology-reader.cc.

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

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

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

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

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

Sets an arbitrary link attribute.

Parameters
namethe name of the attribute
valuethe value of the attribute

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

Referenced by ns3::InetTopologyReader::Read().


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