LEMUR Packages: ompl_lemur or_lemur pr_bgl prpy_lemur
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Groups Pages
vector_ref_property_map.h
Go to the documentation of this file.
1 
9 namespace pr_bgl
10 {
11 
19 template<typename T>
21 {
22 public:
23  typedef boost::readable_property_map_tag category;
24  typedef size_t key_type;
25  typedef T value_type;
26  typedef T reference;
27  std::vector<T> & vec;
28  vector_ref_property_map(std::vector<T> & vec): vec(vec) {}
29 };
30 
31 template<typename T>
32 inline const T get(const vector_ref_property_map<T> & map, const size_t & idx)
33 {
34  return map.vec[idx];
35 }
36 
37 } // namespace pr_bgl
Readable property map adaptor for a vector.
Definition: vector_ref_property_map.h:20