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 #define BOOST_CONTAINER_ADAPTIVE_NODE_POOL_CHECK_INVARIANTS
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/cached_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 cached adaptive pool that allocates ints
26 typedef cached_adaptive_pool
27    <int, managed_shared_memory::segment_manager>
28    cached_node_allocator_t;
29 
30 typedef ipcdetail::cached_adaptive_pool_v1
31    <int, managed_shared_memory::segment_manager>
32    cached_node_allocator_v1_t;
33 
34 namespace boost {
35 namespace interprocess {
36 
37 //Explicit instantiations to catch compilation errors
38 template class cached_adaptive_pool<int, managed_shared_memory::segment_manager>;
39 template class cached_adaptive_pool<void, managed_shared_memory::segment_manager>;
40 
41 namespace ipcdetail {
42 
43 template class ipcdetail::cached_adaptive_pool_v1<int, managed_shared_memory::segment_manager>;
44 template class ipcdetail::cached_adaptive_pool_v1<void, managed_shared_memory::segment_manager>;
45 
46 }}}
47 
48 //Alias list types
49 typedef list<int, cached_node_allocator_t>    MyShmList;
50 typedef list<int, cached_node_allocator_v1_t> MyShmListV1;
51 
52 //Alias vector types
53 typedef vector<int, cached_node_allocator_t>    MyShmVector;
54 typedef vector<int, cached_node_allocator_v1_t> MyShmVectorV1;
55 
main()56 int main ()
57 {
58    if(test::list_test<managed_shared_memory, MyShmList, true>())
59       return 1;
60 
61    if(test::list_test<managed_shared_memory, MyShmListV1, true>())
62       return 1;
63 
64    if(test::vector_test<managed_shared_memory, MyShmVector>())
65       return 1;
66 
67    if(test::vector_test<managed_shared_memory, MyShmVectorV1>())
68       return 1;
69 
70    return 0;
71 }
72 
73 #include <boost/interprocess/detail/config_end.hpp>
74