Move libcds 1.6.0 from SVN
[libcds.git] / cds / container / striped_map / boost_unordered_map.h
1 //$$CDS-header$$
2
3 #ifndef __CDS_CONTAINER_STRIPED_MAP_BOOST_UNORDERED_MAP_ADAPTER_H
4 #define __CDS_CONTAINER_STRIPED_MAP_BOOST_UNORDERED_MAP_ADAPTER_H
5
6 #include <cds/container/striped_set/adapter.h>
7 #include <boost/unordered_map.hpp>
8
9 //@cond
10 namespace cds { namespace container {
11     namespace striped_set {
12
13         // Copy policy for map
14         template <typename Key, typename T, typename Traits, typename Alloc>
15         struct copy_item_policy< boost::unordered_map< Key, T, Traits, Alloc > >
16             : public details::boost_map_copy_policies<boost::unordered_map< Key, T, Traits, Alloc > >::copy_item_policy
17         {};
18
19         // Swap policy for map
20         template <typename Key, typename T, typename Traits, typename Alloc>
21         struct swap_item_policy< boost::unordered_map< Key, T, Traits, Alloc > >
22             : public details::boost_map_copy_policies<boost::unordered_map< Key, T, Traits, Alloc > >::swap_item_policy
23         {};
24
25 #ifdef CDS_MOVE_SEMANTICS_SUPPORT
26         // Move policy for map
27         template <typename Key, typename T, typename Traits, typename Alloc>
28         struct move_item_policy< boost::unordered_map< Key, T, Traits, Alloc > >
29             : public details::boost_map_copy_policies<boost::unordered_map< Key, T, Traits, Alloc > >::move_item_policy
30         {};
31 #endif
32     }   // namespace striped_set
33 }} // namespace cds::container
34
35 namespace cds { namespace intrusive { namespace striped_set {
36
37     /// boost::unordered_map  adapter for hash map bucket
38     template <typename Key, typename T, class Hash, class Pred, class Alloc, CDS_SPEC_OPTIONS>
39     class adapt< boost::unordered_map< Key, T, Hash, Pred, Alloc>, CDS_OPTIONS >
40     {
41     public:
42         typedef boost::unordered_map< Key, T, Hash, Pred, Alloc>  container_type  ;   ///< underlying container type
43         typedef cds::container::striped_set::details::boost_map_adapter< container_type, CDS_OPTIONS >    type;
44     };
45 }}} // namespace cds::intrusive::striped_set
46
47
48 //@endcond
49
50 #endif  // #ifndef __CDS_CONTAINER_STRIPED_MAP_BOOST_UNORDERED_MAP_ADAPTER_H