nlsr::NexthopListT< T > Class Template Reference

#include <nexthop-list.hpp>

+ Inheritance diagram for nlsr::NexthopListT< T >:

Public Types

typedef std::set< NextHop, T >::const_iterator const_iterator
 
typedef std::set< NextHop, T >::iterator iterator
 
typedef std::set< NextHop, T >::reverse_iterator reverse_iterator
 
typedef T value_type
 

Public Member Functions

 NexthopListT ()=default
 
void addNextHop (const NextHop &nh)
 Adds a next hop to the list. More...
 
iterator begin () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
void clear ()
 
iterator end () const
 
const std::set< NextHop, T > & getNextHops () const
 
reverse_iterator rbegin () const
 
void removeNextHop (const NextHop &nh)
 Remove a next hop from the Next Hop list. More...
 
reverse_iterator rend () const
 
size_t size () const
 

Detailed Description

template<typename T = std::less<NextHop>>
class nlsr::NexthopListT< T >

Definition at line 44 of file nexthop-list.hpp.

Member Typedef Documentation

◆ const_iterator

template<typename T = std::less<NextHop>>
typedef std::set<NextHop, T>::const_iterator nlsr::NexthopListT< T >::const_iterator

Definition at line 106 of file nexthop-list.hpp.

◆ iterator

template<typename T = std::less<NextHop>>
typedef std::set<NextHop, T>::iterator nlsr::NexthopListT< T >::iterator

Definition at line 105 of file nexthop-list.hpp.

◆ reverse_iterator

template<typename T = std::less<NextHop>>
typedef std::set<NextHop, T>::reverse_iterator nlsr::NexthopListT< T >::reverse_iterator

Definition at line 107 of file nexthop-list.hpp.

◆ value_type

template<typename T = std::less<NextHop>>
typedef T nlsr::NexthopListT< T >::value_type

Definition at line 104 of file nexthop-list.hpp.

Constructor & Destructor Documentation

◆ NexthopListT()

template<typename T = std::less<NextHop>>
nlsr::NexthopListT< T >::NexthopListT ( )
default

Member Function Documentation

◆ addNextHop()

template<typename T = std::less<NextHop>>
void nlsr::NexthopListT< T >::addNextHop ( const NextHop nh)
inline

Adds a next hop to the list.

Parameters
nhThe next hop.

Adds a next hop to this object. If the next hop is new it is added. If the next hop already exists but has a higher cost then its route cost is updated.

Definition at line 57 of file nexthop-list.hpp.

◆ begin()

template<typename T = std::less<NextHop>>
iterator nlsr::NexthopListT< T >::begin ( ) const
inline

Definition at line 110 of file nexthop-list.hpp.

◆ cbegin()

template<typename T = std::less<NextHop>>
const_iterator nlsr::NexthopListT< T >::cbegin ( ) const
inline

Definition at line 122 of file nexthop-list.hpp.

◆ cend()

template<typename T = std::less<NextHop>>
const_iterator nlsr::NexthopListT< T >::cend ( ) const
inline

Definition at line 128 of file nexthop-list.hpp.

◆ clear()

template<typename T = std::less<NextHop>>
void nlsr::NexthopListT< T >::clear ( )
inline

Definition at line 93 of file nexthop-list.hpp.

◆ end()

template<typename T = std::less<NextHop>>
iterator nlsr::NexthopListT< T >::end ( ) const
inline

Definition at line 116 of file nexthop-list.hpp.

◆ getNextHops()

template<typename T = std::less<NextHop>>
const std::set<NextHop, T>& nlsr::NexthopListT< T >::getNextHops ( ) const
inline

Definition at line 99 of file nexthop-list.hpp.

◆ rbegin()

template<typename T = std::less<NextHop>>
reverse_iterator nlsr::NexthopListT< T >::rbegin ( ) const
inline

Definition at line 134 of file nexthop-list.hpp.

◆ removeNextHop()

template<typename T = std::less<NextHop>>
void nlsr::NexthopListT< T >::removeNextHop ( const NextHop nh)
inline

Remove a next hop from the Next Hop list.

Parameters
nhThe NextHop we want to remove.

The next hop gets removed only if both next hop face and route cost are same.

Definition at line 78 of file nexthop-list.hpp.

◆ rend()

template<typename T = std::less<NextHop>>
reverse_iterator nlsr::NexthopListT< T >::rend ( ) const
inline

Definition at line 140 of file nexthop-list.hpp.

◆ size()

template<typename T = std::less<NextHop>>
size_t nlsr::NexthopListT< T >::size ( ) const
inline

Definition at line 87 of file nexthop-list.hpp.