NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
nfd::FaceTable Class Reference

container of all faces More...

#include <face-table.hpp>

Inheritance diagram for nfd::FaceTable:
Collaboration diagram for nfd::FaceTable:

Public Types

typedef std::map< FaceId, shared_ptr< Face > > FaceMap
 
typedef boost::indirected_range< const boost::select_second_const_range< FaceMap > > ForwardRange
 
typedef boost::range_iterator< ForwardRange >::type const_iterator
 ForwardIterator for Face&. More...
 

Public Member Functions

 FaceTable ()
 
void add (shared_ptr< Face > face)
 add a face More...
 
void addReserved (shared_ptr< Face > face, FaceId faceId)
 add a special face with a reserved FaceId More...
 
Faceget (FaceId id) const
 get face by FaceId More...
 
size_t size () const
 
const_iterator begin () const
 
const_iterator end () const
 

Public Attributes

signal::Signal< FaceTable, Face & > afterAdd
 fires after a face is added More...
 
signal::Signal< FaceTable, Face & > beforeRemove
 fires before a face is removed More...
 

Detailed Description

container of all faces

Definition at line 37 of file face-table.hpp.

Member Typedef Documentation

◆ FaceMap

typedef std::map<FaceId, shared_ptr<Face> > nfd::FaceTable::FaceMap

Definition at line 68 of file face-table.hpp.

◆ ForwardRange

typedef boost::indirected_range<const boost::select_second_const_range<FaceMap> > nfd::FaceTable::ForwardRange

Definition at line 70 of file face-table.hpp.

◆ const_iterator

typedef boost::range_iterator<ForwardRange>::type nfd::FaceTable::const_iterator

ForwardIterator for Face&.

Definition at line 74 of file face-table.hpp.

Constructor & Destructor Documentation

◆ FaceTable()

nfd::FaceTable::FaceTable ( )

Definition at line 36 of file face-table.cpp.

Member Function Documentation

◆ add()

void nfd::FaceTable::add ( shared_ptr< Face face)

add a face

FaceTable obtains shared ownership of the face. The channel or protocol factory that creates the face may retain ownership.

Definition at line 58 of file face-table.cpp.

References nfd::face::FACEID_RESERVED_MAX, nfd::face::INVALID_FACEID, and NFD_LOG_WARN.

Referenced by nfd::FaceManager::setConfigFile().

◆ addReserved()

void nfd::FaceTable::addReserved ( shared_ptr< Face face,
FaceId  faceId 
)

◆ get()

Face * nfd::FaceTable::get ( FaceId  id) const

get face by FaceId

Returns
a face if found, nullptr if not found; face->shared_from_this() can be used if shared_ptr<Face> is desired

Definition at line 42 of file face-table.cpp.

Referenced by nfd::FibManager::FibManager(), nfd::FaceManager::setConfigFile(), and nfd::Forwarder::startProcessNack().

◆ size()

size_t nfd::FaceTable::size ( ) const
Returns
count of faces

Definition at line 52 of file face-table.cpp.

◆ begin()

FaceTable::const_iterator nfd::FaceTable::begin ( ) const

Definition at line 119 of file face-table.cpp.

◆ end()

FaceTable::const_iterator nfd::FaceTable::end ( ) const

Definition at line 125 of file face-table.cpp.

Member Data Documentation

◆ afterAdd

signal::Signal<FaceTable, Face&> nfd::FaceTable::afterAdd

fires after a face is added

Definition at line 85 of file face-table.hpp.

Referenced by addReserved(), nfd::FaceManager::FaceManager(), and nfd::Forwarder::Forwarder().

◆ beforeRemove

signal::Signal<FaceTable, Face&> nfd::FaceTable::beforeRemove

fires before a face is removed

When this signal is emitted, face is still in FaceTable and has valid FaceId.

Definition at line 91 of file face-table.hpp.

Referenced by addReserved(), nfd::FaceManager::FaceManager(), and nfd::Forwarder::Forwarder().


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