Kea 3.1.9
isc::dhcp::IfaceCollection Class Reference

Collection of pointers to network interfaces. More...

#include <iface_mgr.h>

Public Types

typedef boost::multi_index_container< IfacePtr, boost::multi_index::indexed_by< boost::multi_index::sequenced<>, boost::multi_index::hashed_unique< boost::multi_index::const_mem_fun< Iface, unsigned int, &Iface::getIndex > >, boost::multi_index::hashed_unique< boost::multi_index::const_mem_fun< Iface, std::string, &Iface::getName > >, boost::multi_index::sequenced<> > > IfaceContainer
 Multi index container for network interfaces.
typedef IfaceContainer::nth_index< 3 >::type LruIndex
 Type of LRU index.
typedef LruIndex::iterator LruIterator
 Type of LRU iterator.

Public Member Functions

IfaceContainer::const_iterator begin () const
 Begin iterator.
void clear ()
 Clear the collection.
bool empty () const
 Empty predicate.
IfaceContainer::const_iterator end () const
 End iterator.
IfacePtr getIface (const std::string &ifname)
 Lookup by interface name.
IfacePtr getIface (const unsigned int ifindex)
 Lookup by interface index.
LruIndexgetLru ()
 LRU index.
void push_back (const IfacePtr &iface)
 Adds an interface to the collection.
size_t size () const
 Return the number of interfaces.

Detailed Description

Collection of pointers to network interfaces.

Definition at line 547 of file iface_mgr.h.

Member Typedef Documentation

◆ IfaceContainer

typedef boost::multi_index_container< IfacePtr, boost::multi_index::indexed_by< boost::multi_index::sequenced<>, boost::multi_index::hashed_unique< boost::multi_index::const_mem_fun< Iface, unsigned int, &Iface::getIndex > >, boost::multi_index::hashed_unique< boost::multi_index::const_mem_fun< Iface, std::string, &Iface::getName > >, boost::multi_index::sequenced<> > > isc::dhcp::IfaceCollection::IfaceContainer

Multi index container for network interfaces.

This container allows to search for a network interfaces using three indexes:

  • sequenced: used to access elements in the order they have been added to the container.
  • interface index: used to access an interface using its index.
  • interface name: used to access an interface using its name. Note that indexes and names are unique.

Definition at line 585 of file iface_mgr.h.

◆ LruIndex

typedef IfaceContainer::nth_index<3>::type isc::dhcp::IfaceCollection::LruIndex

Type of LRU index.

Definition at line 602 of file iface_mgr.h.

◆ LruIterator

typedef LruIndex::iterator isc::dhcp::IfaceCollection::LruIterator

Type of LRU iterator.

Definition at line 612 of file iface_mgr.h.

Member Function Documentation

◆ begin()

IfaceContainer::const_iterator isc::dhcp::IfaceCollection::begin ( ) const
inline

Begin iterator.

Returns
The container sequence begin iterator.

Definition at line 590 of file iface_mgr.h.

◆ clear()

void isc::dhcp::IfaceCollection::clear ( )
inline

Clear the collection.

Definition at line 629 of file iface_mgr.h.

◆ empty()

bool isc::dhcp::IfaceCollection::empty ( ) const
inline

Empty predicate.

Returns
If the container is empty true else false.

Definition at line 617 of file iface_mgr.h.

◆ end()

IfaceContainer::const_iterator isc::dhcp::IfaceCollection::end ( ) const
inline

End iterator.

Returns
The container sequence end iterator.

Definition at line 597 of file iface_mgr.h.

◆ getIface() [1/2]

IfacePtr isc::dhcp::IfaceCollection::getIface ( const std::string & ifname)

Lookup by interface name.

Parameters
ifnameThe name of the interface to find.
Returns
The interface with the name or null.

Definition at line 838 of file iface_mgr.cc.

References isc::util::MultiThreadingMgr::instance().

Here is the call graph for this function:

◆ getIface() [2/2]

IfacePtr isc::dhcp::IfaceCollection::getIface ( const unsigned int ifindex)

Lookup by interface index.

Parameters
ifindexThe index of the interface to find.
Returns
The interface with the index or null.

Definition at line 833 of file iface_mgr.cc.

References isc::util::MultiThreadingMgr::instance().

Here is the call graph for this function:

◆ getLru()

LruIndex & isc::dhcp::IfaceCollection::getLru ( )
inline

LRU index.

Returns
A reference to the LRU index.

Definition at line 607 of file iface_mgr.h.

◆ push_back()

void isc::dhcp::IfaceCollection::push_back ( const IfacePtr & iface)
inline

Adds an interface to the collection.

The interface is added at the end of sequence.

Parameters
ifacereference to Iface object.

Definition at line 639 of file iface_mgr.h.

◆ size()

size_t isc::dhcp::IfaceCollection::size ( ) const
inline

Return the number of interfaces.

Returns
The container size.

Definition at line 624 of file iface_mgr.h.


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