Kea  1.9.9-git
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, uint32_t,&Iface::getIndex > >, boost::multi_index::hashed_unique< boost::multi_index::const_mem_fun< Iface, std::string,&Iface::getName > > > > IfaceContainer
 Multi index container for network interfaces. More...
 

Public Member Functions

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

Detailed Description

Collection of pointers to network interfaces.

Definition at line 466 of file iface_mgr.h.

Member Typedef Documentation

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, uint32_t, &Iface::getIndex > >, boost::multi_index::hashed_unique< boost::multi_index::const_mem_fun< Iface, std::string, &Iface::getName > > > > 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 501 of file iface_mgr.h.

Member Function Documentation

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

Begin iterator.

Returns
The container sequence begin iterator.

Definition at line 506 of file iface_mgr.h.

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

Clear the collection.

Definition at line 532 of file iface_mgr.h.

Referenced by isc::dhcp::IfaceMgr::clearIfaces().

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

Empty predicate.

Returns
If the container is empty true else false.

Definition at line 520 of file iface_mgr.h.

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

End iterator.

Returns
The container sequence end iterator.

Definition at line 513 of file iface_mgr.h.

IfacePtr isc::dhcp::IfaceCollection::getIface ( uint32_t  ifindex)

Lookup by interface index.

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

Definition at line 808 of file iface_mgr.cc.

Referenced by isc::dhcp::IfaceMgr::getIface().

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 814 of file iface_mgr.cc.

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 542 of file iface_mgr.h.

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

Return the number of interfaces.

Returns
The container size.

Definition at line 527 of file iface_mgr.h.

Referenced by isc::dhcp::IfaceMgr::countIfaces().


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