vdj_pipe
pipeline for processing DNA sequence data
get_by_id.hpp
Go to the documentation of this file.
1 
7 #ifndef GET_BY_ID_HPP_
8 #define GET_BY_ID_HPP_
9 #include "boost/type_traits/remove_reference.hpp"
10 #include "boost/type_traits/remove_const.hpp"
11 
12 namespace vdj_pipe{ namespace detail{
13 
18 template<
19  class Stor,
20  class Id,
21  class Obj,
22  typename Result,
23  Result(Obj::*MemFunPtr)()const
24 >
25 class Getter {
26 public:
27  typedef typename boost::remove_const<
28  typename boost::remove_reference<Result>::type
29  >::type result_type;
30 
31  explicit Getter(Stor const& stor) : stor_(stor) {}
32  Result operator()(const Id id) const {return (stor_[id].*MemFunPtr)();}
33 private:
34  Stor const& stor_;
35 };
36 
37 }//namespace detail
38 }//namespace vdj_pipe
39 #endif /* GET_BY_ID_HPP_ */
Getter(Stor const &stor)
Definition: get_by_id.hpp:31
Stor const & stor_
Definition: get_by_id.hpp:34
Result operator()(const Id id) const
Definition: get_by_id.hpp:32
boost::remove_const< typename boost::remove_reference< Result >::type >::type result_type
Definition: get_by_id.hpp:29
Main namespace of vdj_pipe library.
Definition: keywords_variable.hpp:11
Extract object by its ID and apply member function.
Definition: get_by_id.hpp:25