47 auto i = m_faces.find(
id);
48 return i == m_faces.end() ? nullptr : i->second.get();
54 return m_faces.size();
61 NFD_LOG_WARN(
"Trying to add existing face id=" << face->getId() <<
" to the face table");
65 FaceId faceId = ++m_lastFaceId;
79 FaceTable::addImpl(shared_ptr<Face> face,
FaceId faceId)
82 auto ret = m_faces.emplace(faceId, face);
83 BOOST_VERIFY(ret.second);
86 " remote=" << face->getRemoteUri() <<
87 " local=" << face->getLocalUri());
95 FaceTable::remove(
FaceId faceId)
97 auto i = m_faces.find(faceId);
98 BOOST_ASSERT(i != m_faces.end());
99 shared_ptr<Face> face = i->second;
107 " remote=" << face->getRemoteUri() <<
108 " local=" << face->getLocalUri());
115 FaceTable::getForwardRange()
const 117 return m_faces | boost::adaptors::map_values | boost::adaptors::indirected;
123 return this->getForwardRange().begin();
129 return this->getForwardRange().end();
boost::indirected_range< const boost::select_second_const_range< FaceMap > > ForwardRange
#define NFD_LOG_INIT(name)
void add(shared_ptr< Face > face)
add a face
detail::SimulatorIo & getGlobalIoService()
Returns the global io_service instance for the calling thread.
const_iterator begin() const
Face * get(FaceId id) const
get face by FaceId
void connectFaceClosedSignal(Face &face, std::function< void()> f)
Invokes a callback when a face is closed.
signal::Signal< FaceTable, Face > beforeRemove
Fires immediately before a face is removed.
boost::range_iterator< ForwardRange >::type const_iterator
ForwardIterator for Face&.
const_iterator end() const
Copyright (c) 2011-2015 Regents of the University of California.
void post(const std::function< void()> &callback)
const FaceId FACEID_RESERVED_MAX
upper bound of reserved FaceIds
void addReserved(shared_ptr< Face > face, FaceId faceId)
add a special face with a reserved FaceId
NDN_CXX_ASSERT_FORWARD_ITERATOR(FaceTable::const_iterator)
uint64_t FaceId
Identifies a face.
const FaceId INVALID_FACEID
indicates an invalid FaceId
signal::Signal< FaceTable, Face > afterAdd
Fires immediately after a face is added.