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