nfd::FaceTable Class Reference

container of all faces More...

#include <daemon/fw/face-table.hpp>

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

Public Types

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

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...
 
const_iterator begin () const
 
const_iterator end () const
 
Face * get (FaceId id) const
 get face by FaceId More...
 
size_t size () 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

using nfd::FaceTable::const_iterator = boost::range_iterator<ForwardRange>::type

ForwardIterator for Face&.

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

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

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

using nfd::FaceTable::ForwardRange = boost::indirected_range<const boost::select_second_const_range<FaceMap>>

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

Constructor & Destructor Documentation

nfd::FaceTable::FaceTable ( )

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

Member Function Documentation

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 57 of file face-table.cpp.

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

add a special face with a reserved FaceId

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

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

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

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

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

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 44 of file face-table.cpp.

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

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

Member Data Documentation

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

fires after a face is added

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

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 90 of file face-table.hpp.