nfd::rib::Rib Class Reference

represents the RIB More...

#include <rib.hpp>

Inheritance diagram for nfd::rib::Rib:
Collaboration diagram for nfd::rib::Rib:

Public Types

typedef std::list< shared_ptr< RibEntry > > RibEntryList
 
typedef std::map< Name, shared_ptr< RibEntry > > RibTable
 
typedef RibTable::const_iterator const_iterator
 
typedef std::map< uint64_t, std::list< shared_ptr< RibEntry > > > FaceLookupTable
 
typedef bool(* RouteComparePredicate) (const Route &, const Route &)
 
typedef std::set< Route, RouteComparePredicateRouteSet
 
typedef function< void()> UpdateSuccessCallback
 
typedef function< void(uint32_t code, const std::string &error)> UpdateFailureCallback
 

Public Member Functions

 Rib ()
 
 ~Rib ()
 
void setFibUpdater (FibUpdater *updater)
 
const_iterator find (const Name &prefix) const
 
Routefind (const Name &prefix, const Route &route) const
 
const_iterator begin () const
 
const_iterator end () const
 
size_t size () const
 
bool empty () const
 
shared_ptr< RibEntryfindParent (const Name &prefix) const
 
std::list< shared_ptr< RibEntry > > findDescendants (const Name &prefix) const
 finds namespaces under the passed prefix More...
 
std::list< shared_ptr< RibEntry > > findDescendantsForNonInsertedName (const Name &prefix) const
 finds namespaces under the passed prefix More...
 
void beginApplyUpdate (const RibUpdate &update, const UpdateSuccessCallback &onSuccess, const UpdateFailureCallback &onFailure)
 passes the provided RibUpdateBatch to FibUpdater to calculate and send FibUpdates. More...
 
void beginRemoveFace (uint64_t faceId)
 starts the FIB update process when a face has been destroyed More...
 
void onFibUpdateSuccess (const RibUpdateBatch &batch, const RibUpdateList &inheritedRoutes, const Rib::UpdateSuccessCallback &onSuccess)
 
void onFibUpdateFailure (const Rib::UpdateFailureCallback &onFailure, uint32_t code, const std::string &error)
 
void onRouteExpiration (const Name &prefix, const Route &route)
 
void insert (const Name &prefix, const Route &route)
 

Public Attributes

ndn::util::signal::Signal< Rib, Name > afterInsertEntry
 
ndn::util::signal::Signal< Rib, Name > afterEraseEntry
 

Friends

class FibUpdater
 

Detailed Description

represents the RIB

Definition at line 43 of file rib.hpp.

Member Typedef Documentation

typedef RibTable::const_iterator nfd::rib::Rib::const_iterator

Definition at line 48 of file rib.hpp.

typedef std::map<uint64_t, std::list<shared_ptr<RibEntry> > > nfd::rib::Rib::FaceLookupTable

Definition at line 49 of file rib.hpp.

typedef std::list<shared_ptr<RibEntry> > nfd::rib::Rib::RibEntryList

Definition at line 46 of file rib.hpp.

typedef std::map<Name, shared_ptr<RibEntry> > nfd::rib::Rib::RibTable

Definition at line 47 of file rib.hpp.

typedef bool(* nfd::rib::Rib::RouteComparePredicate) (const Route &, const Route &)

Definition at line 50 of file rib.hpp.

Definition at line 51 of file rib.hpp.

typedef function<void(uint32_t code, const std::string& error)> nfd::rib::Rib::UpdateFailureCallback

Definition at line 100 of file rib.hpp.

typedef function<void()> nfd::rib::Rib::UpdateSuccessCallback

Definition at line 99 of file rib.hpp.

Constructor & Destructor Documentation

nfd::rib::Rib::Rib ( )

Definition at line 42 of file rib.cpp.

nfd::rib::Rib::~Rib ( )

Definition at line 48 of file rib.cpp.

Member Function Documentation

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

Definition at line 233 of file rib.hpp.

void nfd::rib::Rib::beginApplyUpdate ( const RibUpdate update,
const UpdateSuccessCallback onSuccess,
const UpdateFailureCallback onFailure 
)

passes the provided RibUpdateBatch to FibUpdater to calculate and send FibUpdates.

If the FIB is updated successfully, onFibUpdateSuccess() will be called, and the RIB will be updated

If the FIB update fails, onFibUpdateFailure() will be called, and the RIB will not be updated.

Definition at line 338 of file rib.cpp.

void nfd::rib::Rib::beginRemoveFace ( uint64_t  faceId)

starts the FIB update process when a face has been destroyed

Definition at line 350 of file rib.cpp.

bool nfd::rib::Rib::empty ( ) const
inline

Definition at line 251 of file rib.hpp.

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

Definition at line 239 of file rib.hpp.

Rib::const_iterator nfd::rib::Rib::find ( const Name &  prefix) const

Definition at line 59 of file rib.cpp.

Route * nfd::rib::Rib::find ( const Name &  prefix,
const Route route 
) const

Definition at line 65 of file rib.cpp.

std::list< shared_ptr< RibEntry > > nfd::rib::Rib::findDescendants ( const Name &  prefix) const

finds namespaces under the passed prefix

Returns
{ a list of entries which are under the passed prefix }

Definition at line 214 of file rib.cpp.

std::list< shared_ptr< RibEntry > > nfd::rib::Rib::findDescendantsForNonInsertedName ( const Name &  prefix) const

finds namespaces under the passed prefix

Note
Unlike findDescendants, needs to find where prefix would fit in tree before collecting list of descendant prefixes
Returns
{ a list of entries which would be under the passed prefix if the prefix existed in the RIB }

Definition at line 236 of file rib.cpp.

shared_ptr< RibEntry > nfd::rib::Rib::findParent ( const Name &  prefix) const

Definition at line 200 of file rib.cpp.

void nfd::rib::Rib::insert ( const Name &  prefix,
const Route route 
)

Definition at line 84 of file rib.cpp.

void nfd::rib::Rib::onFibUpdateFailure ( const Rib::UpdateFailureCallback onFailure,
uint32_t  code,
const std::string &  error 
)

Definition at line 438 of file rib.cpp.

void nfd::rib::Rib::onFibUpdateSuccess ( const RibUpdateBatch batch,
const RibUpdateList inheritedRoutes,
const Rib::UpdateSuccessCallback onSuccess 
)

Definition at line 408 of file rib.cpp.

void nfd::rib::Rib::onRouteExpiration ( const Name &  prefix,
const Route route 
)

Definition at line 187 of file rib.cpp.

void nfd::rib::Rib::setFibUpdater ( FibUpdater updater)

Definition at line 53 of file rib.cpp.

size_t nfd::rib::Rib::size ( ) const
inline

Definition at line 245 of file rib.hpp.

Friends And Related Function Documentation

friend class FibUpdater
friend

Definition at line 214 of file rib.hpp.

Member Data Documentation

ndn::util::signal::Signal<Rib, Name> nfd::rib::Rib::afterEraseEntry

Definition at line 205 of file rib.hpp.

ndn::util::signal::Signal<Rib, Name> nfd::rib::Rib::afterInsertEntry

Definition at line 204 of file rib.hpp.