]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/interprocess/test/adaptive_pool_test.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / interprocess / test / adaptive_pool_test.cpp
1 //////////////////////////////////////////////////////////////////////////////
2 //
3 // (C) Copyright Ion Gaztanaga 2004-2012. Distributed under the Boost
4 // Software License, Version 1.0. (See accompanying file
5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 //
7 // See http://www.boost.org/libs/interprocess for documentation.
8 //
9 //////////////////////////////////////////////////////////////////////////////
10
11 #include <boost/interprocess/detail/config_begin.hpp>
12 #include <boost/interprocess/managed_shared_memory.hpp>
13 #include <boost/interprocess/containers/list.hpp>
14 #include <boost/interprocess/containers/vector.hpp>
15 #include <boost/interprocess/allocators/adaptive_pool.hpp>
16 #include "print_container.hpp"
17 #include "dummy_test_allocator.hpp"
18 #include "movable_int.hpp"
19 #include "list_test.hpp"
20 #include "vector_test.hpp"
21
22 using namespace boost::interprocess;
23
24 //We will work with wide characters for shared memory objects
25 //Alias an adaptive pool that allocates ints
26 typedef adaptive_pool
27 <int, managed_shared_memory::segment_manager> shmem_node_allocator_t;
28
29 typedef ipcdetail::adaptive_pool_v1
30 <int, managed_shared_memory::segment_manager> shmem_node_allocator_v1_t;
31
32 namespace boost {
33 namespace interprocess {
34
35 //Explicit instantiations to catch compilation errors
36 template class adaptive_pool<int, managed_shared_memory::segment_manager>;
37 template class adaptive_pool<void, managed_shared_memory::segment_manager>;
38
39 namespace ipcdetail {
40
41 template class ipcdetail::adaptive_pool_v1<int, managed_shared_memory::segment_manager>;
42 template class ipcdetail::adaptive_pool_v1<void, managed_shared_memory::segment_manager>;
43
44 }}}
45
46 //Alias list types
47 typedef list<int, shmem_node_allocator_t> MyShmList;
48 typedef list<int, shmem_node_allocator_v1_t> MyShmListV1;
49
50 //Alias vector types
51 typedef vector<int, shmem_node_allocator_t> MyShmVector;
52 typedef vector<int, shmem_node_allocator_v1_t> MyShmVectorV1;
53
54 int main ()
55 {
56 if(test::list_test<managed_shared_memory, MyShmList, true>())
57 return 1;
58
59 if(test::list_test<managed_shared_memory, MyShmListV1, true>())
60 return 1;
61
62 if(test::vector_test<managed_shared_memory, MyShmVector>())
63 return 1;
64
65 if(test::vector_test<managed_shared_memory, MyShmVectorV1>())
66 return 1;
67
68 return 0;
69 }
70
71 #include <boost/interprocess/detail/config_end.hpp>