voxelTerrain
 All Classes Functions Variables Typedefs Enumerations Pages
hashMapMulti.hpp
1 #ifndef HASHMULTIMAP_HPP
2 #define HASHMULTIMAP_HPP
3 
4 #include "blub/core/pair.hpp"
5 
6 #include <boost/unordered_map.hpp>
7 
8 
9 namespace blub
10 {
11 
12 template <class S,
13  class T,
14  class H,// = boost::hash<S>,
15  class P,// = std::equal_to<S>,
16  class A// = std::allocator<pair<const S, T> >
17  >
18 class hashMapMulti : public boost::unordered::unordered_multimap<S, T, H, P, A>
19 {
20 public:
21  typedef boost::unordered::unordered_multimap<S, T, H, P, A> t_base;
22  typedef std::pair<typename t_base::iterator, typename t_base::iterator> equal_range_result;
23  typedef std::pair<typename t_base::const_iterator, typename t_base::const_iterator> equal_range_result_const;
24 
25 
26  hashMapMulti<S, T, H, P, A>() : t_base() {;}
27 
28 
29  typename t_base::const_iterator constBegin() const
30  {
31  return t_base::cbegin();
32  }
33 
34  typename t_base::const_iterator constEnd() const
35  {
36  return t_base::cend();
37  }
38 
39  void insert(const typename t_base::key_type& key, const typename t_base::mapped_type& value)
40  {
42  t_base::insert(toInsert);
43  }
44 
45  void remove(const typename t_base::key_type& key)
46  {
47  t_base::erase(key);
48  }
49 
50  bool contains(const typename t_base::key_type& key) const
51  {
52  return t_base::find(key) != t_base::cend();
53  }
54 
55 };
56 
57 }
58 
59 
60 #endif // HASHMULTIMAP_HPP
Definition: hashMapMulti.hpp:18
Definition: pair.hpp:9
Definition: deadlineTimer.hpp:10