fw: FaceTable iterator dereferences to Face& instead of shared_ptr
This commit also improves the speed and reliability of
Mgmt/TestFaceManager/CreateFace test suite.
refs #3205
Change-Id: Idd013488ced2d7f8072ef8a3d910f94da2e0c8ac
diff --git a/daemon/fw/face-table.hpp b/daemon/fw/face-table.hpp
index 19517b7..c8f93d0 100644
--- a/daemon/fw/face-table.hpp
+++ b/daemon/fw/face-table.hpp
@@ -27,6 +27,7 @@
#define NFD_DAEMON_FW_FACE_TABLE_HPP
#include "face/face.hpp"
+#include <boost/range/adaptor/indirected.hpp>
#include <boost/range/adaptor/map.hpp>
namespace nfd {
@@ -72,9 +73,9 @@
public: // enumeration
typedef std::map<FaceId, shared_ptr<Face>> FaceMap;
- typedef boost::select_second_const_range<FaceMap> ForwardRange;
+ typedef boost::indirected_range<const boost::select_second_const_range<FaceMap>> ForwardRange;
- /** \brief ForwardIterator for shared_ptr<Face>
+ /** \brief ForwardIterator for Face&
*/
typedef boost::range_iterator<ForwardRange>::type const_iterator;