INET Framework for OMNeT++/OMNEST
inet::Topology::Link Class Reference

Supporting class for Topology, represents a link in the graph. More...

#include <Topology.h>

Inheritance diagram for inet::Topology::Link:
inet::L2NetworkConfigurator::Link inet::L3NetworkConfiguratorBase::Link inet::NetworkConfiguratorBase::Link

Public Member Functions

 Link (double weight=1)
 Constructor. More...
 
virtual ~Link ()
 
double getWeight () const
 Returns the weight of this link. More...
 
void setWeight (double d)
 Sets the weight of this link. More...
 
bool isEnabled () const
 Returns true of this link is enabled. More...
 
void enable ()
 Enables this link. More...
 
void disable ()
 Disables this link. More...
 
NodegetLinkInRemoteNode () const
 Returns the node at the remote end of this connection. More...
 
NodegetLinkInLocalNode () const
 Returns the node at the local end of this connection. More...
 
int getLinkInRemoteGateId () const
 Returns the gate ID at the remote end of this connection. More...
 
int getLinkInLocalGateId () const
 Returns the gate ID at the local end of this connection. More...
 
cGate * getLinkInRemoteGate () const
 Returns the gate at the remote end of this connection. More...
 
cGate * getLinkInLocalGate () const
 Returns the gate at the local end of this connection. More...
 
NodegetLinkOutRemoteNode () const
 Returns the node at the remote end of this connection. More...
 
NodegetLinkOutLocalNode () const
 Returns the node at the local end of this connection. More...
 
int getLinkOutRemoteGateId () const
 Returns the gate ID at the remote end of this connection. More...
 
int getLinkOutLocalGateId () const
 Returns the gate ID at the local end of this connection. More...
 
cGate * getLinkOutRemoteGate () const
 Returns the gate at the remote end of this connection. More...
 
cGate * getLinkOutLocalGate () const
 Returns the gate at the local end of this connection. More...
 

Protected Attributes

NodesrcNode
 
int srcGateId
 
NodedestNode
 
int destGateId
 
double weight
 
bool enabled
 

Friends

class Topology
 

Detailed Description

Supporting class for Topology, represents a link in the graph.

Constructor & Destructor Documentation

◆ Link()

inet::Topology::Link::Link ( double  weight = 1)
inline

Constructor.

221 { srcNode = destNode = nullptr; srcGateId = destGateId = -1; this->weight = weight; enabled = true; }

◆ ~Link()

virtual inet::Topology::Link::~Link ( )
inlinevirtual
222 {}

Member Function Documentation

◆ disable()

void inet::Topology::Link::disable ( )
inline

Disables this link.

This has significance with the shortest path finder methods of Topology.

252 { enabled = false; }

◆ enable()

void inet::Topology::Link::enable ( )
inline

Enables this link.

This has significance with the shortest path finder methods of Topology.

246 { enabled = true; }

◆ getLinkInLocalGate()

cGate* inet::Topology::Link::getLinkInLocalGate ( ) const
inline

Returns the gate at the local end of this connection.

282 { return destNode->getModule()->gate(destGateId); }

◆ getLinkInLocalGateId()

int inet::Topology::Link::getLinkInLocalGateId ( ) const
inline

Returns the gate ID at the local end of this connection.

272 { return destGateId; }

◆ getLinkInLocalNode()

Node* inet::Topology::Link::getLinkInLocalNode ( ) const
inline

Returns the node at the local end of this connection.

262 { return destNode; }

Referenced by inet::L3NetworkConfiguratorBase::dumpTopology().

◆ getLinkInRemoteGate()

cGate* inet::Topology::Link::getLinkInRemoteGate ( ) const
inline

Returns the gate at the remote end of this connection.

277 { return srcNode->getModule()->gate(srcGateId); }

◆ getLinkInRemoteGateId()

int inet::Topology::Link::getLinkInRemoteGateId ( ) const
inline

Returns the gate ID at the remote end of this connection.

267 { return srcGateId; }

◆ getLinkInRemoteNode()

Node* inet::Topology::Link::getLinkInRemoteNode ( ) const
inline

◆ getLinkOutLocalGate()

cGate* inet::Topology::Link::getLinkOutLocalGate ( ) const
inline

Returns the gate at the local end of this connection.

312 { return srcNode->getModule()->gate(srcGateId); }

Referenced by inet::L3NetworkConfiguratorBase::computeWiredLinkWeight().

◆ getLinkOutLocalGateId()

int inet::Topology::Link::getLinkOutLocalGateId ( ) const
inline

◆ getLinkOutLocalNode()

Node* inet::Topology::Link::getLinkOutLocalNode ( ) const
inline

◆ getLinkOutRemoteGate()

cGate* inet::Topology::Link::getLinkOutRemoteGate ( ) const
inline

Returns the gate at the remote end of this connection.

307 { return destNode->getModule()->gate(destGateId); }

Referenced by inet::StpTester::dfsVisit().

◆ getLinkOutRemoteGateId()

int inet::Topology::Link::getLinkOutRemoteGateId ( ) const
inline

◆ getLinkOutRemoteNode()

◆ getWeight()

double inet::Topology::Link::getWeight ( ) const
inline

Returns the weight of this link.

Weight is used with the weighted shortest path finder methods of Topology.

228 { return weight; }

Referenced by inet::Topology::calculateWeightedSingleShortestPathsTo().

◆ isEnabled()

bool inet::Topology::Link::isEnabled ( ) const
inline

Returns true of this link is enabled.

This has significance with the shortest path finder methods of Topology.

240 { return enabled; }

Referenced by inet::Topology::calculateWeightedSingleShortestPathsTo().

◆ setWeight()

void inet::Topology::Link::setWeight ( double  d)
inline

Sets the weight of this link.

Weight is used with the weighted shortest path finder methods of Topology.

234 { weight = d; }

Referenced by inet::Ipv4NetworkConfigurator::addStaticRoutes(), and inet::MacForwardingTableConfigurator::extendConfiguration().

Friends And Related Function Documentation

◆ Topology

friend class Topology
friend

Member Data Documentation

◆ destGateId

int inet::Topology::Link::destGateId
protected

◆ destNode

Node* inet::Topology::Link::destNode
protected

◆ enabled

bool inet::Topology::Link::enabled
protected

◆ srcGateId

int inet::Topology::Link::srcGateId
protected

◆ srcNode

◆ weight

double inet::Topology::Link::weight
protected

The documentation for this class was generated from the following file:
inet::Topology::Node::getModule
cModule * getModule() const
Returns the pointer to the network module to which this node corresponds.
Definition: Topology.h:101