container of all faces More...
#include <face-table.hpp>
Public Types | |
using | FaceMap = std::map< FaceId, shared_ptr< Face > > |
using | ForwardRange = boost::indirected_range< const boost::select_second_const_range< FaceMap > > |
using | const_iterator = boost::range_iterator< ForwardRange >::type |
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... | |
Face * | get (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 immediately after a face is added. More... | |
signal::Signal< FaceTable, Face > | beforeRemove |
Fires immediately before a face is removed. More... | |
container of all faces
Definition at line 38 of file face-table.hpp.
using nfd::FaceTable::FaceMap = std::map<FaceId, shared_ptr<Face> > |
Definition at line 69 of file face-table.hpp.
using nfd::FaceTable::ForwardRange = boost::indirected_range<const boost::select_second_const_range<FaceMap> > |
Definition at line 70 of file face-table.hpp.
using nfd::FaceTable::const_iterator = boost::range_iterator<ForwardRange>::type |
ForwardIterator for Face&.
Definition at line 74 of file face-table.hpp.
nfd::FaceTable::FaceTable | ( | ) |
Definition at line 39 of file face-table.cpp.
References Face.
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, nonstd::optional_lite::std11::move(), and NFD_LOG_WARN.
Referenced by nfd::face::FaceSystem::FaceSystem(), and nfd::makeCreateFaceResponse().
void nfd::FaceTable::addReserved | ( | shared_ptr< Face > | face, |
FaceId | faceId | ||
) |
add a special face with a reserved FaceId
Definition at line 71 of file face-table.cpp.
References afterAdd, beforeRemove, nfd::face::connectFaceClosedSignal(), nfd::face::FACEID_RESERVED_MAX, nfd::getGlobalIoService(), nfd::face::INVALID_FACEID, nonstd::optional_lite::std11::move(), NFD_LOG_INFO, and nfd::detail::SimulatorIo::post().
Referenced by nfd::Forwarder::Forwarder().
Face * nfd::FaceTable::get | ( | FaceId | id | ) | const |
get face by FaceId
Definition at line 45 of file face-table.cpp.
Referenced by nfd::FibManager::FibManager(), nfd::fw::Strategy::getFace(), nfd::Forwarder::onContentStoreMiss(), and nfd::updateLinkServiceOptions().
size_t nfd::FaceTable::size | ( | ) | const |
Definition at line 52 of file face-table.cpp.
FaceTable::const_iterator nfd::FaceTable::begin | ( | ) | const |
Definition at line 121 of file face-table.cpp.
FaceTable::const_iterator nfd::FaceTable::end | ( | ) | const |
Definition at line 127 of file face-table.cpp.
signal::Signal<FaceTable, Face> nfd::FaceTable::afterAdd |
Fires immediately after a face is added.
Definition at line 85 of file face-table.hpp.
Referenced by addReserved(), nfd::FaceManager::FaceManager(), and nfd::Forwarder::Forwarder().
signal::Signal<FaceTable, Face> nfd::FaceTable::beforeRemove |
Fires immediately before a face is removed.
When this signal is emitted, the face is still in FaceTable and has a valid FaceId.
Definition at line 91 of file face-table.hpp.
Referenced by addReserved(), nfd::FaceManager::FaceManager(), and nfd::Forwarder::Forwarder().