diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2 index b6c00e5..09a99b0 100644 --- a/doc/Jamfile.v2 +++ b/doc/Jamfile.v2 @@ -1,6 +1,6 @@ # Boost.Interprocess library documentation Jamfile --------------------------------- # -# Copyright Ion Gaztanaga 2005-2007. Use, modification and +# Copyright Ion Gaztanaga 2005-2009. Use, modification and # distribution is subject to 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) @@ -32,7 +32,7 @@ doxygen autodoc \"BOOST_INTERPROCESS_ENABLE_MOVE_EMULATION(a)= \" \\ \"BOOST_INTERPROCESS_RV_REF(a)=a &&\" \\ \"BOOST_INTERPROCESS_RV_REF_2_TEMPL_ARGS(a,b,c)=a &&\" \\ - \"BOOST_INTERPROCESS_RV_REF_3_TEMPL_ARGS(a)=a &&\" \\ + \"BOOST_INTERPROCESS_RV_REF_3_TEMPL_ARGS(a,b,c,d)=a &&\" \\ \"BOOST_INTERPROCESS_FWD_REF(a)=a &&\"" "boost.doxygen.reftitle=Boost.Interprocess Reference" ; diff --git a/doc/interprocess.qbk b/doc/interprocess.qbk index ac63caf..f74a6af 100644 --- a/doc/interprocess.qbk +++ b/doc/interprocess.qbk @@ -1,12 +1,12 @@ [/ - / Copyright (c) 2007-2008 Ion Gaztanaga + / Copyright (c) 2007-2009 Ion Gaztanaga / / 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) /] [library Boost.Interprocess - [quickbook 1.3] + [quickbook 1.4] [authors [Gaztanaga, Ion]] [copyright 2005- 2008 Ion Gaztanaga] [id interprocess] @@ -1351,14 +1351,14 @@ Boost.Interprocess offers the following mutex types: #include -* [classref boost::interprocess::interprocess_mutex]: A non-recursive, +* [classref boost::interprocess::interprocess_mutex interprocess_mutex]: A non-recursive, anonymous mutex that can be placed in shared memory or memory mapped files. [c++] #include -* [classref boost::interprocess::interprocess_recursive_mutex]: A recursive, +* [classref boost::interprocess::interprocess_recursive_mutex interprocess_recursive_mutex]: A recursive, anonymous mutex that can be placed in shared memory or memory mapped files. [c++] @@ -1518,7 +1518,7 @@ Boost.Interprocess offers the following condition types: #include -* [classref boost::interprocess::interprocess_condition]: +* [classref boost::interprocess::interprocess_condition interprocess_condition]: An anonymous condition variable that can be placed in shared memory or memory mapped files to be used with [classref boost::interprocess::interprocess_mutex]. @@ -1526,8 +1526,8 @@ Boost.Interprocess offers the following condition types: #include -* [classref boost::interprocess::named_condition]: A named - condition variable to be used with [classref boost::interprocess::named_mutex]. +* [classref boost::interprocess::named_condition named_condition]: A named + condition variable to be used with [classref boost::interprocess::named_mutex named_mutex]. Named conditions are similar to anonymous conditions, but they are used in combination with named mutexes. Several times, we don't want to store @@ -1609,7 +1609,7 @@ Boost.Interprocess offers the following semaphore types: #include -* [classref boost::interprocess::interprocess_semaphore]: +* [classref boost::interprocess::interprocess_semaphore interprocess_semaphore]: An anonymous semaphore that can be placed in shared memory or memory mapped files. @@ -1617,13 +1617,9 @@ Boost.Interprocess offers the following semaphore types: #include -* [classref boost::interprocess::named_condition]: A named +* [classref boost::interprocess::named_semaphore named_semaphore]: A named semaphore. -Named conditions are similar to anonymous conditions, but they are used in -combination with named mutexes. Several times, we don't want to store -synchronization objects with the synchronized data: - [endsect] [section:semaphores_anonymous_example Anonymous semaphore example] @@ -1977,7 +1973,7 @@ Boost.Interprocess offers the following upgradable mutex types: #include -* [classref boost::interprocess::interprocess_upgradable_mutex]: A non-recursive, +* [classref boost::interprocess::interprocess_upgradable_mutex interprocess_upgradable_mutex]: A non-recursive, anonymous upgradable mutex that can be placed in shared memory or memory mapped files. [c++] @@ -1993,12 +1989,12 @@ Boost.Interprocess offers the following upgradable mutex types: As with plain mutexes, it's important to release the acquired lock even in the presence of exceptions. [*Boost.Interprocess] mutexes are best used with the -[classref boost::interprocess::scoped_lock] utility, +[classref boost::interprocess::scoped_lock scoped_lock] utility, and this class only offers exclusive locking. As we have sharable locking and upgradable locking with upgradable mutexes, we have two new -utilities: [classref boost::interprocess::sharable_lock] and -[classref boost::interprocess::upgradable_lock]. Both classes are similar to `scoped_lock` +utilities: [classref boost::interprocess::sharable_lock sharable_lock] and +[classref boost::interprocess::upgradable_lock upgradable_lock]. Both classes are similar to `scoped_lock` but `sharable_lock` acquires the sharable lock in the constructor and `upgradable_lock` acquires the upgradable lock in the constructor. @@ -2855,7 +2851,7 @@ This is the second process: [doc_message_queueB] To know more about this class and all its operations, please see the -[classref boost::interprocess::message_queue] class reference. +[classref boost::interprocess::message_queue message_queue] class reference. [endsect] @@ -3425,7 +3421,7 @@ parameter (`MemoryAlgorithm`). That is, the mutex type used to synchronize named/unique allocations is defined by the `MemoryAlgorithm::mutex_family::recursive_mutex_type` type. For shared memory, and memory mapped file based managed segments this recursive mutex is defined -as [classref boost::interprocess::interprocess_recursive_mutex]. +as [classref boost::interprocess::interprocess_recursive_mutex interprocess_recursive_mutex]. If two processes can call: @@ -4189,7 +4185,7 @@ To use a managed heap memory, you must include the following header: #include The use is exactly the same as -[classref boost::interprocess::basic_managed_external_buffer], +[classref boost::interprocess::basic_managed_external_buffer basic_managed_external_buffer], except that memory is created by the managed memory segment itself using dynamic (new/delete) memory. @@ -5023,7 +5019,7 @@ objects in the container, avoiding unnecessary copies. To transfer the contents of a container to another one, use -`boost::move()` function, as shown in the example. For more details +`boost::interprocess::move()` function, as shown in the example. For more details about functions supporting move-semantics, see the reference section of Boost.Interprocess containers: @@ -6534,6 +6530,14 @@ warranty. [section:release_notes Release Notes] +[section:release_notes_boost_1_41_00 Boost 1.41 Release] + +* Support for POSIX shared memory in Mac OS. +* [*ABI breaking]: Generic `semaphore` and `named_semaphore` now implemented more efficiently with atomic operations. +* More robust file opening in Windows platforms with active Anti-virus software. + +[endsect] + [section:release_notes_boost_1_40_00 Boost 1.40 Release] * Windows shared memory is created in Shared Documents folder so that it can be shared diff --git a/example/Jamfile.v2 b/example/Jamfile.v2 index ba27162..e1a68bc 100644 --- a/example/Jamfile.v2 +++ b/example/Jamfile.v2 @@ -36,6 +36,7 @@ rule test_all : # requirements acc:-lrt acc-pa_risc:-lrt + hpux,gcc:"-Wl,+as,mpas" ] ; } diff --git a/example/comp_doc_anonymous_conditionA.cpp b/example/comp_doc_anonymous_conditionA.cpp index 7052723..3071013 100644 --- a/example/comp_doc_anonymous_conditionA.cpp +++ b/example/comp_doc_anonymous_conditionA.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/comp_doc_anonymous_conditionB.cpp b/example/comp_doc_anonymous_conditionB.cpp index baa6a58..11e2d00 100644 --- a/example/comp_doc_anonymous_conditionB.cpp +++ b/example/comp_doc_anonymous_conditionB.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/comp_doc_anonymous_mutexA.cpp b/example/comp_doc_anonymous_mutexA.cpp index 0c2e0b7..d3a13fc 100644 --- a/example/comp_doc_anonymous_mutexA.cpp +++ b/example/comp_doc_anonymous_mutexA.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/comp_doc_anonymous_mutexB.cpp b/example/comp_doc_anonymous_mutexB.cpp index fa024ff..3b022cb 100644 --- a/example/comp_doc_anonymous_mutexB.cpp +++ b/example/comp_doc_anonymous_mutexB.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/comp_doc_anonymous_semaphoreA.cpp b/example/comp_doc_anonymous_semaphoreA.cpp index 9d89624..639a95a 100644 --- a/example/comp_doc_anonymous_semaphoreA.cpp +++ b/example/comp_doc_anonymous_semaphoreA.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/comp_doc_anonymous_semaphoreB.cpp b/example/comp_doc_anonymous_semaphoreB.cpp index 7ab6fc8..06cdd88 100644 --- a/example/comp_doc_anonymous_semaphoreB.cpp +++ b/example/comp_doc_anonymous_semaphoreB.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/comp_doc_anonymous_upgradable_mutexA.cpp b/example/comp_doc_anonymous_upgradable_mutexA.cpp index 2cd65b0..61b8b07 100644 --- a/example/comp_doc_anonymous_upgradable_mutexA.cpp +++ b/example/comp_doc_anonymous_upgradable_mutexA.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/comp_doc_anonymous_upgradable_mutexB.cpp b/example/comp_doc_anonymous_upgradable_mutexB.cpp index a4afa2f..5286842 100644 --- a/example/comp_doc_anonymous_upgradable_mutexB.cpp +++ b/example/comp_doc_anonymous_upgradable_mutexB.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/comp_doc_message_queueA.cpp b/example/comp_doc_message_queueA.cpp index 04c1838..80139a2 100644 --- a/example/comp_doc_message_queueA.cpp +++ b/example/comp_doc_message_queueA.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/comp_doc_message_queueB.cpp b/example/comp_doc_message_queueB.cpp index 0a37a2a..f5bd839 100644 --- a/example/comp_doc_message_queueB.cpp +++ b/example/comp_doc_message_queueB.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_adaptive_pool.cpp b/example/doc_adaptive_pool.cpp index a074173..32c9a44 100644 --- a/example/doc_adaptive_pool.cpp +++ b/example/doc_adaptive_pool.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_allocator.cpp b/example/doc_allocator.cpp index 6a67936..88e0701 100644 --- a/example/doc_allocator.cpp +++ b/example/doc_allocator.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_anonymous_condition_shared_data.hpp b/example/doc_anonymous_condition_shared_data.hpp index 97ad2b2..ad41bdf 100644 --- a/example/doc_anonymous_condition_shared_data.hpp +++ b/example/doc_anonymous_condition_shared_data.hpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_anonymous_mutex_shared_data.hpp b/example/doc_anonymous_mutex_shared_data.hpp index 39d9614..f426f62 100644 --- a/example/doc_anonymous_mutex_shared_data.hpp +++ b/example/doc_anonymous_mutex_shared_data.hpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_anonymous_semaphore_shared_data.hpp b/example/doc_anonymous_semaphore_shared_data.hpp index c82e50e..832a008 100644 --- a/example/doc_anonymous_semaphore_shared_data.hpp +++ b/example/doc_anonymous_semaphore_shared_data.hpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_anonymous_shared_memory.cpp b/example/doc_anonymous_shared_memory.cpp index b0dbcf2..2a7837f 100644 --- a/example/doc_anonymous_shared_memory.cpp +++ b/example/doc_anonymous_shared_memory.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_bufferstream.cpp b/example/doc_bufferstream.cpp index e28c6a4..3c9c67b 100644 --- a/example/doc_bufferstream.cpp +++ b/example/doc_bufferstream.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_cached_adaptive_pool.cpp b/example/doc_cached_adaptive_pool.cpp index bc802ad..bb51195 100644 --- a/example/doc_cached_adaptive_pool.cpp +++ b/example/doc_cached_adaptive_pool.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_cached_node_allocator.cpp b/example/doc_cached_node_allocator.cpp index f88f9e1..8a2d195 100644 --- a/example/doc_cached_node_allocator.cpp +++ b/example/doc_cached_node_allocator.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_complex_map.cpp b/example/doc_complex_map.cpp index ecfa1f1..b97f4c1 100644 --- a/example/doc_complex_map.cpp +++ b/example/doc_complex_map.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2008. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_cont.cpp b/example/doc_cont.cpp index 1cd4d97..37892a7 100644 --- a/example/doc_cont.cpp +++ b/example/doc_cont.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_file_mapping.cpp b/example/doc_file_mapping.cpp index 3cd885b..cc33585 100644 --- a/example/doc_file_mapping.cpp +++ b/example/doc_file_mapping.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_intrusive.cpp b/example/doc_intrusive.cpp index d24bf41..da39c14 100644 --- a/example/doc_intrusive.cpp +++ b/example/doc_intrusive.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_ipc_message.cpp b/example/doc_ipc_message.cpp index 77d3fd4..4097bd6 100644 --- a/example/doc_ipc_message.cpp +++ b/example/doc_ipc_message.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_managed_aligned_allocation.cpp b/example/doc_managed_aligned_allocation.cpp index 2ad8115..9e7a1e7 100644 --- a/example/doc_managed_aligned_allocation.cpp +++ b/example/doc_managed_aligned_allocation.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // @@ -85,4 +85,31 @@ int main() return 0; } //] +/* + +#include +#include + +int main() +{ + using namespace boost::interprocess; + typedef boost::interprocess:: + managed_windows_shared_memory shared_segment; + + std::vector ptrs; + shared_segment m_segment(create_only, "shmem", 4096*16); + try{ + while(1){ + //Now I have several allocate_aligned operations: + ptrs.push_back(m_segment.allocate_aligned(128, 128)); + } + } + catch(...){ + m_segment.deallocate(ptrs.back()); + ptrs.pop_back(); + ptrs.push_back(m_segment.allocate_aligned(128, 128)); + } + return 0; +} +*/ #include diff --git a/example/doc_managed_allocation_command.cpp b/example/doc_managed_allocation_command.cpp index 47fe41e..c464daa 100644 --- a/example/doc_managed_allocation_command.cpp +++ b/example/doc_managed_allocation_command.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_managed_construction_info.cpp b/example/doc_managed_construction_info.cpp index b6bc286..d5bec5d 100644 --- a/example/doc_managed_construction_info.cpp +++ b/example/doc_managed_construction_info.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_managed_copy_on_write.cpp b/example/doc_managed_copy_on_write.cpp index 7daa76e..43941eb 100644 --- a/example/doc_managed_copy_on_write.cpp +++ b/example/doc_managed_copy_on_write.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2008. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_managed_external_buffer.cpp b/example/doc_managed_external_buffer.cpp index 5e4b507..f9c4710 100644 --- a/example/doc_managed_external_buffer.cpp +++ b/example/doc_managed_external_buffer.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_managed_grow.cpp b/example/doc_managed_grow.cpp index 5b34990..241f104 100644 --- a/example/doc_managed_grow.cpp +++ b/example/doc_managed_grow.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_managed_heap_memory.cpp b/example/doc_managed_heap_memory.cpp index 19f55f5..0687dcf 100644 --- a/example/doc_managed_heap_memory.cpp +++ b/example/doc_managed_heap_memory.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_managed_mapped_file.cpp b/example/doc_managed_mapped_file.cpp index 091a7eb..536e5e9 100644 --- a/example/doc_managed_mapped_file.cpp +++ b/example/doc_managed_mapped_file.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_managed_multiple_allocation.cpp b/example/doc_managed_multiple_allocation.cpp index e512379..a6ccab2 100644 --- a/example/doc_managed_multiple_allocation.cpp +++ b/example/doc_managed_multiple_allocation.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_managed_raw_allocation.cpp b/example/doc_managed_raw_allocation.cpp index 6f2f557..dd4fe56 100644 --- a/example/doc_managed_raw_allocation.cpp +++ b/example/doc_managed_raw_allocation.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_map.cpp b/example/doc_map.cpp index 0d5d9d7..9a0596d 100644 --- a/example/doc_map.cpp +++ b/example/doc_map.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_move_containers.cpp b/example/doc_move_containers.cpp index 084f733..ce5bb73 100644 --- a/example/doc_move_containers.cpp +++ b/example/doc_move_containers.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_multi_index.cpp b/example/doc_multi_index.cpp index e4b0924..1e7d0b4 100644 --- a/example/doc_multi_index.cpp +++ b/example/doc_multi_index.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_named_alloc.cpp b/example/doc_named_alloc.cpp index cf4f480..085eae8 100644 --- a/example/doc_named_alloc.cpp +++ b/example/doc_named_alloc.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_named_condition_shared_data.hpp b/example/doc_named_condition_shared_data.hpp index a16936b..589a55c 100644 --- a/example/doc_named_condition_shared_data.hpp +++ b/example/doc_named_condition_shared_data.hpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_named_mutex.cpp b/example/doc_named_mutex.cpp index 7a81810..63e2d66 100644 --- a/example/doc_named_mutex.cpp +++ b/example/doc_named_mutex.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_node_allocator.cpp b/example/doc_node_allocator.cpp index 25f8957..582b642 100644 --- a/example/doc_node_allocator.cpp +++ b/example/doc_node_allocator.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_offset_ptr.cpp b/example/doc_offset_ptr.cpp index 3e3e3a9..13379da 100644 --- a/example/doc_offset_ptr.cpp +++ b/example/doc_offset_ptr.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_private_adaptive_pool.cpp b/example/doc_private_adaptive_pool.cpp index 433c96e..89ee847 100644 --- a/example/doc_private_adaptive_pool.cpp +++ b/example/doc_private_adaptive_pool.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_private_node_allocator.cpp b/example/doc_private_node_allocator.cpp index fb775d6..e2eb8cd 100644 --- a/example/doc_private_node_allocator.cpp +++ b/example/doc_private_node_allocator.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_scoped_ptr.cpp b/example/doc_scoped_ptr.cpp index ba6ca0c..ac3dcad 100644 --- a/example/doc_scoped_ptr.cpp +++ b/example/doc_scoped_ptr.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_shared_memory.cpp b/example/doc_shared_memory.cpp index 8798b91..72f48f2 100644 --- a/example/doc_shared_memory.cpp +++ b/example/doc_shared_memory.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_shared_ptr.cpp b/example/doc_shared_ptr.cpp index 6683b49..3f64abb 100644 --- a/example/doc_shared_ptr.cpp +++ b/example/doc_shared_ptr.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. +// (C) Copyright Ion Gaztanaga 2006-2009. // 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) diff --git a/example/doc_shared_ptr_explicit.cpp b/example/doc_shared_ptr_explicit.cpp index 9b6fa41..f0cc4f6 100644 --- a/example/doc_shared_ptr_explicit.cpp +++ b/example/doc_shared_ptr_explicit.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. +// (C) Copyright Ion Gaztanaga 2006-2009. // 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) diff --git a/example/doc_unique_ptr.cpp b/example/doc_unique_ptr.cpp index 07fd435..adf46c0 100644 --- a/example/doc_unique_ptr.cpp +++ b/example/doc_unique_ptr.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. +// (C) Copyright Ion Gaztanaga 2006-2009. // 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) diff --git a/example/doc_unordered_map.cpp b/example/doc_unordered_map.cpp index c869b13..6e4d222 100644 --- a/example/doc_unordered_map.cpp +++ b/example/doc_unordered_map.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_upgradable_mutex_shared_data.hpp b/example/doc_upgradable_mutex_shared_data.hpp index 9c3e0a5..ffbef04 100644 --- a/example/doc_upgradable_mutex_shared_data.hpp +++ b/example/doc_upgradable_mutex_shared_data.hpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_vectorstream.cpp b/example/doc_vectorstream.cpp index 0478e93..9807831 100644 --- a/example/doc_vectorstream.cpp +++ b/example/doc_vectorstream.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_where_allocate.cpp b/example/doc_where_allocate.cpp index a5bfabd..2b4d23e 100644 --- a/example/doc_where_allocate.cpp +++ b/example/doc_where_allocate.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/example/doc_windows_shared_memory.cpp b/example/doc_windows_shared_memory.cpp index 09e4cf4..6cc80aa 100644 --- a/example/doc_windows_shared_memory.cpp +++ b/example/doc_windows_shared_memory.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // diff --git a/index.html b/index.html index a656e41..83dc343 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,5 @@ diff --git a/proj/to-do.txt b/proj/to-do.txt index 7325836..1b65de1 100644 --- a/proj/to-do.txt +++ b/proj/to-do.txt @@ -55,10 +55,10 @@ -> operator >> and similar need moved_value --> Add cmath workaround for Boost < 1.37 - -> rvalue reference enabled compilers are not optimized with is_movable and move_iterator -> Add allocator test template that test all new functions (allocate_many, etc.) -> MacOS shm_open is non-conformant. Is there a way to know the size of a shared memory object? + +-> swap() of multiallocaiton iterator is wrong. Try to reimplement it with slist \ No newline at end of file diff --git a/proj/vc7ide/Interprocess.sln b/proj/vc7ide/Interprocess.sln index bc16161..b003676 100644 --- a/proj/vc7ide/Interprocess.sln +++ b/proj/vc7ide/Interprocess.sln @@ -387,10 +387,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doc_named_mutex", "doc_name ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doc_windows_shared_memory2", "doc_windows_shared_memory2.vcproj", "{5E1D6C83-31DE-4F6F-6132-87A9FB663041}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "flat_map_index_allocation_test", "flat_map_index_allocation_test.vcproj", "{51D8E9C3-2D65-48FE-3AA7-7922C0E36329}" ProjectSection(ProjectDependencies) = postProject EndProjectSection @@ -833,10 +829,6 @@ Global {58C181B3-9516-463E-2F12-122155400054}.Debug.Build.0 = Debug|Win32 {58C181B3-9516-463E-2F12-122155400054}.Release.ActiveCfg = Release|Win32 {58C181B3-9516-463E-2F12-122155400054}.Release.Build.0 = Release|Win32 - {5E1D6C83-31DE-4F6F-6132-87A9FB663041}.Debug.ActiveCfg = Debug|Win32 - {5E1D6C83-31DE-4F6F-6132-87A9FB663041}.Debug.Build.0 = Debug|Win32 - {5E1D6C83-31DE-4F6F-6132-87A9FB663041}.Release.ActiveCfg = Release|Win32 - {5E1D6C83-31DE-4F6F-6132-87A9FB663041}.Release.Build.0 = Release|Win32 {51D8E9C3-2D65-48FE-3AA7-7922C0E36329}.Debug.ActiveCfg = Debug|Win32 {51D8E9C3-2D65-48FE-3AA7-7922C0E36329}.Debug.Build.0 = Debug|Win32 {51D8E9C3-2D65-48FE-3AA7-7922C0E36329}.Release.ActiveCfg = Release|Win32 diff --git a/proj/vc7ide/interprocesslib.vcproj b/proj/vc7ide/interprocesslib.vcproj index 83dd2cf..90df035 100644 --- a/proj/vc7ide/interprocesslib.vcproj +++ b/proj/vc7ide/interprocesslib.vcproj @@ -98,6 +98,9 @@ + + @@ -372,6 +375,9 @@ + + diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 2435e03..0d2011d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,9 +1,3 @@ -# -# Copyright Troy D. Straszheim -# -# Distributed under the Boost Software License, Version 1.0. -# See http://www.boost.org/LICENSE_1_0.txt -# boost_additional_test_dependencies(interprocess BOOST_DEPENDS test thread date_time multi_index) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index a070a7e..cd48782 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -27,6 +27,7 @@ rule test_all : # requirements acc:-lrt acc-pa_risc:-lrt + hpux,gcc:"-Wl,+as,mpas" ] ; } diff --git a/test/adaptive_node_pool_test.cpp b/test/adaptive_node_pool_test.cpp index 9a052c0..14b7470 100644 --- a/test/adaptive_node_pool_test.cpp +++ b/test/adaptive_node_pool_test.cpp @@ -16,9 +16,6 @@ using namespace boost::interprocess; typedef managed_shared_memory::segment_manager segment_manager_t; -//Explicit specialization to catch compilation errors -template class detail::private_adaptive_node_pool_impl; - int main () { typedef detail::private_adaptive_node_pool diff --git a/test/adaptive_pool_test.cpp b/test/adaptive_pool_test.cpp index ebc3043..b00c0ef 100644 --- a/test/adaptive_pool_test.cpp +++ b/test/adaptive_pool_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/allocator_v1.hpp b/test/allocator_v1.hpp index 3974046..b829bb6 100644 --- a/test/allocator_v1.hpp +++ b/test/allocator_v1.hpp @@ -1,6 +1,6 @@ /////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2005-2009. 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) // diff --git a/test/allocexcept_test.cpp b/test/allocexcept_test.cpp index 8915cbb..3c59fd6 100644 --- a/test/allocexcept_test.cpp +++ b/test/allocexcept_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/anonymous_shared_memory_test.cpp b/test/anonymous_shared_memory_test.cpp index 43ac48b..46c6a19 100644 --- a/test/anonymous_shared_memory_test.cpp +++ b/test/anonymous_shared_memory_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/boost_interprocess_check.hpp b/test/boost_interprocess_check.hpp index 965b252..da1affc 100644 --- a/test/boost_interprocess_check.hpp +++ b/test/boost_interprocess_check.hpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/cached_adaptive_pool_test.cpp b/test/cached_adaptive_pool_test.cpp index 0f5a09a..bd675a9 100644 --- a/test/cached_adaptive_pool_test.cpp +++ b/test/cached_adaptive_pool_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/cached_node_allocator_test.cpp b/test/cached_node_allocator_test.cpp index a70c3e3..62113fa 100644 --- a/test/cached_node_allocator_test.cpp +++ b/test/cached_node_allocator_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2008. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/condition_test_template.hpp b/test/condition_test_template.hpp index 6dd69ed..ced4aa5 100644 --- a/test/condition_test_template.hpp +++ b/test/condition_test_template.hpp @@ -10,7 +10,7 @@ // It is provided "as is" without express or implied warranty. ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2005-2009. 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) // diff --git a/test/data_test.cpp b/test/data_test.cpp index 5c5f15a..af19d90 100644 --- a/test/data_test.cpp +++ b/test/data_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/deque_test.cpp b/test/deque_test.cpp index 94e1763..cd9666c 100644 --- a/test/deque_test.cpp +++ b/test/deque_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // @@ -152,7 +152,7 @@ bool do_test() const char *const shMemName = test::get_process_id_name(); const int max = 100; - try{ + /*try*/{ shared_memory_object::remove(shMemName); //Create shared memory @@ -167,33 +167,39 @@ bool do_test() MyStdDeque *stddeque = new MyStdDeque; - try{ + /*try*/{ //Compare several shared memory deque operations with std::deque int i; - for(i = 0; i < max*100; ++i){ + for(i = 0; i < max*50; ++i){ IntType move_me(i); shmdeque->insert(shmdeque->end(), boost::interprocess::move(move_me)); stddeque->insert(stddeque->end(), i); + shmdeque->insert(shmdeque->end(), IntType(i)); + stddeque->insert(stddeque->end(), int(i)); } if(!test::CheckEqualContainers(shmdeque, stddeque)) return false; shmdeque->clear(); stddeque->clear(); - for(i = 0; i < max*100; ++i){ + for(i = 0; i < max*50; ++i){ IntType move_me(i); shmdeque->push_back(boost::interprocess::move(move_me)); stddeque->push_back(i); + shmdeque->push_back(IntType(i)); + stddeque->push_back(i); } if(!test::CheckEqualContainers(shmdeque, stddeque)) return false; shmdeque->clear(); stddeque->clear(); - for(i = 0; i < max*100; ++i){ + for(i = 0; i < max*50; ++i){ IntType move_me(i); shmdeque->push_front(boost::interprocess::move(move_me)); stddeque->push_front(i); + shmdeque->push_front(IntType(i)); + stddeque->push_front(int(i)); } if(!test::CheckEqualContainers(shmdeque, stddeque)) return false; @@ -221,8 +227,8 @@ bool do_test() } shmdeque->insert(shmdeque->end() - ,boost::interprocess::make_move_iterator(&aux_vect[0]) - ,boost::interprocess::make_move_iterator(aux_vect + 50)); + ,::boost::interprocess::make_move_iterator(&aux_vect[0]) + ,::boost::interprocess::make_move_iterator(aux_vect + 50)); stddeque->insert(stddeque->end(), aux_vect2, aux_vect2 + 50); if(!test::CheckEqualContainers(shmdeque, stddeque)) return false; @@ -243,14 +249,14 @@ bool do_test() aux_vect2[i] = -1; } shmdeque->insert(shmdeque->begin() - ,boost::interprocess::make_move_iterator(&aux_vect[0]) - ,boost::interprocess::make_move_iterator(aux_vect + 50)); + ,::boost::interprocess::make_move_iterator(&aux_vect[0]) + ,::boost::interprocess::make_move_iterator(aux_vect + 50)); stddeque->insert(stddeque->begin(), aux_vect2, aux_vect2 + 50); if(!test::CheckEqualContainers(shmdeque, stddeque)) return false; } if(!copyable_only(shmdeque, stddeque - ,detail::bool_::value>())){ + ,detail::bool_::value>())){ return false; } @@ -291,18 +297,18 @@ bool do_test() if(!segment.all_memory_deallocated()) return false; - } + }/* catch(std::exception &ex){ std::cout << ex.what() << std::endl; return false; - } + }*/ std::cout << std::endl << "Test OK!" << std::endl; - } + }/* catch(...){ shared_memory_object::remove(shMemName); throw; - } + }*/ shared_memory_object::remove(shMemName); return true; } @@ -315,6 +321,9 @@ int main () if(!do_test()) return 1; + if(!do_test()) + return 1; + if(!do_test()) return 1; diff --git a/test/dummy_test_allocator.hpp b/test/dummy_test_allocator.hpp index 8a7af64..1adb50d 100644 --- a/test/dummy_test_allocator.hpp +++ b/test/dummy_test_allocator.hpp @@ -1,6 +1,6 @@ /////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2005-2009. 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) // diff --git a/test/emplace_test.hpp b/test/emplace_test.hpp index ba27eab..d7ade2c 100644 --- a/test/emplace_test.hpp +++ b/test/emplace_test.hpp @@ -25,11 +25,9 @@ namespace test{ class EmplaceInt { private: - EmplaceInt (const EmplaceInt &o); - EmplaceInt& operator=(const EmplaceInt &o); + BOOST_INTERPROCESS_MOVABLE_BUT_NOT_COPYABLE(EmplaceInt) public: - BOOST_INTERPROCESS_ENABLE_MOVE_EMULATION(EmplaceInt) EmplaceInt(int a = 0, int b = 0, int c = 0, int d = 0, int e = 0) : a_(a), b_(b), c_(c), d_(d), e_(e) diff --git a/test/enable_shared_from_this_test.cpp b/test/enable_shared_from_this_test.cpp index 6cc7a78..286cd64 100644 --- a/test/enable_shared_from_this_test.cpp +++ b/test/enable_shared_from_this_test.cpp @@ -3,7 +3,7 @@ // // This file is the adaptation of shared_from_this_test.cpp from smart_ptr library // -// (C) Copyright Ion Gaztanaga 2005-2008. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2005-2009. 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) // diff --git a/test/expand_bwd_test_allocator.hpp b/test/expand_bwd_test_allocator.hpp index a773cee..ca1e3dd 100644 --- a/test/expand_bwd_test_allocator.hpp +++ b/test/expand_bwd_test_allocator.hpp @@ -1,6 +1,6 @@ /////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2005-2009. 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) // diff --git a/test/file_lock_test.cpp b/test/file_lock_test.cpp index e689256..a76412d 100644 --- a/test/file_lock_test.cpp +++ b/test/file_lock_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2008. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/file_mapping_test.cpp b/test/file_mapping_test.cpp index 1151fd1..35817a4 100644 --- a/test/file_mapping_test.cpp +++ b/test/file_mapping_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/flat_tree_test.cpp b/test/flat_tree_test.cpp index 9bc3ae4..adfa6a0 100644 --- a/test/flat_tree_test.cpp +++ b/test/flat_tree_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // @@ -77,6 +77,10 @@ typedef allocator, my_managed_sh typedef allocator shmem_move_copy_allocator_t; + +typedef allocator + shmem_copy_allocator_t; + typedef allocator, my_managed_shared_memory::segment_manager> shmem_move_copy_pair_allocator_t; @@ -106,6 +110,12 @@ typedef flat_set MyMoveCopyShmSet; typedef flat_multiset ,shmem_move_copy_allocator_t> MyMoveCopyShmMultiSet; + +typedef flat_set + ,shmem_copy_allocator_t> MyCopyShmSet; +typedef flat_multiset + ,shmem_copy_allocator_t> MyCopyShmMultiSet; + typedef flat_map ,shmem_move_copy_pair_allocator_t> MyMoveCopyShmMap; @@ -128,6 +138,12 @@ class recursive_flat_map public: int id_; flat_map map_; + recursive_flat_map (const recursive_flat_map&x) + :id_(x.id_), map_(x.map_) + {} + recursive_flat_map &operator=(const recursive_flat_map &x) + { id_ = x.id_; map_ = x.map_; return *this; } + friend bool operator< (const recursive_flat_map &a, const recursive_flat_map &b) { return a.id_ < b.id_; } }; @@ -147,6 +163,11 @@ class recursive_flat_multimap public: int id_; flat_map map_; + recursive_flat_multimap (const recursive_flat_multimap&x) + :id_(x.id_), map_(x.map_) + {} + recursive_flat_multimap &operator=(const recursive_flat_multimap &x) + { id_ = x.id_; map_ = x.map_; return *this; } friend bool operator< (const recursive_flat_multimap &a, const recursive_flat_multimap &b) { return a.id_ < b.id_; } }; @@ -211,6 +232,15 @@ int main() return 1; } + if (0 != set_test()){ + std::cout << "Error in set_test" << std::endl; + return 1; + } + if (0 != map_test ShmemAllocator; typedef list MyList; -typedef allocator ShmemVolatileAllocator; -typedef list MyVolatileList; +//typedef allocator ShmemVolatileAllocator; +//typedef list MyVolatileList; typedef allocator ShmemMoveAllocator; typedef list MyMoveList; @@ -36,6 +36,10 @@ typedef list MyMoveList; typedef allocator ShmemCopyMoveAllocator; typedef list MyCopyMoveList; +typedef allocator ShmemCopyAllocator; +typedef list MyCopyList; + + class recursive_list { public: @@ -62,8 +66,8 @@ int main () if(test::list_test()) return 1; - if(test::list_test()) - return 1; +// if(test::list_test()) +// return 1; if(test::list_test()) return 1; @@ -71,6 +75,9 @@ int main () if(test::list_test()) return 1; + if(test::list_test()) + return 1; + const test::EmplaceOptions Options = (test::EmplaceOptions)(test::EMPLACE_BACK | test::EMPLACE_FRONT | test::EMPLACE_BEFORE); if(!boost::interprocess::test::test_emplace, Options>()) diff --git a/test/list_test.hpp b/test/list_test.hpp index a9de4c8..8f1b936 100644 --- a/test/list_test.hpp +++ b/test/list_test.hpp @@ -37,6 +37,8 @@ struct push_data_function IntType move_me(i); shmlist->push_back(boost::interprocess::move(move_me)); stdlist->push_back(i); + shmlist->push_back(IntType(i)); + stdlist->push_back(int(i)); } if(!CheckEqualContainers(shmlist, stdlist)) return 1; @@ -55,6 +57,8 @@ struct push_data_function IntType move_me(i); shmlist->push_front(boost::interprocess::move(move_me)); stdlist->push_front(i); + shmlist->push_front(IntType(i)); + stdlist->push_front(int(i)); } if(!CheckEqualContainers(shmlist, stdlist)) return 1; @@ -115,7 +119,7 @@ int list_test (bool copied_allocators_equal = true) MyStdList *stdlist = new MyStdList; - if(push_data_t::execute(max, shmlist, stdlist)){ + if(push_data_t::execute(max/2, shmlist, stdlist)){ return 1; } @@ -141,8 +145,8 @@ int list_test (bool copied_allocators_equal = true) for(int i = 0; i < 50; ++i){ aux_vect2[i] = -1; } - shmlist->assign(boost::interprocess::make_move_iterator(&aux_vect[0]) - ,boost::interprocess::make_move_iterator(&aux_vect[50])); + shmlist->assign(::boost::interprocess::make_move_iterator(&aux_vect[0]) + ,::boost::interprocess::make_move_iterator(&aux_vect[50])); stdlist->assign(&aux_vect2[0], &aux_vect2[50]); if(!CheckEqualContainers(shmlist, stdlist)) return 1; } @@ -172,8 +176,8 @@ int list_test (bool copied_allocators_equal = true) aux_vect2[i] = -1; } shmlist->insert(shmlist->begin() - ,boost::interprocess::make_move_iterator(&aux_vect[0]) - ,boost::interprocess::make_move_iterator(&aux_vect[50])); + ,::boost::interprocess::make_move_iterator(&aux_vect[0]) + ,::boost::interprocess::make_move_iterator(&aux_vect[50])); stdlist->insert(stdlist->begin(), &aux_vect2[0], &aux_vect2[50]); } @@ -198,7 +202,7 @@ int list_test (bool copied_allocators_equal = true) if(!CheckEqualContainers(shmlist, stdlist)) return 1; - if(push_data_t::execute(max, shmlist, stdlist)){ + if(push_data_t::execute(max/2, shmlist, stdlist)){ return 1; } { @@ -207,7 +211,7 @@ int list_test (bool copied_allocators_equal = true) int listsize = (int)shmlist->size(); - if(push_data_t::execute(listsize, shmlist, stdlist)){ + if(push_data_t::execute(listsize/2, shmlist, stdlist)){ return 1; } @@ -220,11 +224,11 @@ int list_test (bool copied_allocators_equal = true) listsize = (int)shmlist->size(); - if(push_data_t::execute(listsize, shmlist, stdlist)){ + if(push_data_t::execute(listsize/2, shmlist, stdlist)){ return 1; } - if(push_data_t::execute(listsize, &othershmlist, &otherstdlist)){ + if(push_data_t::execute(listsize/2, &othershmlist, &otherstdlist)){ return 1; } @@ -244,6 +248,13 @@ int list_test (bool copied_allocators_equal = true) if(!CheckEqualContainers(shmlist, stdlist)) return 1; } + + for(int i = 0; i < max; ++i){ + shmlist->insert(shmlist->begin(), IntType(i)); + stdlist->insert(stdlist->begin(), int(i)); + } + if(!CheckEqualContainers(shmlist, stdlist)) + return 1; } segment.template destroy("MyList"); diff --git a/test/managed_mapped_file_test.cpp b/test/managed_mapped_file_test.cpp index f0b3f6e..d21dd7b 100644 --- a/test/managed_mapped_file_test.cpp +++ b/test/managed_mapped_file_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/managed_shared_memory_test.cpp b/test/managed_shared_memory_test.cpp index f19fabe..564bdc7 100644 --- a/test/managed_shared_memory_test.cpp +++ b/test/managed_shared_memory_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // @@ -122,6 +122,7 @@ int main () if(!shmem_vect) return -1; } + #ifndef BOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS_NO_GROW { std::size_t old_free_memory; { @@ -196,14 +197,16 @@ int main () if(next_shmem_size <= final_shmem_size) return -1; } - { - //Now test move semantics - managed_shared_memory original(open_only, ShmemName); - managed_shared_memory move_ctor(boost::interprocess::move(original)); - managed_shared_memory move_assign; - move_assign = boost::interprocess::move(move_ctor); - move_assign.swap(original); - } + } + #endif //ifndef BOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS_NO_GROW + + { + //Now test move semantics + managed_shared_memory original(open_only, ShmemName); + managed_shared_memory move_ctor(boost::interprocess::move(original)); + managed_shared_memory move_assign; + move_assign = boost::interprocess::move(move_ctor); + move_assign.swap(original); } shared_memory_object::remove(ShmemName); diff --git a/test/managed_windows_shared_memory_test.cpp b/test/managed_windows_shared_memory_test.cpp index cdb1d68..b66c2cb 100644 --- a/test/managed_windows_shared_memory_test.cpp +++ b/test/managed_windows_shared_memory_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/map_test.hpp b/test/map_test.hpp index c4e88f7..9d5b92c 100644 --- a/test/map_test.hpp +++ b/test/map_test.hpp @@ -94,26 +94,75 @@ int map_test () MyShmMap *shmmap2 = segment.template construct("MyShmMap2") - (boost::interprocess::make_move_iterator(&aux_vect[0]) - , boost::interprocess::make_move_iterator(aux_vect + 50) + ( ::boost::interprocess::make_move_iterator(&aux_vect[0]) + , ::boost::interprocess::make_move_iterator(aux_vect + 50) , std::less(), segment.get_segment_manager()); MyStdMap *stdmap2 = new MyStdMap(aux_vect2, aux_vect2 + 50); MyShmMultiMap *shmmultimap2 = segment.template construct("MyShmMultiMap2") - (boost::interprocess::make_move_iterator(&aux_vect3[0]) - , boost::interprocess::make_move_iterator(aux_vect3 + 50) + ( ::boost::interprocess::make_move_iterator(&aux_vect3[0]) + , ::boost::interprocess::make_move_iterator(aux_vect3 + 50) , std::less(), segment.get_segment_manager()); MyStdMultiMap *stdmultimap2 = new MyStdMultiMap(aux_vect2, aux_vect2 + 50); if(!CheckEqualContainers(shmmap2, stdmap2)) return 1; if(!CheckEqualContainers(shmmultimap2, stdmultimap2)) return 1; + //ordered range insertion + //This is really nasty, but we have no other simple choice + for(int i = 0; i < 50; ++i){ + IntType i1(i); + IntType i2(i); + new(&aux_vect[i])IntPairType(boost::interprocess::move(i1), boost::interprocess::move(i2)); + } + + for(int i = 0; i < 50; ++i){ + new(&aux_vect2[i])StdValueType(StdKeyType(i), StdMappedType(i)); + } + + for(int i = 0; i < 50; ++i){ + IntType i1(i); + IntType i2(i); + new(&aux_vect3[i])IntPairType(boost::interprocess::move(i1), boost::interprocess::move(i2)); + } + + MyShmMap *shmmap3 = + segment.template construct("MyShmMap3") + ( ordered_unique_range + , ::boost::interprocess::make_move_iterator(&aux_vect[0]) + , ::boost::interprocess::make_move_iterator(aux_vect + 50) + , std::less(), segment.get_segment_manager()); + + MyStdMap *stdmap3 = new MyStdMap(aux_vect2, aux_vect2 + 50); + + MyShmMultiMap *shmmultimap3 = + segment.template construct("MyShmMultiMap3") + ( ordered_range + , ::boost::interprocess::make_move_iterator(&aux_vect3[0]) + , ::boost::interprocess::make_move_iterator(aux_vect3 + 50) + , std::less(), segment.get_segment_manager()); + + MyStdMultiMap *stdmultimap3 = new MyStdMultiMap(aux_vect2, aux_vect2 + 50); + + if(!CheckEqualContainers(shmmap3, stdmap3)){ + std::cout << "Error in construct(MyShmMap3)" << std::endl; + return 1; + } + if(!CheckEqualContainers(shmmultimap3, stdmultimap3)){ + std::cout << "Error in construct(MyShmMultiMap3)" << std::endl; + return 1; + } + segment.destroy_ptr(shmmap2); segment.destroy_ptr(shmmultimap2); delete stdmap2; delete stdmultimap2; + segment.destroy_ptr(shmmap3); + segment.destroy_ptr(shmmultimap3); + delete stdmap3; + delete stdmultimap3; } { //This is really nasty, but we have no other simple choice @@ -191,8 +240,8 @@ int map_test () new(&aux_vect3[i])IntPairType(boost::interprocess::move(i1), boost::interprocess::move(i2)); } - shmmap->insert(boost::interprocess::make_move_iterator(&aux_vect[0]), boost::interprocess::make_move_iterator(aux_vect + 50)); - shmmultimap->insert(boost::interprocess::make_move_iterator(&aux_vect3[0]), boost::interprocess::make_move_iterator(aux_vect3 + 50)); + shmmap->insert(::boost::interprocess::make_move_iterator(&aux_vect[0]), ::boost::interprocess::make_move_iterator(aux_vect + 50)); + shmmultimap->insert(::boost::interprocess::make_move_iterator(&aux_vect3[0]), ::boost::interprocess::make_move_iterator(aux_vect3 + 50)); for(std::size_t i = 0; i != 50; ++i){ StdPairType stdpairtype(-1, -1); stdmap->insert(stdpairtype); @@ -239,10 +288,10 @@ int map_test () new(&aux_vect5[i])IntPairType(boost::interprocess::move(i1), boost::interprocess::move(i2)); } - shmmap->insert(boost::interprocess::make_move_iterator(&aux_vect[0]), boost::interprocess::make_move_iterator(aux_vect + 50)); - shmmap->insert(boost::interprocess::make_move_iterator(&aux_vect3[0]), boost::interprocess::make_move_iterator(aux_vect3 + 50)); - shmmultimap->insert(boost::interprocess::make_move_iterator(&aux_vect4[0]), boost::interprocess::make_move_iterator(aux_vect4 + 50)); - shmmultimap->insert(boost::interprocess::make_move_iterator(&aux_vect5[0]), boost::interprocess::make_move_iterator(aux_vect5 + 50)); + shmmap->insert(::boost::interprocess::make_move_iterator(&aux_vect[0]), ::boost::interprocess::make_move_iterator(aux_vect + 50)); + shmmap->insert(::boost::interprocess::make_move_iterator(&aux_vect3[0]), ::boost::interprocess::make_move_iterator(aux_vect3 + 50)); + shmmultimap->insert(::boost::interprocess::make_move_iterator(&aux_vect4[0]), ::boost::interprocess::make_move_iterator(aux_vect4 + 50)); + shmmultimap->insert(::boost::interprocess::make_move_iterator(&aux_vect5[0]), ::boost::interprocess::make_move_iterator(aux_vect5 + 50)); for(std::size_t i = 0; i != 50; ++i){ StdPairType stdpairtype(-1, -1); diff --git a/test/mapped_file_test.cpp b/test/mapped_file_test.cpp index d2f6aba..9828643 100644 --- a/test/mapped_file_test.cpp +++ b/test/mapped_file_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/message_queue_test.cpp b/test/message_queue_test.cpp index d68325b..06223dc 100644 --- a/test/message_queue_test.cpp +++ b/test/message_queue_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/movable_int.hpp b/test/movable_int.hpp index ee62582..1026bdc 100644 --- a/test/movable_int.hpp +++ b/test/movable_int.hpp @@ -21,11 +21,9 @@ namespace test { class movable_int { - movable_int(movable_int&); - movable_int &operator= (movable_int&); + BOOST_INTERPROCESS_MOVABLE_BUT_NOT_COPYABLE(movable_int) public: - BOOST_INTERPROCESS_ENABLE_MOVE_EMULATION(movable_int) movable_int() : m_int(0) @@ -81,8 +79,8 @@ std::basic_ostream & operator<< class movable_and_copyable_int { + BOOST_COPYABLE_AND_MOVABLE(movable_and_copyable_int) public: - BOOST_INTERPROCESS_ENABLE_MOVE_EMULATION(movable_and_copyable_int) movable_and_copyable_int() : m_int(0) @@ -96,7 +94,7 @@ class movable_and_copyable_int : m_int(mmi.m_int) {} - movable_and_copyable_int &operator= (const movable_and_copyable_int& mi) + movable_and_copyable_int &operator= (BOOST_INTERPROCESS_COPY_ASSIGN_REF(movable_and_copyable_int) mi) { this->m_int = mi.m_int; return *this; } movable_and_copyable_int(BOOST_INTERPROCESS_RV_REF(movable_and_copyable_int) mmi) @@ -143,6 +141,64 @@ std::basic_ostream & operator<< return os; } + +class copyable_int +{ + public: + copyable_int() + : m_int(0) + {} + + explicit copyable_int(int a) + : m_int(a) + {} + + copyable_int(const copyable_int& mmi) + : m_int(mmi.m_int) + {} + + copyable_int & operator= (const copyable_int &mi) + { this->m_int = mi.m_int; return *this; } + + copyable_int & operator= (int i) + { this->m_int = i; return *this; } + + bool operator ==(const copyable_int &mi) const + { return this->m_int == mi.m_int; } + + bool operator !=(const copyable_int &mi) const + { return this->m_int != mi.m_int; } + + bool operator <(const copyable_int &mi) const + { return this->m_int < mi.m_int; } + + bool operator <=(const copyable_int &mi) const + { return this->m_int <= mi.m_int; } + + bool operator >=(const copyable_int &mi) const + { return this->m_int >= mi.m_int; } + + bool operator >(const copyable_int &mi) const + { return this->m_int > mi.m_int; } + + int get_int() const + { return m_int; } + + private: + int m_int; +}; + +template +std::basic_ostream & operator<< + (std::basic_ostream & os, copyable_int const & p) + +{ + os << p.get_int(); + return os; +} + + + } //namespace test { } //namespace interprocess { } //namespace boost { diff --git a/test/multi_index_test.cpp b/test/multi_index_test.cpp index ad3e75b..ab197cb 100644 --- a/test/multi_index_test.cpp +++ b/test/multi_index_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2006-2009. 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) // @@ -37,6 +37,17 @@ struct employee int id; int age; shm_string name; + + employee(const employee &e) + : id(e.id), age(e.age), name(e.name) + {} + + employee &operator=(const employee &e) + { + id = e.id; age = e.age; name = e.name; + return *this; + } + employee( int id_ , int age_ , const char *name_ diff --git a/test/mutex_test.cpp b/test/mutex_test.cpp index b0098b9..229b158 100644 --- a/test/mutex_test.cpp +++ b/test/mutex_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/mutex_test_template.hpp b/test/mutex_test_template.hpp index 64b4a7a..2b40b75 100644 --- a/test/mutex_test_template.hpp +++ b/test/mutex_test_template.hpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // @@ -234,6 +234,7 @@ void test_mutex_lock() //Wait completion tm1.join(); + boost::thread::sleep(xsecs(1*BaseSeconds)); tm2.join(); assert(d1.m_value == 1); diff --git a/test/named_condition_test.cpp b/test/named_condition_test.cpp index be04499..b4d5013 100644 --- a/test/named_condition_test.cpp +++ b/test/named_condition_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/named_construct_test.cpp b/test/named_construct_test.cpp index fade538..ca1fa5e 100644 --- a/test/named_construct_test.cpp +++ b/test/named_construct_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2008-2008. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2008-2009. 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) // diff --git a/test/named_creation_template.hpp b/test/named_creation_template.hpp index 0d5db18..1c169ca 100644 --- a/test/named_creation_template.hpp +++ b/test/named_creation_template.hpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/named_mutex_test.cpp b/test/named_mutex_test.cpp index eb64286..376b63f 100644 --- a/test/named_mutex_test.cpp +++ b/test/named_mutex_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/named_recursive_mutex_test.cpp b/test/named_recursive_mutex_test.cpp index 6080b76..fb8c185 100644 --- a/test/named_recursive_mutex_test.cpp +++ b/test/named_recursive_mutex_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/named_semaphore_test.cpp b/test/named_semaphore_test.cpp index dd527c7..09d70cf 100644 --- a/test/named_semaphore_test.cpp +++ b/test/named_semaphore_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/named_upgradable_mutex_test.cpp b/test/named_upgradable_mutex_test.cpp index 9f5eaa5..da06ebb 100644 --- a/test/named_upgradable_mutex_test.cpp +++ b/test/named_upgradable_mutex_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/node_allocator_test.cpp b/test/node_allocator_test.cpp index 8333fa8..14c2ef0 100644 --- a/test/node_allocator_test.cpp +++ b/test/node_allocator_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/node_pool_test.cpp b/test/node_pool_test.cpp index da4dcc2..5deb582 100644 --- a/test/node_pool_test.cpp +++ b/test/node_pool_test.cpp @@ -12,9 +12,8 @@ #include using namespace boost::interprocess; -typedef managed_shared_memory::segment_manager segment_manager_t; -template class detail::private_node_pool_impl; +typedef managed_shared_memory::segment_manager segment_manager_t; int main () { diff --git a/test/null_index_test.cpp b/test/null_index_test.cpp index e428361..e0aedc9 100644 --- a/test/null_index_test.cpp +++ b/test/null_index_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2005-2009. 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) // diff --git a/test/print_container.hpp b/test/print_container.hpp index 1fc001a..2eca310 100644 --- a/test/print_container.hpp +++ b/test/print_container.hpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/private_adaptive_pool_test.cpp b/test/private_adaptive_pool_test.cpp index 953bdfa..27d2dd7 100644 --- a/test/private_adaptive_pool_test.cpp +++ b/test/private_adaptive_pool_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/private_node_allocator_test.cpp b/test/private_node_allocator_test.cpp index 5ea8659..3dd0fa0 100644 --- a/test/private_node_allocator_test.cpp +++ b/test/private_node_allocator_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/recursive_mutex_test.cpp b/test/recursive_mutex_test.cpp index fd2d333..bb1ae79 100644 --- a/test/recursive_mutex_test.cpp +++ b/test/recursive_mutex_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/semaphore_test.cpp b/test/semaphore_test.cpp index 8768506..1416a41 100644 --- a/test/semaphore_test.cpp +++ b/test/semaphore_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/semaphore_test_template.hpp b/test/semaphore_test_template.hpp index 8b313cb..a3a7c7a 100644 --- a/test/semaphore_test_template.hpp +++ b/test/semaphore_test_template.hpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/set_test.hpp b/test/set_test.hpp index 00c1d2f..264ef66 100644 --- a/test/set_test.hpp +++ b/test/set_test.hpp @@ -1,6 +1,6 @@ //////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // @@ -77,16 +77,16 @@ int set_test () MyShmSet *shmset2 = segment.template construct("MyShmSet2") - (boost::interprocess::make_move_iterator(&aux_vect[0]) - , boost::interprocess::make_move_iterator(aux_vect + 50) + ( ::boost::interprocess::make_move_iterator(&aux_vect[0]) + , ::boost::interprocess::make_move_iterator(aux_vect + 50) , std::less(), segment.get_segment_manager()); MyStdSet *stdset2 = new MyStdSet(aux_vect2, aux_vect2 + 50); MyShmMultiSet *shmmultiset2 = segment.template construct("MyShmMultiSet2") - (boost::interprocess::make_move_iterator(&aux_vect3[0]) - , boost::interprocess::make_move_iterator(aux_vect3 + 50) + ( ::boost::interprocess::make_move_iterator(&aux_vect3[0]) + , ::boost::interprocess::make_move_iterator(aux_vect3 + 50) , std::less(), segment.get_segment_manager()); MyStdMultiSet *stdmultiset2 = new MyStdMultiSet(aux_vect2, aux_vect2 + 50); @@ -99,20 +99,88 @@ int set_test () return 1; } + //ordered range insertion + for(int i = 0; i < 50; ++i){ + IntType move_me(i); + aux_vect[i] = boost::interprocess::move(move_me); + } + + for(int i = 0; i < 50; ++i){ + aux_vect2[i] = i; + } + + for(int i = 0; i < 50; ++i){ + IntType move_me(i); + aux_vect3[i] = boost::interprocess::move(move_me); + } + + MyShmSet *shmset3 = + segment.template construct("MyShmSet3") + ( ordered_unique_range + , ::boost::interprocess::make_move_iterator(&aux_vect[0]) + , ::boost::interprocess::make_move_iterator(aux_vect + 50) + , std::less(), segment.get_segment_manager()); + + MyStdSet *stdset3 = new MyStdSet(aux_vect2, aux_vect2 + 50); + + MyShmMultiSet *shmmultiset3 = + segment.template construct("MyShmMultiSet3") + ( ordered_range + , ::boost::interprocess::make_move_iterator(&aux_vect3[0]) + , ::boost::interprocess::make_move_iterator(aux_vect3 + 50) + , std::less(), segment.get_segment_manager()); + + MyStdMultiSet *stdmultiset3 = new MyStdMultiSet(aux_vect2, aux_vect2 + 50); + + if(!CheckEqualContainers(shmset3, stdset3)){ + std::cout << "Error in construct(MyShmSet3)" << std::endl; + return 1; + } + if(!CheckEqualContainers(shmmultiset3, stdmultiset3)){ + std::cout << "Error in construct(MyShmMultiSet3)" << std::endl; + return 1; + } + segment.destroy_ptr(shmset2); segment.destroy_ptr(shmmultiset2); delete stdset2; delete stdmultiset2; + + segment.destroy_ptr(shmset3); + segment.destroy_ptr(shmmultiset3); + delete stdset3; + delete stdmultiset3; + } + + if(!CheckEqualContainers(shmset, stdset)){ + std::cout << "Error in shmset->insert(boost::interprocess::move(move_me)" << std::endl; + return 1; } int i, j; - for(i = 0; i < max; ++i){ + for(i = 0; i < max/2; ++i){ IntType move_me(i); shmset->insert(boost::interprocess::move(move_me)); stdset->insert(i); IntType move_me2(i); shmmultiset->insert(boost::interprocess::move(move_me2)); stdmultiset->insert(i); + + if(!CheckEqualContainers(shmset, stdset)){ + std::cout << "Error in shmset->insert(boost::interprocess::move(move_me)" << std::endl; + return 1; + } + // + shmset->insert(IntType(i)); + stdset->insert(i); + shmmultiset->insert(IntType(i)); + stdmultiset->insert(i); + + if(!CheckEqualContainers(shmset, stdset)){ + std::cout << "Error in shmset->insert(boost::interprocess::move(move_me)" << std::endl; + return 1; + } + } if(!CheckEqualContainers(shmset, stdset)){ @@ -195,16 +263,16 @@ int set_test () aux_vect3[i] = boost::interprocess::move(move_me); } - shmset->insert(boost::interprocess::make_move_iterator(&aux_vect[0]), boost::interprocess::make_move_iterator(aux_vect + 50)); + shmset->insert(::boost::interprocess::make_move_iterator(&aux_vect[0]), ::boost::interprocess::make_move_iterator(aux_vect + 50)); stdset->insert(aux_vect2, aux_vect2 + 50); - shmmultiset->insert(boost::interprocess::make_move_iterator(&aux_vect3[0]), boost::interprocess::make_move_iterator(aux_vect3 + 50)); + shmmultiset->insert(::boost::interprocess::make_move_iterator(&aux_vect3[0]), ::boost::interprocess::make_move_iterator(aux_vect3 + 50)); stdmultiset->insert(aux_vect2, aux_vect2 + 50); if(!CheckEqualContainers(shmset, stdset)){ - std::cout << "Error in shmset->insert(boost::interprocess::make_move_iterator(&aux_vect[0])..." << std::endl; + std::cout << "Error in shmset->insert(::boost::interprocess::make_move_iterator(&aux_vect[0])..." << std::endl; return 1; } if(!CheckEqualContainers(shmmultiset, stdmultiset)){ - std::cout << "Error in shmmultiset->insert(boost::interprocess::make_move_iterator(&aux_vect3[0]), ..." << std::endl; + std::cout << "Error in shmmultiset->insert(::boost::interprocess::make_move_iterator(&aux_vect3[0]), ..." << std::endl; return 1; } @@ -252,20 +320,20 @@ int set_test () aux_vect5[i] = boost::interprocess::move(move_me); } - shmset->insert(boost::interprocess::make_move_iterator(&aux_vect[0]), boost::interprocess::make_move_iterator(aux_vect + 50)); - shmset->insert(boost::interprocess::make_move_iterator(&aux_vect3[0]), boost::interprocess::make_move_iterator(aux_vect3 + 50)); + shmset->insert(::boost::interprocess::make_move_iterator(&aux_vect[0]), ::boost::interprocess::make_move_iterator(aux_vect + 50)); + shmset->insert(::boost::interprocess::make_move_iterator(&aux_vect3[0]), ::boost::interprocess::make_move_iterator(aux_vect3 + 50)); stdset->insert(aux_vect2, aux_vect2 + 50); stdset->insert(aux_vect2, aux_vect2 + 50); - shmmultiset->insert(boost::interprocess::make_move_iterator(&aux_vect4[0]), boost::interprocess::make_move_iterator(aux_vect4 + 50)); - shmmultiset->insert(boost::interprocess::make_move_iterator(&aux_vect5[0]), boost::interprocess::make_move_iterator(aux_vect5 + 50)); + shmmultiset->insert(::boost::interprocess::make_move_iterator(&aux_vect4[0]), ::boost::interprocess::make_move_iterator(aux_vect4 + 50)); + shmmultiset->insert(::boost::interprocess::make_move_iterator(&aux_vect5[0]), ::boost::interprocess::make_move_iterator(aux_vect5 + 50)); stdmultiset->insert(aux_vect2, aux_vect2 + 50); stdmultiset->insert(aux_vect2, aux_vect2 + 50); if(!CheckEqualContainers(shmset, stdset)){ - std::cout << "Error in shmset->insert(boost::interprocess::make_move_iterator(&aux_vect3[0])..." << std::endl; + std::cout << "Error in shmset->insert(::boost::interprocess::make_move_iterator(&aux_vect3[0])..." << std::endl; return 1; } if(!CheckEqualContainers(shmmultiset, stdmultiset)){ - std::cout << "Error in shmmultiset->insert(boost::interprocess::make_move_iterator(&aux_vect5[0])..." << std::endl; + std::cout << "Error in shmmultiset->insert(::boost::interprocess::make_move_iterator(&aux_vect5[0])..." << std::endl; return 1; } @@ -283,13 +351,18 @@ int set_test () } } - for(i = 0; i < max; ++i){ + for(i = 0; i < max/2; ++i){ IntType move_me(i); - shmset->insert(boost::interprocess::move(move_me)); - stdset->insert(i); + shmset->insert(shmset->begin(), boost::interprocess::move(move_me)); + stdset->insert(stdset->begin(), i); IntType move_me2(i); - shmmultiset->insert(boost::interprocess::move(move_me2)); - stdmultiset->insert(i); + shmmultiset->insert(shmmultiset->begin(), boost::interprocess::move(move_me2)); + stdmultiset->insert(stdmultiset->begin(), i); + // + shmset->insert(shmset->begin(), IntType(i)); + stdset->insert(stdset->begin(), i); + shmmultiset->insert(shmmultiset->begin(), IntType(i)); + stdmultiset->insert(stdmultiset->begin(), i); } if(!CheckEqualContainers(shmset, stdset)){ diff --git a/test/sharable_mutex_test_template.hpp b/test/sharable_mutex_test_template.hpp index 338ef1c..88bce01 100644 --- a/test/sharable_mutex_test_template.hpp +++ b/test/sharable_mutex_test_template.hpp @@ -10,7 +10,7 @@ // It is provided "as is" without express or implied warranty. ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2005-2009. 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) // diff --git a/test/shared_memory_mapping_test.cpp b/test/shared_memory_mapping_test.cpp index d424017..ab0d886 100644 --- a/test/shared_memory_mapping_test.cpp +++ b/test/shared_memory_mapping_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/shared_memory_test.cpp b/test/shared_memory_test.cpp index 8f99380..796206d 100644 --- a/test/shared_memory_test.cpp +++ b/test/shared_memory_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/shared_ptr_test.cpp b/test/shared_ptr_test.cpp index 877a00e..d97ba6b 100644 --- a/test/shared_ptr_test.cpp +++ b/test/shared_ptr_test.cpp @@ -1,7 +1,7 @@ ////////////////////////////////////////////////////////////////////////////// // // (C) Copyright Peter Dimov 2002-2005, 2007. -// (C) Copyright Ion Gaztanaga 2006-2008. +// (C) Copyright Ion Gaztanaga 2006-2009. // 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) diff --git a/test/slist_test.cpp b/test/slist_test.cpp index a184eba..a2ece81 100644 --- a/test/slist_test.cpp +++ b/test/slist_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // @@ -26,8 +26,8 @@ template class boost::interprocess::slist ShmemAllocator; typedef slist MyList; -typedef allocator ShmemVolatileAllocator; -typedef slist MyVolatileList; +//typedef allocator ShmemVolatileAllocator; +//typedef slist MyVolatileList; typedef allocator ShmemMoveAllocator; typedef slist MyMoveList; @@ -35,6 +35,9 @@ typedef slist MyMoveList; typedef allocator ShmemCopyMoveAllocator; typedef slist MyCopyMoveList; +typedef allocator ShmemCopyAllocator; +typedef slist MyCopyList; + class recursive_slist { public: @@ -68,7 +71,10 @@ int main () if(test::list_test()) return 1; - if(test::list_test()) +// if(test::list_test()) +// return 1; + + if(test::list_test()) return 1; const test::EmplaceOptions Options = (test::EmplaceOptions) diff --git a/test/stable_vector_test.cpp b/test/stable_vector_test.cpp index 5af0bcf..4204082 100644 --- a/test/stable_vector_test.cpp +++ b/test/stable_vector_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // @@ -71,6 +71,9 @@ int main() typedef allocator ShmemCopyMoveAllocator; typedef stable_vector MyCopyMoveVector; + typedef allocator ShmemCopyAllocator; + typedef stable_vector MyCopyVector; + if(test::vector_test()) return 1; @@ -86,6 +89,9 @@ int main() if(test::vector_test()) return 1; + if(test::vector_test()) + return 1; + const test::EmplaceOptions Options = (test::EmplaceOptions)(test::EMPLACE_BACK | test::EMPLACE_BEFORE); if(!boost::interprocess::test::test_emplace < stable_vector, Options>()) diff --git a/test/string_test.cpp b/test/string_test.cpp index 747900b..831dbbc 100644 --- a/test/string_test.cpp +++ b/test/string_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/tree_test.cpp b/test/tree_test.cpp index ff60dce..e5692bb 100644 --- a/test/tree_test.cpp +++ b/test/tree_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // @@ -52,6 +52,8 @@ typedef allocator, my_mana shmem_movable_node_pair_allocator_t; typedef allocator shmem_move_copy_allocator_t; +typedef allocator + shmem_copy_allocator_t; typedef allocator, my_managed_shared_memory::segment_manager> shmem_move_copy_node_pair_allocator_t; @@ -86,6 +88,15 @@ typedef set, shmem_move_copy_allocator_t> MyMoveCopyShmMultiSet; + +typedef set + ,shmem_copy_allocator_t> MyCopyShmSet; +typedef multiset, + shmem_copy_allocator_t> MyCopyShmMultiSet; + + typedef map @@ -194,6 +205,13 @@ int main () return 1; } + if(0 != test::set_test()){ + return 1; + } if (0 != test::map_test ShmemCopyMoveAllocator; typedef vector MyCopyMoveVector; + typedef allocator ShmemCopyAllocator; + typedef vector MyCopyVector; + if(test::vector_test()) return 1; @@ -114,6 +117,9 @@ int main() if(test::vector_test()) return 1; + if(test::vector_test()) + return 1; + if(test_expand_bwd()) return 1; diff --git a/test/vector_test.hpp b/test/vector_test.hpp index e4c891d..3d7799a 100644 --- a/test/vector_test.hpp +++ b/test/vector_test.hpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // @@ -44,7 +44,7 @@ bool copyable_only(V1 *shmvector, V2 *stdvector, boost::interprocess::detail::tr typedef typename V1::value_type IntType; std::size_t size = shmvector->size(); stdvector->insert(stdvector->end(), 50, 1); - shmvector->insert(shmvector->end(), 50, 1); + shmvector->insert(shmvector->end(), 50, IntType(1)); if(!test::CheckEqualContainers(shmvector, stdvector)) return false; { @@ -134,7 +134,7 @@ int vector_test() IntType aux_vect[50]; for(int i = 0; i < 50; ++i){ IntType new_int(-1); - BOOST_STATIC_ASSERT((boost::interprocess::is_movable::value == true)); + BOOST_STATIC_ASSERT((::boost::interprocess::is_movable::value == true)); aux_vect[i] = boost::interprocess::move(new_int); } int aux_vect2[50]; @@ -143,8 +143,8 @@ int vector_test() } shmvector->insert(shmvector->end() - ,boost::interprocess::make_move_iterator(&aux_vect[0]) - ,boost::interprocess::make_move_iterator(aux_vect + 50)); + ,::boost::interprocess::make_move_iterator(&aux_vect[0]) + ,::boost::interprocess::make_move_iterator(aux_vect + 50)); stdvector->insert(stdvector->end(), aux_vect2, aux_vect2 + 50); if(!test::CheckEqualContainers(shmvector, stdvector)) return 1; @@ -165,8 +165,8 @@ int vector_test() aux_vect2[i] = -1; } shmvector->insert(shmvector->begin() - ,boost::interprocess::make_move_iterator(&aux_vect[0]) - ,boost::interprocess::make_move_iterator(aux_vect + 50)); + ,::boost::interprocess::make_move_iterator(&aux_vect[0]) + ,::boost::interprocess::make_move_iterator(aux_vect + 50)); stdvector->insert(stdvector->begin(), aux_vect2, aux_vect2 + 50); if(!test::CheckEqualContainers(shmvector, stdvector)) return 1; } @@ -178,6 +178,8 @@ int vector_test() IntType push_back_this(1); shmvector->push_back(boost::interprocess::move(push_back_this)); stdvector->push_back(int(1)); + shmvector->push_back(IntType(1)); + stdvector->push_back(int(1)); if(!test::CheckEqualContainers(shmvector, stdvector)) return 1; if(!copyable_only(shmvector, stdvector @@ -193,6 +195,8 @@ int vector_test() IntType insert_this(i); shmvector->insert(shmvector->begin(), boost::interprocess::move(insert_this)); stdvector->insert(stdvector->begin(), i); + shmvector->insert(shmvector->begin(), IntType(i)); + stdvector->insert(stdvector->begin(), int(i)); } if(!test::CheckEqualContainers(shmvector, stdvector)) return 1; diff --git a/test/windows_shared_memory_mapping_test.cpp b/test/windows_shared_memory_mapping_test.cpp index 0135367..842b406 100644 --- a/test/windows_shared_memory_mapping_test.cpp +++ b/test/windows_shared_memory_mapping_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) // diff --git a/test/windows_shared_memory_test.cpp b/test/windows_shared_memory_test.cpp index ae5ac7f..15350cf 100644 --- a/test/windows_shared_memory_test.cpp +++ b/test/windows_shared_memory_test.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2004-2009. 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) //