nfd::rib::RibEntry Class Reference

represents a RIB entry, which contains one or more Routes with the same prefix More...

#include <rib/rib-entry.hpp>

+ Inheritance diagram for nfd::rib::RibEntry:
+ Collaboration diagram for nfd::rib::RibEntry:

Public Types

typedef RouteList::const_iterator const_iterator
 
typedef RouteList::iterator iterator
 
typedef std::list< RouteRouteList
 

Public Member Functions

 RibEntry ()
 
void addChild (shared_ptr< RibEntry > child)
 
void addInheritedRoute (const Route &route)
 
const_iterator begin () const
 
iterator begin ()
 
const_iterator end () const
 
iterator end ()
 
void eraseRoute (const Route &route)
 erases a Route with the same faceId and origin More...
 
iterator eraseRoute (RouteList::iterator route)
 erases a Route with the passed iterator More...
 
RouteList::const_iterator findInheritedRoute (const Route &route) const
 Finds an inherited route with a matching face ID. More...
 
iterator findRoute (const Route &route)
 
const_iterator findRoute (const Route &route) const
 
const std::list< shared_ptr< RibEntry > > & getChildren () const
 
const RouteListgetInheritedRoutes () const
 Returns the routes this namespace has inherited. More...
 
const Name & getName () const
 
size_t getNRoutes () const
 
shared_ptr< RibEntrygetParent () const
 
const RouteListgetRoutes () const
 
const RoutegetRouteWithLowestCostAndChildInheritByFaceId (uint64_t faceId) const
 Returns the route with the lowest cost that has the passed face ID and its child inherit flag set. More...
 
const RoutegetRouteWithLowestCostByFaceId (uint64_t faceId) const
 Returns the route with the lowest cost that has the passed face ID. More...
 
const RoutegetRouteWithSecondLowestCostByFaceId (uint64_t faceId) const
 
bool hasCapture () const
 
bool hasChildInheritOnFaceId (uint64_t faceId) const
 Determines if the entry has an inherited route with the passed face ID and its child inherit flag set. More...
 
bool hasChildren () const
 
bool hasFaceId (const uint64_t faceId) const
 
bool hasInheritedRoute (const Route &route) const
 Determines if the entry has an inherited route with a matching face ID. More...
 
bool hasParent () const
 
bool hasRoute (const Route &route)
 
std::pair< RibEntry::iterator, bool > insertRoute (const Route &route)
 inserts a new route into the entry's route list If another route already exists with the same faceId and origin, the new route is not inserted. More...
 
void removeChild (shared_ptr< RibEntry > child)
 
void removeInheritedRoute (const Route &route)
 
void setName (const Name &prefix)
 

Detailed Description

represents a RIB entry, which contains one or more Routes with the same prefix

Definition at line 36 of file rib-entry.hpp.

Member Typedef Documentation

typedef RouteList::const_iterator nfd::rib::RibEntry::const_iterator

Definition at line 41 of file rib-entry.hpp.

typedef RouteList::iterator nfd::rib::RibEntry::iterator

Definition at line 40 of file rib-entry.hpp.

Definition at line 39 of file rib-entry.hpp.

Constructor & Destructor Documentation

nfd::rib::RibEntry::RibEntry ( )
inline

Definition at line 43 of file rib-entry.hpp.

Member Function Documentation

void nfd::rib::RibEntry::addChild ( shared_ptr< RibEntry child)

Definition at line 98 of file rib-entry.cpp.

void nfd::rib::RibEntry::addInheritedRoute ( const Route route)

Definition at line 132 of file rib-entry.cpp.

RibEntry::const_iterator nfd::rib::RibEntry::begin ( ) const
inline

Definition at line 241 of file rib-entry.hpp.

RibEntry::iterator nfd::rib::RibEntry::begin ( )
inline

Definition at line 253 of file rib-entry.hpp.

RibEntry::const_iterator nfd::rib::RibEntry::end ( ) const
inline

Definition at line 247 of file rib-entry.hpp.

RibEntry::iterator nfd::rib::RibEntry::end ( )
inline

Definition at line 259 of file rib-entry.hpp.

void nfd::rib::RibEntry::eraseRoute ( const Route route)

erases a Route with the same faceId and origin

Definition at line 69 of file rib-entry.cpp.

RibEntry::RouteList::iterator nfd::rib::RibEntry::eraseRoute ( RouteList::iterator  route)

erases a Route with the passed iterator

Returns
{ an iterator to the element that followed the erased iterator }

Definition at line 114 of file rib-entry.cpp.

RibEntry::RouteList::const_iterator nfd::rib::RibEntry::findInheritedRoute ( const Route route) const

Finds an inherited route with a matching face ID.

Returns
{ An iterator to the matching route if one is found; otherwise, an iterator to the end of the entry's inherited route list }

Definition at line 146 of file rib-entry.cpp.

RibEntry::RouteList::iterator nfd::rib::RibEntry::findRoute ( const Route route)

Definition at line 38 of file rib-entry.cpp.

RibEntry::RouteList::const_iterator nfd::rib::RibEntry::findRoute ( const Route route) const

Definition at line 44 of file rib-entry.cpp.

const std::list< shared_ptr< RibEntry > > & nfd::rib::RibEntry::getChildren ( ) const
inline

Definition at line 223 of file rib-entry.hpp.

const RibEntry::RouteList & nfd::rib::RibEntry::getInheritedRoutes ( ) const
inline

Returns the routes this namespace has inherited.

The inherited routes returned represent inherited routes this namespace has in the FIB.

Returns
{ routes inherited by this namespace }

Definition at line 235 of file rib-entry.hpp.

const Name & nfd::rib::RibEntry::getName ( ) const
inline

Definition at line 205 of file rib-entry.hpp.

size_t nfd::rib::RibEntry::getNRoutes ( ) const

Definition at line 92 of file rib-entry.cpp.

shared_ptr< RibEntry > nfd::rib::RibEntry::getParent ( ) const
inline

Definition at line 217 of file rib-entry.hpp.

const RibEntry::RouteList & nfd::rib::RibEntry::getRoutes ( ) const
inline

Definition at line 229 of file rib-entry.hpp.

const Route * nfd::rib::RibEntry::getRouteWithLowestCostAndChildInheritByFaceId ( uint64_t  faceId) const

Returns the route with the lowest cost that has the passed face ID and its child inherit flag set.

Returns
{ The route with the lowest cost that has the passed face ID and its child inherit flag set }

Definition at line 225 of file rib-entry.cpp.

const Route * nfd::rib::RibEntry::getRouteWithLowestCostByFaceId ( uint64_t  faceId) const

Returns the route with the lowest cost that has the passed face ID.

Returns
{ The route with the lowest cost that has the passed face ID}

Definition at line 179 of file rib-entry.cpp.

const Route * nfd::rib::RibEntry::getRouteWithSecondLowestCostByFaceId ( uint64_t  faceId) const

Definition at line 201 of file rib-entry.cpp.

bool nfd::rib::RibEntry::hasCapture ( ) const

Definition at line 161 of file rib-entry.cpp.

bool nfd::rib::RibEntry::hasChildInheritOnFaceId ( uint64_t  faceId) const

Determines if the entry has an inherited route with the passed face ID and its child inherit flag set.

Returns
{ True, if a matching inherited route is found; otherwise, false. }

Definition at line 167 of file rib-entry.cpp.

bool nfd::rib::RibEntry::hasChildren ( ) const
bool nfd::rib::RibEntry::hasFaceId ( const uint64_t  faceId) const

Definition at line 84 of file rib-entry.cpp.

bool nfd::rib::RibEntry::hasInheritedRoute ( const Route route) const

Determines if the entry has an inherited route with a matching face ID.

Returns
{ True, if a matching inherited route is found; otherwise, false. }

Definition at line 153 of file rib-entry.cpp.

bool nfd::rib::RibEntry::hasParent ( ) const
bool nfd::rib::RibEntry::hasRoute ( const Route route)

Definition at line 76 of file rib-entry.cpp.

std::pair< RibEntry::iterator, bool > nfd::rib::RibEntry::insertRoute ( const Route route)

inserts a new route into the entry's route list If another route already exists with the same faceId and origin, the new route is not inserted.

Returns
a pair, whose first element is the iterator to the newly inserted element if the insert succeeds and to the previously-existing element otherwise, and whose second element is true if the insert succeeds and false otherwise.

Definition at line 50 of file rib-entry.cpp.

void nfd::rib::RibEntry::removeChild ( shared_ptr< RibEntry child)

Definition at line 106 of file rib-entry.cpp.

void nfd::rib::RibEntry::removeInheritedRoute ( const Route route)

Definition at line 138 of file rib-entry.cpp.

void nfd::rib::RibEntry::setName ( const Name &  prefix)
inline

Definition at line 199 of file rib-entry.hpp.