////////////////////////////////////////////////////////////////////////////// // // (C) Copyright Ion Gaztanaga 2004-2026. 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 "print_container.hpp" #include "movable_int.hpp" #include "set_test.hpp" #include "emplace_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; //Customize managed_shared_memory class typedef basic_managed_shared_memory , rbtree_best_fit, iset_index > my_managed_shared_memory; //Alias allocator type typedef allocator shmem_allocator_t; typedef allocator shmem_movable_allocator_t; typedef allocator shmem_move_copy_allocator_t; typedef allocator shmem_copy_allocator_t; //Alias set types typedef std::set MyStdSet; typedef std::multiset MyStdMultiSet; typedef boost::container::flat_set, shmem_allocator_t> MyShmSet; typedef boost::container::flat_multiset, shmem_allocator_t> MyShmMultiSet; typedef boost::container::flat_set ,shmem_movable_allocator_t> MyMovableShmSet; typedef boost::container::flat_multiset ,shmem_movable_allocator_t> MyMovableShmMultiSet; typedef boost::container::flat_set ,shmem_move_copy_allocator_t> MyMoveCopyShmSet; typedef boost::container::flat_multiset ,shmem_move_copy_allocator_t> MyMoveCopyShmMultiSet; typedef boost::container::flat_set ,shmem_copy_allocator_t> MyCopyShmSet; typedef boost::container::flat_multiset ,shmem_copy_allocator_t> MyCopyShmMultiSet; 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 != set_test()){ std::cout << "Error in set_test" << std::endl; return 1; } //#if !defined(__GNUC__) || (__GNUC__ < 4) || (__GNUC_MINOR__ < 3) const test::EmplaceOptions SetOptions = (test::EmplaceOptions)(test::EMPLACE_HINT | test::EMPLACE_ASSOC); if(!boost::interprocess::test::test_emplace, SetOptions>()) return 1; if(!boost::interprocess::test::test_emplace, SetOptions>()) return 1; //#endif //!defined(__GNUC__) return 0; }