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