• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/allocators/allocator.hpp>
14 #include <boost/interprocess/offset_ptr.hpp>
15 #include "dummy_test_allocator.hpp"
16 #include "list_test.hpp"
17 #include "movable_int.hpp"
18 #include "emplace_test.hpp"
19 
20 using namespace boost::interprocess;
21 
22 typedef allocator<int, managed_shared_memory::segment_manager> ShmemAllocator;
23 typedef list<int, ShmemAllocator> MyList;
24 
25 //typedef allocator<volatile int, managed_shared_memory::segment_manager> ShmemVolatileAllocator;
26 //typedef list<volatile int, ShmemVolatileAllocator> MyVolatileList;
27 
28 typedef allocator<test::movable_int, managed_shared_memory::segment_manager> ShmemMoveAllocator;
29 typedef list<test::movable_int, ShmemMoveAllocator> MyMoveList;
30 
31 typedef allocator<test::movable_and_copyable_int, managed_shared_memory::segment_manager> ShmemCopyMoveAllocator;
32 typedef list<test::movable_and_copyable_int, ShmemCopyMoveAllocator> MyCopyMoveList;
33 
34 typedef allocator<test::copyable_int, managed_shared_memory::segment_manager> ShmemCopyAllocator;
35 typedef list<test::copyable_int, ShmemCopyAllocator> MyCopyList;
36 
main()37 int main ()
38 {
39    if(test::list_test<managed_shared_memory, MyList, true>())
40       return 1;
41 
42 //   if(test::list_test<managed_shared_memory, MyVolatileList, true>())
43 //      return 1;
44 
45    if(test::list_test<managed_shared_memory, MyMoveList, true>())
46       return 1;
47 
48    if(test::list_test<managed_shared_memory, MyCopyMoveList, true>())
49       return 1;
50 
51    if(test::list_test<managed_shared_memory, MyCopyList, true>())
52       return 1;
53 
54    const test::EmplaceOptions Options = (test::EmplaceOptions)(test::EMPLACE_BACK | test::EMPLACE_FRONT | test::EMPLACE_BEFORE);
55 
56    if(!boost::interprocess::test::test_emplace<list<test::EmplaceInt>, Options>())
57       return 1;
58 
59    return 0;
60 }
61