////////////////////////////////////////////////////////////////////////////// // // (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/libs/interprocess for documentation. // ////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include "print_container.hpp" #include "dummy_test_allocator.hpp" #include "movable_int.hpp" #include "set_test.hpp" #include "map_test.hpp" ///////////////////////////////////////////////////////////////// // // This example repeats the same operations with std::set and // shmem_set using the node allocator // and compares the values of both containers // ///////////////////////////////////////////////////////////////// using namespace boost::interprocess; //Explicit instantiation to detect compilation errors template class boost::interprocess::flat_set ,test::dummy_test_allocator >; template class boost::interprocess::flat_map ,test::dummy_test_allocator > >; template class boost::interprocess::flat_multiset ,test::dummy_test_allocator >; template class boost::interprocess::flat_multimap ,test::dummy_test_allocator > >; //Customize managed_shared_memory class typedef basic_managed_shared_memory , rbtree_best_fit, flat_map_index > my_managed_shared_memory; //Alias allocator type typedef allocator shmem_allocator_t; typedef allocator shmem_movable_allocator_t; typedef allocator, my_managed_shared_memory::segment_manager> shmem_pair_allocator_t; typedef allocator, my_managed_shared_memory::segment_manager> shmem_movable_pair_allocator_t; typedef allocator shmem_move_copy_allocator_t; typedef allocator, my_managed_shared_memory::segment_manager> shmem_move_copy_pair_allocator_t; //Alias set types typedef std::set MyStdSet; typedef std::multiset MyStdMultiSet; typedef std::map MyStdMap; typedef std::multimap MyStdMultiMap; typedef flat_set, shmem_allocator_t> MyShmSet; typedef flat_multiset, shmem_allocator_t> MyShmMultiSet; typedef flat_map, shmem_pair_allocator_t> MyShmMap; typedef flat_multimap, shmem_pair_allocator_t> MyShmMultiMap; typedef flat_set ,shmem_movable_allocator_t> MyMovableShmSet; typedef flat_multiset ,shmem_movable_allocator_t> MyMovableShmMultiSet; typedef flat_map ,shmem_movable_pair_allocator_t> MyMovableShmMap; typedef flat_multimap ,shmem_movable_pair_allocator_t> MyMovableShmMultiMap; typedef flat_set ,shmem_move_copy_allocator_t> MyMoveCopyShmSet; typedef flat_multiset ,shmem_move_copy_allocator_t> MyMoveCopyShmMultiSet; typedef flat_map ,shmem_move_copy_pair_allocator_t> MyMoveCopyShmMap; typedef flat_multimap ,shmem_move_copy_pair_allocator_t> MyMoveCopyShmMultiMap; int main() { using namespace boost::interprocess::test; if (0 != set_test()){ std::cout << "Error in set_test" << std::endl; return 1; } if (0 != set_test_copyable()){ std::cout << "Error in set_test" << std::endl; return 1; } if (0 != set_test()){ std::cout << "Error in set_test" << std::endl; return 1; } if (0 != set_test()){ std::cout << "Error in set_test" << std::endl; return 1; } if (0 != map_test()){ std::cout << "Error in set_test" << std::endl; return 1; } if (0 != map_test_copyable()){ std::cout << "Error in set_test" << std::endl; return 1; } // if (0 != map_test()){ // return 1; // } if (0 != map_test()){ std::cout << "Error in set_test" << std::endl; return 1; } return 0; } #include