37 : m_forwarder(forwarder)
51 return (i == m_faces.end()) ? (shared_ptr<Face>()) : (i->second);
57 return m_faces.size();
64 NFD_LOG_WARN(
"Trying to add existing face id=" << face->getId() <<
" to the face table");
68 FaceId faceId = ++m_lastFaceId;
70 this->addImpl(face, faceId);
77 BOOST_ASSERT(m_faces.count(face->getId()) == 0);
79 this->addImpl(face, faceId);
83 FaceTable::addImpl(shared_ptr<Face>
face,
FaceId faceId)
86 m_faces[faceId] = face;
87 NFD_LOG_INFO(
"Added face id=" << faceId <<
" remote=" << face->getRemoteUri()
88 <<
" local=" << face->getLocalUri());
94 std::weak_ptr<Face> weakFace = face;
96 shared_ptr<Face> face = weakFace.lock();
97 if (face !=
nullptr) {
106 FaceTable::remove(shared_ptr<Face> face)
110 FaceId faceId = face->getId();
111 m_faces.erase(faceId);
115 " remote=" << face->getRemoteUri() <<
116 " local=" << face->getLocalUri());
125 FaceTable::getForwardRange()
const 127 return m_faces | boost::adaptors::map_values;
133 return this->getForwardRange().begin();
139 return this->getForwardRange().end();
signal::Signal< FaceTable, shared_ptr< Face > > afterAdd
fires after a Face is added
boost::range_iterator< ForwardRange >::type const_iterator
ForwardIterator for shared_ptr<Face>
void add(shared_ptr< Face > face)
void connectFaceClosedSignal(Face &face, const std::function< void()> &f)
invokes a callback when the face is closed
void startProcessInterest(Face &face, const Interest &interest)
start incoming Interest processing
detail::SimulatorIo & getGlobalIoService()
const_iterator begin() const
signal::Signal< FaceTable, shared_ptr< Face > > beforeRemove
fires before a Face is removed
#define NFD_LOG_WARN(expression)
void removeNextHopFromAllEntries(shared_ptr< Face > face)
removes the NextHop record for face in all entrites
#define NFD_LOG_INFO(expression)
const_iterator end() const
Copyright (c) 2011-2015 Regents of the University of California.
void post(const std::function< void()> &callback)
void startProcessData(Face &face, const Data &data)
start incoming Data processing
const FaceId FACEID_RESERVED_MAX
upper bound of reserved FaceIds
boost::select_second_const_range< FaceMap > ForwardRange
#define NFD_LOG_INIT(name)
FaceTable(Forwarder &forwarder)
void addReserved(shared_ptr< Face > face, FaceId faceId)
add a special Face with a reserved FaceId
uint64_t FaceId
identifies a face
shared_ptr< Face > get(FaceId id) const
const FaceId INVALID_FACEID
indicates an invalid FaceId
void startProcessNack(Face &face, const lp::Nack &nack)
start incoming Nack processing