INET Framework for OMNeT++/OMNEST
inet::eigrp::EigrpDisabledInterfaces Class Reference

Table with disabled EIGRP interfaces. More...

#include <EigrpDisabledInterfaces.h>

Public Member Functions

 EigrpDisabledInterfaces ()
 
virtual ~EigrpDisabledInterfaces ()
 
int getNumInterfaces () const
 Returns number of interfaces in the table. More...
 
EigrpInterfaceremoveInterface (EigrpInterface *iface)
 Removes specified interface from table and returns it. More...
 
void addInterface (EigrpInterface *interface)
 Adds interface to the table. More...
 
EigrpInterfacefindInterface (int ifaceId)
 Finds interface by ID in table and returns it. More...
 
EigrpInterfacegetInterface (int k) const
 Returns interface by its position in the table. More...
 

Protected Attributes

std::vector< EigrpInterface * > ifVector
 

Detailed Description

Table with disabled EIGRP interfaces.

Used to store the settings of interfaces.

Constructor & Destructor Documentation

◆ EigrpDisabledInterfaces()

inet::eigrp::EigrpDisabledInterfaces::EigrpDisabledInterfaces ( )
24 {
25 }

◆ ~EigrpDisabledInterfaces()

inet::eigrp::EigrpDisabledInterfaces::~EigrpDisabledInterfaces ( )
virtual
28 {
29  int cnt = ifVector.size();
30  EigrpInterface *iface;
31 
32  for (int i = 0; i < cnt; i++) {
33  iface = ifVector[i];
34  ifVector[i] = nullptr;
35  delete iface;
36  }
37  ifVector.clear();
38 }

Member Function Documentation

◆ addInterface()

void inet::eigrp::EigrpDisabledInterfaces::addInterface ( EigrpInterface interface)

Adds interface to the table.

41 {
42  // TODO check duplicity
43  this->ifVector.push_back(interface);
44 }

Referenced by inet::eigrp::EigrpIpv4Pdm::addInterfaceToEigrp(), inet::eigrp::EigrpIpv6Pdm::addInterfaceToEigrp(), inet::eigrp::EigrpIpv4Pdm::disableInterface(), and inet::eigrp::EigrpIpv6Pdm::disableInterface().

◆ findInterface()

EigrpInterface * inet::eigrp::EigrpDisabledInterfaces::findInterface ( int  ifaceId)

Finds interface by ID in table and returns it.

If interface with specified ID does not exist in the table, returns null.

59 {
60  EigrpInterface *iface;
61 
62  for (auto it = ifVector.begin(); it != ifVector.end(); it++) {
63  iface = *it;
64  if (iface->getInterfaceId() == ifaceId) {
65  return iface;
66  }
67  }
68 
69  return nullptr;
70 }

Referenced by inet::eigrp::EigrpIpv4Pdm::getInterfaceById(), and inet::eigrp::EigrpIpv6Pdm::getInterfaceById().

◆ getInterface()

EigrpInterface* inet::eigrp::EigrpDisabledInterfaces::getInterface ( int  k) const
inline

Returns interface by its position in the table.

52 { return ifVector[k]; }

Referenced by inet::eigrp::EigrpIpv4Pdm::cancelHelloTimers(), and inet::eigrp::EigrpIpv6Pdm::cancelHelloTimers().

◆ getNumInterfaces()

int inet::eigrp::EigrpDisabledInterfaces::getNumInterfaces ( ) const
inline

Returns number of interfaces in the table.

36 { return ifVector.size(); }

Referenced by inet::eigrp::EigrpIpv4Pdm::cancelHelloTimers(), and inet::eigrp::EigrpIpv6Pdm::cancelHelloTimers().

◆ removeInterface()

EigrpInterface * inet::eigrp::EigrpDisabledInterfaces::removeInterface ( EigrpInterface iface)

Removes specified interface from table and returns it.

If interface does not exist in the table, returns null.

47 {
48  auto it = find(ifVector, iface);
49 
50  if (it != ifVector.end()) {
51  ifVector.erase(it);
52  return iface;
53  }
54 
55  return nullptr;
56 }

Referenced by inet::eigrp::EigrpIpv4Pdm::enableInterface(), and inet::eigrp::EigrpIpv6Pdm::enableInterface().

Member Data Documentation

◆ ifVector

std::vector<EigrpInterface *> inet::eigrp::EigrpDisabledInterfaces::ifVector
protected

The documentation for this class was generated from the following files:
inet::eigrp::EigrpDisabledInterfaces::ifVector
std::vector< EigrpInterface * > ifVector
Definition: EigrpDisabledInterfaces.h:27
inet::find
std::vector< T >::iterator find(std::vector< T > &v, const Tk &a)
Definition: stlutils.h:44
inet::physicallayer::k
const double k
Definition: Qam1024Modulation.cc:14