|
Boost-Commit : |
From: eric_at_[hidden]
Date: 2008-05-27 20:03:27
Author: eric_niebler
Date: 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
New Revision: 45844
URL: http://svn.boost.org/trac/boost/changeset/45844
Log:
merged from trunk
Added:
branches/proto/v4/boost/bind/bind_mf2_cc.hpp
- copied unchanged from r45841, /trunk/boost/bind/bind_mf2_cc.hpp
branches/proto/v4/boost/interprocess/detail/intersegment_ptr.hpp
- copied unchanged from r45841, /trunk/boost/interprocess/detail/intersegment_ptr.hpp
branches/proto/v4/boost/interprocess/detail/managed_multi_shared_memory.hpp
- copied unchanged from r45841, /trunk/boost/interprocess/detail/managed_multi_shared_memory.hpp
branches/proto/v4/boost/interprocess/detail/managed_open_or_create_impl.hpp
- copied unchanged from r45841, /trunk/boost/interprocess/detail/managed_open_or_create_impl.hpp
branches/proto/v4/boost/interprocess/detail/math_functions.hpp
- copied unchanged from r45841, /trunk/boost/interprocess/detail/math_functions.hpp
branches/proto/v4/boost/interprocess/detail/multi_segment_services.hpp
- copied unchanged from r45841, /trunk/boost/interprocess/detail/multi_segment_services.hpp
branches/proto/v4/boost/interprocess/detail/segment_manager_helper.hpp
- copied unchanged from r45841, /trunk/boost/interprocess/detail/segment_manager_helper.hpp
branches/proto/v4/boost/interprocess/detail/utilities.hpp
- copied unchanged from r45841, /trunk/boost/interprocess/detail/utilities.hpp
branches/proto/v4/boost/interprocess/mem_algo/detail/multi_simple_seq_fit.hpp
- copied unchanged from r45841, /trunk/boost/interprocess/mem_algo/detail/multi_simple_seq_fit.hpp
branches/proto/v4/boost/interprocess/mem_algo/detail/multi_simple_seq_fit_impl.hpp
- copied unchanged from r45841, /trunk/boost/interprocess/mem_algo/detail/multi_simple_seq_fit_impl.hpp
branches/proto/v4/boost/iostreams/filter/grep.hpp
- copied unchanged from r45841, /trunk/boost/iostreams/filter/grep.hpp
branches/proto/v4/boost/thread/detail/thread.hpp
- copied unchanged from r45841, /trunk/boost/thread/detail/thread.hpp
branches/proto/v4/boost/thread/detail/thread_heap_alloc.hpp
- copied unchanged from r45841, /trunk/boost/thread/detail/thread_heap_alloc.hpp
branches/proto/v4/boost/thread/pthread/thread_heap_alloc.hpp
- copied unchanged from r45841, /trunk/boost/thread/pthread/thread_heap_alloc.hpp
branches/proto/v4/boost/thread/win32/thread_data.hpp
- copied unchanged from r45841, /trunk/boost/thread/win32/thread_data.hpp
branches/proto/v4/libs/bind/test/bind_fn2_test.cpp
- copied unchanged from r45841, /trunk/libs/bind/test/bind_fn2_test.cpp
branches/proto/v4/libs/bind/test/bind_fnobj2_test.cpp
- copied unchanged from r45841, /trunk/libs/bind/test/bind_fnobj2_test.cpp
branches/proto/v4/libs/bind/test/bind_mf2_test.cpp
- copied unchanged from r45841, /trunk/libs/bind/test/bind_mf2_test.cpp
branches/proto/v4/libs/interprocess/example/doc_managed_copy_on_write.cpp
- copied unchanged from r45841, /trunk/libs/interprocess/example/doc_managed_copy_on_write.cpp
branches/proto/v4/libs/interprocess/proj/vc7ide/doc_managed_copy_on_write.vcproj
- copied unchanged from r45841, /trunk/libs/interprocess/proj/vc7ide/doc_managed_copy_on_write.vcproj
branches/proto/v4/libs/interprocess/proj/vc7ide/intersegment_ptr_test.vcproj
- copied unchanged from r45841, /trunk/libs/interprocess/proj/vc7ide/intersegment_ptr_test.vcproj
branches/proto/v4/libs/interprocess/test/intersegment_ptr_test.cpp
- copied unchanged from r45841, /trunk/libs/interprocess/test/intersegment_ptr_test.cpp
branches/proto/v4/libs/iostreams/test/grep_test.cpp
- copied unchanged from r45841, /trunk/libs/iostreams/test/grep_test.cpp
branches/proto/v4/libs/math/build/has_long_double_support.cpp
- copied unchanged from r45841, /trunk/libs/math/build/has_long_double_support.cpp
branches/proto/v4/libs/thread/test/test_generic_locks.cpp
- copied unchanged from r45841, /trunk/libs/thread/test/test_generic_locks.cpp
branches/proto/v4/libs/thread/test/test_thread_mf.cpp
- copied unchanged from r45841, /trunk/libs/thread/test/test_thread_mf.cpp
branches/proto/v4/libs/unordered/test/helpers/count.hpp
- copied unchanged from r45841, /trunk/libs/unordered/test/helpers/count.hpp
branches/proto/v4/tools/build/v2/contrib/tntnet.jam
- copied unchanged from r45841, /trunk/tools/build/v2/contrib/tntnet.jam
Removed:
branches/proto/v4/boost/thread/pthread/thread.hpp
branches/proto/v4/boost/thread/win32/thread.hpp
branches/proto/v4/libs/circular_buffer/doc/valid-html40.png
branches/proto/v4/libs/filesystem/src/exception.cpp
Properties modified:
branches/proto/v4/ (props changed)
Text files modified:
branches/proto/v4/boost-build.jam | 18
branches/proto/v4/boost/asio/detail/deadline_timer_service.hpp | 13
branches/proto/v4/boost/asio/detail/dev_poll_reactor.hpp | 10
branches/proto/v4/boost/asio/detail/epoll_reactor.hpp | 10
branches/proto/v4/boost/asio/detail/handler_queue.hpp | 10
branches/proto/v4/boost/asio/detail/indirect_handler_queue.hpp | 10
branches/proto/v4/boost/asio/detail/kqueue_reactor.hpp | 10
branches/proto/v4/boost/asio/detail/old_win_sdk_compat.hpp | 5
branches/proto/v4/boost/asio/detail/reactor_op_queue.hpp | 10
branches/proto/v4/boost/asio/detail/select_reactor.hpp | 10
branches/proto/v4/boost/asio/detail/strand_service.hpp | 10
branches/proto/v4/boost/asio/detail/timer_queue.hpp | 99
branches/proto/v4/boost/asio/detail/timer_queue_base.hpp | 4
branches/proto/v4/boost/asio/detail/win_iocp_handle_service.hpp | 20
branches/proto/v4/boost/asio/detail/win_iocp_io_service.hpp | 12
branches/proto/v4/boost/asio/detail/win_iocp_socket_service.hpp | 50
branches/proto/v4/boost/bind.hpp | 4
branches/proto/v4/boost/circular_buffer/base.hpp | 67
branches/proto/v4/boost/circular_buffer/space_optimized.hpp | 9
branches/proto/v4/boost/concept_check.hpp | 2
branches/proto/v4/boost/detail/endian.hpp | 4
branches/proto/v4/boost/detail/is_incrementable.hpp | 12
branches/proto/v4/boost/detail/sp_counted_base_sync.hpp | 4
branches/proto/v4/boost/interprocess/allocators/adaptive_pool.hpp | 198 -
branches/proto/v4/boost/interprocess/allocators/allocator.hpp | 10
branches/proto/v4/boost/interprocess/allocators/cached_adaptive_pool.hpp | 68
branches/proto/v4/boost/interprocess/allocators/cached_node_allocator.hpp | 36
branches/proto/v4/boost/interprocess/allocators/detail/adaptive_node_pool.hpp | 364 +-
branches/proto/v4/boost/interprocess/allocators/detail/allocator_common.hpp | 65
branches/proto/v4/boost/interprocess/allocators/detail/node_pool.hpp | 106
branches/proto/v4/boost/interprocess/allocators/node_allocator.hpp | 52
branches/proto/v4/boost/interprocess/allocators/private_adaptive_pool.hpp | 100
branches/proto/v4/boost/interprocess/allocators/private_node_allocator.hpp | 76
branches/proto/v4/boost/interprocess/containers/detail/node_alloc_holder.hpp | 2
branches/proto/v4/boost/interprocess/containers/flat_map.hpp | 16
branches/proto/v4/boost/interprocess/containers/vector.hpp | 14
branches/proto/v4/boost/interprocess/creation_tags.hpp | 22
branches/proto/v4/boost/interprocess/detail/file_wrapper.hpp | 4
branches/proto/v4/boost/interprocess/errors.hpp | 4
branches/proto/v4/boost/interprocess/file_mapping.hpp | 19
branches/proto/v4/boost/interprocess/indexes/map_index.hpp | 2
branches/proto/v4/boost/interprocess/interprocess_fwd.hpp | 12
branches/proto/v4/boost/interprocess/managed_external_buffer.hpp | 30
branches/proto/v4/boost/interprocess/managed_heap_memory.hpp | 26
branches/proto/v4/boost/interprocess/managed_mapped_file.hpp | 53
branches/proto/v4/boost/interprocess/managed_shared_memory.hpp | 50
branches/proto/v4/boost/interprocess/managed_windows_shared_memory.hpp | 46
branches/proto/v4/boost/interprocess/mapped_region.hpp | 10
branches/proto/v4/boost/interprocess/mem_algo/detail/mem_algo_common.hpp | 8
branches/proto/v4/boost/interprocess/mem_algo/rbtree_best_fit.hpp | 11
branches/proto/v4/boost/interprocess/segment_manager.hpp | 12
branches/proto/v4/boost/interprocess/shared_memory_object.hpp | 18
branches/proto/v4/boost/interprocess/smart_ptr/unique_ptr.hpp | 10
branches/proto/v4/boost/interprocess/sync/named_condition.hpp | 25
branches/proto/v4/boost/interprocess/windows_shared_memory.hpp | 16
branches/proto/v4/boost/intrusive/detail/utilities.hpp | 6
branches/proto/v4/boost/intrusive/hashtable.hpp | 2
branches/proto/v4/boost/intrusive/list.hpp | 37
branches/proto/v4/boost/intrusive/slist.hpp | 102
branches/proto/v4/boost/intrusive/unordered_set.hpp | 4
branches/proto/v4/boost/iostreams/chain.hpp | 6
branches/proto/v4/boost/iostreams/detail/codecvt_helper.hpp | 5
branches/proto/v4/boost/iostreams/detail/current_directory.hpp | 5
branches/proto/v4/boost/iostreams/detail/is_iterator_range.hpp | 11
branches/proto/v4/boost/iostreams/filter/line.hpp | 37
branches/proto/v4/boost/iostreams/filter/newline.hpp | 4
branches/proto/v4/boost/iostreams/filter/symmetric.hpp | 2
branches/proto/v4/boost/iostreams/filter/zlib.hpp | 17
branches/proto/v4/boost/iostreams/tee.hpp | 112
branches/proto/v4/boost/iostreams/traits.hpp | 35
branches/proto/v4/boost/lexical_cast.hpp | 8
branches/proto/v4/boost/math/special_functions/pow.hpp | 2
branches/proto/v4/boost/math/tr1.hpp | 1
branches/proto/v4/boost/mpi/python/serialize.hpp | 4
branches/proto/v4/boost/rational.hpp | 2
branches/proto/v4/boost/spirit/home/classic/core/scanner/scanner.hpp | 12
branches/proto/v4/boost/test/impl/execution_monitor.ipp | 10
branches/proto/v4/boost/thread/exceptions.hpp | 6
branches/proto/v4/boost/thread/locks.hpp | 12
branches/proto/v4/boost/thread/pthread/thread_data.hpp | 26
branches/proto/v4/boost/thread/thread.hpp | 9
branches/proto/v4/boost/thread/win32/condition_variable.hpp | 35
branches/proto/v4/boost/thread/win32/thread_heap_alloc.hpp | 224 +
branches/proto/v4/boost/thread/win32/thread_primitives.hpp | 11
branches/proto/v4/boost/unordered/detail/hash_table.hpp | 30
branches/proto/v4/boost/unordered_map.hpp | 4
branches/proto/v4/boost/unordered_set.hpp | 4
branches/proto/v4/boost/utility/value_init.hpp | 7
branches/proto/v4/boost/wave/grammars/cpp_chlit_grammar.hpp | 42
branches/proto/v4/boost/wave/grammars/cpp_intlit_grammar.hpp | 17
branches/proto/v4/libs/bind/test/Jamfile.v2 | 3
branches/proto/v4/libs/circular_buffer/doc/circular_buffer.html | 392 +-
branches/proto/v4/libs/circular_buffer/doc/space_optimized.html | 245 -
branches/proto/v4/libs/circular_buffer/test/common.ipp | 40
branches/proto/v4/libs/circular_buffer/test/space_optimized_test.cpp | 19
branches/proto/v4/libs/config/doc/guidelines.qbk | 18
branches/proto/v4/libs/config/doc/html/boost_config/acknowledgements.html | 4
branches/proto/v4/libs/config/doc/html/boost_config/boost_macro_reference.html | 4
branches/proto/v4/libs/config/doc/html/boost_config/guidelines_for_boost_authors.html | 34
branches/proto/v4/libs/config/doc/html/boost_config/rationale.html | 4
branches/proto/v4/libs/config/doc/html/index.html | 8
branches/proto/v4/libs/filesystem/test/convenience_test.cpp | 5
branches/proto/v4/libs/filesystem/test/fstream_test.cpp | 4
branches/proto/v4/libs/filesystem/test/operations_test.cpp | 5
branches/proto/v4/libs/filesystem/test/wide_test.cpp | 6
branches/proto/v4/libs/functional/hash/doc/Jamfile.v2 | 2
branches/proto/v4/libs/functional/hash/doc/ref.xml | 7
branches/proto/v4/libs/interprocess/doc/interprocess.qbk | 28
branches/proto/v4/libs/interprocess/example/doc_file_mapping.cpp | 1
branches/proto/v4/libs/interprocess/example/doc_message_queueA.cpp | 2
branches/proto/v4/libs/interprocess/example/doc_shared_memory.cpp | 1
branches/proto/v4/libs/interprocess/example/doc_shared_memory2.cpp | 3
branches/proto/v4/libs/interprocess/proj/to-do.txt | 6
branches/proto/v4/libs/interprocess/proj/vc7ide/Interprocess.sln | 16
branches/proto/v4/libs/interprocess/test/cached_adaptive_pool_test.cpp | 1
branches/proto/v4/libs/interprocess/test/cached_node_allocator_test.cpp | 1
branches/proto/v4/libs/interprocess/test/file_mapping_test.cpp | 7
branches/proto/v4/libs/interprocess/test/managed_mapped_file_test.cpp | 36
branches/proto/v4/libs/interprocess/test/managed_shared_memory_test.cpp | 35
branches/proto/v4/libs/interprocess/test/managed_windows_shared_memory_test.cpp | 67
branches/proto/v4/libs/interprocess/test/mapped_file_test.cpp | 5
branches/proto/v4/libs/interprocess/test/node_allocator_test.cpp | 1
branches/proto/v4/libs/interprocess/test/node_pool_test.hpp | 36
branches/proto/v4/libs/interprocess/test/private_adaptive_pool_test.cpp | 1
branches/proto/v4/libs/interprocess/test/private_node_allocator_test.cpp | 1
branches/proto/v4/libs/interprocess/test/shared_memory_mapping_test.cpp | 7
branches/proto/v4/libs/interprocess/test/shared_memory_test.cpp | 5
branches/proto/v4/libs/interprocess/test/user_buffer_test.cpp | 12
branches/proto/v4/libs/interprocess/test/vector_test.hpp | 4
branches/proto/v4/libs/intrusive/doc/intrusive.qbk | 437 +-
branches/proto/v4/libs/intrusive/proj/vc7ide/to-do.txt | 1
branches/proto/v4/libs/intrusive/test/unordered_multiset_test.cpp | 1
branches/proto/v4/libs/iostreams/doc/classes/bzip2.html | 1
branches/proto/v4/libs/iostreams/src/zlib.cpp | 6
branches/proto/v4/libs/iostreams/test/Jamfile.v2 | 3
branches/proto/v4/libs/iostreams/test/tee_test.cpp | 60
branches/proto/v4/libs/math/build/Jamfile.v2 | 9
branches/proto/v4/libs/math/test/Jamfile.v2 | 9
branches/proto/v4/libs/math/test/test_tr1.cpp | 25
branches/proto/v4/libs/system/test/error_code_test.cpp | 9
branches/proto/v4/libs/system/test/header_only_test.cpp | 9
branches/proto/v4/libs/system/test/system_error_test.cpp | 9
branches/proto/v4/libs/thread/doc/changes.qbk | 2
branches/proto/v4/libs/thread/src/pthread/thread.cpp | 278 -
branches/proto/v4/libs/thread/src/win32/thread.cpp | 83
branches/proto/v4/libs/thread/test/Jamfile.v2 | 16
branches/proto/v4/libs/thread/test/test_move_function.cpp | 8
branches/proto/v4/libs/thread/test/test_thread_launching.cpp | 63
branches/proto/v4/libs/unordered/doc/ref.xml | 56
branches/proto/v4/libs/unordered/test/helpers/strong.hpp | 2
branches/proto/v4/libs/unordered/test/helpers/test.hpp | 13
branches/proto/v4/libs/unordered/test/objects/test.hpp | 5
branches/proto/v4/libs/unordered/test/unordered/Jamfile.v2 | 2
branches/proto/v4/libs/unordered/test/unordered/bucket_tests.cpp | 4
branches/proto/v4/libs/unordered/test/unordered/load_factor_tests.cpp | 4
branches/proto/v4/libs/unordered/test/unordered/move_tests.cpp | 34
branches/proto/v4/libs/unordered/test/unordered/rehash_tests.cpp | 12
branches/proto/v4/libs/unordered/test/unordered/unnecessary_copy_tests.cpp | 14
branches/proto/v4/libs/utility/value_init.htm | 29
branches/proto/v4/libs/utility/value_init_test.cpp | 5
branches/proto/v4/libs/xpressive/proto/test/toy_spirit.cpp | 1
branches/proto/v4/tools/boostbook/doc/reference.dtdxml | 35
branches/proto/v4/tools/boostbook/doc/reference.xml | 5
branches/proto/v4/tools/boostbook/dtd/boostbook.dtd | 10
branches/proto/v4/tools/boostbook/xsl/annotation.xsl | 8
branches/proto/v4/tools/boostbook/xsl/chunk-common.xsl | 2
branches/proto/v4/tools/boostbook/xsl/function.xsl | 7
branches/proto/v4/tools/boostbook/xsl/global.xsl | 3
branches/proto/v4/tools/boostbook/xsl/lookup.xsl | 55
branches/proto/v4/tools/boostbook/xsl/macro.xsl | 4
branches/proto/v4/tools/boostbook/xsl/navbar.xsl | 10
branches/proto/v4/tools/boostbook/xsl/template.xsl | 5
branches/proto/v4/tools/boostbook/xsl/type.xsl | 27
branches/proto/v4/tools/build/v2/build/feature.jam | 10
branches/proto/v4/tools/build/v2/doc/src/tasks.xml | 429 +-
branches/proto/v4/tools/build/v2/index.html | 2
branches/proto/v4/tools/build/v2/tools/intel-win.jam | 3
branches/proto/v4/tools/build/v2/tools/qt4.jam | 125
branches/proto/v4/tools/inspect/link_check.cpp | 129
branches/proto/v4/tools/jam/src/Jambase | 277 +-
branches/proto/v4/tools/jam/src/builtins.c | 2
branches/proto/v4/tools/jam/src/jambase.c | 111
branches/proto/v4/tools/quickbook/detail/actions.cpp | 12
branches/proto/v4/tools/quickbook/doc/html/index.html | 10
branches/proto/v4/tools/quickbook/doc/html/quickbook/change_log.html | 10
branches/proto/v4/tools/quickbook/doc/html/quickbook/editors.html | 6
branches/proto/v4/tools/quickbook/doc/html/quickbook/editors/kde_support.html | 20
branches/proto/v4/tools/quickbook/doc/html/quickbook/editors/scite.html | 6
branches/proto/v4/tools/quickbook/doc/html/quickbook/faq.html | 10
branches/proto/v4/tools/quickbook/doc/html/quickbook/install.html | 6
branches/proto/v4/tools/quickbook/doc/html/quickbook/install/linux.html | 6
branches/proto/v4/tools/quickbook/doc/html/quickbook/install/macosx.html | 6
branches/proto/v4/tools/quickbook/doc/html/quickbook/install/windows.html | 6
branches/proto/v4/tools/quickbook/doc/html/quickbook/intro.html | 6
branches/proto/v4/tools/quickbook/doc/html/quickbook/ref.html | 8
branches/proto/v4/tools/quickbook/doc/html/quickbook/syntax.html | 6
branches/proto/v4/tools/quickbook/doc/html/quickbook/syntax/block.html | 52
branches/proto/v4/tools/quickbook/doc/html/quickbook/syntax/comments.html | 6
branches/proto/v4/tools/quickbook/doc/html/quickbook/syntax/phrase.html | 22
branches/proto/v4/tools/quickbook/test/code-block-1.gold | 3
branches/proto/v4/tools/quickbook/test/code-block-2.gold | 3
branches/proto/v4/tools/quickbook/test/import.gold | 6
branches/proto/v4/tools/quickbook/test/quickbook-manual.gold | 5076 +++++++++++++++++++--------------------
branches/proto/v4/tools/quickbook/test/templates.gold | 3
branches/proto/v4/tools/quickbook/test/templates.quickbook | 7
branches/proto/v4/tools/regression/src/process_jam_log.py | 317 +-
branches/proto/v4/tools/regression/xsl_reports/build_results.sh | 46
207 files changed, 6663 insertions(+), 5280 deletions(-)
Modified: branches/proto/v4/boost-build.jam
==============================================================================
--- branches/proto/v4/boost-build.jam (original)
+++ branches/proto/v4/boost-build.jam 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -1,9 +1,15 @@
-#~ Copyright (C) 2002-2003 David Abrahams.
-#~ Copyright (C) 2002-2003 Vladimir Prus.
-#~ Copyright (C) 2003,2007 Rene Rivera.
-#~ Use, modification and distribution are 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)
+# Copyright (C) 2002-2003 David Abrahams.
+# Copyright (C) 2002-2003 Vladimir Prus.
+# Copyright (C) 2003,2007 Rene Rivera.
+# Use, modification and distribution are 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)
+
+# This is the initial file loaded by Boost Jam when run from any Boost library
+# folder. It allows us to choose which Boost Build installation to use for
+# building Boost libraries. Unless explicitly selected using a command-line
+# option, the version included with the Boost library distribution is used (as
+# opposed to any other Boost Build version installed on the user's sytem).
BOOST_ROOT = $(.boost-build-file:D) ;
BOOST_BUILD = [ MATCH --boost-build=(.*) : $(ARGV) ] ;
Modified: branches/proto/v4/boost/asio/detail/deadline_timer_service.hpp
==============================================================================
--- branches/proto/v4/boost/asio/detail/deadline_timer_service.hpp (original)
+++ branches/proto/v4/boost/asio/detail/deadline_timer_service.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -26,6 +26,7 @@
#include <boost/asio/error.hpp>
#include <boost/asio/io_service.hpp>
#include <boost/asio/detail/bind_handler.hpp>
+#include <boost/asio/detail/handler_base_from_member.hpp>
#include <boost/asio/detail/noncopyable.hpp>
#include <boost/asio/detail/service_base.hpp>
#include <boost/asio/detail/socket_ops.hpp>
@@ -154,25 +155,25 @@
}
template <typename Handler>
- class wait_handler
+ class wait_handler :
+ public handler_base_from_member<Handler>
{
public:
wait_handler(boost::asio::io_service& io_service, Handler handler)
- : io_service_(io_service),
- work_(io_service),
- handler_(handler)
+ : handler_base_from_member<Handler>(handler),
+ io_service_(io_service),
+ work_(io_service)
{
}
void operator()(const boost::system::error_code& result)
{
- io_service_.post(detail::bind_handler(handler_, result));
+ io_service_.post(detail::bind_handler(this->handler_, result));
}
private:
boost::asio::io_service& io_service_;
boost::asio::io_service::work work_;
- Handler handler_;
};
// Start an asynchronous wait on the timer.
Modified: branches/proto/v4/boost/asio/detail/dev_poll_reactor.hpp
==============================================================================
--- branches/proto/v4/boost/asio/detail/dev_poll_reactor.hpp (original)
+++ branches/proto/v4/boost/asio/detail/dev_poll_reactor.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -340,7 +340,7 @@
// Check if the thread is supposed to stop.
if (stop_thread_)
{
- complete_operations_and_cleanup_timers(lock);
+ complete_operations_and_timers(lock);
return;
}
@@ -349,7 +349,7 @@
if (!block && read_op_queue_.empty() && write_op_queue_.empty()
&& except_op_queue_.empty() && all_timer_queues_are_empty())
{
- complete_operations_and_cleanup_timers(lock);
+ complete_operations_and_timers(lock);
return;
}
@@ -475,7 +475,7 @@
cancel_ops_unlocked(pending_cancellations_[i]);
pending_cancellations_.clear();
- complete_operations_and_cleanup_timers(lock);
+ complete_operations_and_timers(lock);
}
// Run the select loop in the thread.
@@ -575,7 +575,7 @@
// destructors may make calls back into this reactor. We make a copy of the
// vector of timer queues since the original may be modified while the lock
// is not held.
- void complete_operations_and_cleanup_timers(
+ void complete_operations_and_timers(
boost::asio::detail::mutex::scoped_lock& lock)
{
timer_queues_for_cleanup_ = timer_queues_;
@@ -584,7 +584,7 @@
write_op_queue_.complete_operations();
except_op_queue_.complete_operations();
for (std::size_t i = 0; i < timer_queues_for_cleanup_.size(); ++i)
- timer_queues_for_cleanup_[i]->cleanup_timers();
+ timer_queues_for_cleanup_[i]->complete_timers();
}
// Add a pending event entry for the given descriptor.
Modified: branches/proto/v4/boost/asio/detail/epoll_reactor.hpp
==============================================================================
--- branches/proto/v4/boost/asio/detail/epoll_reactor.hpp (original)
+++ branches/proto/v4/boost/asio/detail/epoll_reactor.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -436,7 +436,7 @@
// Check if the thread is supposed to stop.
if (stop_thread_)
{
- complete_operations_and_cleanup_timers(lock);
+ complete_operations_and_timers(lock);
return;
}
@@ -445,7 +445,7 @@
if (!block && read_op_queue_.empty() && write_op_queue_.empty()
&& except_op_queue_.empty() && all_timer_queues_are_empty())
{
- complete_operations_and_cleanup_timers(lock);
+ complete_operations_and_timers(lock);
return;
}
@@ -552,7 +552,7 @@
need_epoll_wait_ = !read_op_queue_.empty()
|| !write_op_queue_.empty() || !except_op_queue_.empty();
- complete_operations_and_cleanup_timers(lock);
+ complete_operations_and_timers(lock);
}
// Run the select loop in the thread.
@@ -655,7 +655,7 @@
// destructors may make calls back into this reactor. We make a copy of the
// vector of timer queues since the original may be modified while the lock
// is not held.
- void complete_operations_and_cleanup_timers(
+ void complete_operations_and_timers(
boost::asio::detail::mutex::scoped_lock& lock)
{
timer_queues_for_cleanup_ = timer_queues_;
@@ -664,7 +664,7 @@
write_op_queue_.complete_operations();
except_op_queue_.complete_operations();
for (std::size_t i = 0; i < timer_queues_for_cleanup_.size(); ++i)
- timer_queues_for_cleanup_[i]->cleanup_timers();
+ timer_queues_for_cleanup_[i]->complete_timers();
}
// Mutex to protect access to internal data.
Modified: branches/proto/v4/boost/asio/detail/handler_queue.hpp
==============================================================================
--- branches/proto/v4/boost/asio/detail/handler_queue.hpp (original)
+++ branches/proto/v4/boost/asio/detail/handler_queue.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -199,6 +199,16 @@
this_type* h(static_cast<this_type*>(base));
typedef handler_alloc_traits<Handler, this_type> alloc_traits;
handler_ptr<alloc_traits> ptr(h->handler_, h);
+
+ // A sub-object of the handler may be the true owner of the memory
+ // associated with the handler. Consequently, a local copy of the handler
+ // is required to ensure that any owning sub-object remains valid until
+ // after we have deallocated the memory here.
+ Handler handler(h->handler_);
+ (void)handler;
+
+ // Free the memory associated with the handler.
+ ptr.reset();
}
private:
Modified: branches/proto/v4/boost/asio/detail/indirect_handler_queue.hpp
==============================================================================
--- branches/proto/v4/boost/asio/detail/indirect_handler_queue.hpp (original)
+++ branches/proto/v4/boost/asio/detail/indirect_handler_queue.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -246,6 +246,16 @@
this_type* h(static_cast<this_type*>(base));
typedef handler_alloc_traits<Handler, this_type> alloc_traits;
handler_ptr<alloc_traits> ptr(h->handler_, h);
+
+ // A sub-object of the handler may be the true owner of the memory
+ // associated with the handler. Consequently, a local copy of the handler
+ // is required to ensure that any owning sub-object remains valid until
+ // after we have deallocated the memory here.
+ Handler handler(h->handler_);
+ (void)handler;
+
+ // Free the memory associated with the handler.
+ ptr.reset();
}
private:
Modified: branches/proto/v4/boost/asio/detail/kqueue_reactor.hpp
==============================================================================
--- branches/proto/v4/boost/asio/detail/kqueue_reactor.hpp (original)
+++ branches/proto/v4/boost/asio/detail/kqueue_reactor.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -403,7 +403,7 @@
// Check if the thread is supposed to stop.
if (stop_thread_)
{
- complete_operations_and_cleanup_timers(lock);
+ complete_operations_and_timers(lock);
return;
}
@@ -412,7 +412,7 @@
if (!block && read_op_queue_.empty() && write_op_queue_.empty()
&& except_op_queue_.empty() && all_timer_queues_are_empty())
{
- complete_operations_and_cleanup_timers(lock);
+ complete_operations_and_timers(lock);
return;
}
@@ -536,7 +536,7 @@
need_kqueue_wait_ = !read_op_queue_.empty()
|| !write_op_queue_.empty() || !except_op_queue_.empty();
- complete_operations_and_cleanup_timers(lock);
+ complete_operations_and_timers(lock);
}
// Run the select loop in the thread.
@@ -637,7 +637,7 @@
// destructors may make calls back into this reactor. We make a copy of the
// vector of timer queues since the original may be modified while the lock
// is not held.
- void complete_operations_and_cleanup_timers(
+ void complete_operations_and_timers(
boost::asio::detail::mutex::scoped_lock& lock)
{
timer_queues_for_cleanup_ = timer_queues_;
@@ -646,7 +646,7 @@
write_op_queue_.complete_operations();
except_op_queue_.complete_operations();
for (std::size_t i = 0; i < timer_queues_for_cleanup_.size(); ++i)
- timer_queues_for_cleanup_[i]->cleanup_timers();
+ timer_queues_for_cleanup_[i]->complete_timers();
}
// Mutex to protect access to internal data.
Modified: branches/proto/v4/boost/asio/detail/old_win_sdk_compat.hpp
==============================================================================
--- branches/proto/v4/boost/asio/detail/old_win_sdk_compat.hpp (original)
+++ branches/proto/v4/boost/asio/detail/old_win_sdk_compat.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -330,6 +330,11 @@
# define IPV6_V6ONLY 27
#endif
+// Some SDKs (e.g. Windows CE) don't define IPPROTO_ICMPV6.
+#if !defined(IPPROTO_ICMPV6)
+# define IPPROTO_ICMPV6 58
+#endif
+
#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
#include <boost/asio/detail/pop_options.hpp>
Modified: branches/proto/v4/boost/asio/detail/reactor_op_queue.hpp
==============================================================================
--- branches/proto/v4/boost/asio/detail/reactor_op_queue.hpp (original)
+++ branches/proto/v4/boost/asio/detail/reactor_op_queue.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -418,6 +418,16 @@
this_type* this_op(static_cast<this_type*>(base));
typedef handler_alloc_traits<Operation, this_type> alloc_traits;
handler_ptr<alloc_traits> ptr(this_op->operation_, this_op);
+
+ // A sub-object of the operation may be the true owner of the memory
+ // associated with the operation. Consequently, a local copy of the
+ // operation is required to ensure that any owning sub-object remains
+ // valid until after we have deallocated the memory here.
+ Operation operation(this_op->operation_);
+ (void)operation;
+
+ // Free the memory associated with the operation.
+ ptr.reset();
}
private:
Modified: branches/proto/v4/boost/asio/detail/select_reactor.hpp
==============================================================================
--- branches/proto/v4/boost/asio/detail/select_reactor.hpp (original)
+++ branches/proto/v4/boost/asio/detail/select_reactor.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -320,7 +320,7 @@
// Check if the thread is supposed to stop.
if (stop_thread_)
{
- complete_operations_and_cleanup_timers(lock);
+ complete_operations_and_timers(lock);
return;
}
@@ -329,7 +329,7 @@
if (!block && read_op_queue_.empty() && write_op_queue_.empty()
&& except_op_queue_.empty() && all_timer_queues_are_empty())
{
- complete_operations_and_cleanup_timers(lock);
+ complete_operations_and_timers(lock);
return;
}
@@ -392,7 +392,7 @@
cancel_ops_unlocked(pending_cancellations_[i]);
pending_cancellations_.clear();
- complete_operations_and_cleanup_timers(lock);
+ complete_operations_and_timers(lock);
}
// Run the select loop in the thread.
@@ -477,7 +477,7 @@
// destructors may make calls back into this reactor. We make a copy of the
// vector of timer queues since the original may be modified while the lock
// is not held.
- void complete_operations_and_cleanup_timers(
+ void complete_operations_and_timers(
boost::asio::detail::mutex::scoped_lock& lock)
{
timer_queues_for_cleanup_ = timer_queues_;
@@ -486,7 +486,7 @@
write_op_queue_.complete_operations();
except_op_queue_.complete_operations();
for (std::size_t i = 0; i < timer_queues_for_cleanup_.size(); ++i)
- timer_queues_for_cleanup_[i]->cleanup_timers();
+ timer_queues_for_cleanup_[i]->complete_timers();
}
// Mutex to protect access to internal data.
Modified: branches/proto/v4/boost/asio/detail/strand_service.hpp
==============================================================================
--- branches/proto/v4/boost/asio/detail/strand_service.hpp (original)
+++ branches/proto/v4/boost/asio/detail/strand_service.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -341,6 +341,16 @@
this_type* h(static_cast<this_type*>(base));
typedef handler_alloc_traits<Handler, this_type> alloc_traits;
handler_ptr<alloc_traits> ptr(h->handler_, h);
+
+ // A sub-object of the handler may be the true owner of the memory
+ // associated with the handler. Consequently, a local copy of the handler
+ // is required to ensure that any owning sub-object remains valid until
+ // after we have deallocated the memory here.
+ Handler handler(h->handler_);
+ (void)handler;
+
+ // Free the memory associated with the handler.
+ ptr.reset();
}
private:
Modified: branches/proto/v4/boost/asio/detail/timer_queue.hpp
==============================================================================
--- branches/proto/v4/boost/asio/detail/timer_queue.hpp (original)
+++ branches/proto/v4/boost/asio/detail/timer_queue.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -27,6 +27,7 @@
#include <boost/asio/detail/pop_options.hpp>
#include <boost/asio/error.hpp>
+#include <boost/asio/detail/handler_alloc_helpers.hpp>
#include <boost/asio/detail/hash_map.hpp>
#include <boost/asio/detail/noncopyable.hpp>
#include <boost/asio/detail/timer_queue_base.hpp>
@@ -51,7 +52,7 @@
: timers_(),
heap_(),
cancelled_timers_(0),
- cleanup_timers_(0)
+ complete_timers_(0)
{
}
@@ -116,10 +117,10 @@
{
timer_base* t = heap_[0];
remove_timer(t);
+ t->result_ = boost::system::error_code();
t->prev_ = 0;
- t->next_ = cleanup_timers_;
- cleanup_timers_ = t;
- t->invoke(boost::system::error_code());
+ t->next_ = complete_timers_;
+ complete_timers_ = t;
}
}
@@ -155,17 +156,23 @@
while (cancelled_timers_)
{
timer_base* this_timer = cancelled_timers_;
+ this_timer->result_ = boost::asio::error::operation_aborted;
cancelled_timers_ = this_timer->next_;
- this_timer->next_ = cleanup_timers_;
- cleanup_timers_ = this_timer;
- this_timer->invoke(boost::asio::error::operation_aborted);
+ this_timer->next_ = complete_timers_;
+ complete_timers_ = this_timer;
}
}
- // Destroy timers that are waiting to be cleaned up.
- virtual void cleanup_timers()
+ // Complete any timers that are waiting to be completed.
+ virtual void complete_timers()
{
- destroy_timer_list(cleanup_timers_);
+ while (complete_timers_)
+ {
+ timer_base* this_timer = complete_timers_;
+ complete_timers_ = this_timer->next_;
+ this_timer->next_ = 0;
+ this_timer->complete();
+ }
}
// Destroy all timers.
@@ -183,7 +190,7 @@
heap_.clear();
timers_.clear();
destroy_timer_list(cancelled_timers_);
- destroy_timer_list(cleanup_timers_);
+ destroy_timer_list(complete_timers_);
}
private:
@@ -192,27 +199,27 @@
class timer_base
{
public:
- // Perform the timer operation and then destroy.
- void invoke(const boost::system::error_code& result)
+ // Delete the timer and post the handler.
+ void complete()
{
- invoke_func_(this, result);
+ complete_func_(this, result_);
}
- // Destroy the timer operation.
+ // Delete the timer.
void destroy()
{
destroy_func_(this);
}
protected:
- typedef void (*invoke_func_type)(timer_base*,
+ typedef void (*complete_func_type)(timer_base*,
const boost::system::error_code&);
typedef void (*destroy_func_type)(timer_base*);
// Constructor.
- timer_base(invoke_func_type invoke_func, destroy_func_type destroy_func,
+ timer_base(complete_func_type complete_func, destroy_func_type destroy_func,
const time_type& time, void* token)
- : invoke_func_(invoke_func),
+ : complete_func_(complete_func),
destroy_func_(destroy_func),
time_(time),
token_(token),
@@ -231,13 +238,16 @@
private:
friend class timer_queue<Time_Traits>;
- // The function to be called to dispatch the handler.
- invoke_func_type invoke_func_;
+ // The function to be called to delete the timer and post the handler.
+ complete_func_type complete_func_;
- // The function to be called to destroy the handler.
+ // The function to be called to delete the timer.
destroy_func_type destroy_func_;
- // The time when the operation should fire.
+ // The result of the timer operation.
+ boost::system::error_code result_;
+
+ // The time when the timer should fire.
time_type time_;
// The token associated with the timer.
@@ -261,23 +271,52 @@
public:
// Constructor.
timer(const time_type& time, Handler handler, void* token)
- : timer_base(&timer<Handler>::invoke_handler,
+ : timer_base(&timer<Handler>::complete_handler,
&timer<Handler>::destroy_handler, time, token),
handler_(handler)
{
}
- // Invoke the handler and then destroy it.
- static void invoke_handler(timer_base* base,
+ // Delete the timer and post the handler.
+ static void complete_handler(timer_base* base,
const boost::system::error_code& result)
{
- static_cast<timer<Handler>*>(base)->handler_(result);
+ // Take ownership of the timer object.
+ typedef timer<Handler> this_type;
+ this_type* this_timer(static_cast<this_type*>(base));
+ typedef handler_alloc_traits<Handler, this_type> alloc_traits;
+ handler_ptr<alloc_traits> ptr(this_timer->handler_, this_timer);
+
+ // Make a copy of the error_code and the handler so that the memory can
+ // be deallocated before the upcall is made.
+ boost::system::error_code ec(result);
+ Handler handler(this_timer->handler_);
+
+ // Free the memory associated with the handler.
+ ptr.reset();
+
+ // Make the upcall.
+ handler(ec);
}
- // Destroy the handler.
+ // Delete the timer.
static void destroy_handler(timer_base* base)
{
- delete static_cast<timer<Handler>*>(base);
+ // Take ownership of the timer object.
+ typedef timer<Handler> this_type;
+ this_type* this_timer(static_cast<this_type*>(base));
+ typedef handler_alloc_traits<Handler, this_type> alloc_traits;
+ handler_ptr<alloc_traits> ptr(this_timer->handler_, this_timer);
+
+ // A sub-object of the handler may be the true owner of the memory
+ // associated with the handler. Consequently, a local copy of the handler
+ // is required to ensure that any owning sub-object remains valid until
+ // after we have deallocated the memory here.
+ Handler handler(this_timer->handler_);
+ (void)handler;
+
+ // Free the memory associated with the handler.
+ ptr.reset();
}
private:
@@ -386,8 +425,8 @@
// The list of timers to be cancelled.
timer_base* cancelled_timers_;
- // The list of timers to be destroyed.
- timer_base* cleanup_timers_;
+ // The list of timers waiting to be completed.
+ timer_base* complete_timers_;
};
} // namespace detail
Modified: branches/proto/v4/boost/asio/detail/timer_queue_base.hpp
==============================================================================
--- branches/proto/v4/boost/asio/detail/timer_queue_base.hpp (original)
+++ branches/proto/v4/boost/asio/detail/timer_queue_base.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -48,8 +48,8 @@
// Dispatch any pending cancels for timers.
virtual void dispatch_cancellations() = 0;
- // Destroy timers that are waiting to be cleaned up.
- virtual void cleanup_timers() = 0;
+ // Complete all timers that are waiting to be completed.
+ virtual void complete_timers() = 0;
// Destroy all timers.
virtual void destroy_timers() = 0;
Modified: branches/proto/v4/boost/asio/detail/win_iocp_handle_service.hpp
==============================================================================
--- branches/proto/v4/boost/asio/detail/win_iocp_handle_service.hpp (original)
+++ branches/proto/v4/boost/asio/detail/win_iocp_handle_service.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -409,6 +409,16 @@
op_type* handler_op(static_cast<op_type*>(op));
typedef handler_alloc_traits<Handler, op_type> alloc_traits;
handler_ptr<alloc_traits> ptr(handler_op->handler_, handler_op);
+
+ // A sub-object of the handler may be the true owner of the memory
+ // associated with the handler. Consequently, a local copy of the handler
+ // is required to ensure that any owning sub-object remains valid until
+ // after we have deallocated the memory here.
+ Handler handler(handler_op->handler_);
+ (void)handler;
+
+ // Free the memory associated with the handler.
+ ptr.reset();
}
boost::asio::io_service::work work_;
@@ -635,6 +645,16 @@
Handler, op_type> alloc_traits;
boost::asio::detail::handler_ptr<alloc_traits> ptr(
handler_op->handler_, handler_op);
+
+ // A sub-object of the handler may be the true owner of the memory
+ // associated with the handler. Consequently, a local copy of the handler
+ // is required to ensure that any owning sub-object remains valid until
+ // after we have deallocated the memory here.
+ Handler handler(handler_op->handler_);
+ (void)handler;
+
+ // Free the memory associated with the handler.
+ ptr.reset();
}
boost::asio::io_service::work work_;
Modified: branches/proto/v4/boost/asio/detail/win_iocp_io_service.hpp
==============================================================================
--- branches/proto/v4/boost/asio/detail/win_iocp_io_service.hpp (original)
+++ branches/proto/v4/boost/asio/detail/win_iocp_io_service.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -436,7 +436,7 @@
{
timer_queues_copy_[i]->dispatch_timers();
timer_queues_copy_[i]->dispatch_cancellations();
- timer_queues_copy_[i]->cleanup_timers();
+ timer_queues_copy_[i]->complete_timers();
}
}
catch (...)
@@ -650,6 +650,16 @@
op_type* handler_op(static_cast<op_type*>(op));
typedef handler_alloc_traits<Handler, op_type> alloc_traits;
handler_ptr<alloc_traits> ptr(handler_op->handler_, handler_op);
+
+ // A sub-object of the handler may be the true owner of the memory
+ // associated with the handler. Consequently, a local copy of the handler
+ // is required to ensure that any owning sub-object remains valid until
+ // after we have deallocated the memory here.
+ Handler handler(handler_op->handler_);
+ (void)handler;
+
+ // Free the memory associated with the handler.
+ ptr.reset();
}
win_iocp_io_service& io_service_;
Modified: branches/proto/v4/boost/asio/detail/win_iocp_socket_service.hpp
==============================================================================
--- branches/proto/v4/boost/asio/detail/win_iocp_socket_service.hpp (original)
+++ branches/proto/v4/boost/asio/detail/win_iocp_socket_service.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -802,6 +802,16 @@
op_type* handler_op(static_cast<op_type*>(op));
typedef handler_alloc_traits<Handler, op_type> alloc_traits;
handler_ptr<alloc_traits> ptr(handler_op->handler_, handler_op);
+
+ // A sub-object of the handler may be the true owner of the memory
+ // associated with the handler. Consequently, a local copy of the handler
+ // is required to ensure that any owning sub-object remains valid until
+ // after we have deallocated the memory here.
+ Handler handler(handler_op->handler_);
+ (void)handler;
+
+ // Free the memory associated with the handler.
+ ptr.reset();
}
boost::asio::io_service::work work_;
@@ -1071,6 +1081,16 @@
op_type* handler_op(static_cast<op_type*>(op));
typedef handler_alloc_traits<Handler, op_type> alloc_traits;
handler_ptr<alloc_traits> ptr(handler_op->handler_, handler_op);
+
+ // A sub-object of the handler may be the true owner of the memory
+ // associated with the handler. Consequently, a local copy of the handler
+ // is required to ensure that any owning sub-object remains valid until
+ // after we have deallocated the memory here.
+ Handler handler(handler_op->handler_);
+ (void)handler;
+
+ // Free the memory associated with the handler.
+ ptr.reset();
}
boost::asio::io_service::work work_;
@@ -1330,6 +1350,16 @@
op_type* handler_op(static_cast<op_type*>(op));
typedef handler_alloc_traits<Handler, op_type> alloc_traits;
handler_ptr<alloc_traits> ptr(handler_op->handler_, handler_op);
+
+ // A sub-object of the handler may be the true owner of the memory
+ // associated with the handler. Consequently, a local copy of the handler
+ // is required to ensure that any owning sub-object remains valid until
+ // after we have deallocated the memory here.
+ Handler handler(handler_op->handler_);
+ (void)handler;
+
+ // Free the memory associated with the handler.
+ ptr.reset();
}
boost::asio::io_service::work work_;
@@ -1648,6 +1678,16 @@
op_type* handler_op(static_cast<op_type*>(op));
typedef handler_alloc_traits<Handler, op_type> alloc_traits;
handler_ptr<alloc_traits> ptr(handler_op->handler_, handler_op);
+
+ // A sub-object of the handler may be the true owner of the memory
+ // associated with the handler. Consequently, a local copy of the handler
+ // is required to ensure that any owning sub-object remains valid until
+ // after we have deallocated the memory here.
+ Handler handler(handler_op->handler_);
+ (void)handler;
+
+ // Free the memory associated with the handler.
+ ptr.reset();
}
endpoint_type& endpoint_;
@@ -2002,6 +2042,16 @@
op_type* handler_op(static_cast<op_type*>(op));
typedef handler_alloc_traits<Handler, op_type> alloc_traits;
handler_ptr<alloc_traits> ptr(handler_op->handler_, handler_op);
+
+ // A sub-object of the handler may be the true owner of the memory
+ // associated with the handler. Consequently, a local copy of the handler
+ // is required to ensure that any owning sub-object remains valid until
+ // after we have deallocated the memory here.
+ Handler handler(handler_op->handler_);
+ (void)handler;
+
+ // Free the memory associated with the handler.
+ ptr.reset();
}
win_iocp_io_service& io_service_;
Modified: branches/proto/v4/boost/bind.hpp
==============================================================================
--- branches/proto/v4/boost/bind.hpp (original)
+++ branches/proto/v4/boost/bind.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -1568,6 +1568,7 @@
#define BOOST_BIND_MF_CC
#include <boost/bind/bind_mf_cc.hpp>
+#include <boost/bind/bind_mf2_cc.hpp>
#undef BOOST_BIND_MF_NAME
#undef BOOST_BIND_MF_CC
@@ -1578,6 +1579,7 @@
#define BOOST_BIND_MF_CC __cdecl
#include <boost/bind/bind_mf_cc.hpp>
+#include <boost/bind/bind_mf2_cc.hpp>
#undef BOOST_BIND_MF_NAME
#undef BOOST_BIND_MF_CC
@@ -1590,6 +1592,7 @@
#define BOOST_BIND_MF_CC __stdcall
#include <boost/bind/bind_mf_cc.hpp>
+#include <boost/bind/bind_mf2_cc.hpp>
#undef BOOST_BIND_MF_NAME
#undef BOOST_BIND_MF_CC
@@ -1602,6 +1605,7 @@
#define BOOST_BIND_MF_CC __fastcall
#include <boost/bind/bind_mf_cc.hpp>
+#include <boost/bind/bind_mf2_cc.hpp>
#undef BOOST_BIND_MF_NAME
#undef BOOST_BIND_MF_CC
Modified: branches/proto/v4/boost/circular_buffer/base.hpp
==============================================================================
--- branches/proto/v4/boost/circular_buffer/base.hpp (original)
+++ branches/proto/v4/boost/circular_buffer/base.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -907,22 +907,23 @@
// Construction/Destruction
- //! Create an empty <code>circular_buffer</code> with a maximum capacity.
+ //! Create an empty <code>circular_buffer</code> with zero capacity.
/*!
- \post <code>capacity() == max_size() \&\& size() == 0</code>
+ \post <code>capacity() == 0 \&\& size() == 0</code>
\param alloc The allocator.
\throws "An allocation error" if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
used).
\par Complexity
Constant.
- \warning This constructor has been defined only due to compatibility with the STL container definition. Avoid
- using it because it may allocate <b>very large</b> amount of memory (depending on allocator's
- %max_size()).
+ \warning Since Boost version 1.36 the behaviour of this constructor has changed. Now the constructor does not
+ allocate any memory and both capacity and size are set to zero. Also note when inserting an element
+ into a <code>circular_buffer</code> with zero capacity (e.g. by
+ <code>\link push_back() push_back(const_reference)\endlink</code> or
+ <code>\link insert(iterator, param_value_type) insert(iterator, value_type)\endlink</code>) nothing
+ will be inserted and the size (as well as capacity) remains zero.
*/
explicit circular_buffer(const allocator_type& alloc = allocator_type())
- : m_size(0), m_alloc(alloc) {
- initialize(max_size());
- }
+ : m_buff(0), m_end(0), m_first(0), m_last(0), m_size(0), m_alloc(alloc) {}
//! Create an empty <code>circular_buffer</code> with the specified capacity.
/*!
@@ -936,7 +937,8 @@
*/
explicit circular_buffer(capacity_type capacity, const allocator_type& alloc = allocator_type())
: m_size(0), m_alloc(alloc) {
- initialize(capacity);
+ initialize_buffer(capacity);
+ m_first = m_last = m_buff;
}
/*! \brief Create a full <code>circular_buffer</code> with the specified capacity and filled with <code>n</code>
@@ -954,7 +956,8 @@
*/
circular_buffer(size_type n, param_value_type item, const allocator_type& alloc = allocator_type())
: m_size(n), m_alloc(alloc) {
- initialize(n, item);
+ initialize_buffer(n, item);
+ m_first = m_last = m_buff;
}
/*! \brief Create a <code>circular_buffer</code> with the specified capacity and filled with <code>n</code>
@@ -976,7 +979,9 @@
const allocator_type& alloc = allocator_type())
: m_size(n), m_alloc(alloc) {
BOOST_CB_ASSERT(capacity >= size()); // check for capacity lower than size
- initialize(capacity, item);
+ initialize_buffer(capacity, item);
+ m_first = m_buff;
+ m_last = capacity == n ? m_buff : m_buff + n;
}
//! The copy constructor.
@@ -992,14 +997,17 @@
*/
circular_buffer(const circular_buffer<T, Alloc>& cb)
: m_size(cb.size()), m_alloc(cb.get_allocator()) {
- m_first = m_last = m_buff = allocate(cb.capacity());
+ initialize_buffer(cb.capacity());
+ m_first = m_buff;
BOOST_TRY {
- m_end = cb_details::uninitialized_copy_with_alloc(cb.begin(), cb.end(), m_buff, m_alloc);
+ m_last = cb_details::uninitialized_copy_with_alloc(cb.begin(), cb.end(), m_buff, m_alloc);
} BOOST_CATCH(...) {
deallocate(m_buff, cb.capacity());
BOOST_RETHROW
}
BOOST_CATCH_END
+ if (m_last == m_end)
+ m_last = m_buff;
}
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
@@ -1997,15 +2005,15 @@
#endif
}
- //! Initialize the circular buffer.
- void initialize(capacity_type capacity) {
- m_first = m_last = m_buff = allocate(capacity);
+ //! Initialize the internal buffer.
+ void initialize_buffer(capacity_type capacity) {
+ m_buff = allocate(capacity);
m_end = m_buff + capacity;
}
- //! Initialize the circular buffer.
- void initialize(capacity_type capacity, param_value_type item) {
- initialize(capacity);
+ //! Initialize the internal buffer.
+ void initialize_buffer(capacity_type capacity, param_value_type item) {
+ initialize_buffer(capacity);
BOOST_TRY {
cb_details::uninitialized_fill_n_with_alloc(m_buff, size(), item, m_alloc);
} BOOST_CATCH(...) {
@@ -2019,7 +2027,8 @@
template <class IntegralType>
void initialize(IntegralType n, IntegralType item, const true_type&) {
m_size = static_cast<size_type>(n);
- initialize(size(), item);
+ initialize_buffer(size(), item);
+ m_first = m_last = m_buff;
}
//! Specialized initialize method.
@@ -2056,7 +2065,9 @@
void initialize(capacity_type capacity, IntegralType n, IntegralType item, const true_type&) {
BOOST_CB_ASSERT(capacity >= static_cast<size_type>(n)); // check for capacity lower than n
m_size = static_cast<size_type>(n);
- initialize(capacity, item);
+ initialize_buffer(capacity, item);
+ m_first = m_buff;
+ m_last = capacity == size() ? m_buff : m_buff + size();
}
//! Specialized initialize method.
@@ -2076,7 +2087,8 @@
InputIterator first,
InputIterator last,
const std::input_iterator_tag&) {
- initialize(capacity);
+ initialize_buffer(capacity);
+ m_first = m_last = m_buff;
m_size = 0;
if (capacity == 0)
return;
@@ -2102,28 +2114,29 @@
initialize(capacity, first, last, std::distance(first, last));
}
- //! Helper initialize method.
+ //! Initialize the circular buffer.
template <class ForwardIterator>
void initialize(capacity_type capacity,
ForwardIterator first,
ForwardIterator last,
size_type distance) {
- initialize(capacity);
+ initialize_buffer(capacity);
+ m_first = m_buff;
if (distance > capacity) {
std::advance(first, distance - capacity);
m_size = capacity;
} else {
m_size = distance;
- if (distance != capacity)
- m_last = m_buff + size();
}
BOOST_TRY {
- cb_details::uninitialized_copy_with_alloc(first, last, m_buff, m_alloc);
+ m_last = cb_details::uninitialized_copy_with_alloc(first, last, m_buff, m_alloc);
} BOOST_CATCH(...) {
deallocate(m_buff, capacity);
BOOST_RETHROW
}
BOOST_CATCH_END
+ if (m_last == m_end)
+ m_last = m_buff;
}
//! Reset the circular buffer.
Modified: branches/proto/v4/boost/circular_buffer/space_optimized.hpp
==============================================================================
--- branches/proto/v4/boost/circular_buffer/space_optimized.hpp (original)
+++ branches/proto/v4/boost/circular_buffer/space_optimized.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -312,18 +312,19 @@
}
}
- //! Create an empty space optimized circular buffer with a maximum capacity.
+ //! Create an empty space optimized circular buffer with zero capacity.
/*!
- \post <code>capacity().%capacity() == max_size() \&\& capacity().min_capacity() == 0 \&\& size() == 0</code>
- <br><br>There is no memory allocated in the internal buffer.
+ \post <code>capacity().%capacity() == 0 \&\& capacity().min_capacity() == 0 \&\& size() == 0</code>
\param alloc The allocator.
\throws Nothing.
\par Complexity
Constant.
+ \warning Since Boost version 1.36 the behaviour of this constructor has changed. Now it creates a space
+ optimized circular buffer with zero capacity.
*/
explicit circular_buffer_space_optimized(const allocator_type& alloc = allocator_type())
: circular_buffer<T, Alloc>(0, alloc)
- , m_capacity_ctrl(max_size()) {}
+ , m_capacity_ctrl(0) {}
//! Create an empty space optimized circular buffer with the specified capacity.
/*!
Modified: branches/proto/v4/boost/concept_check.hpp
==============================================================================
--- branches/proto/v4/boost/concept_check.hpp (original)
+++ branches/proto/v4/boost/concept_check.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -144,6 +144,8 @@
void const_constraints(const TT& b) {
#if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL
a = b; // const required for argument to assignment
+#else
+ ignore_unused_variable_warning(b);
#endif
}
private:
Modified: branches/proto/v4/boost/detail/endian.hpp
==============================================================================
--- branches/proto/v4/boost/detail/endian.hpp (original)
+++ branches/proto/v4/boost/detail/endian.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -42,10 +42,10 @@
# error Unknown machine endianness detected.
# endif
# define BOOST_BYTE_ORDER __BYTE_ORDER
-#elif defined(_BIG_ENDIAN)
+#elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN)
# define BOOST_BIG_ENDIAN
# define BOOST_BYTE_ORDER 4321
-#elif defined(_LITTLE_ENDIAN)
+#elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN)
# define BOOST_LITTLE_ENDIAN
# define BOOST_BYTE_ORDER 1234
#elif defined(__sparc) || defined(__sparc__) \
Modified: branches/proto/v4/boost/detail/is_incrementable.hpp
==============================================================================
--- branches/proto/v4/boost/detail/is_incrementable.hpp (original)
+++ branches/proto/v4/boost/detail/is_incrementable.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -63,7 +63,12 @@
tag operator,(tag,int);
# define BOOST_comma(a,b) (a,b)
# endif
-
+
+# if defined(BOOST_MSVC)
+# pragma warning(push)
+# pragma warning(disable:4913) // Warning about operator,
+# endif
+
// two check overloads help us identify which operator++ was picked
char (& check(tag) )[2];
@@ -92,6 +97,11 @@
, value = sizeof(is_incrementable_::check(BOOST_comma(x++,0))) == 1
);
};
+
+# if defined(BOOST_MSVC)
+# pragma warning(pop)
+# endif
+
}
# undef BOOST_comma
Modified: branches/proto/v4/boost/detail/sp_counted_base_sync.hpp
==============================================================================
--- branches/proto/v4/boost/detail/sp_counted_base_sync.hpp (original)
+++ branches/proto/v4/boost/detail/sp_counted_base_sync.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -18,6 +18,10 @@
#include <boost/detail/sp_typeinfo.hpp>
#include <limits.h>
+#if defined( __ia64__ ) && defined( __INTEL_COMPILER )
+# include <ia64intrin.h>
+#endif
+
namespace boost
{
Modified: branches/proto/v4/boost/interprocess/allocators/adaptive_pool.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/allocators/adaptive_pool.hpp (original)
+++ branches/proto/v4/boost/interprocess/allocators/adaptive_pool.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -40,138 +40,18 @@
/// @cond
namespace detail{
-/*
-template < unsigned int Version
- , class T
- , class SegmentManager
- , std::size_t NodesPerChunk
- , std::size_t MaxFreeChunks
- , unsigned char OverheadPercent
- >
-class adaptive_pool_base
- : public node_pool_allocation_impl
- < adaptive_pool_base
- < Version, T, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent>
- , Version
- , T
- , SegmentManager
- >
-{
- public:
- typedef typename SegmentManager::void_pointer void_pointer;
- typedef SegmentManager segment_manager;
- typedef adaptive_pool_base
- <Version, T, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> self_t;
- static const std::size_t SizeOfT = sizeof(detail::if_c<detail::is_same<T, void>::value, int, T>::type);
- typedef detail::shared_adaptive_node_pool
- < SegmentManager, SizeOfT, NodesPerChunk, MaxFreeChunks, OverheadPercent> node_pool_t;
- typedef typename detail::
- pointer_to_other<void_pointer, node_pool_t>::type node_pool_ptr;
-
- BOOST_STATIC_ASSERT((Version <=2));
-
- public:
- //-------
- typedef typename detail::
- pointer_to_other<void_pointer, T>::type pointer;
- typedef typename detail::
- pointer_to_other<void_pointer, const T>::type const_pointer;
- typedef T value_type;
- typedef typename detail::add_reference
- <value_type>::type reference;
- typedef typename detail::add_reference
- <const value_type>::type const_reference;
- typedef std::size_t size_type;
- typedef std::ptrdiff_t difference_type;
-
- typedef detail::version_type<adaptive_pool_base, Version> version;
- typedef transform_iterator
- < typename SegmentManager::
- multiallocation_iterator
- , detail::cast_functor <T> > multiallocation_iterator;
- typedef typename SegmentManager::
- multiallocation_chain multiallocation_chain;
-
- //!Obtains adaptive_pool_base from
- //!adaptive_pool_base
- template<class T2>
- struct rebind
- {
- typedef adaptive_pool_base<Version, T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> other;
- };
-
- /// @cond
- private:
- //!Not assignable from related adaptive_pool_base
- template<unsigned int Version2, class T2, class SegmentManager2, std::size_t N2, std::size_t F2, unsigned char O2>
- adaptive_pool_base& operator=
- (const adaptive_pool_base<Version2, T2, SegmentManager2, N2, F2, O2>&);
-
- //!Not assignable from other adaptive_pool_base
- adaptive_pool_base& operator=(const adaptive_pool_base&);
- /// @endcond
-
- public:
- //!Constructor from a segment manager. If not present, constructs a node
- //!pool. Increments the reference count of the associated node pool.
- //!Can throw boost::interprocess::bad_alloc
- adaptive_pool_base(segment_manager *segment_mngr)
- : mp_node_pool(detail::get_or_create_node_pool<node_pool_t>(segment_mngr)) { }
-
- //!Copy constructor from other adaptive_pool_base. Increments the reference
- //!count of the associated node pool. Never throws
- adaptive_pool_base(const adaptive_pool_base &other)
- : mp_node_pool(other.get_node_pool())
- {
- mp_node_pool->inc_ref_count();
- }
-
- //!Copy constructor from related adaptive_pool_base. If not present, constructs
- //!a node pool. Increments the reference count of the associated node pool.
- //!Can throw boost::interprocess::bad_alloc
- template<class T2>
- adaptive_pool_base
- (const adaptive_pool_base<Version, T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> &other)
- : mp_node_pool(detail::get_or_create_node_pool<node_pool_t>(other.get_segment_manager())) { }
-
- //!Destructor, removes node_pool_t from memory
- //!if its reference count reaches to zero. Never throws
- ~adaptive_pool_base()
- { detail::destroy_node_pool_if_last_link(detail::get_pointer(mp_node_pool)); }
-
- //!Returns a pointer to the node pool.
- //!Never throws
- node_pool_t* get_node_pool() const
- { return detail::get_pointer(mp_node_pool); }
-
- //!Returns the segment manager.
- //!Never throws
- segment_manager* get_segment_manager()const
- { return mp_node_pool->get_segment_manager(); }
-
- //!Swaps allocators. Does not throw. If each allocator is placed in a
- //!different memory segment, the result is undefined.
- friend void swap(self_t &alloc1, self_t &alloc2)
- { detail::do_swap(alloc1.mp_node_pool, alloc2.mp_node_pool); }
-
- /// @cond
- private:
- node_pool_ptr mp_node_pool;
- /// @endcond
-};
-*/
template < unsigned int Version
, class T
, class SegmentManager
- , std::size_t NodesPerChunk
- , std::size_t MaxFreeChunks
+ , std::size_t NodesPerBlock
+ , std::size_t MaxFreeBlocks
, unsigned char OverheadPercent
>
class adaptive_pool_base
: public node_pool_allocation_impl
< adaptive_pool_base
- < Version, T, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent>
+ < Version, T, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent>
, Version
, T
, SegmentManager
@@ -181,7 +61,7 @@
typedef typename SegmentManager::void_pointer void_pointer;
typedef SegmentManager segment_manager;
typedef adaptive_pool_base
- <Version, T, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> self_t;
+ <Version, T, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> self_t;
/// @cond
@@ -189,7 +69,7 @@
struct node_pool
{
typedef detail::shared_adaptive_node_pool
- < SegmentManager, sizeof(T), NodesPerChunk, MaxFreeChunks, OverheadPercent> type;
+ < SegmentManager, sizeof(T), NodesPerBlock, MaxFreeBlocks, OverheadPercent> type;
static type *get(void *p)
{ return static_cast<type*>(p); }
@@ -225,7 +105,7 @@
template<class T2>
struct rebind
{
- typedef adaptive_pool_base<Version, T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> other;
+ typedef adaptive_pool_base<Version, T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> other;
};
/// @cond
@@ -265,7 +145,7 @@
//!Can throw boost::interprocess::bad_alloc
template<class T2>
adaptive_pool_base
- (const adaptive_pool_base<Version, T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> &other)
+ (const adaptive_pool_base<Version, T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> &other)
: mp_node_pool(detail::get_or_create_node_pool<typename node_pool<0>::type>(other.get_segment_manager())) { }
//!Destructor, removes node_pool_t from memory
@@ -310,8 +190,8 @@
template < class T
, class SegmentManager
- , std::size_t NodesPerChunk = 64
- , std::size_t MaxFreeChunks = 2
+ , std::size_t NodesPerBlock = 64
+ , std::size_t MaxFreeBlocks = 2
, unsigned char OverheadPercent = 5
>
class adaptive_pool_v1
@@ -319,19 +199,19 @@
< 1
, T
, SegmentManager
- , NodesPerChunk
- , MaxFreeChunks
+ , NodesPerBlock
+ , MaxFreeBlocks
, OverheadPercent
>
{
public:
typedef detail::adaptive_pool_base
- < 1, T, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> base_t;
+ < 1, T, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> base_t;
template<class T2>
struct rebind
{
- typedef adaptive_pool_v1<T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> other;
+ typedef adaptive_pool_v1<T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> other;
};
adaptive_pool_v1(SegmentManager *segment_mngr)
@@ -340,7 +220,7 @@
template<class T2>
adaptive_pool_v1
- (const adaptive_pool_v1<T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> &other)
+ (const adaptive_pool_v1<T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> &other)
: base_t(other)
{}
};
@@ -356,17 +236,17 @@
//!
//!This node allocator shares a segregated storage between all instances
//!of adaptive_pool with equal sizeof(T) placed in the same segment
-//!group. NodesPerChunk is the number of nodes allocated at once when the allocator
-//!needs runs out of nodes. MaxFreeChunks is the maximum number of totally free chunks
-//!that the adaptive node pool will hold. The rest of the totally free chunks will be
+//!group. NodesPerBlock is the number of nodes allocated at once when the allocator
+//!needs runs out of nodes. MaxFreeBlocks is the maximum number of totally free blocks
+//!that the adaptive node pool will hold. The rest of the totally free blocks will be
//!deallocated with the segment manager.
//!
//!OverheadPercent is the (approximated) maximum size overhead (1-20%) of the allocator:
//!(memory usable for nodes / total memory allocated from the segment manager)
template < class T
, class SegmentManager
- , std::size_t NodesPerChunk
- , std::size_t MaxFreeChunks
+ , std::size_t NodesPerBlock
+ , std::size_t MaxFreeBlocks
, unsigned char OverheadPercent
>
class adaptive_pool
@@ -375,8 +255,8 @@
< 2
, T
, SegmentManager
- , NodesPerChunk
- , MaxFreeChunks
+ , NodesPerBlock
+ , MaxFreeBlocks
, OverheadPercent
>
/// @endcond
@@ -384,14 +264,14 @@
#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
typedef detail::adaptive_pool_base
- < 2, T, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> base_t;
+ < 2, T, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> base_t;
public:
typedef detail::version_type<adaptive_pool, 2> version;
template<class T2>
struct rebind
{
- typedef adaptive_pool<T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> other;
+ typedef adaptive_pool<T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> other;
};
adaptive_pool(SegmentManager *segment_mngr)
@@ -400,7 +280,7 @@
template<class T2>
adaptive_pool
- (const adaptive_pool<T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> &other)
+ (const adaptive_pool<T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> &other)
: base_t(other)
{}
@@ -423,7 +303,7 @@
template<class T2>
struct rebind
{
- typedef adaptive_pool<T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> other;
+ typedef adaptive_pool<T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> other;
};
private:
@@ -452,7 +332,7 @@
//!Can throw boost::interprocess::bad_alloc
template<class T2>
adaptive_pool
- (const adaptive_pool<T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> &other);
+ (const adaptive_pool<T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> &other);
//!Destructor, removes node_pool_t from memory
//!if its reference count reaches to zero. Never throws
@@ -478,9 +358,9 @@
//!Never throws
void deallocate(const pointer &ptr, size_type count);
- //!Deallocates all free chunks
+ //!Deallocates all free blocks
//!of the pool
- void deallocate_free_chunks();
+ void deallocate_free_blocks();
//!Swaps allocators. Does not throw. If each allocator is placed in a
//!different memory segment, the result is undefined.
@@ -513,7 +393,7 @@
size_type preferred_size,
size_type &received_size, const pointer &reuse = 0);
- //!Allocates many elements of size elem_size in a contiguous chunk
+ //!Allocates many elements of size elem_size in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -522,11 +402,11 @@
multiallocation_iterator allocate_many(size_type elem_size, std::size_t num_elements);
//!Allocates n_elements elements, each one of size elem_sizes[i]in a
- //!contiguous chunk
+ //!contiguous block
//!of memory. The elements must be deallocated
multiallocation_iterator allocate_many(const size_type *elem_sizes, size_type n_elements);
- //!Allocates many elements of size elem_size in a contiguous chunk
+ //!Allocates many elements of size elem_size in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -539,7 +419,7 @@
//!Throws boost::interprocess::bad_alloc if there is no enough memory
pointer allocate_one();
- //!Allocates many elements of size == 1 in a contiguous chunk
+ //!Allocates many elements of size == 1 in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -552,7 +432,7 @@
//!with other functions different from allocate_one(). Never throws
void deallocate_one(const pointer &p);
- //!Allocates many elements of size == 1 in a contiguous chunk
+ //!Allocates many elements of size == 1 in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -566,15 +446,15 @@
//!Equality test for same type
//!of adaptive_pool
-template<class T, class S, std::size_t NodesPerChunk, std::size_t F, unsigned char OP> inline
-bool operator==(const adaptive_pool<T, S, NodesPerChunk, F, OP> &alloc1,
- const adaptive_pool<T, S, NodesPerChunk, F, OP> &alloc2);
+template<class T, class S, std::size_t NodesPerBlock, std::size_t F, unsigned char OP> inline
+bool operator==(const adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc1,
+ const adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc2);
//!Inequality test for same type
//!of adaptive_pool
-template<class T, class S, std::size_t NodesPerChunk, std::size_t F, unsigned char OP> inline
-bool operator!=(const adaptive_pool<T, S, NodesPerChunk, F, OP> &alloc1,
- const adaptive_pool<T, S, NodesPerChunk, F, OP> &alloc2);
+template<class T, class S, std::size_t NodesPerBlock, std::size_t F, unsigned char OP> inline
+bool operator!=(const adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc1,
+ const adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc2);
#endif
Modified: branches/proto/v4/boost/interprocess/allocators/allocator.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/allocators/allocator.hpp (original)
+++ branches/proto/v4/boost/interprocess/allocators/allocator.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -183,7 +183,7 @@
(command, limit_size, preferred_size, received_size, detail::get_pointer(reuse));
}
- //!Allocates many elements of size elem_size in a contiguous chunk
+ //!Allocates many elements of size elem_size in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -196,7 +196,7 @@
}
//!Allocates n_elements elements, each one of size elem_sizes[i]in a
- //!contiguous chunk
+ //!contiguous block
//!of memory. The elements must be deallocated
multiallocation_iterator allocate_many(const size_type *elem_sizes, size_type n_elements)
{
@@ -204,7 +204,7 @@
(mp_mngr->allocate_many(elem_sizes, n_elements, sizeof(T)));
}
- //!Allocates many elements of size elem_size in a contiguous chunk
+ //!Allocates many elements of size elem_size in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -219,7 +219,7 @@
pointer allocate_one()
{ return this->allocate(1); }
- //!Allocates many elements of size == 1 in a contiguous chunk
+ //!Allocates many elements of size == 1 in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -234,7 +234,7 @@
void deallocate_one(const pointer &p)
{ return this->deallocate(p, 1); }
- //!Allocates many elements of size == 1 in a contiguous chunk
+ //!Allocates many elements of size == 1 in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
Modified: branches/proto/v4/boost/interprocess/allocators/cached_adaptive_pool.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/allocators/cached_adaptive_pool.hpp (original)
+++ branches/proto/v4/boost/interprocess/allocators/cached_adaptive_pool.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -38,8 +38,8 @@
template < class T
, class SegmentManager
- , std::size_t NodesPerChunk = 64
- , std::size_t MaxFreeChunks = 2
+ , std::size_t NodesPerBlock = 64
+ , std::size_t MaxFreeBlocks = 2
, unsigned char OverheadPercent = 5
>
class cached_adaptive_pool_v1
@@ -48,8 +48,8 @@
, detail::shared_adaptive_node_pool
< SegmentManager
, sizeof(T)
- , NodesPerChunk
- , MaxFreeChunks
+ , NodesPerBlock
+ , MaxFreeBlocks
, OverheadPercent
>
, 1>
@@ -60,8 +60,8 @@
, detail::shared_adaptive_node_pool
< SegmentManager
, sizeof(T)
- , NodesPerChunk
- , MaxFreeChunks
+ , NodesPerBlock
+ , MaxFreeBlocks
, OverheadPercent
>
, 1> base_t;
@@ -70,7 +70,7 @@
struct rebind
{
typedef cached_adaptive_pool_v1
- <T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> other;
+ <T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> other;
};
cached_adaptive_pool_v1(SegmentManager *segment_mngr,
@@ -81,7 +81,7 @@
template<class T2>
cached_adaptive_pool_v1
(const cached_adaptive_pool_v1
- <T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> &other)
+ <T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> &other)
: base_t(other)
{}
};
@@ -100,17 +100,17 @@
//!memory segment. But also caches some nodes privately to
//!avoid some synchronization overhead.
//!
-//!NodesPerChunk is the minimum number of nodes of nodes allocated at once when
-//!the allocator needs runs out of nodes. MaxFreeChunks is the maximum number of totally free chunks
-//!that the adaptive node pool will hold. The rest of the totally free chunks will be
+//!NodesPerBlock is the minimum number of nodes of nodes allocated at once when
+//!the allocator needs runs out of nodes. MaxFreeBlocks is the maximum number of totally free blocks
+//!that the adaptive node pool will hold. The rest of the totally free blocks will be
//!deallocated with the segment manager.
//!
//!OverheadPercent is the (approximated) maximum size overhead (1-20%) of the allocator:
//!(memory usable for nodes / total memory allocated from the segment manager)
template < class T
, class SegmentManager
- , std::size_t NodesPerChunk
- , std::size_t MaxFreeChunks
+ , std::size_t NodesPerBlock
+ , std::size_t MaxFreeBlocks
, unsigned char OverheadPercent
>
class cached_adaptive_pool
@@ -120,8 +120,8 @@
, detail::shared_adaptive_node_pool
< SegmentManager
, sizeof(typename detail::if_c<detail::is_same<T, void>::value, int, T>::type)
- , NodesPerChunk
- , MaxFreeChunks
+ , NodesPerBlock
+ , MaxFreeBlocks
, OverheadPercent
>
, 2>
@@ -135,8 +135,8 @@
, detail::shared_adaptive_node_pool
< SegmentManager
, sizeof(T)
- , NodesPerChunk
- , MaxFreeChunks
+ , NodesPerBlock
+ , MaxFreeBlocks
, OverheadPercent
>
, 2> base_t;
@@ -148,7 +148,7 @@
struct rebind
{
typedef cached_adaptive_pool
- <T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> other;
+ <T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> other;
};
cached_adaptive_pool(SegmentManager *segment_mngr,
@@ -158,7 +158,7 @@
template<class T2>
cached_adaptive_pool
- (const cached_adaptive_pool<T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> &other)
+ (const cached_adaptive_pool<T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> &other)
: base_t(other)
{}
@@ -181,7 +181,7 @@
template<class T2>
struct rebind
{
- typedef cached_adaptive_pool<T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> other;
+ typedef cached_adaptive_pool<T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> other;
};
private:
@@ -210,7 +210,7 @@
//!Can throw boost::interprocess::bad_alloc
template<class T2>
cached_adaptive_pool
- (const cached_adaptive_pool<T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> &other);
+ (const cached_adaptive_pool<T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> &other);
//!Destructor, removes node_pool_t from memory
//!if its reference count reaches to zero. Never throws
@@ -236,9 +236,9 @@
//!Never throws
void deallocate(const pointer &ptr, size_type count);
- //!Deallocates all free chunks
+ //!Deallocates all free blocks
//!of the pool
- void deallocate_free_chunks();
+ void deallocate_free_blocks();
//!Swaps allocators. Does not throw. If each allocator is placed in a
//!different memory segment, the result is undefined.
@@ -271,7 +271,7 @@
size_type preferred_size,
size_type &received_size, const pointer &reuse = 0);
- //!Allocates many elements of size elem_size in a contiguous chunk
+ //!Allocates many elements of size elem_size in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -280,11 +280,11 @@
multiallocation_iterator allocate_many(size_type elem_size, std::size_t num_elements);
//!Allocates n_elements elements, each one of size elem_sizes[i]in a
- //!contiguous chunk
+ //!contiguous block
//!of memory. The elements must be deallocated
multiallocation_iterator allocate_many(const size_type *elem_sizes, size_type n_elements);
- //!Allocates many elements of size elem_size in a contiguous chunk
+ //!Allocates many elements of size elem_size in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -297,7 +297,7 @@
//!Throws boost::interprocess::bad_alloc if there is no enough memory
pointer allocate_one();
- //!Allocates many elements of size == 1 in a contiguous chunk
+ //!Allocates many elements of size == 1 in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -310,7 +310,7 @@
//!with other functions different from allocate_one(). Never throws
void deallocate_one(const pointer &p);
- //!Allocates many elements of size == 1 in a contiguous chunk
+ //!Allocates many elements of size == 1 in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -331,15 +331,15 @@
//!Equality test for same type
//!of cached_adaptive_pool
-template<class T, class S, std::size_t NodesPerChunk, std::size_t F, std::size_t OP> inline
-bool operator==(const cached_adaptive_pool<T, S, NodesPerChunk, F, OP> &alloc1,
- const cached_adaptive_pool<T, S, NodesPerChunk, F, OP> &alloc2);
+template<class T, class S, std::size_t NodesPerBlock, std::size_t F, std::size_t OP> inline
+bool operator==(const cached_adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc1,
+ const cached_adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc2);
//!Inequality test for same type
//!of cached_adaptive_pool
-template<class T, class S, std::size_t NodesPerChunk, std::size_t F, std::size_t OP> inline
-bool operator!=(const cached_adaptive_pool<T, S, NodesPerChunk, F, OP> &alloc1,
- const cached_adaptive_pool<T, S, NodesPerChunk, F, OP> &alloc2);
+template<class T, class S, std::size_t NodesPerBlock, std::size_t F, std::size_t OP> inline
+bool operator!=(const cached_adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc1,
+ const cached_adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc2);
#endif
Modified: branches/proto/v4/boost/interprocess/allocators/cached_node_allocator.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/allocators/cached_node_allocator.hpp (original)
+++ branches/proto/v4/boost/interprocess/allocators/cached_node_allocator.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -39,7 +39,7 @@
template < class T
, class SegmentManager
- , std::size_t NodesPerChunk = 64
+ , std::size_t NodesPerBlock = 64
>
class cached_node_allocator_v1
: public detail::cached_allocator_impl
@@ -47,7 +47,7 @@
, detail::shared_node_pool
< SegmentManager
, sizeof(T)
- , NodesPerChunk
+ , NodesPerBlock
>
, 1>
{
@@ -57,7 +57,7 @@
, detail::shared_node_pool
< SegmentManager
, sizeof(T)
- , NodesPerChunk
+ , NodesPerBlock
>
, 1> base_t;
@@ -65,7 +65,7 @@
struct rebind
{
typedef cached_node_allocator_v1
- <T2, SegmentManager, NodesPerChunk> other;
+ <T2, SegmentManager, NodesPerBlock> other;
};
cached_node_allocator_v1(SegmentManager *segment_mngr,
@@ -76,7 +76,7 @@
template<class T2>
cached_node_allocator_v1
(const cached_node_allocator_v1
- <T2, SegmentManager, NodesPerChunk> &other)
+ <T2, SegmentManager, NodesPerBlock> &other)
: base_t(other)
{}
};
@@ -87,7 +87,7 @@
template < class T
, class SegmentManager
- , std::size_t NodesPerChunk
+ , std::size_t NodesPerBlock
>
class cached_node_allocator
/// @cond
@@ -96,7 +96,7 @@
, detail::shared_node_pool
< SegmentManager
, sizeof(T)
- , NodesPerChunk
+ , NodesPerBlock
>
, 2>
/// @endcond
@@ -109,7 +109,7 @@
, detail::shared_node_pool
< SegmentManager
, sizeof(T)
- , NodesPerChunk
+ , NodesPerBlock
>
, 2> base_t;
@@ -119,7 +119,7 @@
template<class T2>
struct rebind
{
- typedef cached_node_allocator<T2, SegmentManager, NodesPerChunk> other;
+ typedef cached_node_allocator<T2, SegmentManager, NodesPerBlock> other;
};
cached_node_allocator(SegmentManager *segment_mngr,
@@ -129,7 +129,7 @@
template<class T2>
cached_node_allocator
- (const cached_node_allocator<T2, SegmentManager, NodesPerChunk> &other)
+ (const cached_node_allocator<T2, SegmentManager, NodesPerBlock> &other)
: base_t(other)
{}
@@ -181,7 +181,7 @@
//!Can throw boost::interprocess::bad_alloc
template<class T2>
cached_node_allocator
- (const cached_node_allocator<T2, SegmentManager, NodesPerChunk> &other);
+ (const cached_node_allocator<T2, SegmentManager, NodesPerBlock> &other);
//!Destructor, removes node_pool_t from memory
//!if its reference count reaches to zero. Never throws
@@ -207,9 +207,9 @@
//!Never throws
void deallocate(const pointer &ptr, size_type count);
- //!Deallocates all free chunks
+ //!Deallocates all free blocks
//!of the pool
- void deallocate_free_chunks();
+ void deallocate_free_blocks();
//!Swaps allocators. Does not throw. If each allocator is placed in a
//!different memory segment, the result is undefined.
@@ -242,7 +242,7 @@
size_type preferred_size,
size_type &received_size, const pointer &reuse = 0);
- //!Allocates many elements of size elem_size in a contiguous chunk
+ //!Allocates many elements of size elem_size in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -251,11 +251,11 @@
multiallocation_iterator allocate_many(size_type elem_size, std::size_t num_elements);
//!Allocates n_elements elements, each one of size elem_sizes[i]in a
- //!contiguous chunk
+ //!contiguous block
//!of memory. The elements must be deallocated
multiallocation_iterator allocate_many(const size_type *elem_sizes, size_type n_elements);
- //!Allocates many elements of size elem_size in a contiguous chunk
+ //!Allocates many elements of size elem_size in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -268,7 +268,7 @@
//!Throws boost::interprocess::bad_alloc if there is no enough memory
pointer allocate_one();
- //!Allocates many elements of size == 1 in a contiguous chunk
+ //!Allocates many elements of size == 1 in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -281,7 +281,7 @@
//!with other functions different from allocate_one(). Never throws
void deallocate_one(const pointer &p);
- //!Allocates many elements of size == 1 in a contiguous chunk
+ //!Allocates many elements of size == 1 in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
Modified: branches/proto/v4/boost/interprocess/allocators/detail/adaptive_node_pool.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/allocators/detail/adaptive_node_pool.hpp (original)
+++ branches/proto/v4/boost/interprocess/allocators/detail/adaptive_node_pool.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -71,18 +71,18 @@
std::size_t hdr_offset;
};
- struct chunk_info_t
+ struct block_info_t
:
public hdr_offset_holder,
public multiset_hook_t
{
- //An intrusive list of free node from this chunk
+ //An intrusive list of free node from this block
free_nodes_t free_nodes;
- friend bool operator <(const chunk_info_t &l, const chunk_info_t &r)
+ friend bool operator <(const block_info_t &l, const block_info_t &r)
{
// { return l.free_nodes.size() < r.free_nodes.size(); }
//Let's order blocks first by free nodes and then by address
- //so that highest address fully free chunks are deallocated.
+ //so that highest address fully free blocks are deallocated.
//This improves returning memory to the OS (trimming).
const bool is_less = l.free_nodes.size() < r.free_nodes.size();
const bool is_equal = l.free_nodes.size() == r.free_nodes.size();
@@ -90,11 +90,11 @@
}
};
typedef typename bi::make_multiset
- <chunk_info_t, bi::base_hook<multiset_hook_t> >::type chunk_multiset_t;
- typedef typename chunk_multiset_t::iterator chunk_iterator;
+ <block_info_t, bi::base_hook<multiset_hook_t> >::type block_multiset_t;
+ typedef typename block_multiset_t::iterator block_iterator;
static const std::size_t MaxAlign = alignment_of<node_t>::value;
- static const std::size_t HdrSize = ((sizeof(chunk_info_t)-1)/MaxAlign+1)*MaxAlign;
+ static const std::size_t HdrSize = ((sizeof(block_info_t)-1)/MaxAlign+1)*MaxAlign;
static const std::size_t HdrOffsetSize = ((sizeof(hdr_offset_holder)-1)/MaxAlign+1)*MaxAlign;
static std::size_t calculate_alignment
(std::size_t overhead_percent, std::size_t real_node_size)
@@ -102,15 +102,15 @@
//to-do: handle real_node_size != node_size
const std::size_t divisor = overhead_percent*real_node_size;
const std::size_t dividend = HdrOffsetSize*100;
- std::size_t elements_per_subchunk = (dividend - 1)/divisor + 1;
+ std::size_t elements_per_subblock = (dividend - 1)/divisor + 1;
std::size_t candidate_power_of_2 =
- upper_power_of_2(elements_per_subchunk*real_node_size + HdrOffsetSize);
+ upper_power_of_2(elements_per_subblock*real_node_size + HdrOffsetSize);
bool overhead_satisfied = false;
- //Now calculate the wors-case overhead for a subchunk
- const std::size_t max_subchunk_overhead = HdrSize + PayloadPerAllocation;
+ //Now calculate the wors-case overhead for a subblock
+ const std::size_t max_subblock_overhead = HdrSize + PayloadPerAllocation;
while(!overhead_satisfied){
- elements_per_subchunk = (candidate_power_of_2 - max_subchunk_overhead)/real_node_size;
- const std::size_t overhead_size = candidate_power_of_2 - elements_per_subchunk*real_node_size;
+ elements_per_subblock = (candidate_power_of_2 - max_subblock_overhead)/real_node_size;
+ const std::size_t overhead_size = candidate_power_of_2 - elements_per_subblock*real_node_size;
if(overhead_size*100/candidate_power_of_2 < overhead_percent){
overhead_satisfied = true;
}
@@ -121,30 +121,30 @@
return candidate_power_of_2;
}
- static void calculate_num_subchunks
- (std::size_t alignment, std::size_t real_node_size, std::size_t elements_per_chunk
- ,std::size_t &num_subchunks, std::size_t &real_num_node, std::size_t overhead_percent)
- {
- std::size_t elements_per_subchunk = (alignment - HdrOffsetSize)/real_node_size;
- std::size_t possible_num_subchunk = (elements_per_chunk - 1)/elements_per_subchunk + 1;
- std::size_t hdr_subchunk_elements = (alignment - HdrSize - PayloadPerAllocation)/real_node_size;
- while(((possible_num_subchunk-1)*elements_per_subchunk + hdr_subchunk_elements) < elements_per_chunk){
- ++possible_num_subchunk;
+ static void calculate_num_subblocks
+ (std::size_t alignment, std::size_t real_node_size, std::size_t elements_per_block
+ ,std::size_t &num_subblocks, std::size_t &real_num_node, std::size_t overhead_percent)
+ {
+ std::size_t elements_per_subblock = (alignment - HdrOffsetSize)/real_node_size;
+ std::size_t possible_num_subblock = (elements_per_block - 1)/elements_per_subblock + 1;
+ std::size_t hdr_subblock_elements = (alignment - HdrSize - PayloadPerAllocation)/real_node_size;
+ while(((possible_num_subblock-1)*elements_per_subblock + hdr_subblock_elements) < elements_per_block){
+ ++possible_num_subblock;
}
- elements_per_subchunk = (alignment - HdrOffsetSize)/real_node_size;
+ elements_per_subblock = (alignment - HdrOffsetSize)/real_node_size;
bool overhead_satisfied = false;
while(!overhead_satisfied){
- const std::size_t total_data = (elements_per_subchunk*(possible_num_subchunk-1) + hdr_subchunk_elements)*real_node_size;
- const std::size_t total_size = alignment*possible_num_subchunk;
+ const std::size_t total_data = (elements_per_subblock*(possible_num_subblock-1) + hdr_subblock_elements)*real_node_size;
+ const std::size_t total_size = alignment*possible_num_subblock;
if((total_size - total_data)*100/total_size < overhead_percent){
overhead_satisfied = true;
}
else{
- ++possible_num_subchunk;
+ ++possible_num_subblock;
}
}
- num_subchunks = possible_num_subchunk;
- real_num_node = (possible_num_subchunk-1)*elements_per_subchunk + hdr_subchunk_elements;
+ num_subblocks = possible_num_subblock;
+ real_num_node = (possible_num_subblock-1)*elements_per_subblock + hdr_subblock_elements;
}
public:
@@ -154,27 +154,27 @@
//!Constructor from a segment manager. Never throws
private_adaptive_node_pool_impl
( segment_manager_base_type *segment_mngr_base, std::size_t node_size
- , std::size_t nodes_per_chunk, std::size_t max_free_chunks
+ , std::size_t nodes_per_block, std::size_t max_free_blocks
, unsigned char overhead_percent
)
- : m_max_free_chunks(max_free_chunks)
+ : m_max_free_blocks(max_free_blocks)
, m_real_node_size(lcm(node_size, std::size_t(alignment_of<node_t>::value)))
//Round the size to a power of two value.
//This is the total memory size (including payload) that we want to
//allocate from the general-purpose allocator
- , m_real_chunk_alignment(calculate_alignment(overhead_percent, m_real_node_size))
- //This is the real number of nodes per chunk
- , m_num_subchunks(0)
+ , m_real_block_alignment(calculate_alignment(overhead_percent, m_real_node_size))
+ //This is the real number of nodes per block
+ , m_num_subblocks(0)
, m_real_num_node(0)
//General purpose allocator
, mp_segment_mngr_base(segment_mngr_base)
- , m_chunk_multiset()
- , m_totally_free_chunks(0)
+ , m_block_multiset()
+ , m_totally_free_blocks(0)
{
- calculate_num_subchunks(m_real_chunk_alignment, m_real_node_size, nodes_per_chunk, m_num_subchunks, m_real_num_node, overhead_percent);
+ calculate_num_subblocks(m_real_block_alignment, m_real_node_size, nodes_per_block, m_num_subblocks, m_real_num_node, overhead_percent);
}
- //!Destructor. Deallocates all allocated chunks. Never throws
+ //!Destructor. Deallocates all allocated blocks. Never throws
~private_adaptive_node_pool_impl()
{ priv_clear(); }
@@ -190,8 +190,8 @@
{
priv_invariants();
//If there are no free nodes we allocate a new block
- if (m_chunk_multiset.empty()){
- priv_alloc_chunk(1);
+ if (m_block_multiset.empty()){
+ priv_alloc_block(1);
}
//We take the first free node the multiset can't be empty
return priv_take_first_node();
@@ -200,11 +200,11 @@
//!Deallocates an array pointed by ptr. Never throws
void deallocate_node(void *pElem)
{
- this->priv_reinsert_nodes_in_chunk
+ this->priv_reinsert_nodes_in_block
(multiallocation_iterator::create_simple_range(pElem));
- //Update free chunk count
- if(m_totally_free_chunks > m_max_free_chunks){
- this->priv_deallocate_free_chunks(m_max_free_chunks);
+ //Update free block count
+ if(m_totally_free_blocks > m_max_free_blocks){
+ this->priv_deallocate_free_blocks(m_max_free_blocks);
}
priv_invariants();
}
@@ -215,17 +215,32 @@
{
try{
priv_invariants();
- for(std::size_t i = 0; i != n; ++i){
- //If there are no free nodes we allocate all needed chunks
- if (m_chunk_multiset.empty()){
- priv_alloc_chunk(((n - i) - 1)/m_real_num_node + 1);
+ std::size_t i = 0;
+ while(i != n){
+ //If there are no free nodes we allocate all needed blocks
+ if (m_block_multiset.empty()){
+ priv_alloc_block(((n - i) - 1)/m_real_num_node + 1);
}
- nodes.push_front(priv_take_first_node());
+ free_nodes_t &free_nodes = m_block_multiset.begin()->free_nodes;
+ const std::size_t free_nodes_count_before = free_nodes.size();
+ if(free_nodes_count_before == m_real_num_node){
+ --m_totally_free_blocks;
+ }
+ const std::size_t num_elems = ((n-i) < free_nodes_count_before) ? (n-i) : free_nodes_count_before;
+ for(std::size_t j = 0; j != num_elems; ++j){
+ void *new_node = &free_nodes.front();
+ free_nodes.pop_front();
+ nodes.push_back(new_node);
+ }
+
+ if(free_nodes.empty()){
+ m_block_multiset.erase(m_block_multiset.begin());
+ }
+ i += num_elems;
}
}
catch(...){
this->deallocate_nodes(nodes, nodes.size());
- this->priv_deallocate_free_chunks(m_max_free_chunks);
throw;
}
priv_invariants();
@@ -259,20 +274,20 @@
//!Deallocates the nodes pointed by the multiallocation iterator. Never throws
void deallocate_nodes(multiallocation_iterator it)
{
- this->priv_reinsert_nodes_in_chunk(it);
- if(m_totally_free_chunks > m_max_free_chunks){
- this->priv_deallocate_free_chunks(m_max_free_chunks);
+ this->priv_reinsert_nodes_in_block(it);
+ if(m_totally_free_blocks > m_max_free_blocks){
+ this->priv_deallocate_free_blocks(m_max_free_blocks);
}
}
- void deallocate_free_chunks()
- { this->priv_deallocate_free_chunks(0); }
+ void deallocate_free_blocks()
+ { this->priv_deallocate_free_blocks(0); }
std::size_t num_free_nodes()
{
- typedef typename chunk_multiset_t::const_iterator citerator;
+ typedef typename block_multiset_t::const_iterator citerator;
std::size_t count = 0;
- citerator it (m_chunk_multiset.begin()), itend(m_chunk_multiset.end());
+ citerator it (m_block_multiset.begin()), itend(m_block_multiset.end());
for(; it != itend; ++it){
count += it->free_nodes.size();
}
@@ -281,76 +296,80 @@
void swap(private_adaptive_node_pool_impl &other)
{
- assert(m_max_free_chunks == other.m_max_free_chunks);
+ assert(m_max_free_blocks == other.m_max_free_blocks);
assert(m_real_node_size == other.m_real_node_size);
- assert(m_real_chunk_alignment == other.m_real_chunk_alignment);
+ assert(m_real_block_alignment == other.m_real_block_alignment);
assert(m_real_num_node == other.m_real_num_node);
std::swap(mp_segment_mngr_base, other.mp_segment_mngr_base);
- std::swap(m_totally_free_chunks, other.m_totally_free_chunks);
- m_chunk_multiset.swap(other.m_chunk_multiset);
+ std::swap(m_totally_free_blocks, other.m_totally_free_blocks);
+ m_block_multiset.swap(other.m_block_multiset);
}
+ //Deprecated, use deallocate_free_blocks
+ void deallocate_free_chunks()
+ { this->priv_deallocate_free_blocks(0); }
+
private:
- void priv_deallocate_free_chunks(std::size_t max_free_chunks)
+ void priv_deallocate_free_blocks(std::size_t max_free_blocks)
{
priv_invariants();
//Now check if we've reached the free nodes limit
- //and check if we have free chunks. If so, deallocate as much
+ //and check if we have free blocks. If so, deallocate as much
//as we can to stay below the limit
- for( chunk_iterator itend = m_chunk_multiset.end()
- ; m_totally_free_chunks > max_free_chunks
- ; --m_totally_free_chunks
+ for( block_iterator itend = m_block_multiset.end()
+ ; m_totally_free_blocks > max_free_blocks
+ ; --m_totally_free_blocks
){
- assert(!m_chunk_multiset.empty());
- chunk_iterator it = itend;
+ assert(!m_block_multiset.empty());
+ block_iterator it = itend;
--it;
std::size_t num_nodes = it->free_nodes.size();
assert(num_nodes == m_real_num_node);
(void)num_nodes;
- m_chunk_multiset.erase_and_dispose
- (it, chunk_destroyer(this));
+ m_block_multiset.erase_and_dispose
+ (it, block_destroyer(this));
}
}
- void priv_reinsert_nodes_in_chunk(multiallocation_iterator it)
+ void priv_reinsert_nodes_in_block(multiallocation_iterator it)
{
multiallocation_iterator itend;
- chunk_iterator chunk_it(m_chunk_multiset.end());
+ block_iterator block_it(m_block_multiset.end());
while(it != itend){
void *pElem = &*it;
++it;
priv_invariants();
- chunk_info_t *chunk_info = this->priv_chunk_from_node(pElem);
- assert(chunk_info->free_nodes.size() < m_real_num_node);
+ block_info_t *block_info = this->priv_block_from_node(pElem);
+ assert(block_info->free_nodes.size() < m_real_num_node);
//We put the node at the beginning of the free node list
node_t * to_deallocate = static_cast<node_t*>(pElem);
- chunk_info->free_nodes.push_front(*to_deallocate);
+ block_info->free_nodes.push_front(*to_deallocate);
- chunk_iterator this_chunk(chunk_multiset_t::s_iterator_to(*chunk_info));
- chunk_iterator next_chunk(this_chunk);
- ++next_chunk;
+ block_iterator this_block(block_multiset_t::s_iterator_to(*block_info));
+ block_iterator next_block(this_block);
+ ++next_block;
- //Cache the free nodes from the chunk
- std::size_t this_chunk_free_nodes = this_chunk->free_nodes.size();
+ //Cache the free nodes from the block
+ std::size_t this_block_free_nodes = this_block->free_nodes.size();
- if(this_chunk_free_nodes == 1){
- m_chunk_multiset.insert(m_chunk_multiset.begin(), *chunk_info);
+ if(this_block_free_nodes == 1){
+ m_block_multiset.insert(m_block_multiset.begin(), *block_info);
}
else{
- chunk_iterator next_chunk(this_chunk);
- ++next_chunk;
- if(next_chunk != chunk_it){
- std::size_t next_free_nodes = next_chunk->free_nodes.size();
- if(this_chunk_free_nodes > next_free_nodes){
- //Now move the chunk to the new position
- m_chunk_multiset.erase(this_chunk);
- m_chunk_multiset.insert(*chunk_info);
+ block_iterator next_block(this_block);
+ ++next_block;
+ if(next_block != block_it){
+ std::size_t next_free_nodes = next_block->free_nodes.size();
+ if(this_block_free_nodes > next_free_nodes){
+ //Now move the block to the new position
+ m_block_multiset.erase(this_block);
+ m_block_multiset.insert(*block_info);
}
}
}
- //Update free chunk count
- if(this_chunk_free_nodes == m_real_num_node){
- ++m_totally_free_chunks;
+ //Update free block count
+ if(this_block_free_nodes == m_real_num_node){
+ ++m_totally_free_blocks;
}
priv_invariants();
}
@@ -358,40 +377,40 @@
node_t *priv_take_first_node()
{
- assert(m_chunk_multiset.begin() != m_chunk_multiset.end());
+ assert(m_block_multiset.begin() != m_block_multiset.end());
//We take the first free node the multiset can't be empty
- free_nodes_t &free_nodes = m_chunk_multiset.begin()->free_nodes;
+ free_nodes_t &free_nodes = m_block_multiset.begin()->free_nodes;
node_t *first_node = &free_nodes.front();
const std::size_t free_nodes_count = free_nodes.size();
assert(0 != free_nodes_count);
free_nodes.pop_front();
if(free_nodes_count == 1){
- m_chunk_multiset.erase(m_chunk_multiset.begin());
+ m_block_multiset.erase(m_block_multiset.begin());
}
else if(free_nodes_count == m_real_num_node){
- --m_totally_free_chunks;
+ --m_totally_free_blocks;
}
priv_invariants();
return first_node;
}
- class chunk_destroyer;
- friend class chunk_destroyer;
+ class block_destroyer;
+ friend class block_destroyer;
- class chunk_destroyer
+ class block_destroyer
{
public:
- chunk_destroyer(const private_adaptive_node_pool_impl *impl)
+ block_destroyer(const private_adaptive_node_pool_impl *impl)
: mp_impl(impl)
{}
- void operator()(typename chunk_multiset_t::pointer to_deallocate)
+ void operator()(typename block_multiset_t::pointer to_deallocate)
{
std::size_t free_nodes = to_deallocate->free_nodes.size();
(void)free_nodes;
assert(free_nodes == mp_impl->m_real_num_node);
assert(0 == to_deallocate->hdr_offset);
- hdr_offset_holder *hdr_off_holder = mp_impl->priv_first_subchunk_from_chunk((chunk_info_t*)detail::get_pointer(to_deallocate));
+ hdr_offset_holder *hdr_off_holder = mp_impl->priv_first_subblock_from_block((block_info_t*)detail::get_pointer(to_deallocate));
mp_impl->mp_segment_mngr_base->deallocate(hdr_off_holder);
}
const private_adaptive_node_pool_impl *mp_impl;
@@ -403,12 +422,12 @@
#ifdef BOOST_INTERPROCESS_ADAPTIVE_NODE_POOL_CHECK_INVARIANTS
#undef BOOST_INTERPROCESS_ADAPTIVE_NODE_POOL_CHECK_INVARIANTS
{
- //We iterate through the chunk list to free the memory
- chunk_iterator it(m_chunk_multiset.begin()),
- itend(m_chunk_multiset.end()), to_deallocate;
+ //We iterate through the block list to free the memory
+ block_iterator it(m_block_multiset.begin()),
+ itend(m_block_multiset.end()), to_deallocate;
if(it != itend){
for(++it; it != itend; ++it){
- chunk_iterator prev(it);
+ block_iterator prev(it);
--prev;
std::size_t sp = prev->free_nodes.size(),
si = it->free_nodes.size();
@@ -419,35 +438,35 @@
{
//Check that the total free nodes are correct
- it = m_chunk_multiset.begin();
- itend = m_chunk_multiset.end();
+ it = m_block_multiset.begin();
+ itend = m_block_multiset.end();
std::size_t total_free_nodes = 0;
for(; it != itend; ++it){
total_free_nodes += it->free_nodes.size();
}
- assert(total_free_nodes >= m_totally_free_chunks*m_real_num_node);
+ assert(total_free_nodes >= m_totally_free_blocks*m_real_num_node);
}
{
- //Check that the total totally free chunks are correct
- it = m_chunk_multiset.begin();
- itend = m_chunk_multiset.end();
- std::size_t total_free_chunks = 0;
+ //Check that the total totally free blocks are correct
+ it = m_block_multiset.begin();
+ itend = m_block_multiset.end();
+ std::size_t total_free_blocks = 0;
for(; it != itend; ++it){
- total_free_chunks += (it->free_nodes.size() == m_real_num_node);
+ total_free_blocks += (it->free_nodes.size() == m_real_num_node);
}
- assert(total_free_chunks == m_totally_free_chunks);
+ assert(total_free_blocks == m_totally_free_blocks);
}
{
//Check that header offsets are correct
- it = m_chunk_multiset.begin();
+ it = m_block_multiset.begin();
for(; it != itend; ++it){
- hdr_offset_holder *hdr_off_holder = priv_first_subchunk_from_chunk(&*it);
- for(std::size_t i = 0, max = m_num_subchunks; i < max; ++i){
+ hdr_offset_holder *hdr_off_holder = priv_first_subblock_from_block(&*it);
+ for(std::size_t i = 0, max = m_num_subblocks; i < max; ++i){
assert(hdr_off_holder->hdr_offset == std::size_t((char*)&*it- (char*)hdr_off_holder));
- assert(0 == ((std::size_t)hdr_off_holder & (m_real_chunk_alignment - 1)));
- assert(0 == (hdr_off_holder->hdr_offset & (m_real_chunk_alignment - 1)));
- hdr_off_holder = (hdr_offset_holder *)((char*)hdr_off_holder + m_real_chunk_alignment);
+ assert(0 == ((std::size_t)hdr_off_holder & (m_real_block_alignment - 1)));
+ assert(0 == (hdr_off_holder->hdr_offset & (m_real_block_alignment - 1)));
+ hdr_off_holder = (hdr_offset_holder *)((char*)hdr_off_holder + m_real_block_alignment);
}
}
}
@@ -460,72 +479,72 @@
void priv_clear()
{
#ifndef NDEBUG
- chunk_iterator it = m_chunk_multiset.begin();
- chunk_iterator itend = m_chunk_multiset.end();
+ block_iterator it = m_block_multiset.begin();
+ block_iterator itend = m_block_multiset.end();
std::size_t num_free_nodes = 0;
for(; it != itend; ++it){
//Check for memory leak
assert(it->free_nodes.size() == m_real_num_node);
++num_free_nodes;
}
- assert(num_free_nodes == m_totally_free_chunks);
+ assert(num_free_nodes == m_totally_free_blocks);
#endif
priv_invariants();
- m_chunk_multiset.clear_and_dispose
- (chunk_destroyer(this));
- m_totally_free_chunks = 0;
+ m_block_multiset.clear_and_dispose
+ (block_destroyer(this));
+ m_totally_free_blocks = 0;
}
- chunk_info_t *priv_chunk_from_node(void *node) const
+ block_info_t *priv_block_from_node(void *node) const
{
hdr_offset_holder *hdr_off_holder =
- (hdr_offset_holder*)((std::size_t)node & std::size_t(~(m_real_chunk_alignment - 1)));
- assert(0 == ((std::size_t)hdr_off_holder & (m_real_chunk_alignment - 1)));
- assert(0 == (hdr_off_holder->hdr_offset & (m_real_chunk_alignment - 1)));
- chunk_info_t *chunk = (chunk_info_t *)(((char*)hdr_off_holder) + hdr_off_holder->hdr_offset);
- assert(chunk->hdr_offset == 0);
- return chunk;
+ (hdr_offset_holder*)((std::size_t)node & std::size_t(~(m_real_block_alignment - 1)));
+ assert(0 == ((std::size_t)hdr_off_holder & (m_real_block_alignment - 1)));
+ assert(0 == (hdr_off_holder->hdr_offset & (m_real_block_alignment - 1)));
+ block_info_t *block = (block_info_t *)(((char*)hdr_off_holder) + hdr_off_holder->hdr_offset);
+ assert(block->hdr_offset == 0);
+ return block;
}
- hdr_offset_holder *priv_first_subchunk_from_chunk(chunk_info_t *chunk) const
+ hdr_offset_holder *priv_first_subblock_from_block(block_info_t *block) const
{
hdr_offset_holder *hdr_off_holder = (hdr_offset_holder*)
- (((char*)chunk) - (m_num_subchunks-1)*m_real_chunk_alignment);
- assert(hdr_off_holder->hdr_offset == std::size_t((char*)chunk - (char*)hdr_off_holder));
- assert(0 == ((std::size_t)hdr_off_holder & (m_real_chunk_alignment - 1)));
- assert(0 == (hdr_off_holder->hdr_offset & (m_real_chunk_alignment - 1)));
+ (((char*)block) - (m_num_subblocks-1)*m_real_block_alignment);
+ assert(hdr_off_holder->hdr_offset == std::size_t((char*)block - (char*)hdr_off_holder));
+ assert(0 == ((std::size_t)hdr_off_holder & (m_real_block_alignment - 1)));
+ assert(0 == (hdr_off_holder->hdr_offset & (m_real_block_alignment - 1)));
return hdr_off_holder;
}
- //!Allocates a several chunks of nodes. Can throw boost::interprocess::bad_alloc
- void priv_alloc_chunk(std::size_t n)
+ //!Allocates a several blocks of nodes. Can throw boost::interprocess::bad_alloc
+ void priv_alloc_block(std::size_t n)
{
- std::size_t real_chunk_size = m_real_chunk_alignment*m_num_subchunks - SegmentManagerBase::PayloadPerAllocation;
- std::size_t elements_per_subchunk = (m_real_chunk_alignment - HdrOffsetSize)/m_real_node_size;
- std::size_t hdr_subchunk_elements = (m_real_chunk_alignment - HdrSize - SegmentManagerBase::PayloadPerAllocation)/m_real_node_size;
+ std::size_t real_block_size = m_real_block_alignment*m_num_subblocks - SegmentManagerBase::PayloadPerAllocation;
+ std::size_t elements_per_subblock = (m_real_block_alignment - HdrOffsetSize)/m_real_node_size;
+ std::size_t hdr_subblock_elements = (m_real_block_alignment - HdrSize - SegmentManagerBase::PayloadPerAllocation)/m_real_node_size;
for(std::size_t i = 0; i != n; ++i){
//We allocate a new NodeBlock and put it the last
//element of the tree
char *mem_address = detail::char_ptr_cast
- (mp_segment_mngr_base->allocate_aligned(real_chunk_size, m_real_chunk_alignment));
+ (mp_segment_mngr_base->allocate_aligned(real_block_size, m_real_block_alignment));
if(!mem_address) throw std::bad_alloc();
- ++m_totally_free_chunks;
+ ++m_totally_free_blocks;
- //First initialize header information on the last subchunk
- char *hdr_addr = mem_address + m_real_chunk_alignment*(m_num_subchunks-1);
- chunk_info_t *c_info = new(hdr_addr)chunk_info_t;
+ //First initialize header information on the last subblock
+ char *hdr_addr = mem_address + m_real_block_alignment*(m_num_subblocks-1);
+ block_info_t *c_info = new(hdr_addr)block_info_t;
//Some structural checks
assert(static_cast<void*>(&static_cast<hdr_offset_holder*>(c_info)->hdr_offset) ==
static_cast<void*>(c_info));
typename free_nodes_t::iterator prev_insert_pos = c_info->free_nodes.before_begin();
- for( std::size_t subchunk = 0, maxsubchunk = m_num_subchunks - 1
- ; subchunk < maxsubchunk
- ; ++subchunk, mem_address += m_real_chunk_alignment){
+ for( std::size_t subblock = 0, maxsubblock = m_num_subblocks - 1
+ ; subblock < maxsubblock
+ ; ++subblock, mem_address += m_real_block_alignment){
//Initialize header offset mark
new(mem_address) hdr_offset_holder(std::size_t(hdr_addr - mem_address));
char *pNode = mem_address + HdrOffsetSize;
- for(std::size_t i = 0; i < elements_per_subchunk; ++i){
+ for(std::size_t i = 0; i < elements_per_subblock; ++i){
prev_insert_pos = c_info->free_nodes.insert_after(prev_insert_pos, *new (pNode) node_t);
pNode += m_real_node_size;
}
@@ -534,13 +553,13 @@
char *pNode = hdr_addr + HdrSize;
//We initialize all Nodes in Node Block to insert
//them in the free Node list
- for(std::size_t i = 0; i < hdr_subchunk_elements; ++i){
+ for(std::size_t i = 0; i < hdr_subblock_elements; ++i){
prev_insert_pos = c_info->free_nodes.insert_after(prev_insert_pos, *new (pNode) node_t);
pNode += m_real_node_size;
}
}
- //Insert the chunk after the free node list is full
- m_chunk_multiset.insert(m_chunk_multiset.end(), *c_info);
+ //Insert the block after the free node list is full
+ m_block_multiset.insert(m_block_multiset.end(), *c_info);
}
}
@@ -548,25 +567,25 @@
typedef typename pointer_to_other
<void_pointer, segment_manager_base_type>::type segment_mngr_base_ptr_t;
- const std::size_t m_max_free_chunks;
+ const std::size_t m_max_free_blocks;
const std::size_t m_real_node_size;
//Round the size to a power of two value.
//This is the total memory size (including payload) that we want to
//allocate from the general-purpose allocator
- const std::size_t m_real_chunk_alignment;
- std::size_t m_num_subchunks;
- //This is the real number of nodes per chunk
+ const std::size_t m_real_block_alignment;
+ std::size_t m_num_subblocks;
+ //This is the real number of nodes per block
//const
std::size_t m_real_num_node;
segment_mngr_base_ptr_t mp_segment_mngr_base;//Segment manager
- chunk_multiset_t m_chunk_multiset; //Intrusive chunk list
- std::size_t m_totally_free_chunks; //Free chunks
+ block_multiset_t m_block_multiset; //Intrusive block list
+ std::size_t m_totally_free_blocks; //Free blocks
};
template< class SegmentManager
, std::size_t NodeSize
- , std::size_t NodesPerChunk
- , std::size_t MaxFreeChunks
+ , std::size_t NodesPerBlock
+ , std::size_t MaxFreeBlocks
, unsigned char OverheadPercent
>
class private_adaptive_node_pool
@@ -583,11 +602,14 @@
public:
typedef SegmentManager segment_manager;
- static const std::size_t nodes_per_chunk = NodesPerChunk;
+ static const std::size_t nodes_per_block = NodesPerBlock;
+
+ //Deprecated, use node_per_block
+ static const std::size_t nodes_per_chunk = NodesPerBlock;
//!Constructor from a segment manager. Never throws
private_adaptive_node_pool(segment_manager *segment_mngr)
- : base_t(segment_mngr, NodeSize, NodesPerChunk, MaxFreeChunks, OverheadPercent)
+ : base_t(segment_mngr, NodeSize, NodesPerBlock, MaxFreeBlocks, OverheadPercent)
{}
//!Returns the segment manager. Never throws
@@ -598,22 +620,22 @@
//!Pooled shared memory allocator using adaptive pool. Includes
//!a reference count but the class does not delete itself, this is
//!responsibility of user classes. Node size (NodeSize) and the number of
-//!nodes allocated per chunk (NodesPerChunk) are known at compile time
+//!nodes allocated per block (NodesPerBlock) are known at compile time
template< class SegmentManager
, std::size_t NodeSize
- , std::size_t NodesPerChunk
- , std::size_t MaxFreeChunks
+ , std::size_t NodesPerBlock
+ , std::size_t MaxFreeBlocks
, unsigned char OverheadPercent
>
class shared_adaptive_node_pool
: public detail::shared_pool_impl
< private_adaptive_node_pool
- <SegmentManager, NodeSize, NodesPerChunk, MaxFreeChunks, OverheadPercent>
+ <SegmentManager, NodeSize, NodesPerBlock, MaxFreeBlocks, OverheadPercent>
>
{
typedef detail::shared_pool_impl
< private_adaptive_node_pool
- <SegmentManager, NodeSize, NodesPerChunk, MaxFreeChunks, OverheadPercent>
+ <SegmentManager, NodeSize, NodesPerBlock, MaxFreeBlocks, OverheadPercent>
> base_t;
public:
shared_adaptive_node_pool(SegmentManager *segment_mgnr)
Modified: branches/proto/v4/boost/interprocess/allocators/detail/allocator_common.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/allocators/detail/allocator_common.hpp (original)
+++ branches/proto/v4/boost/interprocess/allocators/detail/allocator_common.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -294,7 +294,7 @@
(command, limit_size, preferred_size, received_size, detail::get_pointer(reuse));
}
- //!Allocates many elements of size elem_size in a contiguous chunk
+ //!Allocates many elements of size elem_size in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -307,7 +307,7 @@
}
//!Allocates n_elements elements, each one of size elem_sizes[i]in a
- //!contiguous chunk
+ //!contiguous block
//!of memory. The elements must be deallocated
multiallocation_iterator allocate_many(const size_type *elem_sizes, size_type n_elements)
{
@@ -315,7 +315,7 @@
(this->derived()->get_segment_manager()->allocate_many(elem_sizes, n_elements, sizeof(T)));
}
- //!Allocates many elements of size elem_size in a contiguous chunk
+ //!Allocates many elements of size elem_size in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -439,7 +439,7 @@
return pointer(static_cast<value_type*>(pool->allocate_node()));
}
- //!Allocates many elements of size == 1 in a contiguous chunk
+ //!Allocates many elements of size == 1 in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -462,7 +462,7 @@
pool->deallocate_node(detail::get_pointer(p));
}
- //!Allocates many elements of size == 1 in a contiguous chunk
+ //!Allocates many elements of size == 1 in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -471,9 +471,14 @@
void deallocate_individual(multiallocation_iterator it)
{ node_pool<0>::get(this->derived()->get_node_pool())->deallocate_nodes(it.base()); }
- //!Deallocates all free chunks of the pool
+ //!Deallocates all free blocks of the pool
+ void deallocate_free_blocks()
+ { node_pool<0>::get(this->derived()->get_node_pool())->deallocate_free_blocks(); }
+
+ //!Deprecated, use deallocate_free_blocks.
+ //!Deallocates all free chunks of the pool.
void deallocate_free_chunks()
- { node_pool<0>::get(this->derived()->get_node_pool())->deallocate_free_chunks(); }
+ { node_pool<0>::get(this->derived()->get_node_pool())->deallocate_free_blocks(); }
};
template<class T, class NodePool, unsigned int Version>
@@ -576,7 +581,7 @@
pointer allocate_one()
{ return pointer(static_cast<value_type*>(this->m_cache.cached_allocation())); }
- //!Allocates many elements of size == 1 in a contiguous chunk
+ //!Allocates many elements of size == 1 in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -591,7 +596,7 @@
void deallocate_one(const pointer &p)
{ this->m_cache.cached_deallocation(detail::get_pointer(p)); }
- //!Allocates many elements of size == 1 in a contiguous chunk
+ //!Allocates many elements of size == 1 in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -600,9 +605,9 @@
void deallocate_individual(multiallocation_iterator it)
{ m_cache.cached_deallocation(it.base()); }
- //!Deallocates all free chunks of the pool
- void deallocate_free_chunks()
- { m_cache.get_node_pool()->deallocate_free_chunks(); }
+ //!Deallocates all free blocks of the pool
+ void deallocate_free_blocks()
+ { m_cache.get_node_pool()->deallocate_free_blocks(); }
//!Swaps allocators. Does not throw. If each allocator is placed in a
//!different shared memory segments, the result is undefined.
@@ -616,6 +621,10 @@
void deallocate_cache()
{ m_cache.deallocate_all_cached_nodes(); }
+ //!Deprecated use deallocate_free_blocks.
+ void deallocate_free_chunks()
+ { m_cache.get_node_pool()->deallocate_free_blocks(); }
+
/// @cond
private:
cache_impl<node_pool_t> m_cache;
@@ -639,7 +648,7 @@
//!Pooled shared memory allocator using adaptive pool. Includes
//!a reference count but the class does not delete itself, this is
//!responsibility of user classes. Node size (NodeSize) and the number of
-//!nodes allocated per chunk (NodesPerChunk) are known at compile time
+//!nodes allocated per block (NodesPerBlock) are known at compile time
template<class private_node_allocator_t>
class shared_pool_impl
: public private_node_allocator_t
@@ -661,7 +670,7 @@
: private_node_allocator_t(segment_mngr)
{}
- //!Destructor. Deallocates all allocated chunks. Never throws
+ //!Destructor. Deallocates all allocated blocks. Never throws
~shared_pool_impl()
{}
@@ -730,24 +739,24 @@
private_node_allocator_t::deallocate_nodes(it);
}
- //!Deallocates all the free chunks of memory. Never throws
- void deallocate_free_chunks()
+ //!Deallocates all the free blocks of memory. Never throws
+ void deallocate_free_blocks()
{
//-----------------------
boost::interprocess::scoped_lock<mutex_type> guard(m_header);
//-----------------------
- private_node_allocator_t::deallocate_free_chunks();
+ private_node_allocator_t::deallocate_free_blocks();
}
//!Deallocates all used memory from the common pool.
//!Precondition: all nodes allocated from this pool should
//!already be deallocated. Otherwise, undefined behavior. Never throws
- void purge_chunks()
+ void purge_blocks()
{
//-----------------------
boost::interprocess::scoped_lock<mutex_type> guard(m_header);
//-----------------------
- private_node_allocator_t::purge_chunks();
+ private_node_allocator_t::purge_blocks();
}
//!Increments internal reference count and returns new count. Never throws
@@ -769,6 +778,24 @@
return --m_header.m_usecount;
}
+ //!Deprecated, use deallocate_free_blocks.
+ void deallocate_free_chunks()
+ {
+ //-----------------------
+ boost::interprocess::scoped_lock<mutex_type> guard(m_header);
+ //-----------------------
+ private_node_allocator_t::deallocate_free_blocks();
+ }
+
+ //!Deprecated, use purge_blocks.
+ void purge_chunks()
+ {
+ //-----------------------
+ boost::interprocess::scoped_lock<mutex_type> guard(m_header);
+ //-----------------------
+ private_node_allocator_t::purge_blocks();
+ }
+
private:
//!This struct includes needed data and derives from
//!interprocess_mutex to allow EBO when using null_mutex
Modified: branches/proto/v4/boost/interprocess/allocators/detail/node_pool.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/allocators/detail/node_pool.hpp (original)
+++ branches/proto/v4/boost/interprocess/allocators/detail/node_pool.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -60,30 +60,30 @@
typedef typename bi::make_slist
< node_t, bi::base_hook<slist_hook_t>
, bi::linear<true>
- , bi::constant_time_size<false> >::type chunkslist_t;
+ , bi::constant_time_size<false> >::type blockslist_t;
public:
//!Segment manager typedef
typedef SegmentManagerBase segment_manager_base_type;
//!Constructor from a segment manager. Never throws
- private_node_pool_impl(segment_manager_base_type *segment_mngr_base, std::size_t node_size, std::size_t nodes_per_chunk)
- : m_nodes_per_chunk(nodes_per_chunk)
+ private_node_pool_impl(segment_manager_base_type *segment_mngr_base, std::size_t node_size, std::size_t nodes_per_block)
+ : m_nodes_per_block(nodes_per_block)
, m_real_node_size(detail::lcm(node_size, std::size_t(alignment_of<node_t>::value)))
//General purpose allocator
, mp_segment_mngr_base(segment_mngr_base)
- , m_chunklist()
+ , m_blocklist()
, m_freelist()
//Debug node count
, m_allocated(0)
{}
- //!Destructor. Deallocates all allocated chunks. Never throws
+ //!Destructor. Deallocates all allocated blocks. Never throws
~private_node_pool_impl()
- { this->purge_chunks(); }
+ { this->purge_blocks(); }
std::size_t get_real_num_node() const
- { return m_nodes_per_chunk; }
+ { return m_nodes_per_block; }
//!Returns the segment manager. Never throws
segment_manager_base_type* get_segment_manager_base()const
@@ -94,7 +94,7 @@
{
//If there are no free nodes we allocate a new block
if (m_freelist.empty())
- priv_alloc_chunk();
+ priv_alloc_block();
//We take the first free node
node_t *n = (node_t*)&m_freelist.front();
m_freelist.pop_front();
@@ -173,36 +173,36 @@
}
}
- //!Deallocates all the free chunks of memory. Never throws
- void deallocate_free_chunks()
+ //!Deallocates all the free blocks of memory. Never throws
+ void deallocate_free_blocks()
{
typedef typename free_nodes_t::iterator nodelist_iterator;
- typename chunkslist_t::iterator bit(m_chunklist.before_begin()),
- it(m_chunklist.begin()),
- itend(m_chunklist.end());
+ typename blockslist_t::iterator bit(m_blocklist.before_begin()),
+ it(m_blocklist.begin()),
+ itend(m_blocklist.end());
free_nodes_t backup_list;
nodelist_iterator backup_list_last = backup_list.before_begin();
//Execute the algorithm and get an iterator to the last value
std::size_t blocksize = detail::get_rounded_size
- (m_real_node_size*m_nodes_per_chunk, alignment_of<node_t>::value);
+ (m_real_node_size*m_nodes_per_block, alignment_of<node_t>::value);
while(it != itend){
- //Collect all the nodes from the chunk pointed by it
+ //Collect all the nodes from the block pointed by it
//and push them in the list
free_nodes_t free_nodes;
nodelist_iterator last_it = free_nodes.before_begin();
- const void *addr = get_chunk_from_hook(&*it, blocksize);
+ const void *addr = get_block_from_hook(&*it, blocksize);
m_freelist.remove_and_dispose_if
(is_between(addr, blocksize), push_in_list(free_nodes, last_it));
- //If the number of nodes is equal to m_nodes_per_chunk
+ //If the number of nodes is equal to m_nodes_per_block
//this means that the block can be deallocated
- if(free_nodes.size() == m_nodes_per_chunk){
+ if(free_nodes.size() == m_nodes_per_block){
//Unlink the nodes
free_nodes.clear();
- it = m_chunklist.erase_after(bit);
+ it = m_blocklist.erase_after(bit);
mp_segment_mngr_base->deallocate((void*)addr);
}
//Otherwise, insert them in the backup list, since the
@@ -240,19 +240,19 @@
//!Deallocates all used memory. Precondition: all nodes allocated from this pool should
//!already be deallocated. Otherwise, undefined behaviour. Never throws
- void purge_chunks()
+ void purge_blocks()
{
//check for memory leaks
assert(m_allocated==0);
std::size_t blocksize = detail::get_rounded_size
- (m_real_node_size*m_nodes_per_chunk, alignment_of<node_t>::value);
- typename chunkslist_t::iterator
- it(m_chunklist.begin()), itend(m_chunklist.end()), aux;
+ (m_real_node_size*m_nodes_per_block, alignment_of<node_t>::value);
+ typename blockslist_t::iterator
+ it(m_blocklist.begin()), itend(m_blocklist.end()), aux;
//We iterate though the NodeBlock list to free the memory
- while(!m_chunklist.empty()){
- void *addr = get_chunk_from_hook(&m_chunklist.front(), blocksize);
- m_chunklist.pop_front();
+ while(!m_blocklist.empty()){
+ void *addr = get_block_from_hook(&m_blocklist.front(), blocksize);
+ m_blocklist.pop_front();
mp_segment_mngr_base->deallocate((void*)addr);
}
//Just clear free node list
@@ -262,7 +262,7 @@
void swap(private_node_pool_impl &other)
{
std::swap(mp_segment_mngr_base, other.mp_segment_mngr_base);
- m_chunklist.swap(other.m_chunklist);
+ m_blocklist.swap(other.m_blocklist);
m_freelist.swap(other.m_freelist);
std::swap(m_allocated, other.m_allocated);
}
@@ -305,36 +305,44 @@
const char * end_;
};
- //!Allocates a chunk of nodes. Can throw boost::interprocess::bad_alloc
- void priv_alloc_chunk()
+ //!Allocates a block of nodes. Can throw boost::interprocess::bad_alloc
+ void priv_alloc_block()
{
//We allocate a new NodeBlock and put it as first
//element in the free Node list
std::size_t blocksize =
- detail::get_rounded_size(m_real_node_size*m_nodes_per_chunk, alignment_of<node_t>::value);
+ detail::get_rounded_size(m_real_node_size*m_nodes_per_block, alignment_of<node_t>::value);
char *pNode = detail::char_ptr_cast
(mp_segment_mngr_base->allocate(blocksize + sizeof(node_t)));
if(!pNode) throw bad_alloc();
char *pBlock = pNode;
- m_chunklist.push_front(get_chunk_hook(pBlock, blocksize));
+ m_blocklist.push_front(get_block_hook(pBlock, blocksize));
//We initialize all Nodes in Node Block to insert
//them in the free Node list
- for(std::size_t i = 0; i < m_nodes_per_chunk; ++i, pNode += m_real_node_size){
+ for(std::size_t i = 0; i < m_nodes_per_block; ++i, pNode += m_real_node_size){
m_freelist.push_front(*new (pNode) node_t);
}
}
+ //!Deprecated, use deallocate_free_blocks
+ void deallocate_free_chunks()
+ { this->deallocate_free_blocks(); }
+
+ //!Deprecated, use purge_blocks
+ void purge_chunks()
+ { this->purge_blocks()(); }
+
private:
- //!Returns a reference to the chunk hook placed in the end of the chunk
- static inline node_t & get_chunk_hook (void *chunk, std::size_t blocksize)
+ //!Returns a reference to the block hook placed in the end of the block
+ static inline node_t & get_block_hook (void *block, std::size_t blocksize)
{
return *static_cast<node_t*>(
- static_cast<void*>((detail::char_ptr_cast(chunk) + blocksize)));
+ static_cast<void*>((detail::char_ptr_cast(block) + blocksize)));
}
- //!Returns the starting address of the chunk reference to the chunk hook placed in the end of the chunk
- inline void *get_chunk_from_hook (node_t *hook, std::size_t blocksize)
+ //!Returns the starting address of the block reference to the block hook placed in the end of the block
+ inline void *get_block_from_hook (node_t *hook, std::size_t blocksize)
{
return static_cast<void*>((detail::char_ptr_cast(hook) - blocksize));
}
@@ -343,10 +351,10 @@
typedef typename pointer_to_other
<void_pointer, segment_manager_base_type>::type segment_mngr_base_ptr_t;
- const std::size_t m_nodes_per_chunk;
+ const std::size_t m_nodes_per_block;
const std::size_t m_real_node_size;
segment_mngr_base_ptr_t mp_segment_mngr_base; //Segment manager
- chunkslist_t m_chunklist; //Intrusive container of chunks
+ blockslist_t m_blocklist; //Intrusive container of blocks
free_nodes_t m_freelist; //Intrusive container of free nods
std::size_t m_allocated; //Used nodes for debugging
};
@@ -355,8 +363,8 @@
//!Pooled shared memory allocator using single segregated storage. Includes
//!a reference count but the class does not delete itself, this is
//!responsibility of user classes. Node size (NodeSize) and the number of
-//!nodes allocated per chunk (NodesPerChunk) are known at compile time
-template< class SegmentManager, std::size_t NodeSize, std::size_t NodesPerChunk >
+//!nodes allocated per block (NodesPerBlock) are known at compile time
+template< class SegmentManager, std::size_t NodeSize, std::size_t NodesPerBlock >
class private_node_pool
//Inherit from the implementation to avoid template bloat
: public private_node_pool_impl<typename SegmentManager::segment_manager_base_type>
@@ -370,11 +378,13 @@
public:
typedef SegmentManager segment_manager;
- static const std::size_t nodes_per_chunk = NodesPerChunk;
+ static const std::size_t nodes_per_block = NodesPerBlock;
+ //Deprecated, use nodes_per_block
+ static const std::size_t nodes_per_chunk = NodesPerBlock;
//!Constructor from a segment manager. Never throws
private_node_pool(segment_manager *segment_mngr)
- : base_t(segment_mngr, NodeSize, NodesPerChunk)
+ : base_t(segment_mngr, NodeSize, NodesPerBlock)
{}
//!Returns the segment manager. Never throws
@@ -386,24 +396,24 @@
//!Pooled shared memory allocator using single segregated storage. Includes
//!a reference count but the class does not delete itself, this is
//!responsibility of user classes. Node size (NodeSize) and the number of
-//!nodes allocated per chunk (NodesPerChunk) are known at compile time
+//!nodes allocated per block (NodesPerBlock) are known at compile time
//!Pooled shared memory allocator using adaptive pool. Includes
//!a reference count but the class does not delete itself, this is
//!responsibility of user classes. Node size (NodeSize) and the number of
-//!nodes allocated per chunk (NodesPerChunk) are known at compile time
+//!nodes allocated per block (NodesPerBlock) are known at compile time
template< class SegmentManager
, std::size_t NodeSize
- , std::size_t NodesPerChunk
+ , std::size_t NodesPerBlock
>
class shared_node_pool
: public detail::shared_pool_impl
< private_node_pool
- <SegmentManager, NodeSize, NodesPerChunk>
+ <SegmentManager, NodeSize, NodesPerBlock>
>
{
typedef detail::shared_pool_impl
< private_node_pool
- <SegmentManager, NodeSize, NodesPerChunk>
+ <SegmentManager, NodeSize, NodesPerBlock>
> base_t;
public:
shared_node_pool(SegmentManager *segment_mgnr)
Modified: branches/proto/v4/boost/interprocess/allocators/node_allocator.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/allocators/node_allocator.hpp (original)
+++ branches/proto/v4/boost/interprocess/allocators/node_allocator.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -43,12 +43,12 @@
template < unsigned int Version
, class T
, class SegmentManager
- , std::size_t NodesPerChunk
+ , std::size_t NodesPerBlock
>
class node_allocator_base
: public node_pool_allocation_impl
< node_allocator_base
- < Version, T, SegmentManager, NodesPerChunk>
+ < Version, T, SegmentManager, NodesPerBlock>
, Version
, T
, SegmentManager
@@ -58,7 +58,7 @@
typedef typename SegmentManager::void_pointer void_pointer;
typedef SegmentManager segment_manager;
typedef node_allocator_base
- <Version, T, SegmentManager, NodesPerChunk> self_t;
+ <Version, T, SegmentManager, NodesPerBlock> self_t;
/// @cond
@@ -66,7 +66,7 @@
struct node_pool
{
typedef detail::shared_node_pool
- < SegmentManager, sizeof(T), NodesPerChunk> type;
+ < SegmentManager, sizeof(T), NodesPerBlock> type;
static type *get(void *p)
{ return static_cast<type*>(p); }
@@ -102,7 +102,7 @@
template<class T2>
struct rebind
{
- typedef node_allocator_base<Version, T2, SegmentManager, NodesPerChunk> other;
+ typedef node_allocator_base<Version, T2, SegmentManager, NodesPerBlock> other;
};
/// @cond
@@ -136,7 +136,7 @@
//!Can throw boost::interprocess::bad_alloc
template<class T2>
node_allocator_base
- (const node_allocator_base<Version, T2, SegmentManager, NodesPerChunk> &other)
+ (const node_allocator_base<Version, T2, SegmentManager, NodesPerBlock> &other)
: mp_node_pool(detail::get_or_create_node_pool<typename node_pool<0>::type>(other.get_segment_manager())) { }
//!Assignment from other node_allocator_base
@@ -189,24 +189,24 @@
template < class T
, class SegmentManager
- , std::size_t NodesPerChunk = 64
+ , std::size_t NodesPerBlock = 64
>
class node_allocator_v1
: public node_allocator_base
< 1
, T
, SegmentManager
- , NodesPerChunk
+ , NodesPerBlock
>
{
public:
typedef detail::node_allocator_base
- < 1, T, SegmentManager, NodesPerChunk> base_t;
+ < 1, T, SegmentManager, NodesPerBlock> base_t;
template<class T2>
struct rebind
{
- typedef node_allocator_v1<T2, SegmentManager, NodesPerChunk> other;
+ typedef node_allocator_v1<T2, SegmentManager, NodesPerBlock> other;
};
node_allocator_v1(SegmentManager *segment_mngr)
@@ -215,7 +215,7 @@
template<class T2>
node_allocator_v1
- (const node_allocator_v1<T2, SegmentManager, NodesPerChunk> &other)
+ (const node_allocator_v1<T2, SegmentManager, NodesPerBlock> &other)
: base_t(other)
{}
};
@@ -230,11 +230,11 @@
//!placing the allocator in shared memory, memory mapped-files, etc...
//!This node allocator shares a segregated storage between all instances
//!of node_allocator with equal sizeof(T) placed in the same segment
-//!group. NodesPerChunk is the number of nodes allocated at once when the allocator
+//!group. NodesPerBlock is the number of nodes allocated at once when the allocator
//!needs runs out of nodes
template < class T
, class SegmentManager
- , std::size_t NodesPerChunk
+ , std::size_t NodesPerBlock
>
class node_allocator
/// @cond
@@ -242,21 +242,21 @@
< 2
, T
, SegmentManager
- , NodesPerChunk
+ , NodesPerBlock
>
/// @endcond
{
#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
typedef detail::node_allocator_base
- < 2, T, SegmentManager, NodesPerChunk> base_t;
+ < 2, T, SegmentManager, NodesPerBlock> base_t;
public:
typedef detail::version_type<node_allocator, 2> version;
template<class T2>
struct rebind
{
- typedef node_allocator<T2, SegmentManager, NodesPerChunk> other;
+ typedef node_allocator<T2, SegmentManager, NodesPerBlock> other;
};
node_allocator(SegmentManager *segment_mngr)
@@ -265,7 +265,7 @@
template<class T2>
node_allocator
- (const node_allocator<T2, SegmentManager, NodesPerChunk> &other)
+ (const node_allocator<T2, SegmentManager, NodesPerBlock> &other)
: base_t(other)
{}
@@ -288,7 +288,7 @@
template<class T2>
struct rebind
{
- typedef node_allocator<T2, SegmentManager, NodesPerChunk> other;
+ typedef node_allocator<T2, SegmentManager, NodesPerBlock> other;
};
private:
@@ -317,7 +317,7 @@
//!Can throw boost::interprocess::bad_alloc
template<class T2>
node_allocator
- (const node_allocator<T2, SegmentManager, NodesPerChunk> &other);
+ (const node_allocator<T2, SegmentManager, NodesPerBlock> &other);
//!Destructor, removes node_pool_t from memory
//!if its reference count reaches to zero. Never throws
@@ -343,9 +343,9 @@
//!Never throws
void deallocate(const pointer &ptr, size_type count);
- //!Deallocates all free chunks
+ //!Deallocates all free blocks
//!of the pool
- void deallocate_free_chunks();
+ void deallocate_free_blocks();
//!Swaps allocators. Does not throw. If each allocator is placed in a
//!different memory segment, the result is undefined.
@@ -378,7 +378,7 @@
size_type preferred_size,
size_type &received_size, const pointer &reuse = 0);
- //!Allocates many elements of size elem_size in a contiguous chunk
+ //!Allocates many elements of size elem_size in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -387,11 +387,11 @@
multiallocation_iterator allocate_many(size_type elem_size, std::size_t num_elements);
//!Allocates n_elements elements, each one of size elem_sizes[i]in a
- //!contiguous chunk
+ //!contiguous block
//!of memory. The elements must be deallocated
multiallocation_iterator allocate_many(const size_type *elem_sizes, size_type n_elements);
- //!Allocates many elements of size elem_size in a contiguous chunk
+ //!Allocates many elements of size elem_size in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -404,7 +404,7 @@
//!Throws boost::interprocess::bad_alloc if there is no enough memory
pointer allocate_one();
- //!Allocates many elements of size == 1 in a contiguous chunk
+ //!Allocates many elements of size == 1 in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -417,7 +417,7 @@
//!with other functions different from allocate_one(). Never throws
void deallocate_one(const pointer &p);
- //!Allocates many elements of size == 1 in a contiguous chunk
+ //!Allocates many elements of size == 1 in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
Modified: branches/proto/v4/boost/interprocess/allocators/private_adaptive_pool.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/allocators/private_adaptive_pool.hpp (original)
+++ branches/proto/v4/boost/interprocess/allocators/private_adaptive_pool.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -42,14 +42,14 @@
template < unsigned int Version
, class T
, class SegmentManager
- , std::size_t NodesPerChunk
- , std::size_t MaxFreeChunks
+ , std::size_t NodesPerBlock
+ , std::size_t MaxFreeBlocks
, unsigned char OverheadPercent
>
class private_adaptive_pool_base
: public node_pool_allocation_impl
- < private_adaptive_pool_base < Version, T, SegmentManager, NodesPerChunk
- , MaxFreeChunks, OverheadPercent>
+ < private_adaptive_pool_base < Version, T, SegmentManager, NodesPerBlock
+ , MaxFreeBlocks, OverheadPercent>
, Version
, T
, SegmentManager
@@ -63,13 +63,13 @@
/// @cond
private:
typedef private_adaptive_pool_base
- < Version, T, SegmentManager, NodesPerChunk
- , MaxFreeChunks, OverheadPercent> self_t;
+ < Version, T, SegmentManager, NodesPerBlock
+ , MaxFreeBlocks, OverheadPercent> self_t;
typedef detail::private_adaptive_node_pool
<SegmentManager
, sizeof(T)
- , NodesPerChunk
- , MaxFreeChunks
+ , NodesPerBlock
+ , MaxFreeBlocks
, OverheadPercent
> node_pool_t;
@@ -103,7 +103,7 @@
struct rebind
{
typedef private_adaptive_pool_base
- <Version, T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> other;
+ <Version, T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> other;
};
/// @cond
@@ -114,8 +114,8 @@
typedef detail::private_adaptive_node_pool
<SegmentManager
, sizeof(T)
- , NodesPerChunk
- , MaxFreeChunks
+ , NodesPerBlock
+ , MaxFreeBlocks
, OverheadPercent
> type;
@@ -148,7 +148,7 @@
template<class T2>
private_adaptive_pool_base
(const private_adaptive_pool_base
- <Version, T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> &other)
+ <Version, T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> &other)
: m_node_pool(other.get_segment_manager())
{}
@@ -176,21 +176,21 @@
};
//!Equality test for same type of private_adaptive_pool_base
-template<unsigned int V, class T, class S, std::size_t NodesPerChunk, std::size_t F, unsigned char OP> inline
-bool operator==(const private_adaptive_pool_base<V, T, S, NodesPerChunk, F, OP> &alloc1,
- const private_adaptive_pool_base<V, T, S, NodesPerChunk, F, OP> &alloc2)
+template<unsigned int V, class T, class S, std::size_t NodesPerBlock, std::size_t F, unsigned char OP> inline
+bool operator==(const private_adaptive_pool_base<V, T, S, NodesPerBlock, F, OP> &alloc1,
+ const private_adaptive_pool_base<V, T, S, NodesPerBlock, F, OP> &alloc2)
{ return &alloc1 == &alloc2; }
//!Inequality test for same type of private_adaptive_pool_base
-template<unsigned int V, class T, class S, std::size_t NodesPerChunk, std::size_t F, unsigned char OP> inline
-bool operator!=(const private_adaptive_pool_base<V, T, S, NodesPerChunk, F, OP> &alloc1,
- const private_adaptive_pool_base<V, T, S, NodesPerChunk, F, OP> &alloc2)
+template<unsigned int V, class T, class S, std::size_t NodesPerBlock, std::size_t F, unsigned char OP> inline
+bool operator!=(const private_adaptive_pool_base<V, T, S, NodesPerBlock, F, OP> &alloc1,
+ const private_adaptive_pool_base<V, T, S, NodesPerBlock, F, OP> &alloc2)
{ return &alloc1 != &alloc2; }
template < class T
, class SegmentManager
- , std::size_t NodesPerChunk = 64
- , std::size_t MaxFreeChunks = 2
+ , std::size_t NodesPerBlock = 64
+ , std::size_t MaxFreeBlocks = 2
, unsigned char OverheadPercent = 5
>
class private_adaptive_pool_v1
@@ -198,19 +198,19 @@
< 1
, T
, SegmentManager
- , NodesPerChunk
- , MaxFreeChunks
+ , NodesPerBlock
+ , MaxFreeBlocks
, OverheadPercent
>
{
public:
typedef detail::private_adaptive_pool_base
- < 1, T, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> base_t;
+ < 1, T, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> base_t;
template<class T2>
struct rebind
{
- typedef private_adaptive_pool_v1<T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> other;
+ typedef private_adaptive_pool_v1<T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> other;
};
private_adaptive_pool_v1(SegmentManager *segment_mngr)
@@ -219,7 +219,7 @@
template<class T2>
private_adaptive_pool_v1
- (const private_adaptive_pool_v1<T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> &other)
+ (const private_adaptive_pool_v1<T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> &other)
: base_t(other)
{}
};
@@ -234,17 +234,17 @@
//!placing the allocator in shared memory, memory mapped-files, etc...
//!This allocator has its own node pool.
//!
-//!NodesPerChunk is the minimum number of nodes of nodes allocated at once when
-//!the allocator needs runs out of nodes. MaxFreeChunks is the maximum number of totally free chunks
-//!that the adaptive node pool will hold. The rest of the totally free chunks will be
+//!NodesPerBlock is the minimum number of nodes of nodes allocated at once when
+//!the allocator needs runs out of nodes. MaxFreeBlocks is the maximum number of totally free blocks
+//!that the adaptive node pool will hold. The rest of the totally free blocks will be
//!deallocated with the segment manager.
//!
//!OverheadPercent is the (approximated) maximum size overhead (1-20%) of the allocator:
//!(memory usable for nodes / total memory allocated from the segment manager)
template < class T
, class SegmentManager
- , std::size_t NodesPerChunk
- , std::size_t MaxFreeChunks
+ , std::size_t NodesPerBlock
+ , std::size_t MaxFreeBlocks
, unsigned char OverheadPercent
>
class private_adaptive_pool
@@ -253,8 +253,8 @@
< 2
, T
, SegmentManager
- , NodesPerChunk
- , MaxFreeChunks
+ , NodesPerBlock
+ , MaxFreeBlocks
, OverheadPercent
>
/// @endcond
@@ -262,7 +262,7 @@
#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
typedef detail::private_adaptive_pool_base
- < 2, T, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> base_t;
+ < 2, T, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> base_t;
public:
typedef detail::version_type<private_adaptive_pool, 2> version;
@@ -270,7 +270,7 @@
struct rebind
{
typedef private_adaptive_pool
- <T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> other;
+ <T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> other;
};
private_adaptive_pool(SegmentManager *segment_mngr)
@@ -279,7 +279,7 @@
template<class T2>
private_adaptive_pool
- (const private_adaptive_pool<T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> &other)
+ (const private_adaptive_pool<T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> &other)
: base_t(other)
{}
@@ -303,7 +303,7 @@
struct rebind
{
typedef private_adaptive_pool
- <T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> other;
+ <T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> other;
};
private:
@@ -332,7 +332,7 @@
//!Can throw boost::interprocess::bad_alloc
template<class T2>
private_adaptive_pool
- (const private_adaptive_pool<T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> &other);
+ (const private_adaptive_pool<T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> &other);
//!Destructor, removes node_pool_t from memory
//!if its reference count reaches to zero. Never throws
@@ -358,9 +358,9 @@
//!Never throws
void deallocate(const pointer &ptr, size_type count);
- //!Deallocates all free chunks
+ //!Deallocates all free blocks
//!of the pool
- void deallocate_free_chunks();
+ void deallocate_free_blocks();
//!Swaps allocators. Does not throw. If each allocator is placed in a
//!different memory segment, the result is undefined.
@@ -393,7 +393,7 @@
size_type preferred_size,
size_type &received_size, const pointer &reuse = 0);
- //!Allocates many elements of size elem_size in a contiguous chunk
+ //!Allocates many elements of size elem_size in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -402,11 +402,11 @@
multiallocation_iterator allocate_many(size_type elem_size, std::size_t num_elements);
//!Allocates n_elements elements, each one of size elem_sizes[i]in a
- //!contiguous chunk
+ //!contiguous block
//!of memory. The elements must be deallocated
multiallocation_iterator allocate_many(const size_type *elem_sizes, size_type n_elements);
- //!Allocates many elements of size elem_size in a contiguous chunk
+ //!Allocates many elements of size elem_size in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -419,7 +419,7 @@
//!Throws boost::interprocess::bad_alloc if there is no enough memory
pointer allocate_one();
- //!Allocates many elements of size == 1 in a contiguous chunk
+ //!Allocates many elements of size == 1 in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -432,7 +432,7 @@
//!with other functions different from allocate_one(). Never throws
void deallocate_one(const pointer &p);
- //!Allocates many elements of size == 1 in a contiguous chunk
+ //!Allocates many elements of size == 1 in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -446,15 +446,15 @@
//!Equality test for same type
//!of private_adaptive_pool
-template<class T, class S, std::size_t NodesPerChunk, std::size_t F, unsigned char OP> inline
-bool operator==(const private_adaptive_pool<T, S, NodesPerChunk, F, OP> &alloc1,
- const private_adaptive_pool<T, S, NodesPerChunk, F, OP> &alloc2);
+template<class T, class S, std::size_t NodesPerBlock, std::size_t F, unsigned char OP> inline
+bool operator==(const private_adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc1,
+ const private_adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc2);
//!Inequality test for same type
//!of private_adaptive_pool
-template<class T, class S, std::size_t NodesPerChunk, std::size_t F, unsigned char OP> inline
-bool operator!=(const private_adaptive_pool<T, S, NodesPerChunk, F, OP> &alloc1,
- const private_adaptive_pool<T, S, NodesPerChunk, F, OP> &alloc2);
+template<class T, class S, std::size_t NodesPerBlock, std::size_t F, unsigned char OP> inline
+bool operator!=(const private_adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc1,
+ const private_adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc2);
#endif
Modified: branches/proto/v4/boost/interprocess/allocators/private_node_allocator.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/allocators/private_node_allocator.hpp (original)
+++ branches/proto/v4/boost/interprocess/allocators/private_node_allocator.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -8,16 +8,6 @@
//
//////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-//
-// (C) Copyright Ion Gaztanaga 2005-2008. Distributed under the Boost
-// Software License, Version 1.0. (See accompanying file
-// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-// See http://www.boost.org/libs/interprocess for documentation.
-//
-//////////////////////////////////////////////////////////////////////////////
-
#ifndef BOOST_INTERPROCESS_PRIVATE_NODE_ALLOCATOR_HPP
#define BOOST_INTERPROCESS_PRIVATE_NODE_ALLOCATOR_HPP
@@ -52,11 +42,11 @@
template < unsigned int Version
, class T
, class SegmentManager
- , std::size_t NodesPerChunk
+ , std::size_t NodesPerBlock
>
class private_node_allocator_base
: public node_pool_allocation_impl
- < private_node_allocator_base < Version, T, SegmentManager, NodesPerChunk>
+ < private_node_allocator_base < Version, T, SegmentManager, NodesPerBlock>
, Version
, T
, SegmentManager
@@ -70,11 +60,11 @@
/// @cond
private:
typedef private_node_allocator_base
- < Version, T, SegmentManager, NodesPerChunk> self_t;
+ < Version, T, SegmentManager, NodesPerBlock> self_t;
typedef detail::private_node_pool
<SegmentManager
, sizeof(T)
- , NodesPerChunk
+ , NodesPerBlock
> node_pool_t;
BOOST_STATIC_ASSERT((Version <=2));
@@ -107,7 +97,7 @@
struct rebind
{
typedef private_node_allocator_base
- <Version, T2, SegmentManager, NodesPerChunk> other;
+ <Version, T2, SegmentManager, NodesPerBlock> other;
};
/// @cond
@@ -117,7 +107,7 @@
typedef detail::private_node_pool
<SegmentManager
, sizeof(T)
- , NodesPerChunk
+ , NodesPerBlock
> type;
static type *get(void *p)
@@ -149,7 +139,7 @@
template<class T2>
private_node_allocator_base
(const private_node_allocator_base
- <Version, T2, SegmentManager, NodesPerChunk> &other)
+ <Version, T2, SegmentManager, NodesPerBlock> &other)
: m_node_pool(other.get_segment_manager())
{}
@@ -190,24 +180,24 @@
template < class T
, class SegmentManager
- , std::size_t NodesPerChunk = 64
+ , std::size_t NodesPerBlock = 64
>
class private_node_allocator_v1
: public private_node_allocator_base
< 1
, T
, SegmentManager
- , NodesPerChunk
+ , NodesPerBlock
>
{
public:
typedef detail::private_node_allocator_base
- < 1, T, SegmentManager, NodesPerChunk> base_t;
+ < 1, T, SegmentManager, NodesPerBlock> base_t;
template<class T2>
struct rebind
{
- typedef private_node_allocator_v1<T2, SegmentManager, NodesPerChunk> other;
+ typedef private_node_allocator_v1<T2, SegmentManager, NodesPerBlock> other;
};
private_node_allocator_v1(SegmentManager *segment_mngr)
@@ -216,7 +206,7 @@
template<class T2>
private_node_allocator_v1
- (const private_node_allocator_v1<T2, SegmentManager, NodesPerChunk> &other)
+ (const private_node_allocator_v1<T2, SegmentManager, NodesPerBlock> &other)
: base_t(other)
{}
};
@@ -229,11 +219,11 @@
//!source. The internal pointer type will of the same type (raw, smart) as
//!"typename SegmentManager::void_pointer" type. This allows
//!placing the allocator in shared memory, memory mapped-files, etc...
-//!This allocator has its own node pool. NodesPerChunk is the number of nodes allocated
+//!This allocator has its own node pool. NodesPerBlock is the number of nodes allocated
//!at once when the allocator needs runs out of nodes
template < class T
, class SegmentManager
- , std::size_t NodesPerChunk
+ , std::size_t NodesPerBlock
>
class private_node_allocator
/// @cond
@@ -241,14 +231,14 @@
< 2
, T
, SegmentManager
- , NodesPerChunk
+ , NodesPerBlock
>
/// @endcond
{
#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
typedef detail::private_node_allocator_base
- < 2, T, SegmentManager, NodesPerChunk> base_t;
+ < 2, T, SegmentManager, NodesPerBlock> base_t;
public:
typedef detail::version_type<private_node_allocator, 2> version;
@@ -256,7 +246,7 @@
struct rebind
{
typedef private_node_allocator
- <T2, SegmentManager, NodesPerChunk> other;
+ <T2, SegmentManager, NodesPerBlock> other;
};
private_node_allocator(SegmentManager *segment_mngr)
@@ -265,7 +255,7 @@
template<class T2>
private_node_allocator
- (const private_node_allocator<T2, SegmentManager, NodesPerChunk> &other)
+ (const private_node_allocator<T2, SegmentManager, NodesPerBlock> &other)
: base_t(other)
{}
@@ -289,7 +279,7 @@
struct rebind
{
typedef private_node_allocator
- <T2, SegmentManager, NodesPerChunk> other;
+ <T2, SegmentManager, NodesPerBlock> other;
};
private:
@@ -318,7 +308,7 @@
//!Can throw boost::interprocess::bad_alloc
template<class T2>
private_node_allocator
- (const private_node_allocator<T2, SegmentManager, NodesPerChunk> &other);
+ (const private_node_allocator<T2, SegmentManager, NodesPerBlock> &other);
//!Destructor, removes node_pool_t from memory
//!if its reference count reaches to zero. Never throws
@@ -344,9 +334,9 @@
//!Never throws
void deallocate(const pointer &ptr, size_type count);
- //!Deallocates all free chunks
+ //!Deallocates all free blocks
//!of the pool
- void deallocate_free_chunks();
+ void deallocate_free_blocks();
//!Swaps allocators. Does not throw. If each allocator is placed in a
//!different memory segment, the result is undefined.
@@ -379,7 +369,7 @@
size_type preferred_size,
size_type &received_size, const pointer &reuse = 0);
- //!Allocates many elements of size elem_size in a contiguous chunk
+ //!Allocates many elements of size elem_size in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -388,11 +378,11 @@
multiallocation_iterator allocate_many(size_type elem_size, std::size_t num_elements);
//!Allocates n_elements elements, each one of size elem_sizes[i]in a
- //!contiguous chunk
+ //!contiguous block
//!of memory. The elements must be deallocated
multiallocation_iterator allocate_many(const size_type *elem_sizes, size_type n_elements);
- //!Allocates many elements of size elem_size in a contiguous chunk
+ //!Allocates many elements of size elem_size in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -405,7 +395,7 @@
//!Throws boost::interprocess::bad_alloc if there is no enough memory
pointer allocate_one();
- //!Allocates many elements of size == 1 in a contiguous chunk
+ //!Allocates many elements of size == 1 in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -418,7 +408,7 @@
//!with other functions different from allocate_one(). Never throws
void deallocate_one(const pointer &p);
- //!Allocates many elements of size == 1 in a contiguous chunk
+ //!Allocates many elements of size == 1 in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
@@ -432,15 +422,15 @@
//!Equality test for same type
//!of private_node_allocator
-template<class T, class S, std::size_t NodesPerChunk, std::size_t F, unsigned char OP> inline
-bool operator==(const private_node_allocator<T, S, NodesPerChunk, F, OP> &alloc1,
- const private_node_allocator<T, S, NodesPerChunk, F, OP> &alloc2);
+template<class T, class S, std::size_t NodesPerBlock, std::size_t F, unsigned char OP> inline
+bool operator==(const private_node_allocator<T, S, NodesPerBlock, F, OP> &alloc1,
+ const private_node_allocator<T, S, NodesPerBlock, F, OP> &alloc2);
//!Inequality test for same type
//!of private_node_allocator
-template<class T, class S, std::size_t NodesPerChunk, std::size_t F, unsigned char OP> inline
-bool operator!=(const private_node_allocator<T, S, NodesPerChunk, F, OP> &alloc1,
- const private_node_allocator<T, S, NodesPerChunk, F, OP> &alloc2);
+template<class T, class S, std::size_t NodesPerBlock, std::size_t F, unsigned char OP> inline
+bool operator!=(const private_node_allocator<T, S, NodesPerBlock, F, OP> &alloc1,
+ const private_node_allocator<T, S, NodesPerBlock, F, OP> &alloc2);
#endif
Modified: branches/proto/v4/boost/interprocess/containers/detail/node_alloc_holder.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/containers/detail/node_alloc_holder.hpp (original)
+++ branches/proto/v4/boost/interprocess/containers/detail/node_alloc_holder.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -275,7 +275,7 @@
{
typedef typename NodeAlloc::multiallocation_iterator multiallocation_iterator;
- //Try to allocate memory in a single chunk
+ //Try to allocate memory in a single block
multiallocation_iterator itbeg =
this->node_alloc().allocate_individual(n), itend, itold;
int constructed = 0;
Modified: branches/proto/v4/boost/interprocess/containers/flat_map.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/containers/flat_map.hpp (original)
+++ branches/proto/v4/boost/interprocess/containers/flat_map.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -479,8 +479,8 @@
//!
//! <b>Note</b>: Invalidates elements with keys
//! not less than the erased element.
- void erase(const_iterator position)
- { m_flat_tree.erase(force<impl_const_iterator>(position)); }
+ iterator erase(const_iterator position)
+ { return force<iterator>(m_flat_tree.erase(force<impl_const_iterator>(position))); }
//! <b>Effects</b>: Erases all elements in the container with key equivalent to x.
//!
@@ -499,8 +499,8 @@
//!
//! <b>Complexity</b>: Logarithmic search time plus erasure time
//! linear to the elements with bigger keys.
- void erase(const_iterator first, const_iterator last)
- { m_flat_tree.erase(force<impl_const_iterator>(first), force<impl_const_iterator>(last)); }
+ iterator erase(const_iterator first, const_iterator last)
+ { return force<iterator>(m_flat_tree.erase(force<impl_const_iterator>(first), force<impl_const_iterator>(last))); }
//! <b>Effects</b>: erase(a.begin(),a.end()).
//!
@@ -1060,8 +1060,8 @@
//!
//! <b>Note</b>: Invalidates elements with keys
//! not less than the erased element.
- void erase(const_iterator position)
- { m_flat_tree.erase(force<impl_const_iterator>(position)); }
+ iterator erase(const_iterator position)
+ { return force<iterator>(m_flat_tree.erase(force<impl_const_iterator>(position))); }
//! <b>Effects</b>: Erases all elements in the container with key equivalent to x.
//!
@@ -1080,8 +1080,8 @@
//!
//! <b>Complexity</b>: Logarithmic search time plus erasure time
//! linear to the elements with bigger keys.
- void erase(const_iterator first, const_iterator last)
- { m_flat_tree.erase(force<impl_const_iterator>(first), force<impl_const_iterator>(last)); }
+ iterator erase(const_iterator first, const_iterator last)
+ { return force<iterator>(m_flat_tree.erase(force<impl_const_iterator>(first), force<impl_const_iterator>(last))); }
//! <b>Effects</b>: erase(a.begin(),a.end()).
//!
Modified: branches/proto/v4/boost/interprocess/containers/vector.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/containers/vector.hpp (original)
+++ branches/proto/v4/boost/interprocess/containers/vector.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -1148,8 +1148,15 @@
}
else{
size_type received_size;
- this->alloc().allocation_command(shrink_in_place, this->size(), this->capacity()
- ,received_size, this->members_.m_start);
+ if(this->alloc().allocation_command
+ ( shrink_in_place | nothrow_allocation
+ , this->capacity(), this->size()
+ , received_size, this->members_.m_start).first){
+ this->members_.m_capacity = received_size;
+ #ifdef BOOST_INTERPROCESS_VECTOR_ALLOC_STATS
+ ++this->num_shrink;
+ #endif
+ }
}
}
}
@@ -1786,9 +1793,10 @@
public:
unsigned int num_expand_fwd;
unsigned int num_expand_bwd;
+ unsigned int num_shrink;
unsigned int num_alloc;
void reset_alloc_stats()
- { num_expand_fwd = num_expand_bwd = num_alloc = 0; }
+ { num_expand_fwd = num_expand_bwd = num_alloc = 0, num_shrink = 0; }
#endif
/// @endcond
};
Modified: branches/proto/v4/boost/interprocess/creation_tags.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/creation_tags.hpp (original)
+++ branches/proto/v4/boost/interprocess/creation_tags.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -26,20 +26,36 @@
struct open_only_t {};
//!Tag to indicate that the resource must
+//!be only opened for reading
+struct open_read_only_t {};
+
+//!Tag to indicate that the resource must
+//!be only opened for reading
+struct open_copy_on_write_t {};
+
+//!Tag to indicate that the resource must
//!be created. If already created, it must be opened.
struct open_or_create_t {};
//!Value to indicate that the resource must
//!be only created
-static const create_only_t create_only = create_only_t();
+static const create_only_t create_only = create_only_t();
//!Value to indicate that the resource must
//!be only opened
-static const open_only_t open_only = open_only_t();
+static const open_only_t open_only = open_only_t();
+
+//!Value to indicate that the resource must
+//!be only opened for reading
+static const open_read_only_t open_read_only = open_read_only_t();
//!Value to indicate that the resource must
//!be created. If already created, it must be opened.
-static const open_or_create_t open_or_create = open_or_create_t();
+static const open_or_create_t open_or_create = open_or_create_t();
+
+//!Value to indicate that the resource must
+//!be only opened for reading
+static const open_copy_on_write_t open_copy_on_write = open_copy_on_write_t();
namespace detail {
Modified: branches/proto/v4/boost/interprocess/detail/file_wrapper.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/detail/file_wrapper.hpp (original)
+++ branches/proto/v4/boost/interprocess/detail/file_wrapper.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -51,7 +51,7 @@
//!Does not throw
#ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE
file_wrapper
- (detail::moved_object<file_wrapper> &moved)
+ (detail::moved_object<file_wrapper> moved)
{ this->swap(moved.get()); }
#else
file_wrapper(file_wrapper &&moved)
@@ -63,7 +63,7 @@
//!Does not throw
#ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE
file_wrapper &operator=
- (detail::moved_object<file_wrapper> &moved)
+ (detail::moved_object<file_wrapper> moved)
{
file_wrapper tmp(moved);
this->swap(tmp);
Modified: branches/proto/v4/boost/interprocess/errors.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/errors.hpp (original)
+++ branches/proto/v4/boost/interprocess/errors.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -10,8 +10,8 @@
//
//////////////////////////////////////////////////////////////////////////////
//
-// Copyright (c) 2002 Beman Dawes
-// Copyright (c) 2001 Dietmar Kuehl
+// Copyright (C) 2002 Beman Dawes
+// Copyright (C) 2001 Dietmar Kuehl
// 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)
Modified: branches/proto/v4/boost/interprocess/file_mapping.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/file_mapping.hpp (original)
+++ branches/proto/v4/boost/interprocess/file_mapping.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -19,6 +19,7 @@
#include <boost/interprocess/detail/utilities.hpp>
#include <boost/interprocess/creation_tags.hpp>
#include <boost/interprocess/detail/os_file_functions.hpp>
+#include <boost/interprocess/detail/move.hpp>
#include <string> //std::string
#include <cstdio> //std::remove
#include <string>
@@ -55,10 +56,12 @@
//!After the call, "moved" does not represent any shared memory object.
//!Does not throw
#ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE
- file_mapping(detail::moved_object<file_mapping> &moved)
+ file_mapping(detail::moved_object<file_mapping> moved)
+ : m_handle(file_handle_t(detail::invalid_file()))
{ this->swap(moved.get()); }
#else
file_mapping(file_mapping &&moved)
+ : m_handle(file_handle_t(detail::invalid_file()))
{ this->swap(moved); }
#endif
@@ -67,7 +70,7 @@
//!Does not throw
#ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE
file_mapping &operator=
- (detail::moved_object<file_mapping> &moved)
+ (detail::moved_object<file_mapping> moved)
{
file_mapping tmp(moved);
this->swap(tmp);
@@ -165,6 +168,18 @@
}
}
+///@cond
+
+//!Trait class to detect if a type is
+//!movable
+template<>
+struct is_movable<file_mapping>
+{
+ enum { value = true };
+};
+
+///@endcond
+
} //namespace interprocess {
} //namespace boost {
Modified: branches/proto/v4/boost/interprocess/indexes/map_index.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/indexes/map_index.hpp (original)
+++ branches/proto/v4/boost/interprocess/indexes/map_index.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -77,7 +77,7 @@
//!This tries to free previously allocate
//!unused memory.
void shrink_to_fit()
- { base_type::get_stored_allocator().deallocate_free_chunks(); }
+ { base_type::get_stored_allocator().deallocate_free_blocks(); }
};
/// @cond
Modified: branches/proto/v4/boost/interprocess/interprocess_fwd.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/interprocess_fwd.hpp (original)
+++ branches/proto/v4/boost/interprocess/interprocess_fwd.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -120,26 +120,26 @@
template<class T, class SegmentManager>
class allocator;
-template<class T, class SegmentManager, std::size_t NodesPerChunk = 64>
+template<class T, class SegmentManager, std::size_t NodesPerBlock = 64>
class node_allocator;
-template<class T, class SegmentManager, std::size_t NodesPerChunk = 64>
+template<class T, class SegmentManager, std::size_t NodesPerBlock = 64>
class private_node_allocator;
-template<class T, class SegmentManager, std::size_t NodesPerChunk = 64>
+template<class T, class SegmentManager, std::size_t NodesPerBlock = 64>
class cached_node_allocator;
-template<class T, class SegmentManager, std::size_t NodesPerChunk = 64, std::size_t MaxFreeChunks = 2
+template<class T, class SegmentManager, std::size_t NodesPerBlock = 64, std::size_t MaxFreeBlocks = 2
, unsigned char OverheadPercent = 5
>
class adaptive_pool;
-template<class T, class SegmentManager, std::size_t NodesPerChunk = 64, std::size_t MaxFreeChunks = 2
+template<class T, class SegmentManager, std::size_t NodesPerBlock = 64, std::size_t MaxFreeBlocks = 2
, unsigned char OverheadPercent = 5
>
class private_adaptive_pool;
-template<class T, class SegmentManager, std::size_t NodesPerChunk = 64, std::size_t MaxFreeChunks = 2
+template<class T, class SegmentManager, std::size_t NodesPerBlock = 64, std::size_t MaxFreeBlocks = 2
, unsigned char OverheadPercent = 5
>
class cached_adaptive_pool;
Modified: branches/proto/v4/boost/interprocess/managed_external_buffer.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/managed_external_buffer.hpp (original)
+++ branches/proto/v4/boost/interprocess/managed_external_buffer.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -46,6 +46,12 @@
/// @endcond
public:
+
+ //!Default constructor. Does nothing.
+ //!Useful in combination with move semantics
+ basic_managed_external_buffer()
+ {}
+
//!Creates and places the segment manager. This can throw
basic_managed_external_buffer
(create_only_t, void *addr, std::size_t size)
@@ -71,7 +77,7 @@
//!Moves the ownership of "moved"'s managed memory to *this. Does not throw
#ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE
basic_managed_external_buffer
- (detail::moved_object<basic_managed_external_buffer> &moved)
+ (detail::moved_object<basic_managed_external_buffer> moved)
{ this->swap(moved.get()); }
#else
basic_managed_external_buffer
@@ -82,7 +88,7 @@
//!Moves the ownership of "moved"'s managed memory to *this. Does not throw
#ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE
basic_managed_external_buffer &operator=
- (detail::moved_object<basic_managed_external_buffer> &moved)
+ (detail::moved_object<basic_managed_external_buffer> moved)
{ this->swap(moved.get()); return *this; }
#else
basic_managed_external_buffer &operator=
@@ -100,6 +106,26 @@
};
+///@cond
+
+//!Trait class to detect if a type is
+//!movable
+template
+ <
+ class CharType,
+ class AllocationAlgorithm,
+ template<class IndexConfig> class IndexType
+ >
+struct is_movable<basic_managed_external_buffer
+ <CharType, AllocationAlgorithm, IndexType>
+>
+{
+ static const bool value = true;
+};
+
+///@endcond
+
+
} //namespace interprocess {
} //namespace boost {
Modified: branches/proto/v4/boost/interprocess/managed_heap_memory.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/managed_heap_memory.hpp (original)
+++ branches/proto/v4/boost/interprocess/managed_heap_memory.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -50,7 +50,8 @@
public: //functions
- //!Constructor. Never throws.
+ //!Default constructor. Does nothing.
+ //!Useful in combination with move semantics
basic_managed_heap_memory(){}
//!Destructor. Liberates the heap memory holding the managed data.
@@ -72,7 +73,7 @@
//!Moves the ownership of "moved"'s managed memory to *this. Does not throw
#ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE
basic_managed_heap_memory
- (detail::moved_object<basic_managed_heap_memory> &moved)
+ (detail::moved_object<basic_managed_heap_memory> moved)
{ this->swap(moved.get()); }
#else
basic_managed_heap_memory(basic_managed_heap_memory &&moved)
@@ -82,7 +83,7 @@
//!Moves the ownership of "moved"'s managed memory to *this. Does not throw
#ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE
basic_managed_heap_memory &operator=
- (detail::moved_object<basic_managed_heap_memory> &moved)
+ (detail::moved_object<basic_managed_heap_memory> moved)
{ this->swap(moved.get()); return *this; }
#else
basic_managed_heap_memory &operator=
@@ -139,6 +140,25 @@
/// @endcond
};
+///@cond
+
+//!Trait class to detect if a type is
+//!movable
+template
+ <
+ class CharType,
+ class AllocationAlgorithm,
+ template<class IndexConfig> class IndexType
+ >
+struct is_movable<basic_managed_heap_memory
+ <CharType, AllocationAlgorithm, IndexType>
+>
+{
+ static const bool value = true;
+};
+
+///@endcond
+
} //namespace interprocess {
} //namespace boost {
Modified: branches/proto/v4/boost/interprocess/managed_mapped_file.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/managed_mapped_file.hpp (original)
+++ branches/proto/v4/boost/interprocess/managed_mapped_file.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -23,14 +23,11 @@
#include <boost/interprocess/detail/file_wrapper.hpp>
#include <boost/interprocess/detail/move.hpp>
-//!\file
-//!Describes a named shared memory object allocation user class.
-
namespace boost {
namespace interprocess {
-//!A basic shared memory named object creation class. Initializes the
-//!shared memory segment. Inherits all basic functionality from
+//!A basic mapped file named object creation class. Initializes the
+//!mapped file. Inherits all basic functionality from
//!basic_managed_memory_impl<CharType, AllocationAlgorithm, IndexType>
template
<
@@ -61,7 +58,12 @@
public: //functions
- //!Creates shared memory and creates and places the segment manager.
+ //!Creates mapped file and creates and places the segment manager.
+ //!This can throw.
+ basic_managed_mapped_file()
+ {}
+
+ //!Creates mapped file and creates and places the segment manager.
//!This can throw.
basic_managed_mapped_file(create_only_t create_only, const char *name,
std::size_t size, const void *addr = 0)
@@ -69,7 +71,7 @@
create_open_func_t(get_this_pointer(), detail::DoCreate))
{}
- //!Creates shared memory and creates and places the segment manager if
+ //!Creates mapped file and creates and places the segment manager if
//!segment was not created. If segment was created it connects to the
//!segment.
//!This can throw.
@@ -81,8 +83,8 @@
detail::DoOpenOrCreate))
{}
- //!Connects to a created shared memory and it's the segment manager.
- //!Never throws.
+ //!Connects to a created mapped file and its segment manager.
+ //!This can throw.
basic_managed_mapped_file (open_only_t open_only, const char* name,
const void *addr = 0)
: m_mfile(open_only, name, read_write, addr,
@@ -90,11 +92,21 @@
detail::DoOpen))
{}
+ //!Connects to a created mapped file and its segment manager
+ //!in copy_on_write mode.
+ //!This can throw.
+ basic_managed_mapped_file (open_copy_on_write_t, const char* name,
+ const void *addr = 0)
+ : m_mfile(open_only, name, copy_on_write, addr,
+ create_open_func_t(get_this_pointer(),
+ detail::DoOpen))
+ {}
+
//!Moves the ownership of "moved"'s managed memory to *this.
//!Does not throw
#ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE
basic_managed_mapped_file
- (detail::moved_object<basic_managed_mapped_file> &moved)
+ (detail::moved_object<basic_managed_mapped_file> moved)
{ this->swap(moved.get()); }
#else
basic_managed_mapped_file(basic_managed_mapped_file &&moved)
@@ -105,7 +117,7 @@
//!Does not throw
#ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE
basic_managed_mapped_file &operator=
- (detail::moved_object<basic_managed_mapped_file> &moved)
+ (detail::moved_object<basic_managed_mapped_file> moved)
{ this->swap(moved.get()); return *this; }
#else
basic_managed_mapped_file &operator=(basic_managed_mapped_file &&moved)
@@ -161,6 +173,25 @@
/// @endcond
};
+///@cond
+
+//!Trait class to detect if a type is
+//!movable
+template
+ <
+ class CharType,
+ class AllocationAlgorithm,
+ template<class IndexConfig> class IndexType
+ >
+struct is_movable<basic_managed_mapped_file
+ <CharType, AllocationAlgorithm, IndexType>
+>
+{
+ static const bool value = true;
+};
+
+///@endcond
+
} //namespace interprocess {
} //namespace boost {
Modified: branches/proto/v4/boost/interprocess/managed_shared_memory.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/managed_shared_memory.hpp (original)
+++ branches/proto/v4/boost/interprocess/managed_shared_memory.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -23,9 +23,6 @@
#include <boost/interprocess/shared_memory_object.hpp>
#include <boost/interprocess/creation_tags.hpp>
-//!\file
-//!Describes a named shared memory object allocation user class.
-
namespace boost {
namespace interprocess {
@@ -58,8 +55,6 @@
typedef detail::create_open_func<base_t> create_open_func_t;
- basic_managed_shared_memory();
-
basic_managed_shared_memory *get_this_pointer()
{ return this; }
/// @endcond
@@ -75,6 +70,11 @@
~basic_managed_shared_memory()
{}
+ //!Default constructor. Does nothing.
+ //!Useful in combination with move semantics
+ basic_managed_shared_memory()
+ {}
+
//!Creates shared memory and creates and places the segment manager.
//!This can throw.
basic_managed_shared_memory(create_only_t create_only, const char *name,
@@ -97,10 +97,21 @@
detail::DoOpenOrCreate))
{}
- //!Connects to a created shared memory and it's the segment manager.
- //!Never throws.
+ //!Connects to a created shared memory and its segment manager.
+ //!in copy_on_write mode.
+ //!This can throw.
+ basic_managed_shared_memory (open_copy_on_write_t, const char* name,
+ const void *addr = 0)
+ : base_t()
+ , base2_t(open_only, name, copy_on_write, addr,
+ create_open_func_t(get_this_pointer(),
+ detail::DoOpen))
+ {}
+
+ //!Connects to a created shared memory and its segment manager.
+ //!This can throw.
basic_managed_shared_memory (open_only_t open_only, const char* name,
- const void *addr = 0)
+ const void *addr = 0)
: base_t()
, base2_t(open_only, name, read_write, addr,
create_open_func_t(get_this_pointer(),
@@ -111,7 +122,7 @@
//!Does not throw
#ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE
basic_managed_shared_memory
- (detail::moved_object<basic_managed_shared_memory> &moved)
+ (detail::moved_object<basic_managed_shared_memory> moved)
{ this->swap(moved.get()); }
#else
basic_managed_shared_memory(basic_managed_shared_memory &&moved)
@@ -122,7 +133,7 @@
//!Does not throw
#ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE
basic_managed_shared_memory &operator=
- (detail::moved_object<basic_managed_shared_memory> &moved)
+ (detail::moved_object<basic_managed_shared_memory> moved)
{ this->swap(moved.get()); return *this; }
#else
basic_managed_shared_memory &operator=(basic_managed_shared_memory &&moved)
@@ -159,6 +170,25 @@
}
};
+///@cond
+
+//!Trait class to detect if a type is
+//!movable
+template
+ <
+ class CharType,
+ class AllocationAlgorithm,
+ template<class IndexConfig> class IndexType
+ >
+struct is_movable<basic_managed_shared_memory
+ <CharType, AllocationAlgorithm, IndexType>
+>
+{
+ static const bool value = true;
+};
+
+///@endcond
+
} //namespace interprocess {
} //namespace boost {
Modified: branches/proto/v4/boost/interprocess/managed_windows_shared_memory.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/managed_windows_shared_memory.hpp (original)
+++ branches/proto/v4/boost/interprocess/managed_windows_shared_memory.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -23,9 +23,6 @@
#include <boost/interprocess/windows_shared_memory.hpp>
#include <boost/interprocess/detail/move.hpp>
-//!\file
-//!Describes a named shared memory object allocation user class.
-
namespace boost {
namespace interprocess {
@@ -63,6 +60,12 @@
/// @endcond
public: //functions
+
+ //!Default constructor. Does nothing.
+ //!Useful in combination with move semantics
+ basic_managed_windows_shared_memory()
+ {}
+
//!Creates shared memory and creates and places the segment manager.
//!This can throw.
basic_managed_windows_shared_memory
@@ -85,8 +88,8 @@
detail::DoOpenOrCreate))
{}
- //!Connects to a created shared memory and it's the segment manager.
- //!Never throws.
+ //!Connects to a created shared memory and its segment manager.
+ //!This can throw.
basic_managed_windows_shared_memory (open_only_t open_only, const char* name,
const void *addr = 0)
: m_wshm(open_only, name, read_write, addr,
@@ -94,11 +97,21 @@
detail::DoOpen))
{}
+ //!Connects to a created shared memory and its segment manager
+ //!in copy_on_write mode.
+ //!This can throw.
+ basic_managed_windows_shared_memory (open_copy_on_write_t, const char* name,
+ const void *addr = 0)
+ : m_wshm(open_only, name, copy_on_write, addr,
+ create_open_func_t(get_this_pointer(),
+ detail::DoOpen))
+ {}
+
//!Moves the ownership of "moved"'s managed memory to *this.
//!Does not throw
#ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE
basic_managed_windows_shared_memory
- (detail::moved_object<basic_managed_windows_shared_memory> &moved)
+ (detail::moved_object<basic_managed_windows_shared_memory> moved)
{ this->swap(moved.get()); }
#else
basic_managed_windows_shared_memory(basic_managed_windows_shared_memory &&moved)
@@ -109,7 +122,7 @@
//!Does not throw
#ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE
basic_managed_windows_shared_memory &operator=
- (detail::moved_object<basic_managed_windows_shared_memory> &moved)
+ (detail::moved_object<basic_managed_windows_shared_memory> moved)
{ this->swap(moved.get()); return *this; }
#else
basic_managed_windows_shared_memory &operator=
@@ -138,6 +151,25 @@
/// @endcond
};
+///@cond
+
+//!Trait class to detect if a type is
+//!movable
+template
+ <
+ class CharType,
+ class AllocationAlgorithm,
+ template<class IndexConfig> class IndexType
+ >
+struct is_movable<basic_managed_windows_shared_memory
+ <CharType, AllocationAlgorithm, IndexType>
+>
+{
+ static const bool value = true;
+};
+
+///@endcond
+
} //namespace interprocess {
} //namespace boost {
Modified: branches/proto/v4/boost/interprocess/mapped_region.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/mapped_region.hpp (original)
+++ branches/proto/v4/boost/interprocess/mapped_region.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -444,7 +444,7 @@
break;
case copy_on_write:
- prot |= PROT_READ;
+ prot |= (PROT_WRITE | PROT_READ);
flags |= MAP_PRIVATE;
break;
@@ -553,6 +553,14 @@
bool operator()(void *, std::size_t , bool) const
{ return true; }
};
+
+//!Trait class to detect if a type is
+//!movable
+template<>
+struct is_movable<mapped_region>
+{
+ enum { value = true };
+};
/// @endcond
} //namespace interprocess {
Modified: branches/proto/v4/boost/interprocess/mem_algo/detail/mem_algo_common.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/mem_algo/detail/mem_algo_common.hpp (original)
+++ branches/proto/v4/boost/interprocess/mem_algo/detail/mem_algo_common.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -406,13 +406,13 @@
if(nbytes > UsableByPreviousChunk)
nbytes -= UsableByPreviousChunk;
- //We can find a aligned portion if we allocate a chunk that has alignment
+ //We can find a aligned portion if we allocate a block that has alignment
//nbytes + alignment bytes or more.
std::size_t minimum_allocation = max_value
(nbytes + alignment, std::size_t(MinBlockUnits*Alignment));
- //Since we will split that chunk, we must request a bit more memory
+ //Since we will split that block, we must request a bit more memory
//if the alignment is near the beginning of the buffer, because otherwise,
- //there is no space for a new chunk before the alignment.
+ //there is no space for a new block before the alignment.
//
// ____ Aligned here
// |
@@ -487,7 +487,7 @@
// | MBU +more | ACB | (3) | BCU |
// -----------------------------------------------------
//This size will be the minimum size to be able to create a
- //new chunk in the end.
+ //new block in the end.
const std::size_t second_min_units = max_value(std::size_t(MinBlockUnits),
ceil_units(nbytes) + AllocatedCtrlUnits );
Modified: branches/proto/v4/boost/interprocess/mem_algo/rbtree_best_fit.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/mem_algo/rbtree_best_fit.hpp (original)
+++ branches/proto/v4/boost/interprocess/mem_algo/rbtree_best_fit.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -812,7 +812,7 @@
assert(prev_block->m_size >= BlockCtrlUnits);
priv_mark_as_free_block(prev_block);
- //Update the old previous block in the free chunks tree
+ //Update the old previous block in the free blocks tree
//If the new size fulfills tree invariants do nothing,
//otherwise erase() + insert()
{
@@ -1058,12 +1058,12 @@
assert(next_block->m_size == priv_next_block(next_block)->m_prev_size);
const std::size_t rem_units = merged_units - intended_units;
- //Check if we we need to update the old next block in the free chunks tree
+ //Check if we we need to update the old next block in the free blocks tree
//If the new size fulfills tree invariants, we just need to replace the node
//(the block start has been displaced), otherwise erase() + insert().
//
- //This fixup must be done in two parts, because the new next chunk might
- //overwrite the tree hook of the old next chunk. So we first erase the
+ //This fixup must be done in two parts, because the new next block might
+ //overwrite the tree hook of the old next block. So we first erase the
//old if needed and we'll insert the new one after creating the new next
imultiset_iterator old_next_block_it(Imultiset::s_iterator_to(*next_block));
const bool size_invariants_broken =
@@ -1292,7 +1292,7 @@
bool merge_with_prev = !priv_is_prev_allocated(block);
bool merge_with_next = !priv_is_allocated_block(next_block);
- //Merge logic. First just update block sizes, then fix free chunks tree
+ //Merge logic. First just update block sizes, then fix free blocks tree
if(merge_with_prev || merge_with_next){
//Merge if the previous is free
if(merge_with_prev){
@@ -1338,4 +1338,3 @@
#include <boost/interprocess/detail/config_end.hpp>
#endif //#ifndef BOOST_INTERPROCESS_MEM_ALGO_RBTREE_BEST_FIT_HPP
-
Modified: branches/proto/v4/boost/interprocess/segment_manager.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/segment_manager.hpp (original)
+++ branches/proto/v4/boost/interprocess/segment_manager.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -1118,7 +1118,7 @@
//Initialize the node value_eraser to erase inserted node
//if something goes wrong
- detail::value_eraser<index_type> value_eraser(index, it);
+ value_eraser<index_type> v_eraser(index, it);
//Avoid constructions if constructor is trivial
//Build scoped ptr to avoid leaks with constructor exception
@@ -1130,8 +1130,8 @@
//All constructors successful, we don't want to release memory
mem.release();
- //Release node value_eraser since construction was successful
- value_eraser.release();
+ //Release node v_eraser since construction was successful
+ v_eraser.release();
return ptr;
}
@@ -1204,7 +1204,7 @@
}
//Initialize the node value_eraser to erase inserted node
//if something goes wrong
- detail::value_eraser<index_type> value_eraser(index, it);
+ value_eraser<index_type> v_eraser(index, it);
//Allocates buffer for name + data, this can throw (it hurts)
void *buffer_ptr;
@@ -1260,8 +1260,8 @@
//All constructors successful, we don't want to release memory
mem.release();
- //Release node value_eraser since construction was successful
- value_eraser.release();
+ //Release node v_eraser since construction was successful
+ v_eraser.release();
return ptr;
}
Modified: branches/proto/v4/boost/interprocess/shared_memory_object.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/shared_memory_object.hpp (original)
+++ branches/proto/v4/boost/interprocess/shared_memory_object.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -76,10 +76,12 @@
//!Does not throw
#ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE
shared_memory_object
- (detail::moved_object<shared_memory_object> &moved)
+ (const detail::moved_object<shared_memory_object> moved)
+ : m_handle(file_handle_t(detail::invalid_file()))
{ this->swap(moved.get()); }
#else
shared_memory_object(shared_memory_object &&moved)
+ : m_handle(file_handle_t(detail::invalid_file()))
{ this->swap(moved); }
#endif
@@ -88,7 +90,7 @@
//!Does not throw
#ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE
shared_memory_object &operator=
- (detail::moved_object<shared_memory_object> &moved)
+ (detail::moved_object<shared_memory_object> moved)
{
shared_memory_object tmp(moved);
this->swap(tmp);
@@ -341,6 +343,18 @@
#endif
+///@cond
+
+//!Trait class to detect if a type is
+//!movable
+template<>
+struct is_movable<shared_memory_object>
+{
+ enum { value = true };
+};
+
+///@endcond
+
} //namespace interprocess {
} //namespace boost {
Modified: branches/proto/v4/boost/interprocess/smart_ptr/unique_ptr.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/smart_ptr/unique_ptr.hpp (original)
+++ branches/proto/v4/boost/interprocess/smart_ptr/unique_ptr.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -181,7 +181,7 @@
//!Throws: nothing.
#ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE
template <class U, class E>
- unique_ptr(const detail::moved_object<unique_ptr<U, E> >& u,
+ unique_ptr(detail::moved_object<unique_ptr<U, E> > u,
typename detail::enable_if_c<
detail::is_convertible<typename unique_ptr<U, E>::pointer, pointer>::value &&
detail::is_convertible<E, D>::value &&
@@ -231,7 +231,7 @@
//!
//!Throws: nothing.
#ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE
- unique_ptr& operator=(const detail::moved_object<unique_ptr>& u)
+ unique_ptr& operator=(detail::moved_object<unique_ptr> u)
{
reset(u.get().release());
ptr_.second() = move(u.get().get_deleter());
@@ -262,7 +262,7 @@
//!Throws: nothing.
template <class U, class E>
#ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE
- unique_ptr& operator=(const detail::moved_object<unique_ptr<U, E> >& mu)
+ unique_ptr& operator=(detail::moved_object<unique_ptr<U, E> > mu)
{
reset(mu.get().release());
ptr_.second() = move(mu.get().get_deleter());
@@ -356,8 +356,8 @@
//!Requires: The deleter D is Swappable and will not throw an exception under swap.
//!
- //!Effects: The stored pointers of this and u are exchanged. The stored deleters are swap'd (unqualified).
- //!
+ //!Effects: The stored pointers of this and u are exchanged.
+ //! The stored deleters are swapped (unqualified).
//!Throws: nothing.
#ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE
void swap(unique_ptr& u)
Modified: branches/proto/v4/boost/interprocess/sync/named_condition.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/sync/named_condition.hpp (original)
+++ branches/proto/v4/boost/interprocess/sync/named_condition.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -146,23 +146,30 @@
template <class Lock>
void do_wait(Lock& lock)
{
+ //lock internal before unlocking external to avoid race with a notifier
+ scoped_lock<interprocess_mutex> internal_lock(*this->mutex());
lock_inverter<Lock> inverted_lock(lock);
- //unlock internal first to avoid deadlock with near simultaneous waits
scoped_lock<lock_inverter<Lock> > external_unlock(inverted_lock);
- scoped_lock<interprocess_mutex> internal_lock(*this->mutex());
- this->condition()->wait(internal_lock);
+
+ //unlock internal first to avoid deadlock with near simultaneous waits
+ scoped_lock<interprocess_mutex> internal_unlock;
+ internal_lock.swap(internal_unlock);
+ this->condition()->wait(internal_unlock);
}
template <class Lock>
bool do_timed_wait(Lock& lock, const boost::posix_time::ptime &abs_time)
{
- //unlock internal first to avoid deadlock with near simultaneous waits
- lock_inverter<Lock> inverted_lock(lock);
- scoped_lock<lock_inverter<Lock> > external_unlock(inverted_lock);
+ //lock internal before unlocking external to avoid race with a notifier
+ scoped_lock<interprocess_mutex> internal_lock(*this->mutex(), abs_time);
if(!external_unlock) return false;
- scoped_lock<interprocess_mutex> internal_lock(*this->mutex(), abs_time);
- if(!internal_lock) return false;
- return this->condition()->timed_wait(internal_lock, abs_time);
+ lock_inverter<Lock> inverted_lock(lock);
+ scoped_lock<lock_inverter<Lock> > external_unlock(inverted_lock);
+
+ //unlock internal first to avoid deadlock with near simultaneous waits
+ scoped_lock<interprocess_mutex> internal_unlock;
+ internal_lock.swap(internal_unlock);
+ return this->condition()->timed_wait(internal_unlock, abs_time);
}
#endif
Modified: branches/proto/v4/boost/interprocess/windows_shared_memory.hpp
==============================================================================
--- branches/proto/v4/boost/interprocess/windows_shared_memory.hpp (original)
+++ branches/proto/v4/boost/interprocess/windows_shared_memory.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -83,7 +83,7 @@
//!Does not throw
#ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE
windows_shared_memory
- (detail::moved_object<windows_shared_memory> &moved)
+ (detail::moved_object<windows_shared_memory> moved)
{ this->swap(moved.get()); }
#else
windows_shared_memory(windows_shared_memory &&moved)
@@ -95,7 +95,7 @@
//!Does not throw
#ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE
windows_shared_memory &operator=
- (detail::moved_object<windows_shared_memory> &moved)
+ (detail::moved_object<windows_shared_memory> moved)
{
windows_shared_memory tmp(moved);
this->swap(tmp);
@@ -235,6 +235,18 @@
}
}
+///@cond
+
+//!Trait class to detect if a type is
+//!movable
+template<>
+struct is_movable<windows_shared_memory>
+{
+ static const bool value = true;
+};
+
+///@endcond
+
} //namespace interprocess {
} //namespace boost {
Modified: branches/proto/v4/boost/intrusive/detail/utilities.hpp
==============================================================================
--- branches/proto/v4/boost/intrusive/detail/utilities.hpp (original)
+++ branches/proto/v4/boost/intrusive/detail/utilities.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -391,7 +391,11 @@
template<class Hook>
void destructor_impl(Hook &hook, detail::link_dispatch<safe_link>)
-{ (void)hook; BOOST_INTRUSIVE_SAFE_HOOK_DESTRUCTOR_ASSERT(!hook.is_linked()); }
+{ //If this assertion raises, you might have destroyed an object
+ //while it was still inserted in a container that is alive.
+ //If so, remove the object from the container before destroying it.
+ (void)hook; BOOST_INTRUSIVE_SAFE_HOOK_DESTRUCTOR_ASSERT(!hook.is_linked());
+}
template<class Hook>
void destructor_impl(Hook &hook, detail::link_dispatch<auto_unlink>)
Modified: branches/proto/v4/boost/intrusive/hashtable.hpp
==============================================================================
--- branches/proto/v4/boost/intrusive/hashtable.hpp (original)
+++ branches/proto/v4/boost/intrusive/hashtable.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -343,7 +343,7 @@
//! is used to construct intrusive unordered_set and unordered_multiset containers. The
//! no-throw guarantee holds only, if the Equal object and Hasher don't throw.
//!
-//! hashtable is a pseudo-intrusive container: each object to be stored in the
+//! hashtable is a semi-intrusive container: each object to be stored in the
//! container must contain a proper hook, but the container also needs
//! additional auxiliary memory to work: hashtable needs a pointer to an array
//! of type `bucket_type` to be passed in the constructor. This bucket array must
Modified: branches/proto/v4/boost/intrusive/list.hpp
==============================================================================
--- branches/proto/v4/boost/intrusive/list.hpp (original)
+++ branches/proto/v4/boost/intrusive/list.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -586,7 +586,7 @@
iterator erase(iterator i)
{ return this->erase_and_dispose(i, detail::null_disposer()); }
- //! <b>Requires</b>: first and last must be valid iterator to elements in *this.
+ //! <b>Requires</b>: b and e must be valid iterators to elements in *this.
//!
//! <b>Effects</b>: Erases the element range pointed by b and e
//! No destructors are called.
@@ -596,8 +596,8 @@
//!
//! <b>Throws</b>: Nothing.
//!
- //! <b>Complexity</b>: Linear to the number of elements erased if it's a safe-mode
- //! or auto-unlink value. Constant time otherwise.
+ //! <b>Complexity</b>: Linear to the number of erased elements if it's a safe-mode
+ //! or auto-unlink value, or constant-time size is enabled. Constant-time otherwise.
//!
//! <b>Note</b>: Invalidates the iterators (but not the references) to the
//! erased elements.
@@ -612,6 +612,37 @@
}
}
+ //! <b>Requires</b>: b and e must be valid iterators to elements in *this.
+ //! n must be std::distance(b, e).
+ //!
+ //! <b>Effects</b>: Erases the element range pointed by b and e
+ //! No destructors are called.
+ //!
+ //! <b>Returns</b>: the first element remaining beyond the removed elements,
+ //! or end() if no such element exists.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of erased elements if it's a safe-mode
+ //! or auto-unlink value is enabled. Constant-time otherwise.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references) to the
+ //! erased elements.
+ iterator erase(iterator b, iterator e, difference_type n)
+ {
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(std::distance(b, e) == difference_type(n));
+ if(safemode_or_autounlink || constant_time_size){
+ return this->erase_and_dispose(b, e, detail::null_disposer());
+ }
+ else{
+ if(constant_time_size){
+ this->priv_size_traits().set_size(this->priv_size_traits().get_size() - n);
+ }
+ node_algorithms::unlink(b.pointed_node(), e.pointed_node());
+ return e;
+ }
+ }
+
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//!
//! <b>Effects</b>: Erases the element pointed by i of the list.
Modified: branches/proto/v4/boost/intrusive/slist.hpp
==============================================================================
--- branches/proto/v4/boost/intrusive/slist.hpp (original)
+++ branches/proto/v4/boost/intrusive/slist.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -778,12 +778,64 @@
//!
//! <b>Throws</b>: Nothing.
//!
- //! <b>Complexity</b>: Lineal to the elements (last - before_first + 1).
+ //! <b>Complexity</b>: Linear to the number of erased elements if it's a safe-mode
+ //! , auto-unlink value or constant-time size is activated. Constant time otherwise.
//!
//! <b>Note</b>: Invalidates the iterators (but not the references) to the
//! erased element.
iterator erase_after(iterator before_first, iterator last)
- { return this->erase_after_and_dispose(before_first, last, detail::null_disposer()); }
+ {
+ if(safemode_or_autounlink || constant_time_size){
+ return this->erase_after_and_dispose(before_first, last, detail::null_disposer());
+ }
+ else{
+ node_ptr bfp = before_first.pointed_node();
+ node_ptr lp = last.pointed_node();
+ if(cache_last){
+ if((lp == this->get_end_node())){
+ this->set_last_node(bfp);
+ }
+ }
+ node_algorithms::unlink_after(bfp, lp);
+ return last;
+ }
+ }
+
+ //! <b>Effects</b>: Erases the range (before_first, last) from
+ //! the list. n must be std::distance(before_first, last) - 1.
+ //! No destructors are called.
+ //!
+ //! <b>Returns</b>: the first element remaining beyond the removed elements,
+ //! or end() if no such element exists.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: constant-time if link_mode is normal_link.
+ //! Linear to the elements (last - before_first) otherwise.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references) to the
+ //! erased element.
+ iterator erase_after(iterator before_first, iterator last, difference_type n)
+ {
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(std::distance(++iterator(before_first), last) == difference_type(n));
+ if(safemode_or_autounlink){
+ return this->erase_after(before_first, last);
+ }
+ else{
+ node_ptr bfp = before_first.pointed_node();
+ node_ptr lp = last.pointed_node();
+ if(cache_last){
+ if((lp == this->get_end_node())){
+ this->set_last_node(bfp);
+ }
+ }
+ node_algorithms::unlink_after(bfp, lp);
+ if(constant_time_size){
+ this->priv_size_traits().set_size(this->priv_size_traits().get_size() - n);
+ }
+ return last;
+ }
+ }
//! <b>Effects</b>: Erases the element pointed by i of the list.
//! No destructors are called.
@@ -810,14 +862,30 @@
//!
//! <b>Throws</b>: Nothing.
//!
- //! <b>Complexity</b>: Linear to the number of elements erased plus linear
- //! to the elements before first.
+ //! <b>Complexity</b>: Linear to the elements before last.
//!
//! <b>Note</b>: Invalidates the iterators (but not the references) to the
//! erased elements.
iterator erase(iterator first, iterator last)
{ return this->erase_after(this->previous(first), last); }
+ //! <b>Effects</b>: Erases the range [first, last) from
+ //! the list. n must be std::distance(first, last).
+ //! No destructors are called.
+ //!
+ //! <b>Returns</b>: the first element remaining beyond the removed elements,
+ //! or end() if no such element exists.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: linear to the elements before first if link_mode is normal_link
+ //! and constant_time_size is activated. Linear to the elements before last otherwise.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references) to the
+ //! erased element.
+ iterator erase(iterator first, iterator last, difference_type n)
+ { return this->erase_after(this->previous(first), last, n); }
+
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//!
//! <b>Effects</b>: Erases the element after the element pointed by prev of
@@ -885,7 +953,7 @@
//!
//! <b>Throws</b>: Nothing.
//!
- //! <b>Complexity</b>: Lineal to the elements (last - before_first).
+ //! <b>Complexity</b>: Lineal to the elements (last - before_first + 1).
//!
//! <b>Note</b>: Invalidates the iterators to the erased element.
template<class Disposer>
@@ -939,7 +1007,7 @@
//!
//! <b>Throws</b>: Nothing.
//!
- //! <b>Complexity</b>: Linear to the number of elements erased plus linear
+ //! <b>Complexity</b>: Linear to the number of erased elements plus linear
//! to the elements before first.
//!
//! <b>Note</b>: Invalidates the iterators (but not the references) to the
@@ -1047,10 +1115,7 @@
void splice_after(iterator prev_pos, slist_impl &x, iterator prev_ele)
{
iterator elem = prev_ele;
- ++elem;
- if (elem != prev_pos && prev_ele != prev_pos){
- this->splice_after(prev_pos, x, prev_ele, elem, 1);
- }
+ this->splice_after(prev_pos, x, prev_ele, ++elem, 1);
}
//! <b>Requires</b>: prev_pos must be a dereferenceable iterator in *this or be
@@ -1588,15 +1653,18 @@
private:
void priv_splice_after(node_ptr prev_pos_n, slist_impl &x, node_ptr before_first_n, node_ptr before_last_n)
{
- if(cache_last){
- if(node_traits::get_next(prev_pos_n) == this->get_end_node()){
- this->set_last_node(before_last_n);
- }
- if(node_traits::get_next(before_last_n) == x.get_end_node()){
- x.set_last_node(before_first_n);
+ if (before_first_n != before_last_n && prev_pos_n != before_first_n && prev_pos_n != before_last_n)
+ {
+ if(cache_last){
+ if(node_traits::get_next(prev_pos_n) == this->get_end_node()){
+ this->set_last_node(before_last_n);
+ }
+ if(node_traits::get_next(before_last_n) == x.get_end_node()){
+ x.set_last_node(before_first_n);
+ }
}
+ node_algorithms::transfer_after(prev_pos_n, before_first_n, before_last_n);
}
- node_algorithms::transfer_after(prev_pos_n, before_first_n, before_last_n);
}
void priv_reverse(detail::bool_<false>)
Modified: branches/proto/v4/boost/intrusive/unordered_set.hpp
==============================================================================
--- branches/proto/v4/boost/intrusive/unordered_set.hpp (original)
+++ branches/proto/v4/boost/intrusive/unordered_set.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -24,7 +24,7 @@
//! The class template unordered_set is an intrusive container, that mimics most of
//! the interface of std::tr1::unordered_set as described in the C++ TR1.
//!
-//! unordered_set is a pseudo-intrusive container: each object to be stored in the
+//! unordered_set is a semi-intrusive container: each object to be stored in the
//! container must contain a proper hook, but the container also needs
//! additional auxiliary memory to work: unordered_set needs a pointer to an array
//! of type `bucket_type` to be passed in the constructor. This bucket array must
@@ -1019,7 +1019,7 @@
//! The class template unordered_multiset is an intrusive container, that mimics most of
//! the interface of std::tr1::unordered_multiset as described in the C++ TR1.
//!
-//! unordered_multiset is a pseudo-intrusive container: each object to be stored in the
+//! unordered_multiset is a semi-intrusive container: each object to be stored in the
//! container must contain a proper hook, but the container also needs
//! additional auxiliary memory to work: unordered_multiset needs a pointer to an array
//! of type `bucket_type` to be passed in the constructor. This bucket array must
Modified: branches/proto/v4/boost/iostreams/chain.hpp
==============================================================================
--- branches/proto/v4/boost/iostreams/chain.hpp (original)
+++ branches/proto/v4/boost/iostreams/chain.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -140,6 +140,10 @@
chain_base(const chain_base& rhs): pimpl_(rhs.pimpl_) { }
public:
+ // dual_use is a pseudo-mode to facilitate filter writing,
+ // not a genuine mode.
+ BOOST_STATIC_ASSERT((!is_convertible<mode, dual_use>::value));
+
//----------Buffer sizing-------------------------------------------------//
// Sets the size of the buffer created for the devices to be added to this
@@ -408,7 +412,7 @@
typedef typename traits_type::int_type int_type; \
typedef typename traits_type::off_type off_type; \
name_() { } \
- name_(const name_& rhs) { *this = rhs; } \
+ name_(const name_& rhs) : base_type(rhs) { } \
name_& operator=(const name_& rhs) \
{ base_type::operator=(rhs); return *this; } \
}; \
Modified: branches/proto/v4/boost/iostreams/detail/codecvt_helper.hpp
==============================================================================
--- branches/proto/v4/boost/iostreams/detail/codecvt_helper.hpp (original)
+++ branches/proto/v4/boost/iostreams/detail/codecvt_helper.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -134,8 +134,7 @@
}
std::codecvt_base::result
- virtual do_unshift( State& state, Extern* first2, Extern* last2,
- Extern*& next2 ) const
+ virtual do_unshift(State&, Extern*, Extern*, Extern*&) const
{
return std::codecvt_base::ok;
}
@@ -146,7 +145,7 @@
virtual int do_encoding() const throw() { return 1; }
- virtual int do_length( BOOST_IOSTREAMS_CODECVT_CV_QUALIFIER State& state,
+ virtual int do_length( BOOST_IOSTREAMS_CODECVT_CV_QUALIFIER State&,
const Extern* first1, const Extern* last1,
std::size_t len2 ) const throw()
{
Modified: branches/proto/v4/boost/iostreams/detail/current_directory.hpp
==============================================================================
--- branches/proto/v4/boost/iostreams/detail/current_directory.hpp (original)
+++ branches/proto/v4/boost/iostreams/detail/current_directory.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -30,6 +30,9 @@
# include <unistd.h> // sysconf.
#endif
+// Must come last.
+#include <boost/iostreams/detail/config/disable_warnings.hpp>
+
namespace boost { namespace iostreams { namespace detail {
// Returns the current working directory
@@ -57,4 +60,6 @@
} } } // End namespaces detail, iostreams, boost.
+#include <boost/iostreams/detail/config/enable_warnings.hpp>
+
#endif // #ifndef BOOST_IOSTREAMS_DETAIL_CURRENT_DIRECTORY_HPP_INCLUDED
Modified: branches/proto/v4/boost/iostreams/detail/is_iterator_range.hpp
==============================================================================
--- branches/proto/v4/boost/iostreams/detail/is_iterator_range.hpp (original)
+++ branches/proto/v4/boost/iostreams/detail/is_iterator_range.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -8,6 +8,8 @@
#ifndef BOOST_IOSTREAMS_DETAIL_IS_ITERATOR_RANGE_HPP_INCLUDED
#define BOOST_IOSTREAMS_DETAIL_IS_ITERATOR_RANGE_HPP_INCLUDED
+#include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>
#include <boost/iostreams/detail/bool_trait_def.hpp>
namespace boost {
@@ -20,8 +22,17 @@
namespace iostreams {
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
+# pragma warning(push)
+# pragma warning(disable:6334)
+#endif
+
BOOST_IOSTREAMS_BOOL_TRAIT_DEF(is_iterator_range, boost::iterator_range, 1)
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
+# pragma warning(pop)
+#endif
+
} // End namespace iostreams.
# else // # if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) //-----------------------//
Modified: branches/proto/v4/boost/iostreams/filter/line.hpp
==============================================================================
--- branches/proto/v4/boost/iostreams/filter/line.hpp (original)
+++ branches/proto/v4/boost/iostreams/filter/line.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -18,6 +18,7 @@
#include <string>
#include <boost/config.hpp> // BOOST_STATIC_CONSTANT.
#include <boost/iostreams/categories.hpp>
+#include <boost/iostreams/checked_operations.hpp>
#include <boost/iostreams/detail/ios.hpp> // openmode, streamsize.
#include <boost/iostreams/read.hpp> // check_eof
#include <boost/iostreams/pipeline.hpp>
@@ -61,7 +62,10 @@
closable_tag
{ };
protected:
- basic_line_filter() : pos_(string_type::npos), state_(0) { }
+ basic_line_filter(bool suppress_newlines = false)
+ : pos_(string_type::npos),
+ flags_(suppress_newlines ? f_suppress : 0)
+ { }
public:
virtual ~basic_line_filter() { }
@@ -69,8 +73,8 @@
std::streamsize read(Source& src, char_type* s, std::streamsize n)
{
using namespace std;
- assert(!(state_ & f_write));
- state_ |= f_read;
+ assert(!(flags_ & f_write));
+ flags_ |= f_read;
// Handle unfinished business.
std::streamsize result = 0;
@@ -80,7 +84,7 @@
typename traits_type::int_type status = traits_type::good();
while (result < n && !traits_type::is_eof(status)) {
- // Call next_line() to retrieve a line of filtered test, and
+ // Call next_line() to retrieve a line of filtered text, and
// read_line() to copy it into buffer s.
if (traits_type::would_block(status = next_line(src)))
return result;
@@ -94,8 +98,8 @@
std::streamsize write(Sink& snk, const char_type* s, std::streamsize n)
{
using namespace std;
- assert(!(state_ & f_read));
- state_ |= f_write;
+ assert(!(flags_ & f_read));
+ flags_ |= f_write;
// Handle unfinished business.
if (pos_ != string_type::npos && !write_line(snk))
@@ -122,10 +126,10 @@
template<typename Sink>
void close(Sink& snk, BOOST_IOS::openmode which)
{
- if ((state_ & f_read) && which == BOOST_IOS::in)
+ if ((flags_ & f_read) && which == BOOST_IOS::in)
close_impl();
- if ((state_ & f_write) && which == BOOST_IOS::out) {
+ if ((flags_ & f_write) && which == BOOST_IOS::out) {
try {
if (!cur_line_.empty())
write_line(snk);
@@ -168,7 +172,7 @@
if (!traits_type::would_block(c)) {
if (!cur_line_.empty() || c == traits_type::newline())
cur_line_ = do_filter(cur_line_);
- if (c == traits_type::newline())
+ if (c == traits_type::newline() && (flags_ & f_suppress) == 0)
cur_line_ += c;
}
return c; // status indicator.
@@ -179,9 +183,11 @@
template<typename Sink>
bool write_line(Sink& snk)
{
- string_type line = do_filter(cur_line_) + traits_type::newline();
+ string_type line = do_filter(cur_line_);
+ if ((flags_ & f_suppress) == 0)
+ line += traits_type::newline();
std::streamsize amt = static_cast<std::streamsize>(line.size());
- bool result = iostreams::write(snk, line.data(), amt) == amt;
+ bool result = iostreams::write_if(snk, line.data(), amt) == amt;
if (result)
clear();
return result;
@@ -190,7 +196,7 @@
void close_impl()
{
clear();
- state_ = 0;
+ flags_ &= f_suppress;
}
void clear()
@@ -200,13 +206,14 @@
}
enum flag_type {
- f_read = 1,
- f_write = f_read << 1
+ f_read = 1,
+ f_write = f_read << 1,
+ f_suppress = f_write << 1
};
string_type cur_line_;
typename string_type::size_type pos_;
- int state_;
+ int flags_;
};
BOOST_IOSTREAMS_PIPABLE(basic_line_filter, 2)
Modified: branches/proto/v4/boost/iostreams/filter/newline.hpp
==============================================================================
--- branches/proto/v4/boost/iostreams/filter/newline.hpp (original)
+++ branches/proto/v4/boost/iostreams/filter/newline.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -211,7 +211,7 @@
}
template<typename Sink>
- void close(Sink& dest, BOOST_IOS::openmode which)
+ void close(Sink& dest, BOOST_IOS::openmode)
{
typedef typename iostreams::category_of<Sink>::type category;
if ((flags_ & f_write) != 0 && (flags_ & f_has_CR) != 0)
@@ -398,7 +398,7 @@
}
template<typename Sink>
- void close(Sink&, BOOST_IOS::openmode which)
+ void close(Sink&, BOOST_IOS::openmode)
{
using iostreams::newline::final_newline;
Modified: branches/proto/v4/boost/iostreams/filter/symmetric.hpp
==============================================================================
--- branches/proto/v4/boost/iostreams/filter/symmetric.hpp (original)
+++ branches/proto/v4/boost/iostreams/filter/symmetric.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -152,7 +152,7 @@
}
template<typename Sink>
- void close(Sink& snk, BOOST_IOS::openmode which)
+ void close(Sink& snk, BOOST_IOS::openmode)
{
if ((state() & f_write) != 0) {
Modified: branches/proto/v4/boost/iostreams/filter/zlib.hpp
==============================================================================
--- branches/proto/v4/boost/iostreams/filter/zlib.hpp (original)
+++ branches/proto/v4/boost/iostreams/filter/zlib.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -47,8 +47,9 @@
typedef unsigned char byte;
typedef unsigned long ulong;
-typedef void* (*alloc_func)(void*, zlib::uint, zlib::uint);
-typedef void (*free_func)(void*, void*);
+// Prefix 'x' prevents symbols from being redefined when Z_PREFIX is defined
+typedef void* (*xalloc_func)(void*, zlib::uint, zlib::uint);
+typedef void (*xfree_func)(void*, void*);
// Compression levels
@@ -191,8 +192,8 @@
char*& dest_begin, char* dest_end );
void after( const char*& src_begin, char*& dest_begin,
bool compress );
- int deflate(int flush);
- int inflate(int flush);
+ int xdeflate(int flush); // Prefix 'x' prevents symbols from being
+ int xinflate(int flush); // redefined when Z_PREFIX is defined
void reset(bool compress, bool realloc);
public:
zlib::ulong crc() const { return crc_; }
@@ -201,8 +202,8 @@
private:
void do_init( const zlib_params& p, bool compress,
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
- zlib::alloc_func,
- zlib::free_func,
+ zlib::xalloc_func,
+ zlib::xfree_func,
#endif
void* derived );
void* stream_; // Actual type: z_stream*.
@@ -341,7 +342,7 @@
char*& dest_begin, char* dest_end, bool flush )
{
before(src_begin, src_end, dest_begin, dest_end);
- int result = deflate(flush ? zlib::finish : zlib::no_flush);
+ int result = xdeflate(flush ? zlib::finish : zlib::no_flush);
after(src_begin, dest_begin, true);
zlib_error::check(result);
return result != zlib::stream_end;
@@ -374,7 +375,7 @@
char*& dest_begin, char* dest_end, bool /* flush */ )
{
before(src_begin, src_end, dest_begin, dest_end);
- int result = inflate(zlib::sync_flush);
+ int result = xinflate(zlib::sync_flush);
after(src_begin, dest_begin, false);
zlib_error::check(result);
return result != zlib::stream_end;
Modified: branches/proto/v4/boost/iostreams/tee.hpp
==============================================================================
--- branches/proto/v4/boost/iostreams/tee.hpp (original)
+++ branches/proto/v4/boost/iostreams/tee.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -40,7 +40,8 @@
typedef typename detail::param_type<Device>::type param_type;
typedef typename char_type_of<Device>::type char_type;
struct category
- : multichar_output_filter_tag,
+ : dual_use_filter_tag,
+ multichar_tag,
closable_tag,
flushable_tag,
localizable_tag,
@@ -57,6 +58,18 @@
: detail::filter_adapter<Device>(dev)
{ }
+ template<typename Source>
+ std::streamsize read(Source& src, char_type* s, std::streamsize n)
+ {
+ std::streamsize result = iostreams::read(src, s, n);
+ if (result != -1) {
+ std::streamsize result2 = iostreams::write(this->component(), s, result);
+ (void) result2; // Suppress 'unused variable' warning.
+ assert(result == result2);
+ }
+ return result;
+ }
+
template<typename Sink>
std::streamsize write(Sink& snk, const char_type* s, std::streamsize n)
{
@@ -68,7 +81,7 @@
}
template<typename Next>
- void close(Next&)
+ void close(Next&, BOOST_IOS::openmode)
{
detail::close_all(this->component());
}
@@ -86,48 +99,75 @@
//
// Template name: tee_device.
// Template paramters:
-// Sink1 - A blocking Sink.
-// Sink2 - A blocking Sink.
+// Device - A blocking Device.
+// Sink - A blocking Sink.
//
-template<typename Sink1, typename Sink2>
+template<typename Device, typename Sink>
class tee_device {
public:
- typedef typename detail::param_type<Sink1>::type param_type1;
- typedef typename detail::param_type<Sink2>::type param_type2;
- typedef typename detail::value_type<Sink1>::type value_type1;
- typedef typename detail::value_type<Sink2>::type value_type2;
- typedef typename char_type_of<Sink1>::type char_type;
+ typedef typename detail::param_type<Device>::type device_param;
+ typedef typename detail::param_type<Sink>::type sink_param;
+ typedef typename detail::value_type<Device>::type device_value;
+ typedef typename detail::value_type<Sink>::type sink_value;
+ typedef typename char_type_of<Device>::type char_type;
+ typedef typename
+ mpl::if_<
+ is_convertible<
+ BOOST_DEDUCED_TYPENAME
+ iostreams::category_of<Device>::type,
+ output
+ >,
+ output,
+ input
+ >::type mode;
BOOST_STATIC_ASSERT((
is_same<
char_type,
- BOOST_DEDUCED_TYPENAME char_type_of<Sink2>::type
- >::value
- ));
- BOOST_STATIC_ASSERT((
- is_convertible< // Using mode_of causes failures on VC6-7.0.
- BOOST_DEDUCED_TYPENAME iostreams::category_of<Sink1>::type, output
+ BOOST_DEDUCED_TYPENAME char_type_of<Sink>::type
>::value
));
BOOST_STATIC_ASSERT((
- is_convertible< // Using mode_of causes failures on VC6-7.0.
- BOOST_DEDUCED_TYPENAME iostreams::category_of<Sink2>::type, output
+ is_convertible<
+ BOOST_DEDUCED_TYPENAME iostreams::category_of<Sink>::type,
+ output
>::value
));
struct category
- : output,
+ : mode,
device_tag,
closable_tag,
flushable_tag,
localizable_tag,
optimally_buffered_tag
{ };
- tee_device(param_type1 sink1, param_type2 sink2)
- : sink1_(sink1), sink2_(sink2)
+ tee_device(device_param device, sink_param sink)
+ : dev_(device), sink_(sink)
{ }
+ std::streamsize read(char_type* s, std::streamsize n)
+ {
+ BOOST_STATIC_ASSERT((
+ is_convertible<
+ BOOST_DEDUCED_TYPENAME iostreams::category_of<Device>::type, input
+ >::value
+ ));
+ std::streamsize result1 = iostreams::read(dev_, s, n);
+ if (result1 != -1) {
+ std::streamsize result2 = iostreams::write(sink_, s, result1);
+ (void) result1; // Suppress 'unused variable' warning.
+ (void) result2;
+ assert(result1 == result2);
+ }
+ return result1;
+ }
std::streamsize write(const char_type* s, std::streamsize n)
{
- std::streamsize result1 = iostreams::write(sink1_, s, n);
- std::streamsize result2 = iostreams::write(sink2_, s, n);
+ BOOST_STATIC_ASSERT((
+ is_convertible<
+ BOOST_DEDUCED_TYPENAME iostreams::category_of<Device>::type, output
+ >::value
+ ));
+ std::streamsize result1 = iostreams::write(dev_, s, n);
+ std::streamsize result2 = iostreams::write(sink_, s, n);
(void) result1; // Suppress 'unused variable' warning.
(void) result2;
assert(result1 == n && result2 == n);
@@ -135,38 +175,38 @@
}
void close()
{
- detail::execute_all( detail::call_close_all(sink1_),
- detail::call_close_all(sink2_) );
+ detail::execute_all( detail::call_close_all(dev_),
+ detail::call_close_all(sink_) );
}
bool flush()
{
- bool r1 = iostreams::flush(sink1_);
- bool r2 = iostreams::flush(sink2_);
+ bool r1 = iostreams::flush(dev_);
+ bool r2 = iostreams::flush(sink_);
return r1 && r2;
}
template<typename Locale>
void imbue(const Locale& loc)
{
- iostreams::imbue(sink1_, loc);
- iostreams::imbue(sink2_, loc);
+ iostreams::imbue(dev_, loc);
+ iostreams::imbue(sink_, loc);
}
std::streamsize optimal_buffer_size() const
{
- return (std::max) ( iostreams::optimal_buffer_size(sink1_),
- iostreams::optimal_buffer_size(sink2_) );
+ return (std::max) ( iostreams::optimal_buffer_size(dev_),
+ iostreams::optimal_buffer_size(sink_) );
}
private:
- value_type1 sink1_;
- value_type2 sink2_;
+ device_value dev_;
+ sink_value sink_;
};
template<typename Sink>
tee_filter<Sink> tee(const Sink& snk)
{ return tee_filter<Sink>(snk); }
-template<typename Sink1, typename Sink2>
-tee_device<Sink1, Sink2> tee(const Sink1& sink1, const Sink2& sink2)
-{ return tee_device<Sink1, Sink2>(sink1, sink2); }
+template<typename Device, typename Sink>
+tee_device<Device, Sink> tee(const Device& dev, const Sink& sink)
+{ return tee_device<Device, Sink>(dev, sink); }
} } // End namespaces iostreams, boost.
Modified: branches/proto/v4/boost/iostreams/traits.hpp
==============================================================================
--- branches/proto/v4/boost/iostreams/traits.hpp (original)
+++ branches/proto/v4/boost/iostreams/traits.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -21,6 +21,7 @@
#include <iosfwd> // stream types, char_traits.
#include <boost/config.hpp> // partial spec, deduced typename.
+#include <boost/detail/workaround.hpp>
#include <boost/iostreams/categories.hpp>
#include <boost/iostreams/detail/bool_trait_def.hpp>
#include <boost/iostreams/detail/config/wide_streams.hpp>
@@ -38,12 +39,18 @@
# include <boost/range/iterator_range.hpp>
# include <boost/range/value_type.hpp>
#endif // #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
-#include <boost/type_traits/is_convertible.hpp>
+#include <boost/ref.hpp>
+#include <boost/type_traits/is_convertible.hpp>
namespace boost { namespace iostreams {
//----------Definitions of predicates for streams and stream buffers----------//
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
+# pragma warning(push)
+# pragma warning(disable:6334)
+#endif
+
#ifndef BOOST_IOSTREAMS_NO_STREAM_TEMPLATES //--------------------------------//
BOOST_IOSTREAMS_BOOL_TRAIT_DEF(is_istream, std::basic_istream, 2)
@@ -68,6 +75,10 @@
#endif // #ifndef BOOST_IOSTREAMS_NO_STREAM_TEMPLATES //----------------------//
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
+# pragma warning(pop)
+#endif
+
template<typename T>
struct is_std_io
: mpl::or_< is_istream<T>, is_ostream<T>, is_streambuf<T> >
@@ -269,6 +280,16 @@
>::type type;
};
+// Partial specialization for reference wrappers
+#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION //---------------------------//
+
+template<typename T>
+struct category_of< reference_wrapper<T> >
+ : category_of<T>
+ { };
+
+#endif // #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION //-----------------//
+
//------------------Definition of get_category--------------------------------//
//
@@ -292,7 +313,7 @@
#endif
};
-//------------------Definition of mode----------------------------------------//
+//------------------Definition of mode_of-------------------------------------//
namespace detail {
@@ -323,6 +344,16 @@
template<typename T> // Borland 5.6.4 requires this circumlocution.
struct mode_of : detail::io_mode_impl< detail::io_mode_id<T>::value > { };
+
+// Partial specialization for reference wrappers
+#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION //---------------------------//
+
+template<typename T>
+struct mode_of< reference_wrapper<T> >
+ : mode_of<T>
+ { };
+
+#endif // #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION //-----------------//
//------------------Definition of is_device, is_filter and is_direct----------//
Modified: branches/proto/v4/boost/lexical_cast.hpp
==============================================================================
--- branches/proto/v4/boost/lexical_cast.hpp (original)
+++ branches/proto/v4/boost/lexical_cast.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -19,6 +19,7 @@
#include <istream>
#include <string>
#include <typeinfo>
+#include <exception>
#include <boost/config.hpp>
#include <boost/limits.hpp>
#include <boost/mpl/if.hpp>
@@ -28,6 +29,7 @@
#include <boost/call_traits.hpp>
#include <boost/static_assert.hpp>
#include <boost/detail/lcast_precision.hpp>
+#include <boost/detail/workaround.hpp>
#ifndef BOOST_NO_STD_LOCALE
#include <locale>
@@ -49,6 +51,12 @@
{
// exception used to indicate runtime lexical_cast failure
class bad_lexical_cast : public std::bad_cast
+
+#if defined(__BORLANDC__) && BOOST_WORKAROUND( __BORLANDC__, < 0x560 )
+ // under bcc32 5.5.1 bad_cast doesn't derive from exception
+ , public std::exception
+#endif
+
{
public:
bad_lexical_cast() :
Modified: branches/proto/v4/boost/math/special_functions/pow.hpp
==============================================================================
--- branches/proto/v4/boost/math/special_functions/pow.hpp (original)
+++ branches/proto/v4/boost/math/special_functions/pow.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -38,7 +38,7 @@
};
template <>
-struct positive_power<1, false>
+struct positive_power<1, true>
{
template <typename T>
static typename tools::promote_args<T>::type result(T x)
Modified: branches/proto/v4/boost/math/tr1.hpp
==============================================================================
--- branches/proto/v4/boost/math/tr1.hpp (original)
+++ branches/proto/v4/boost/math/tr1.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -14,6 +14,7 @@
#ifdef __cplusplus
#include <boost/config.hpp>
+#include <boost/static_assert.hpp>
namespace boost{ namespace math{ namespace tr1{ extern "C"{
Modified: branches/proto/v4/boost/mpi/python/serialize.hpp
==============================================================================
--- branches/proto/v4/boost/mpi/python/serialize.hpp (original)
+++ branches/proto/v4/boost/mpi/python/serialize.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -317,8 +317,8 @@
template<typename T>
struct default_saver {
void operator()(OArchiver& ar, const object& obj, const unsigned int) {
- typedef typename mpl::if_<is_fundamental<T>, T, T&>::type Type;
- ar << extract<Type>(obj)();
+ T value = extract<T>(obj)();
+ ar << value;
}
};
Modified: branches/proto/v4/boost/rational.hpp
==============================================================================
--- branches/proto/v4/boost/rational.hpp (original)
+++ branches/proto/v4/boost/rational.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -51,7 +51,7 @@
#define BOOST_RATIONAL_HPP
#include <iostream> // for std::istream and std::ostream
-#include <iomanip> // for std::noskipws
+#include <ios> // for std::noskipws
#include <stdexcept> // for std::domain_error
#include <string> // for std::string implicit constructor
#include <boost/operators.hpp> // for boost::addable etc
Modified: branches/proto/v4/boost/spirit/home/classic/core/scanner/scanner.hpp
==============================================================================
--- branches/proto/v4/boost/spirit/home/classic/core/scanner/scanner.hpp (original)
+++ branches/proto/v4/boost/spirit/home/classic/core/scanner/scanner.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -248,22 +248,22 @@
bool
at_end() const
{
- typedef typename PoliciesT::iteration_policy_t iteration_policy_t;
- return iteration_policy_t::at_end(*this);
+ typedef typename PoliciesT::iteration_policy_t iteration_policy_type;
+ return iteration_policy_type::at_end(*this);
}
value_t
operator*() const
{
- typedef typename PoliciesT::iteration_policy_t iteration_policy_t;
- return iteration_policy_t::filter(iteration_policy_t::get(*this));
+ typedef typename PoliciesT::iteration_policy_t iteration_policy_type;
+ return iteration_policy_type::filter(iteration_policy_type::get(*this));
}
scanner const&
operator++() const
{
- typedef typename PoliciesT::iteration_policy_t iteration_policy_t;
- iteration_policy_t::advance(*this);
+ typedef typename PoliciesT::iteration_policy_t iteration_policy_type;
+ iteration_policy_type::advance(*this);
return *this;
}
Modified: branches/proto/v4/boost/test/impl/execution_monitor.ipp
==============================================================================
--- branches/proto/v4/boost/test/impl/execution_monitor.ipp (original)
+++ branches/proto/v4/boost/test/impl/execution_monitor.ipp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -69,9 +69,13 @@
# include <eh.h>
# endif
-# if defined(__BORLANDC__) || defined(__MWERKS__)
+# if defined(__BORLANDC__) && __BORLANDC__ >= 0x560 || defined(__MWERKS__)
# include <stdint.h>
-#endif
+# endif
+
+# if defined(__BORLANDC__) && __BORLANDC__ < 0x560
+ typedef unsigned uintptr_t;
+# endif
# if BOOST_WORKAROUND(_MSC_VER, < 1300 ) || defined(UNDER_CE)
typedef void* uintptr_t;
@@ -139,7 +143,7 @@
# define BOOST_TEST_USE_ALT_STACK
# endif
-# if !defined(__CYGWIN__) && \
+# if defined(SIGPOLL) && !defined(__CYGWIN__) && \
!(defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)) && \
!defined(__NetBSD__)
# define BOOST_TEST_CATCH_SIGPOLL
Modified: branches/proto/v4/boost/thread/exceptions.hpp
==============================================================================
--- branches/proto/v4/boost/thread/exceptions.hpp (original)
+++ branches/proto/v4/boost/thread/exceptions.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -19,7 +19,11 @@
#include <string>
#include <stdexcept>
-namespace boost {
+namespace boost
+{
+
+ class BOOST_THREAD_DECL thread_interrupted
+ {};
class BOOST_THREAD_DECL thread_exception : public std::exception
{
Modified: branches/proto/v4/boost/thread/locks.hpp
==============================================================================
--- branches/proto/v4/boost/thread/locks.hpp (original)
+++ branches/proto/v4/boost/thread/locks.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -625,11 +625,19 @@
using base::try_lock;
using base::unlock;
using base::owns_lock;
- using base::operator!;
using base::mutex;
using base::release;
+
+ bool operator!() const
+ {
+ return !this->owns_lock();
+ }
+
typedef typename base::bool_type bool_type;
- using base::operator bool_type;
+ operator bool_type() const
+ {
+ return static_cast<base const&>(*this);
+ }
};
template<typename MutexType1,typename MutexType2>
Deleted: branches/proto/v4/boost/thread/pthread/thread.hpp
==============================================================================
--- branches/proto/v4/boost/thread/pthread/thread.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
+++ (empty file)
@@ -1,352 +0,0 @@
-#ifndef BOOST_THREAD_THREAD_PTHREAD_HPP
-#define BOOST_THREAD_THREAD_PTHREAD_HPP
-// Copyright (C) 2001-2003
-// William E. Kempf
-// Copyright (C) 2007 Anthony Williams
-//
-// 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)
-
-#include <boost/thread/detail/config.hpp>
-
-#include <boost/utility.hpp>
-#include <boost/function.hpp>
-#include <boost/thread/mutex.hpp>
-#include <boost/thread/condition_variable.hpp>
-#include <list>
-#include <memory>
-
-#include <pthread.h>
-#include <boost/optional.hpp>
-#include <boost/thread/detail/move.hpp>
-#include <boost/shared_ptr.hpp>
-#include "thread_data.hpp"
-#include <boost/bind.hpp>
-#include <stdlib.h>
-
-#ifdef BOOST_MSVC
-#pragma warning(push)
-#pragma warning(disable:4251)
-#endif
-
-namespace boost
-{
- class thread;
-
- namespace detail
- {
- class thread_id;
- }
-
- namespace this_thread
- {
- BOOST_THREAD_DECL detail::thread_id get_id();
- }
-
- namespace detail
- {
- class thread_id
- {
- private:
- detail::thread_data_ptr thread_data;
-
- thread_id(detail::thread_data_ptr thread_data_):
- thread_data(thread_data_)
- {}
- friend class boost::thread;
- friend thread_id this_thread::get_id();
- public:
- thread_id():
- thread_data()
- {}
-
- bool operator==(const thread_id& y) const
- {
- return thread_data==y.thread_data;
- }
-
- bool operator!=(const thread_id& y) const
- {
- return thread_data!=y.thread_data;
- }
-
- bool operator<(const thread_id& y) const
- {
- return thread_data<y.thread_data;
- }
-
- bool operator>(const thread_id& y) const
- {
- return y.thread_data<thread_data;
- }
-
- bool operator<=(const thread_id& y) const
- {
- return !(y.thread_data<thread_data);
- }
-
- bool operator>=(const thread_id& y) const
- {
- return !(thread_data<y.thread_data);
- }
-
- template<class charT, class traits>
- friend std::basic_ostream<charT, traits>&
- operator<<(std::basic_ostream<charT, traits>& os, const thread_id& x)
- {
- if(x.thread_data)
- {
- return os<<x.thread_data;
- }
- else
- {
- return os<<"{Not-any-thread}";
- }
- }
- };
- }
-
- struct xtime;
- class BOOST_THREAD_DECL thread
- {
- private:
- thread(thread&);
- thread& operator=(thread&);
-
- template<typename F>
- struct thread_data:
- detail::thread_data_base
- {
- F f;
-
- thread_data(F f_):
- f(f_)
- {}
- thread_data(detail::thread_move_t<F> f_):
- f(f_)
- {}
-
- void run()
- {
- f();
- }
- };
-
- mutable boost::mutex thread_info_mutex;
- detail::thread_data_ptr thread_info;
-
- void start_thread();
-
- explicit thread(detail::thread_data_ptr data);
-
- detail::thread_data_ptr get_thread_info() const;
-
- template<typename F>
- static inline detail::thread_data_ptr make_thread_info(F f)
- {
- return detail::thread_data_ptr(new thread_data<F>(f));
- }
-
- public:
- thread();
- ~thread();
-
- template <class F>
- explicit thread(F f):
- thread_info(make_thread_info(f))
- {
- start_thread();
- }
- template <class F>
- thread(detail::thread_move_t<F> f):
- thread_info(make_thread_info(f))
- {
- start_thread();
- }
-
- template <class F,class A1>
- thread(F f,A1 a1):
- thread_info(make_thread_info(boost::bind<void>(f,a1)))
- {
- start_thread();
- }
- template <class F,class A1,class A2>
- thread(F f,A1 a1,A2 a2):
- thread_info(make_thread_info(boost::bind<void>(f,a1,a2)))
- {
- start_thread();
- }
- template <class F,class A1,class A2,class A3>
- thread(F f,A1 a1,A2 a2,A3 a3):
- thread_info(make_thread_info(boost::bind<void>(f,a1,a2,a3)))
- {
- start_thread();
- }
-
- thread(detail::thread_move_t<thread> x);
- thread& operator=(detail::thread_move_t<thread> x);
- operator detail::thread_move_t<thread>();
- detail::thread_move_t<thread> move();
-
- void swap(thread& x);
-
- typedef detail::thread_id id;
-
- id get_id() const;
-
- bool joinable() const;
- void join();
- bool timed_join(const system_time& wait_until);
-
- template<typename TimeDuration>
- inline bool timed_join(TimeDuration const& rel_time)
- {
- return timed_join(get_system_time()+rel_time);
- }
- void detach();
-
- static unsigned hardware_concurrency();
-
- // backwards compatibility
- bool operator==(const thread& other) const;
- bool operator!=(const thread& other) const;
-
- static void sleep(const system_time& xt);
- static void yield();
-
- typedef pthread_t native_handle_type;
- native_handle_type native_handle();
-
- // extensions
- void interrupt();
- bool interruption_requested() const;
- };
-
- inline detail::thread_move_t<thread> move(detail::thread_move_t<thread> t)
- {
- return t;
- }
-
- template<typename F>
- struct thread::thread_data<boost::reference_wrapper<F> >:
- detail::thread_data_base
- {
- F& f;
-
- thread_data(boost::reference_wrapper<F> f_):
- f(f_)
- {}
-
- void run()
- {
- f();
- }
- };
-
- namespace this_thread
- {
- class BOOST_THREAD_DECL disable_interruption
- {
- disable_interruption(const disable_interruption&);
- disable_interruption& operator=(const disable_interruption&);
-
- bool interruption_was_enabled;
- friend class restore_interruption;
- public:
- disable_interruption();
- ~disable_interruption();
- };
-
- class BOOST_THREAD_DECL restore_interruption
- {
- restore_interruption(const restore_interruption&);
- restore_interruption& operator=(const restore_interruption&);
- public:
- explicit restore_interruption(disable_interruption& d);
- ~restore_interruption();
- };
-
- BOOST_THREAD_DECL thread::id get_id();
-
- BOOST_THREAD_DECL void interruption_point();
- BOOST_THREAD_DECL bool interruption_enabled();
- BOOST_THREAD_DECL bool interruption_requested();
-
- inline void yield()
- {
- thread::yield();
- }
-
- template<typename TimeDuration>
- inline void sleep(TimeDuration const& rel_time)
- {
- thread::sleep(get_system_time()+rel_time);
- }
- }
-
- namespace detail
- {
- struct thread_exit_function_base
- {
- virtual ~thread_exit_function_base()
- {}
- virtual void operator()() const=0;
- };
-
- template<typename F>
- struct thread_exit_function:
- thread_exit_function_base
- {
- F f;
-
- thread_exit_function(F f_):
- f(f_)
- {}
-
- void operator()() const
- {
- f();
- }
- };
-
- BOOST_THREAD_DECL void add_thread_exit_function(thread_exit_function_base*);
- }
-
- namespace this_thread
- {
- template<typename F>
- inline void at_thread_exit(F f)
- {
- detail::thread_exit_function_base* const thread_exit_func=new detail::thread_exit_function<F>(f);
- detail::add_thread_exit_function(thread_exit_func);
- }
- }
-
- class BOOST_THREAD_DECL thread_group
- {
- public:
- thread_group();
- ~thread_group();
-
- thread* create_thread(const function0<void>& threadfunc);
- void add_thread(thread* thrd);
- void remove_thread(thread* thrd);
- void join_all();
- void interrupt_all();
- size_t size() const;
-
- private:
- thread_group(thread_group&);
- void operator=(thread_group&);
-
- std::list<thread*> m_threads;
- mutex m_mutex;
- };
-} // namespace boost
-
-#ifdef BOOST_MSVC
-#pragma warning(pop)
-#endif
-
-
-#endif
Modified: branches/proto/v4/boost/thread/pthread/thread_data.hpp
==============================================================================
--- branches/proto/v4/boost/thread/pthread/thread_data.hpp (original)
+++ branches/proto/v4/boost/thread/pthread/thread_data.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -6,6 +6,7 @@
// (C) Copyright 2007 Anthony Williams
#include <boost/thread/detail/config.hpp>
+#include <boost/thread/exceptions.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp>
#include <boost/thread/mutex.hpp>
@@ -15,9 +16,8 @@
namespace boost
{
- class thread_interrupted
- {};
-
+ class thread;
+
namespace detail
{
struct thread_exit_callback_node;
@@ -26,7 +26,7 @@
struct thread_data_base;
typedef boost::shared_ptr<thread_data_base> thread_data_ptr;
- struct thread_data_base:
+ struct BOOST_THREAD_DECL thread_data_base:
enable_shared_from_this<thread_data_base>
{
thread_data_ptr self;
@@ -51,8 +51,9 @@
interrupt_requested(false),
current_cond(0)
{}
- virtual ~thread_data_base()
- {}
+ virtual ~thread_data_base();
+
+ typedef pthread_t native_handle_type;
virtual void run()=0;
};
@@ -95,6 +96,19 @@
}
};
}
+
+ namespace this_thread
+ {
+ void BOOST_THREAD_DECL yield();
+
+ void BOOST_THREAD_DECL sleep(system_time const& abs_time);
+
+ template<typename TimeDuration>
+ inline void sleep(TimeDuration const& rel_time)
+ {
+ this_thread::sleep(get_system_time()+rel_time);
+ }
+ }
}
Modified: branches/proto/v4/boost/thread/thread.hpp
==============================================================================
--- branches/proto/v4/boost/thread/thread.hpp (original)
+++ branches/proto/v4/boost/thread/thread.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -3,7 +3,7 @@
// thread.hpp
//
-// (C) Copyright 2007 Anthony Williams
+// (C) Copyright 2007-8 Anthony Williams
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
@@ -12,11 +12,14 @@
#include <boost/thread/detail/platform.hpp>
#if defined(BOOST_THREAD_PLATFORM_WIN32)
-#include <boost/thread/win32/thread.hpp>
+#include <boost/thread/win32/thread_data.hpp>
#elif defined(BOOST_THREAD_PLATFORM_PTHREAD)
-#include <boost/thread/pthread/thread.hpp>
+#include <boost/thread/pthread/thread_data.hpp>
#else
#error "Boost threads unavailable on this platform"
#endif
+#include <boost/thread/detail/thread.hpp>
+
+
#endif
Modified: branches/proto/v4/boost/thread/win32/condition_variable.hpp
==============================================================================
--- branches/proto/v4/boost/thread/win32/condition_variable.hpp (original)
+++ branches/proto/v4/boost/thread/win32/condition_variable.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -46,21 +46,11 @@
notified=true;
detail::win32::ReleaseSemaphore(semaphore,count_to_release,0);
}
-
- friend void intrusive_ptr_add_ref(list_entry * p)
- {
- BOOST_INTERLOCKED_INCREMENT(&p->references);
- }
-
- friend void intrusive_ptr_release(list_entry * p)
- {
- if(!BOOST_INTERLOCKED_DECREMENT(&p->references))
- {
- delete p;
- }
- }
};
+ friend void intrusive_ptr_add_ref(list_entry * p);
+ friend void intrusive_ptr_release(list_entry * p);
+
typedef boost::intrusive_ptr<list_entry> entry_ptr;
typedef std::vector<entry_ptr> generation_list;
@@ -206,7 +196,7 @@
{
if(detail::interlocked_read_acquire(&total_count))
{
- boost::mutex::scoped_lock internal_lock(internal_mutex);
+ boost::lock_guard<boost::mutex> internal_lock(internal_mutex);
if(!total_count)
{
return;
@@ -227,7 +217,7 @@
{
if(detail::interlocked_read_acquire(&total_count))
{
- boost::mutex::scoped_lock internal_lock(internal_mutex);
+ boost::lock_guard<boost::mutex> internal_lock(internal_mutex);
if(!total_count)
{
return;
@@ -239,11 +229,26 @@
{
(*it)->release(detail::interlocked_read_acquire(&(*it)->waiters));
}
+ generations.clear();
wake_sem=detail::win32::handle(0);
}
}
};
+ inline void intrusive_ptr_add_ref(basic_condition_variable::list_entry * p)
+ {
+ BOOST_INTERLOCKED_INCREMENT(&p->references);
+ }
+
+ inline void intrusive_ptr_release(basic_condition_variable::list_entry * p)
+ {
+ if(!BOOST_INTERLOCKED_DECREMENT(&p->references))
+ {
+ delete p;
+ }
+ }
+
+
}
class condition_variable:
Deleted: branches/proto/v4/boost/thread/win32/thread.hpp
==============================================================================
--- branches/proto/v4/boost/thread/win32/thread.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
+++ (empty file)
@@ -1,576 +0,0 @@
-#ifndef BOOST_THREAD_THREAD_WIN32_HPP
-#define BOOST_THREAD_THREAD_WIN32_HPP
-// 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)
-// (C) Copyright 2007 Anthony Williams
-
-#include <exception>
-#include <boost/thread/exceptions.hpp>
-#include <ostream>
-#include <boost/thread/detail/move.hpp>
-#include <boost/intrusive_ptr.hpp>
-#include <boost/thread/mutex.hpp>
-#include <boost/thread/thread_time.hpp>
-#include "thread_primitives.hpp"
-#include "thread_heap_alloc.hpp"
-#include <boost/utility.hpp>
-#include <boost/assert.hpp>
-#include <list>
-#include <algorithm>
-#include <boost/ref.hpp>
-#include <boost/cstdint.hpp>
-#include <boost/bind.hpp>
-#include <stdlib.h>
-#include <memory>
-
-#ifdef BOOST_MSVC
-#pragma warning(push)
-#pragma warning(disable:4251)
-#endif
-
-namespace boost
-{
- class thread_interrupted
- {};
-
- namespace detail
- {
- struct thread_exit_callback_node;
- struct tss_data_node;
-
- struct thread_data_base
- {
- long count;
- detail::win32::handle_manager thread_handle;
- detail::win32::handle_manager interruption_handle;
- boost::detail::thread_exit_callback_node* thread_exit_callbacks;
- boost::detail::tss_data_node* tss_data;
- bool interruption_enabled;
- unsigned id;
-
- thread_data_base():
- count(0),thread_handle(detail::win32::invalid_handle_value),
- interruption_handle(create_anonymous_event(detail::win32::manual_reset_event,detail::win32::event_initially_reset)),
- thread_exit_callbacks(0),tss_data(0),
- interruption_enabled(true),
- id(0)
- {}
- virtual ~thread_data_base()
- {}
-
- friend void intrusive_ptr_add_ref(thread_data_base * p)
- {
- BOOST_INTERLOCKED_INCREMENT(&p->count);
- }
-
- friend void intrusive_ptr_release(thread_data_base * p)
- {
- if(!BOOST_INTERLOCKED_DECREMENT(&p->count))
- {
- detail::heap_delete(p);
- }
- }
-
- void interrupt()
- {
- BOOST_VERIFY(detail::win32::SetEvent(interruption_handle)!=0);
- }
-
-
- virtual void run()=0;
- };
-
- typedef boost::intrusive_ptr<detail::thread_data_base> thread_data_ptr;
-
- struct timeout
- {
- unsigned long start;
- uintmax_t milliseconds;
- bool relative;
- boost::system_time abs_time;
-
- static unsigned long const max_non_infinite_wait=0xfffffffe;
-
- timeout(uintmax_t milliseconds_):
- start(win32::GetTickCount()),
- milliseconds(milliseconds_),
- relative(true),
- abs_time(boost::get_system_time())
- {}
-
- timeout(boost::system_time const& abs_time_):
- start(win32::GetTickCount()),
- milliseconds(0),
- relative(false),
- abs_time(abs_time_)
- {}
-
- struct remaining_time
- {
- bool more;
- unsigned long milliseconds;
-
- remaining_time(uintmax_t remaining):
- more(remaining>max_non_infinite_wait),
- milliseconds(more?max_non_infinite_wait:(unsigned long)remaining)
- {}
- };
-
- remaining_time remaining_milliseconds() const
- {
- if(is_sentinel())
- {
- return remaining_time(win32::infinite);
- }
- else if(relative)
- {
- unsigned long const now=win32::GetTickCount();
- unsigned long const elapsed=now-start;
- return remaining_time((elapsed<milliseconds)?(milliseconds-elapsed):0);
- }
- else
- {
- system_time const now=get_system_time();
- if(abs_time<=now)
- {
- return remaining_time(0);
- }
- return remaining_time((abs_time-now).total_milliseconds()+1);
- }
- }
-
- bool is_sentinel() const
- {
- return milliseconds==~uintmax_t(0);
- }
-
-
- static timeout sentinel()
- {
- return timeout(sentinel_type());
- }
- private:
- struct sentinel_type
- {};
-
- explicit timeout(sentinel_type):
- start(0),milliseconds(~uintmax_t(0)),relative(true)
- {}
- };
- }
-
- class BOOST_THREAD_DECL thread
- {
- private:
- thread(thread&);
- thread& operator=(thread&);
-
- void release_handle();
-
- template<typename F>
- struct thread_data:
- detail::thread_data_base
- {
- F f;
-
-#ifdef BOOST_HAS_RVALUE_REFS
- thread_data(F&& f_):
- f(static_cast<F&&>(f_))
- {}
-#else
- thread_data(F f_):
- f(f_)
- {}
- thread_data(detail::thread_move_t<F> f_):
- f(f_)
- {}
-#endif
- void run()
- {
- f();
- }
- private:
- void operator=(thread_data&);
- thread_data(thread_data&);
- };
-
- mutable boost::mutex thread_info_mutex;
- detail::thread_data_ptr thread_info;
-
- static unsigned __stdcall thread_start_function(void* param);
-
- void start_thread();
-
- explicit thread(detail::thread_data_ptr data);
-
- detail::thread_data_ptr get_thread_info() const;
-
-#ifdef BOOST_HAS_RVALUE_REFS
- template<typename F>
- static inline detail::thread_data_ptr make_thread_info(F&& f)
- {
- return detail::heap_new<thread_data<F> >(static_cast<F&&>(f));
- }
-#else
- template<typename F>
- static inline detail::thread_data_ptr make_thread_info(F f)
- {
- return detail::heap_new<thread_data<F> >(f);
- }
- template<typename F>
- static inline detail::thread_data_ptr make_thread_info(boost::detail::thread_move_t<F> f)
- {
- return detail::heap_new<thread_data<F> >(f);
- }
-#endif
- public:
- thread();
- ~thread();
-
-#ifdef BOOST_HAS_RVALUE_REFS
- template <class F>
- thread(F&& f):
- thread_info(make_thread_info(static_cast<F&&>(f)))
- {
- start_thread();
- }
-#else
- template <class F>
- explicit thread(F f):
- thread_info(make_thread_info(f))
- {
- start_thread();
- }
-
- template <class F>
- thread(detail::thread_move_t<F> f):
- thread_info(make_thread_info(f))
- {
- start_thread();
- }
-#endif
-
- template <class F,class A1>
- thread(F f,A1 a1):
- thread_info(make_thread_info(boost::bind<void>(f,a1)))
- {
- start_thread();
- }
- template <class F,class A1,class A2>
- thread(F f,A1 a1,A2 a2):
- thread_info(make_thread_info(boost::bind<void>(f,a1,a2)))
- {
- start_thread();
- }
- template <class F,class A1,class A2,class A3>
- thread(F f,A1 a1,A2 a2,A3 a3):
- thread_info(make_thread_info(boost::bind<void>(f,a1,a2,a3)))
- {
- start_thread();
- }
-
- thread(detail::thread_move_t<thread> x);
- thread& operator=(detail::thread_move_t<thread> x);
- operator detail::thread_move_t<thread>();
- detail::thread_move_t<thread> move();
-
- void swap(thread& x);
-
- class id;
- id get_id() const;
-
-
- bool joinable() const;
- void join();
- bool timed_join(const system_time& wait_until);
-
- template<typename TimeDuration>
- inline bool timed_join(TimeDuration const& rel_time)
- {
- return timed_join(get_system_time()+rel_time);
- }
- void detach();
-
- static unsigned hardware_concurrency();
-
- typedef detail::win32::handle native_handle_type;
- native_handle_type native_handle();
-
- // backwards compatibility
- bool operator==(const thread& other) const;
- bool operator!=(const thread& other) const;
-
- static void yield();
- static void sleep(const system_time& xt);
-
- // extensions
- void interrupt();
- bool interruption_requested() const;
- };
-
- inline detail::thread_move_t<thread> move(detail::thread_move_t<thread> t)
- {
- return t;
- }
-
- template<typename F>
- struct thread::thread_data<boost::reference_wrapper<F> >:
- detail::thread_data_base
- {
- F& f;
-
- thread_data(boost::reference_wrapper<F> f_):
- f(f_)
- {}
-
- void run()
- {
- f();
- }
- };
-
-
- namespace this_thread
- {
- class BOOST_THREAD_DECL disable_interruption
- {
- disable_interruption(const disable_interruption&);
- disable_interruption& operator=(const disable_interruption&);
-
- bool interruption_was_enabled;
- friend class restore_interruption;
- public:
- disable_interruption();
- ~disable_interruption();
- };
-
- class BOOST_THREAD_DECL restore_interruption
- {
- restore_interruption(const restore_interruption&);
- restore_interruption& operator=(const restore_interruption&);
- public:
- explicit restore_interruption(disable_interruption& d);
- ~restore_interruption();
- };
-
- thread::id BOOST_THREAD_DECL get_id();
-
- bool BOOST_THREAD_DECL interruptible_wait(detail::win32::handle handle_to_wait_for,detail::timeout target_time);
- inline bool interruptible_wait(unsigned long milliseconds)
- {
- return interruptible_wait(detail::win32::invalid_handle_value,milliseconds);
- }
-
- void BOOST_THREAD_DECL interruption_point();
- bool BOOST_THREAD_DECL interruption_enabled();
- bool BOOST_THREAD_DECL interruption_requested();
-
- void BOOST_THREAD_DECL yield();
- template<typename TimeDuration>
- void sleep(TimeDuration const& rel_time)
- {
- interruptible_wait(static_cast<unsigned long>(rel_time.total_milliseconds()));
- }
- }
-
- class thread::id
- {
- private:
- detail::thread_data_ptr thread_data;
-
- id(detail::thread_data_ptr thread_data_):
- thread_data(thread_data_)
- {}
- friend class thread;
- friend id this_thread::get_id();
- public:
- id():
- thread_data(0)
- {}
-
- bool operator==(const id& y) const
- {
- return thread_data==y.thread_data;
- }
-
- bool operator!=(const id& y) const
- {
- return thread_data!=y.thread_data;
- }
-
- bool operator<(const id& y) const
- {
- return thread_data<y.thread_data;
- }
-
- bool operator>(const id& y) const
- {
- return y.thread_data<thread_data;
- }
-
- bool operator<=(const id& y) const
- {
- return !(y.thread_data<thread_data);
- }
-
- bool operator>=(const id& y) const
- {
- return !(thread_data<y.thread_data);
- }
-
- template<class charT, class traits>
- friend std::basic_ostream<charT, traits>&
- operator<<(std::basic_ostream<charT, traits>& os, const id& x)
- {
- if(x.thread_data)
- {
- return os<<x.thread_data;
- }
- else
- {
- return os<<"{Not-any-thread}";
- }
- }
-
- void interrupt()
- {
- if(thread_data)
- {
- thread_data->interrupt();
- }
- }
-
- };
-
- inline bool thread::operator==(const thread& other) const
- {
- return get_id()==other.get_id();
- }
-
- inline bool thread::operator!=(const thread& other) const
- {
- return get_id()!=other.get_id();
- }
-
- namespace detail
- {
- struct thread_exit_function_base
- {
- virtual ~thread_exit_function_base()
- {}
- virtual void operator()() const=0;
- };
-
- template<typename F>
- struct thread_exit_function:
- thread_exit_function_base
- {
- F f;
-
- thread_exit_function(F f_):
- f(f_)
- {}
-
- void operator()() const
- {
- f();
- }
- };
-
- void add_thread_exit_function(thread_exit_function_base*);
- }
-
- namespace this_thread
- {
- template<typename F>
- void at_thread_exit(F f)
- {
- detail::thread_exit_function_base* const thread_exit_func=detail::heap_new<detail::thread_exit_function<F> >(f);
- detail::add_thread_exit_function(thread_exit_func);
- }
- }
-
- class thread_group:
- private noncopyable
- {
- public:
- ~thread_group()
- {
- for(std::list<thread*>::iterator it=threads.begin(),end=threads.end();
- it!=end;
- ++it)
- {
- delete *it;
- }
- }
-
- template<typename F>
- thread* create_thread(F threadfunc)
- {
- boost::lock_guard<mutex> guard(m);
- std::auto_ptr<thread> new_thread(new thread(threadfunc));
- threads.push_back(new_thread.get());
- return new_thread.release();
- }
-
- void add_thread(thread* thrd)
- {
- if(thrd)
- {
- boost::lock_guard<mutex> guard(m);
- threads.push_back(thrd);
- }
- }
-
- void remove_thread(thread* thrd)
- {
- boost::lock_guard<mutex> guard(m);
- std::list<thread*>::iterator const it=std::find(threads.begin(),threads.end(),thrd);
- if(it!=threads.end())
- {
- threads.erase(it);
- }
- }
-
- void join_all()
- {
- boost::lock_guard<mutex> guard(m);
-
- for(std::list<thread*>::iterator it=threads.begin(),end=threads.end();
- it!=end;
- ++it)
- {
- (*it)->join();
- }
- }
-
- void interrupt_all()
- {
- boost::lock_guard<mutex> guard(m);
-
- for(std::list<thread*>::iterator it=threads.begin(),end=threads.end();
- it!=end;
- ++it)
- {
- (*it)->interrupt();
- }
- }
-
- size_t size() const
- {
- boost::lock_guard<mutex> guard(m);
- return threads.size();
- }
-
- private:
- std::list<thread*> threads;
- mutable mutex m;
- };
-}
-
-#ifdef BOOST_MSVC
-#pragma warning(pop)
-#endif
-
-#endif
Modified: branches/proto/v4/boost/thread/win32/thread_heap_alloc.hpp
==============================================================================
--- branches/proto/v4/boost/thread/win32/thread_heap_alloc.hpp (original)
+++ branches/proto/v4/boost/thread/win32/thread_heap_alloc.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -69,7 +69,7 @@
}
template<typename T>
- T* heap_new()
+ inline T* heap_new()
{
void* const heap_memory=allocate_raw_heap_memory(sizeof(T));
try
@@ -86,7 +86,7 @@
#ifdef BOOST_HAS_RVALUE_REFS
template<typename T,typename A1>
- T* heap_new(A1&& a1)
+ inline T* heap_new(A1&& a1)
{
void* const heap_memory=allocate_raw_heap_memory(sizeof(T));
try
@@ -100,9 +100,56 @@
throw;
}
}
+ template<typename T,typename A1,typename A2>
+ inline T* heap_new(A1&& a1,A2&& a2)
+ {
+ void* const heap_memory=allocate_raw_heap_memory(sizeof(T));
+ try
+ {
+ T* const data=new (heap_memory) T(static_cast<A1&&>(a1),static_cast<A2&&>(a2));
+ return data;
+ }
+ catch(...)
+ {
+ free_raw_heap_memory(heap_memory);
+ throw;
+ }
+ }
+ template<typename T,typename A1,typename A2,typename A3>
+ inline T* heap_new(A1&& a1,A2&& a2,A3&& a3)
+ {
+ void* const heap_memory=allocate_raw_heap_memory(sizeof(T));
+ try
+ {
+ T* const data=new (heap_memory) T(static_cast<A1&&>(a1),static_cast<A2&&>(a2),
+ static_cast<A3&&>(a3));
+ return data;
+ }
+ catch(...)
+ {
+ free_raw_heap_memory(heap_memory);
+ throw;
+ }
+ }
+ template<typename T,typename A1,typename A2,typename A3,typename A4>
+ inline T* heap_new(A1&& a1,A2&& a2,A3&& a3,A4&& a4)
+ {
+ void* const heap_memory=allocate_raw_heap_memory(sizeof(T));
+ try
+ {
+ T* const data=new (heap_memory) T(static_cast<A1&&>(a1),static_cast<A2&&>(a2),
+ static_cast<A3&&>(a3),static_cast<A4&&>(a4));
+ return data;
+ }
+ catch(...)
+ {
+ free_raw_heap_memory(heap_memory);
+ throw;
+ }
+ }
#else
template<typename T,typename A1>
- T* heap_new(A1 a1)
+ inline T* heap_new_impl(A1 a1)
{
void* const heap_memory=allocate_raw_heap_memory(sizeof(T));
try
@@ -116,9 +163,9 @@
throw;
}
}
-#endif
+
template<typename T,typename A1,typename A2>
- T* heap_new(A1 a1,A2 a2)
+ inline T* heap_new_impl(A1 a1,A2 a2)
{
void* const heap_memory=allocate_raw_heap_memory(sizeof(T));
try
@@ -134,7 +181,7 @@
}
template<typename T,typename A1,typename A2,typename A3>
- T* heap_new(A1 a1,A2 a2,A3 a3)
+ inline T* heap_new_impl(A1 a1,A2 a2,A3 a3)
{
void* const heap_memory=allocate_raw_heap_memory(sizeof(T));
try
@@ -148,9 +195,9 @@
throw;
}
}
-
+
template<typename T,typename A1,typename A2,typename A3,typename A4>
- T* heap_new(A1 a1,A2 a2,A3 a3,A4 a4)
+ inline T* heap_new_impl(A1 a1,A2 a2,A3 a3,A4 a4)
{
void* const heap_memory=allocate_raw_heap_memory(sizeof(T));
try
@@ -164,9 +211,168 @@
throw;
}
}
+
+
+ template<typename T,typename A1>
+ inline T* heap_new(A1 const& a1)
+ {
+ return heap_new_impl<T,A1 const&>(a1);
+ }
+ template<typename T,typename A1>
+ inline T* heap_new(A1& a1)
+ {
+ return heap_new_impl<T,A1&>(a1);
+ }
+
+ template<typename T,typename A1,typename A2>
+ inline T* heap_new(A1 const& a1,A2 const& a2)
+ {
+ return heap_new_impl<T,A1 const&,A2 const&>(a1,a2);
+ }
+ template<typename T,typename A1,typename A2>
+ inline T* heap_new(A1& a1,A2 const& a2)
+ {
+ return heap_new_impl<T,A1&,A2 const&>(a1,a2);
+ }
+ template<typename T,typename A1,typename A2>
+ inline T* heap_new(A1 const& a1,A2& a2)
+ {
+ return heap_new_impl<T,A1 const&,A2&>(a1,a2);
+ }
+ template<typename T,typename A1,typename A2>
+ inline T* heap_new(A1& a1,A2& a2)
+ {
+ return heap_new_impl<T,A1&,A2&>(a1,a2);
+ }
+
+ template<typename T,typename A1,typename A2,typename A3>
+ inline T* heap_new(A1 const& a1,A2 const& a2,A3 const& a3)
+ {
+ return heap_new_impl<T,A1 const&,A2 const&,A3 const&>(a1,a2,a3);
+ }
+ template<typename T,typename A1,typename A2,typename A3>
+ inline T* heap_new(A1& a1,A2 const& a2,A3 const& a3)
+ {
+ return heap_new_impl<T,A1&,A2 const&,A3 const&>(a1,a2,a3);
+ }
+ template<typename T,typename A1,typename A2,typename A3>
+ inline T* heap_new(A1 const& a1,A2& a2,A3 const& a3)
+ {
+ return heap_new_impl<T,A1 const&,A2&,A3 const&>(a1,a2,a3);
+ }
+ template<typename T,typename A1,typename A2,typename A3>
+ inline T* heap_new(A1& a1,A2& a2,A3 const& a3)
+ {
+ return heap_new_impl<T,A1&,A2&,A3 const&>(a1,a2,a3);
+ }
+
+ template<typename T,typename A1,typename A2,typename A3>
+ inline T* heap_new(A1 const& a1,A2 const& a2,A3& a3)
+ {
+ return heap_new_impl<T,A1 const&,A2 const&,A3&>(a1,a2,a3);
+ }
+ template<typename T,typename A1,typename A2,typename A3>
+ inline T* heap_new(A1& a1,A2 const& a2,A3& a3)
+ {
+ return heap_new_impl<T,A1&,A2 const&,A3&>(a1,a2,a3);
+ }
+ template<typename T,typename A1,typename A2,typename A3>
+ inline T* heap_new(A1 const& a1,A2& a2,A3& a3)
+ {
+ return heap_new_impl<T,A1 const&,A2&,A3&>(a1,a2,a3);
+ }
+ template<typename T,typename A1,typename A2,typename A3>
+ inline T* heap_new(A1& a1,A2& a2,A3& a3)
+ {
+ return heap_new_impl<T,A1&,A2&,A3&>(a1,a2,a3);
+ }
+
+ template<typename T,typename A1,typename A2,typename A3,typename A4>
+ inline T* heap_new(A1 const& a1,A2 const& a2,A3 const& a3,A4 const& a4)
+ {
+ return heap_new_impl<T,A1 const&,A2 const&,A3 const&,A4 const&>(a1,a2,a3,a4);
+ }
+ template<typename T,typename A1,typename A2,typename A3,typename A4>
+ inline T* heap_new(A1& a1,A2 const& a2,A3 const& a3,A4 const& a4)
+ {
+ return heap_new_impl<T,A1&,A2 const&,A3 const&,A4 const&>(a1,a2,a3,a4);
+ }
+ template<typename T,typename A1,typename A2,typename A3,typename A4>
+ inline T* heap_new(A1 const& a1,A2& a2,A3 const& a3,A4 const& a4)
+ {
+ return heap_new_impl<T,A1 const&,A2&,A3 const&,A4 const&>(a1,a2,a3,a4);
+ }
+ template<typename T,typename A1,typename A2,typename A3,typename A4>
+ inline T* heap_new(A1& a1,A2& a2,A3 const& a3,A4 const& a4)
+ {
+ return heap_new_impl<T,A1&,A2&,A3 const&,A4 const&>(a1,a2,a3,a4);
+ }
+
+ template<typename T,typename A1,typename A2,typename A3,typename A4>
+ inline T* heap_new(A1 const& a1,A2 const& a2,A3& a3,A4 const& a4)
+ {
+ return heap_new_impl<T,A1 const&,A2 const&,A3&,A4 const&>(a1,a2,a3,a4);
+ }
+ template<typename T,typename A1,typename A2,typename A3,typename A4>
+ inline T* heap_new(A1& a1,A2 const& a2,A3& a3,A4 const& a4)
+ {
+ return heap_new_impl<T,A1&,A2 const&,A3&,A4 const&>(a1,a2,a3,a4);
+ }
+ template<typename T,typename A1,typename A2,typename A3,typename A4>
+ inline T* heap_new(A1 const& a1,A2& a2,A3& a3,A4 const& a4)
+ {
+ return heap_new_impl<T,A1 const&,A2&,A3&,A4 const&>(a1,a2,a3,a4);
+ }
+ template<typename T,typename A1,typename A2,typename A3,typename A4>
+ inline T* heap_new(A1& a1,A2& a2,A3& a3,A4 const& a4)
+ {
+ return heap_new_impl<T,A1&,A2&,A3&,A4 const&>(a1,a2,a3,a4);
+ }
+ template<typename T,typename A1,typename A2,typename A3,typename A4>
+ inline T* heap_new(A1 const& a1,A2 const& a2,A3 const& a3,A4& a4)
+ {
+ return heap_new_impl<T,A1 const&,A2 const&,A3 const&,A4&>(a1,a2,a3,a4);
+ }
+ template<typename T,typename A1,typename A2,typename A3,typename A4>
+ inline T* heap_new(A1& a1,A2 const& a2,A3 const& a3,A4& a4)
+ {
+ return heap_new_impl<T,A1&,A2 const&,A3 const&,A4&>(a1,a2,a3,a4);
+ }
+ template<typename T,typename A1,typename A2,typename A3,typename A4>
+ inline T* heap_new(A1 const& a1,A2& a2,A3 const& a3,A4& a4)
+ {
+ return heap_new_impl<T,A1 const&,A2&,A3 const&,A4&>(a1,a2,a3,a4);
+ }
+ template<typename T,typename A1,typename A2,typename A3,typename A4>
+ inline T* heap_new(A1& a1,A2& a2,A3 const& a3,A4& a4)
+ {
+ return heap_new_impl<T,A1&,A2&,A3 const&,A4&>(a1,a2,a3,a4);
+ }
+
+ template<typename T,typename A1,typename A2,typename A3,typename A4>
+ inline T* heap_new(A1 const& a1,A2 const& a2,A3& a3,A4& a4)
+ {
+ return heap_new_impl<T,A1 const&,A2 const&,A3&,A4&>(a1,a2,a3,a4);
+ }
+ template<typename T,typename A1,typename A2,typename A3,typename A4>
+ inline T* heap_new(A1& a1,A2 const& a2,A3& a3,A4& a4)
+ {
+ return heap_new_impl<T,A1&,A2 const&,A3&,A4&>(a1,a2,a3,a4);
+ }
+ template<typename T,typename A1,typename A2,typename A3,typename A4>
+ inline T* heap_new(A1 const& a1,A2& a2,A3& a3,A4& a4)
+ {
+ return heap_new_impl<T,A1 const&,A2&,A3&,A4&>(a1,a2,a3,a4);
+ }
+ template<typename T,typename A1,typename A2,typename A3,typename A4>
+ inline T* heap_new(A1& a1,A2& a2,A3& a3,A4& a4)
+ {
+ return heap_new_impl<T,A1&,A2&,A3&,A4&>(a1,a2,a3,a4);
+ }
+#endif
template<typename T>
- void heap_delete(T* data)
+ inline void heap_delete(T* data)
{
data->~T();
free_raw_heap_memory(data);
Modified: branches/proto/v4/boost/thread/win32/thread_primitives.hpp
==============================================================================
--- branches/proto/v4/boost/thread/win32/thread_primitives.hpp (original)
+++ branches/proto/v4/boost/thread/win32/thread_primitives.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -279,9 +279,14 @@
}
#if defined(BOOST_MSVC) || defined(BOOST_INTEL_WIN)
-#if MSC_VER>=1400
+#if _MSC_VER>=1400
+#if _MSC_VER==1400
extern "C" unsigned char _interlockedbittestandset(long *a,long b);
extern "C" unsigned char _interlockedbittestandreset(long *a,long b);
+#else
+extern "C" unsigned char _interlockedbittestandset(volatile long *a,long b);
+extern "C" unsigned char _interlockedbittestandreset(volatile long *a,long b);
+#endif
#pragma intrinsic(_interlockedbittestandset)
#pragma intrinsic(_interlockedbittestandreset)
@@ -294,12 +299,12 @@
{
inline bool interlocked_bit_test_and_set(long* x,long bit)
{
- return _interlockedbittestandset(x,bit);
+ return _interlockedbittestandset(x,bit)!=0;
}
inline bool interlocked_bit_test_and_reset(long* x,long bit)
{
- return _interlockedbittestandreset(x,bit);
+ return _interlockedbittestandreset(x,bit)!=0;
}
}
Modified: branches/proto/v4/boost/unordered/detail/hash_table.hpp
==============================================================================
--- branches/proto/v4/boost/unordered/detail/hash_table.hpp (original)
+++ branches/proto/v4/boost/unordered/detail/hash_table.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -78,7 +78,14 @@
// prime number list, accessor
- static const std::size_t prime_list[] = {
+ template<typename T> struct prime_list_template
+ {
+ static std::size_t const value[];
+ static std::ptrdiff_t const length;
+ };
+
+ template<typename T>
+ std::size_t const prime_list_template<T>::value[] = {
53ul, 97ul, 193ul, 389ul, 769ul,
1543ul, 3079ul, 6151ul, 12289ul, 24593ul,
49157ul, 98317ul, 196613ul, 393241ul, 786433ul,
@@ -86,12 +93,18 @@
50331653ul, 100663319ul, 201326611ul, 402653189ul, 805306457ul,
1610612741ul, 3221225473ul, 4294967291ul };
+ template<typename T>
+ std::ptrdiff_t const prime_list_template<T>::length = 28;
+
+ typedef prime_list_template<std::size_t> prime_list;
+
// no throw
inline std::size_t next_prime(std::size_t n) {
- std::size_t const* const prime_list_end = prime_list +
- sizeof(prime_list) / sizeof(*prime_list);
+ std::size_t const* const prime_list_begin = prime_list::value;
+ std::size_t const* const prime_list_end = prime_list_begin +
+ prime_list::length;
std::size_t const* bound =
- std::lower_bound(prime_list,prime_list_end, n);
+ std::lower_bound(prime_list_begin, prime_list_end, n);
if(bound == prime_list_end)
bound--;
return *bound;
@@ -99,11 +112,12 @@
// no throw
inline std::size_t prev_prime(std::size_t n) {
- std::size_t const* const prime_list_end = prime_list +
- sizeof(prime_list) / sizeof(*prime_list);
+ std::size_t const* const prime_list_begin = prime_list::value;
+ std::size_t const* const prime_list_end = prime_list_begin +
+ prime_list::length;
std::size_t const* bound =
- std::upper_bound(prime_list,prime_list_end, n);
- if(bound != prime_list)
+ std::upper_bound(prime_list_begin,prime_list_end, n);
+ if(bound != prime_list_begin)
bound--;
return *bound;
}
Modified: branches/proto/v4/boost/unordered_map.hpp
==============================================================================
--- branches/proto/v4/boost/unordered_map.hpp (original)
+++ branches/proto/v4/boost/unordered_map.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -126,12 +126,14 @@
{
}
+#if !BOOST_WORKAROUND(__BORLANDC__, < 0x0593)
unordered_map& operator=(unordered_map x)
{
base.move(x.base);
return *this;
}
#endif
+#endif
private:
@@ -509,12 +511,14 @@
{
}
+#if !BOOST_WORKAROUND(__BORLANDC__, < 0x0593)
unordered_multimap& operator=(unordered_multimap x)
{
base.move(x.base);
return *this;
}
#endif
+#endif
private:
Modified: branches/proto/v4/boost/unordered_set.hpp
==============================================================================
--- branches/proto/v4/boost/unordered_set.hpp (original)
+++ branches/proto/v4/boost/unordered_set.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -123,12 +123,14 @@
{
}
+#if !BOOST_WORKAROUND(__BORLANDC__, < 0x0593)
unordered_set& operator=(unordered_set x)
{
base.move(x.base);
return *this;
}
#endif
+#endif
private:
@@ -478,12 +480,14 @@
{
}
+#if !BOOST_WORKAROUND(__BORLANDC__, < 0x0593)
unordered_multiset& operator=(unordered_multiset x)
{
base.move(x.base);
return *this;
}
#endif
+#endif
private:
Modified: branches/proto/v4/boost/utility/value_init.hpp
==============================================================================
--- branches/proto/v4/boost/utility/value_init.hpp (original)
+++ branches/proto/v4/boost/utility/value_init.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -5,7 +5,8 @@
// http://www.boost.org/LICENSE_1_0.txt)
//
// 21 Ago 2002 (Created) Fernando Cacciola
-// 18 Feb 2008 (Worked around compiler bugs, added initialized_value) Fernando Cacciola, Niels Dekker
+// 24 Dec 2007 (Refactored and worked around various compiler bugs) Fernando Cacciola, Niels Dekker
+// 23 May 2008 (Fixed operator= const issue, added initialized_value) Niels Dekker, Fernando Cacciola
//
#ifndef BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP
#define BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP
@@ -110,7 +111,7 @@
}
-class initialized_value
+class initialized_value_t
{
public :
@@ -120,6 +121,8 @@
}
};
+initialized_value_t const initialized_value = {} ;
+
} // namespace boost
Modified: branches/proto/v4/boost/wave/grammars/cpp_chlit_grammar.hpp
==============================================================================
--- branches/proto/v4/boost/wave/grammars/cpp_chlit_grammar.hpp (original)
+++ branches/proto/v4/boost/wave/grammars/cpp_chlit_grammar.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -154,9 +154,7 @@
definition(chlit_grammar const &self)
{
using namespace boost::spirit::classic;
- using phoenix::var;
- using phoenix::val;
- using phoenix::arg1;
+ namespace phx = phoenix;
// special parsers for '\x..' and L'\x....'
typedef uint_parser<
@@ -168,65 +166,65 @@
// the rule for a character literal
ch_lit
- = eps_p[self.value = val(0), self.long_lit = val(false)]
- >> !ch_p('L')[self.long_lit = val(true)]
+ = eps_p[self.value = phx::val(0), self.long_lit = phx::val(false)]
+ >> !ch_p('L')[self.long_lit = phx::val(true)]
>> ch_p('\'')
>> +( (
ch_p('\\')
>> ( ch_p('a') // BEL
[
impl::compose(self.value, self.long_lit,
- var(self.overflow), val(0x07))
+ phx::var(self.overflow), phx::val(0x07))
]
| ch_p('b') // BS
[
impl::compose(self.value, self.long_lit,
- var(self.overflow), val(0x08))
+ phx::var(self.overflow), phx::val(0x08))
]
| ch_p('t') // HT
[
impl::compose(self.value, self.long_lit,
- var(self.overflow), val(0x09))
+ phx::var(self.overflow), phx::val(0x09))
]
| ch_p('n') // NL
[
impl::compose(self.value, self.long_lit,
- var(self.overflow), val(0x0a))
+ phx::var(self.overflow), phx::val(0x0a))
]
| ch_p('v') // VT
[
impl::compose(self.value, self.long_lit,
- var(self.overflow), val(0x0b))
+ phx::var(self.overflow), phx::val(0x0b))
]
| ch_p('f') // FF
[
impl::compose(self.value, self.long_lit,
- var(self.overflow), val(0x0c))
+ phx::var(self.overflow), phx::val(0x0c))
]
| ch_p('r') // CR
[
impl::compose(self.value, self.long_lit,
- var(self.overflow), val(0x0d))
+ phx::var(self.overflow), phx::val(0x0d))
]
| ch_p('?')
[
impl::compose(self.value, self.long_lit,
- var(self.overflow), val('?'))
+ phx::var(self.overflow), phx::val('?'))
]
| ch_p('\'')
[
impl::compose(self.value, self.long_lit,
- var(self.overflow), val('\''))
+ phx::var(self.overflow), phx::val('\''))
]
| ch_p('\"')
[
impl::compose(self.value, self.long_lit,
- var(self.overflow), val('\"'))
+ phx::var(self.overflow), phx::val('\"'))
]
| ch_p('\\')
[
impl::compose(self.value, self.long_lit,
- var(self.overflow), val('\\'))
+ phx::var(self.overflow), phx::val('\\'))
]
| ch_p('x')
>> if_p(self.long_lit)
@@ -234,7 +232,7 @@
hex_wchar_parser_type()
[
impl::compose(self.value, self.long_lit,
- var(self.overflow), arg1)
+ phx::var(self.overflow), phx::arg1)
]
]
.else_p
@@ -242,32 +240,32 @@
hex_char_parser_type()
[
impl::compose(self.value, self.long_lit,
- var(self.overflow), arg1)
+ phx::var(self.overflow), phx::arg1)
]
]
| ch_p('u')
>> uint_parser<unsigned int, 16, 4, 4>()
[
impl::compose(self.value, self.long_lit,
- var(self.overflow), arg1)
+ phx::var(self.overflow), phx::arg1)
]
| ch_p('U')
>> uint_parser<unsigned int, 16, 8, 8>()
[
impl::compose(self.value, self.long_lit,
- var(self.overflow), arg1)
+ phx::var(self.overflow), phx::arg1)
]
| uint_parser<unsigned int, 8, 1, 3>()
[
impl::compose(self.value, self.long_lit,
- var(self.overflow), arg1)
+ phx::var(self.overflow), phx::arg1)
]
)
)
| ~eps_p(ch_p('\'')) >> anychar_p
[
impl::compose(self.value, self.long_lit,
- var(self.overflow), arg1)
+ phx::var(self.overflow), phx::arg1)
]
)
>> ch_p('\'')
Modified: branches/proto/v4/boost/wave/grammars/cpp_intlit_grammar.hpp
==============================================================================
--- branches/proto/v4/boost/wave/grammars/cpp_intlit_grammar.hpp (original)
+++ branches/proto/v4/boost/wave/grammars/cpp_intlit_grammar.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -83,8 +83,7 @@
definition(intlit_grammar const &self)
{
using namespace boost::spirit::classic;
- using phoenix::var;
- using phoenix::arg1;
+ namespace phx = phoenix;
int_lit = (
@@ -93,8 +92,8 @@
| dec_lit
)
>> !as_lower_d[
- (ch_p('u')[var(self.is_unsigned) = true] || ch_p('l'))
- | (ch_p('l') || ch_p('u')[var(self.is_unsigned) = true])
+ (ch_p('u')[phx::var(self.is_unsigned) = true] || ch_p('l'))
+ | (ch_p('l') || ch_p('u')[phx::var(self.is_unsigned) = true])
]
,
@@ -102,23 +101,23 @@
(ch_p('X') | ch_p('x'))
>> uint_parser<uint_literal_type, 16>()
[
- self.val = arg1,
- var(self.is_unsigned) = true
+ self.val = phx::arg1,
+ phx::var(self.is_unsigned) = true
]
,
oct_lit =
!uint_parser<uint_literal_type, 8>()
[
- self.val = arg1,
- var(self.is_unsigned) = true
+ self.val = phx::arg1,
+ phx::var(self.is_unsigned) = true
]
,
dec_lit =
uint_parser<uint_literal_type, 10>()
[
- self.val = arg1
+ self.val = phx::arg1
]
)
;
Modified: branches/proto/v4/libs/bind/test/Jamfile.v2
==============================================================================
--- branches/proto/v4/libs/bind/test/Jamfile.v2 (original)
+++ branches/proto/v4/libs/bind/test/Jamfile.v2 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -35,4 +35,7 @@
[ run mem_fn_dm_test.cpp ]
[ run mem_fn_rv_test.cpp ]
[ run ref_fn_test.cpp ]
+ [ run bind_fnobj2_test.cpp ]
+ [ run bind_fn2_test.cpp ]
+ [ run bind_mf2_test.cpp ]
;
Modified: branches/proto/v4/libs/circular_buffer/doc/circular_buffer.html
==============================================================================
--- branches/proto/v4/libs/circular_buffer/doc/circular_buffer.html (original)
+++ branches/proto/v4/libs/circular_buffer/doc/circular_buffer.html 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -47,7 +47,8 @@
<a href="#functions">Standalone Functions</a><br>
<a href="#notes">Notes</a><br>
<a href="#see">See also</a><br>
- Acknowledgements
+ Acknowledgements<br>
+ Release Notes
<table id="table_figure" align="right" border="0">
<tr>
<td>
@@ -200,17 +201,17 @@
<a href="#classboost_1_1circular__buffer_164250ffbbbdbc62b99e8301fc195b80c">~circular_buffer</a>();
allocator_type <a href=
-"#classboost_1_1circular__buffer_15693ba52e58ef90f1d914cbb63143cd3">get_allocator</a>() const;
+"#classboost_1_1circular__buffer_1a20b7d0e7a4da0af13286df9f53d660c">get_allocator</a>() const;
allocator_type& get_allocator();
iterator begin();
iterator end();
- const_iterator begin() const;
- const_iterator end() const;
+ const_iterator begin() const;
+ const_iterator end() const;
reverse_iterator rbegin();
reverse_iterator rend();
const_reverse_iterator <a href=
-"#classboost_1_1circular__buffer_146a8356a1aec6abca9c44cfc60b3bb10">rbegin</a>() const;
- const_reverse_iterator rend() const;
+"#classboost_1_1circular__buffer_1765d91bf48341907418433a1e3aab026">rbegin</a>() const;
+ const_reverse_iterator rend() const;
reference <a href=
"#classboost_1_1circular__buffer_1d219f0d3203fb43b964a8cf63f1865cd">operator[]</a>(size_type index);
const_reference <a href=
@@ -220,19 +221,19 @@
"#classboost_1_1circular__buffer_1b233a298f5845a0fcf2ecc56f4170810">at</a>(size_type index) const;
reference front();
reference back();
- const_reference front() const;
- const_reference back() const;
+ const_reference front() const;
+ const_reference back() const;
array_range array_one();
array_range array_two();
- const_array_range array_one() const;
- const_array_range array_two() const;
+ const_array_range array_one() const;
+ const_array_range array_two() const;
pointer linearize();
- size_type size() const;
- size_type max_size() const;
- bool empty() const;
- bool full() const;
- size_type reserve() const;
- capacity_type capacity() const;
+ size_type size() const;
+ size_type max_size() const;
+ bool empty() const;
+ bool full() const;
+ size_type reserve() const;
+ capacity_type capacity() const;
void <a href=
"#classboost_1_1circular__buffer_161714204ef5172d156e2c7eccd04998f">set_capacity</a>(capacity_type new_capacity);
void <a href=
@@ -723,6 +724,52 @@
Default
</th>
</tr>
+ <tr>
+ <td>
+ <a id="templateparam_T" name="templateparam_T"><code>T</code></a>
+ </td>
+ <td>
+ The type of the elements stored in the <code>circular_buffer</code>.
+ <dl>
+ <dt>
+ <b>Type Requirements:</b>
+ </dt>
+ <dd>
+ The <code>T</code> has to be SGIAssignable
+ (SGI STL defined combination of Assignable and <a href=
+ "../../utility/CopyConstructible.html">CopyConstructible</a>). Moreover <code>T</code> has to be
+ DefaultConstructible if supplied as
+ a default parameter when invoking some of the <code>circular_buffer</code>'s methods e.g.
+ <code>insert(iterator pos, const value_type& item = value_type())</code>. And <a href=
+ "http://www.sgi.com/tech/stl/EqualityComparable.html">EqualityComparable</a> and/or <a href=
+ "../../utility/LessThanComparable.html">LessThanComparable</a> if the <code>circular_buffer</code> will
+ be compared with another container.
+ </dd>
+ </dl>
+ </td>
+ <td>
+ <br>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <a id="templateparam_Alloc" name="templateparam_Alloc"><code>Alloc</code></a>
+ </td>
+ <td>
+ The allocator type used for all internal memory management.
+ <dl>
+ <dt>
+ <b>Type Requirements:</b>
+ </dt>
+ <dd>
+ The <code>Alloc</code> has to meet the allocator requirements imposed by STL.
+ </dd>
+ </dl>
+ </td>
+ <td>
+ <code>std::allocator<T></code>
+ </td>
+ </tr>
</table>
</div>
<h2>
@@ -894,15 +941,15 @@
"#classboost_1_1circular__buffer_14e07c6ddfe89debe384e59bed06e7cb7">allocator_type</a>& alloc =
allocator_type());</b></code><br>
<br>
- Create an empty <code>circular_buffer</code> with a maximum capacity.
+ Create an empty <code>circular_buffer</code> with zero capacity.
<dl>
<dt>
<b>Effect:</b>
</dt>
<dd>
- <code>capacity() ==
- max_size() &&
- size() == 0</code>
+ <code>capacity() == 0
+ && size() ==
+ 0</code>
</dd>
</dl>
<dl>
@@ -942,9 +989,12 @@
<b>Warning:</b>
</dt>
<dd>
- This constructor has been defined only due to compatibility with the STL container definition. Avoid
- using it because it may allocate <b>very large</b> amount of memory (depending on allocator's
- max_size()).
+ Since Boost version 1.36 the behaviour of this constructor has changed. Now the constructor does not
+ allocate any memory and both capacity and size are set to zero. Also note when inserting an element
+ into a <code>circular_buffer</code> with zero capacity (e.g. by <code><a href=
+ "#classboost_1_1circular__buffer_1aa35dd7ef8eb1d04508494d1835cc82e">push_back(const_reference)</a></code>
+ or <code><a href="#classboost_1_1circular__buffer_128c92740fee1b9deb8c69816e389de95">insert(iterator,
+ value_type)</a></code>) nothing will be inserted and the size (as well as capacity) remains zero.
</dd>
</dl>
</td>
@@ -964,9 +1014,9 @@
<b>Effect:</b>
</dt>
<dd>
- <code>capacity() ==
+ <code>capacity() ==
capacity && <a href=
- "#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> == 0</code>
+ "#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> == 0</code>
</dd>
</dl>
<dl>
@@ -1029,8 +1079,8 @@
<b>Effect:</b>
</dt>
<dd>
- <code>capacity() == n
- && full()
+ <code>capacity() == n
+ && full()
&& (*this)[0] == item && (*this)[1] == item && ... && (*this)[n - 1] ==
item</code>
</dd>
@@ -1117,9 +1167,9 @@
<b>Effect:</b>
</dt>
<dd>
- <code>capacity() ==
+ <code>capacity() ==
capacity && <a href=
- "#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> == n &&
+ "#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> == n &&
(*this)[0] == item && (*this)[1] == item && ... && (*this)[n - 1] ==
item</code>
</dd>
@@ -1271,9 +1321,9 @@
<b>Effect:</b>
</dt>
<dd>
- <code>capacity() ==
+ <code>capacity() ==
std::distance(first, last) && <a href=
- "#classboost_1_1circular__buffer_174a305e473c0bba9dcf30abb68bff909">full()</a> && (*this)[0]==
+ "#classboost_1_1circular__buffer_1fd0eef8ba91210d1575404b7e3e8207a">full()</a> && (*this)[0]==
*first && (*this)[1] == *(first + 1) && ... && (*this)[std::distance(first,
last) - 1] == *(last - 1)</code>
</dd>
@@ -1362,9 +1412,9 @@
<b>Effect:</b>
</dt>
<dd>
- <code>capacity() ==
+ <code>capacity() ==
capacity && <a href=
- "#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> <=
+ "#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> <=
std::distance(first, last) && (*this)[0]== *(last - capacity) && (*this)[1] == *(last -
capacity + 1) && ... && (*this)[capacity - 1] == *(last - 1)</code><br>
<br>
@@ -1496,8 +1546,8 @@
<table id="table_methods" border="1" cellpadding="3">
<tr>
<td>
- <a id="classboost_1_1circular__buffer_15693ba52e58ef90f1d914cbb63143cd3" name=
- "classboost_1_1circular__buffer_15693ba52e58ef90f1d914cbb63143cd3"></a><code><b><a href=
+ <a id="classboost_1_1circular__buffer_1a20b7d0e7a4da0af13286df9f53d660c" name=
+ "classboost_1_1circular__buffer_1a20b7d0e7a4da0af13286df9f53d660c"></a><code><b><a href=
"#classboost_1_1circular__buffer_14e07c6ddfe89debe384e59bed06e7cb7">allocator_type</a> get_allocator()
const;</b></code><br>
<br>
@@ -1616,7 +1666,7 @@
<b>See Also:</b>
</dt>
<dd>
- <code><a href="#classboost_1_1circular__buffer_15693ba52e58ef90f1d914cbb63143cd3">get_allocator()
+ <code><a href="#classboost_1_1circular__buffer_1a20b7d0e7a4da0af13286df9f53d660c">get_allocator()
const</a></code>
</dd>
</dl>
@@ -1747,8 +1797,8 @@
</tr>
<tr>
<td>
- <a id="classboost_1_1circular__buffer_1ee6c38b2ecdc8dfec79975dbc685c80b" name=
- "classboost_1_1circular__buffer_1ee6c38b2ecdc8dfec79975dbc685c80b"></a><code><b><a href=
+ <a id="classboost_1_1circular__buffer_10640d3d41c13b6089b6f169224cf1038" name=
+ "classboost_1_1circular__buffer_10640d3d41c13b6089b6f169224cf1038"></a><code><b><a href=
"#classboost_1_1circular__buffer_15cab6d46f03c40d1e52d41843319ddb9">const_iterator</a> begin()
const;</b></code><br>
<br>
@@ -1760,7 +1810,7 @@
<dd>
A const random access iterator pointing to the first element of the <code>circular_buffer</code>. If
the <code>circular_buffer</code> is empty it returns an iterator equal to the one returned by
- <code><a href="#classboost_1_1circular__buffer_19813e1d191cd04c4cfc100bbc4733e92">end()
+ <code><a href="#classboost_1_1circular__buffer_17890810d07bc595cfb87f9c47cb075ac">end()
const</a></code>.
</dd>
</dl>
@@ -1801,10 +1851,10 @@
<b>See Also:</b>
</dt>
<dd>
- <code><a href="#classboost_1_1circular__buffer_19813e1d191cd04c4cfc100bbc4733e92">end()
+ <code><a href="#classboost_1_1circular__buffer_17890810d07bc595cfb87f9c47cb075ac">end()
const</a></code>, <code><a href=
- "#classboost_1_1circular__buffer_146a8356a1aec6abca9c44cfc60b3bb10">rbegin() const</a></code>,
- <code><a href="#classboost_1_1circular__buffer_1a09f7111dde9f52a4d8babfcdef7e798">rend()
+ "#classboost_1_1circular__buffer_1765d91bf48341907418433a1e3aab026">rbegin() const</a></code>,
+ <code><a href="#classboost_1_1circular__buffer_108dbf538b00a14daf5582ece80746fc3">rend()
const</a></code>
</dd>
</dl>
@@ -1812,8 +1862,8 @@
</tr>
<tr>
<td>
- <a id="classboost_1_1circular__buffer_19813e1d191cd04c4cfc100bbc4733e92" name=
- "classboost_1_1circular__buffer_19813e1d191cd04c4cfc100bbc4733e92"></a><code><b><a href=
+ <a id="classboost_1_1circular__buffer_17890810d07bc595cfb87f9c47cb075ac" name=
+ "classboost_1_1circular__buffer_17890810d07bc595cfb87f9c47cb075ac"></a><code><b><a href=
"#classboost_1_1circular__buffer_15cab6d46f03c40d1e52d41843319ddb9">const_iterator</a> end()
const;</b></code><br>
<br>
@@ -1826,7 +1876,7 @@
A const random access iterator pointing to the element "one behind" the last element of the
<code>circular_buffer</code>. If the <code>circular_buffer</code> is empty it returns an iterator equal
to the one returned by <code><a href=
- "#classboost_1_1circular__buffer_1ee6c38b2ecdc8dfec79975dbc685c80b">begin() const</a></code> const.
+ "#classboost_1_1circular__buffer_10640d3d41c13b6089b6f169224cf1038">begin() const</a></code> const.
</dd>
</dl>
<dl>
@@ -1866,10 +1916,10 @@
<b>See Also:</b>
</dt>
<dd>
- <code><a href="#classboost_1_1circular__buffer_1ee6c38b2ecdc8dfec79975dbc685c80b">begin()
+ <code><a href="#classboost_1_1circular__buffer_10640d3d41c13b6089b6f169224cf1038">begin()
const</a></code>, <code><a href=
- "#classboost_1_1circular__buffer_146a8356a1aec6abca9c44cfc60b3bb10">rbegin() const</a></code>,
- <code><a href="#classboost_1_1circular__buffer_1a09f7111dde9f52a4d8babfcdef7e798">rend()
+ "#classboost_1_1circular__buffer_1765d91bf48341907418433a1e3aab026">rbegin() const</a></code>,
+ <code><a href="#classboost_1_1circular__buffer_108dbf538b00a14daf5582ece80746fc3">rend()
const</a></code>
</dd>
</dl>
@@ -2002,8 +2052,8 @@
</tr>
<tr>
<td>
- <a id="classboost_1_1circular__buffer_146a8356a1aec6abca9c44cfc60b3bb10" name=
- "classboost_1_1circular__buffer_146a8356a1aec6abca9c44cfc60b3bb10"></a><code><b><a href=
+ <a id="classboost_1_1circular__buffer_1765d91bf48341907418433a1e3aab026" name=
+ "classboost_1_1circular__buffer_1765d91bf48341907418433a1e3aab026"></a><code><b><a href=
"#classboost_1_1circular__buffer_1c7317701b511bc5f7a663b06b53e2b73">const_reverse_iterator</a> rbegin()
const;</b></code><br>
<br>
@@ -2016,7 +2066,7 @@
A const reverse random access iterator pointing to the last element of the
<code>circular_buffer</code>. If the <code>circular_buffer</code> is empty it returns an iterator equal
to the one returned by <code><a href=
- "#classboost_1_1circular__buffer_1a09f7111dde9f52a4d8babfcdef7e798">rend() const</a></code>.
+ "#classboost_1_1circular__buffer_108dbf538b00a14daf5582ece80746fc3">rend() const</a></code>.
</dd>
</dl>
<dl>
@@ -2056,10 +2106,10 @@
<b>See Also:</b>
</dt>
<dd>
- <code><a href="#classboost_1_1circular__buffer_1a09f7111dde9f52a4d8babfcdef7e798">rend()
+ <code><a href="#classboost_1_1circular__buffer_108dbf538b00a14daf5582ece80746fc3">rend()
const</a></code>, <code><a href=
- "#classboost_1_1circular__buffer_1ee6c38b2ecdc8dfec79975dbc685c80b">begin() const</a></code>,
- <code><a href="#classboost_1_1circular__buffer_19813e1d191cd04c4cfc100bbc4733e92">end()
+ "#classboost_1_1circular__buffer_10640d3d41c13b6089b6f169224cf1038">begin() const</a></code>,
+ <code><a href="#classboost_1_1circular__buffer_17890810d07bc595cfb87f9c47cb075ac">end()
const</a></code>
</dd>
</dl>
@@ -2067,8 +2117,8 @@
</tr>
<tr>
<td>
- <a id="classboost_1_1circular__buffer_1a09f7111dde9f52a4d8babfcdef7e798" name=
- "classboost_1_1circular__buffer_1a09f7111dde9f52a4d8babfcdef7e798"></a><code><b><a href=
+ <a id="classboost_1_1circular__buffer_108dbf538b00a14daf5582ece80746fc3" name=
+ "classboost_1_1circular__buffer_108dbf538b00a14daf5582ece80746fc3"></a><code><b><a href=
"#classboost_1_1circular__buffer_1c7317701b511bc5f7a663b06b53e2b73">const_reverse_iterator</a> rend()
const;</b></code><br>
<br>
@@ -2081,7 +2131,7 @@
A const reverse random access iterator pointing to the element "one before" the first element of the
<code>circular_buffer</code>. If the <code>circular_buffer</code> is empty it returns an iterator equal
to the one returned by <code><a href=
- "#classboost_1_1circular__buffer_146a8356a1aec6abca9c44cfc60b3bb10">rbegin() const</a></code>.
+ "#classboost_1_1circular__buffer_1765d91bf48341907418433a1e3aab026">rbegin() const</a></code>.
</dd>
</dl>
<dl>
@@ -2121,10 +2171,10 @@
<b>See Also:</b>
</dt>
<dd>
- <code><a href="#classboost_1_1circular__buffer_146a8356a1aec6abca9c44cfc60b3bb10">rbegin()
+ <code><a href="#classboost_1_1circular__buffer_1765d91bf48341907418433a1e3aab026">rbegin()
const</a></code>, <code><a href=
- "#classboost_1_1circular__buffer_1ee6c38b2ecdc8dfec79975dbc685c80b">begin() const</a></code>,
- <code><a href="#classboost_1_1circular__buffer_19813e1d191cd04c4cfc100bbc4733e92">end()
+ "#classboost_1_1circular__buffer_10640d3d41c13b6089b6f169224cf1038">begin() const</a></code>,
+ <code><a href="#classboost_1_1circular__buffer_17890810d07bc595cfb87f9c47cb075ac">end()
const</a></code>
</dd>
</dl>
@@ -2144,7 +2194,7 @@
</dt>
<dd>
<code>0 <= index && index < <a href=
- "#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a></code>
+ "#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a></code>
</dd>
</dl>
<dl>
@@ -2227,7 +2277,7 @@
</dt>
<dd>
<code>0 <= index && index < <a href=
- "#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a></code>
+ "#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a></code>
</dd>
</dl>
<dl>
@@ -2332,7 +2382,7 @@
</dt>
<dd>
<code>std::out_of_range</code> when the <code>index</code> is invalid (when <code>index >= <a href=
- "#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a></code>).
+ "#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a></code>).
</dd>
</dl>
<dl>
@@ -2364,7 +2414,7 @@
<b>See Also:</b>
</dt>
<dd>
- <code>operator[]</code>
+ <code>operator[]</code>
</dd>
</dl>
</td>
@@ -2407,7 +2457,7 @@
</dt>
<dd>
<code>std::out_of_range</code> when the <code>index</code> is invalid (when <code>index >= <a href=
- "#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a></code>).
+ "#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a></code>).
</dd>
</dl>
<dl>
@@ -2577,8 +2627,8 @@
</tr>
<tr>
<td>
- <a id="classboost_1_1circular__buffer_13261c47e81bb5e447fb0d70f096728b8" name=
- "classboost_1_1circular__buffer_13261c47e81bb5e447fb0d70f096728b8"></a><code><b><a href=
+ <a id="classboost_1_1circular__buffer_10df8595d83bb9d8a7ce50aabc678f90b" name=
+ "classboost_1_1circular__buffer_10df8595d83bb9d8a7ce50aabc678f90b"></a><code><b><a href=
"#classboost_1_1circular__buffer_1a8397191092f5bacee991b623ca4b910">const_reference</a> front()
const;</b></code><br>
<br>
@@ -2636,7 +2686,7 @@
<b>See Also:</b>
</dt>
<dd>
- <code><a href="#classboost_1_1circular__buffer_14cd3a019a9d99b4e29918b51c2181a07">back()
+ <code><a href="#classboost_1_1circular__buffer_1027201797868c6274feb6712f670a132">back()
const</a></code>
</dd>
</dl>
@@ -2644,8 +2694,8 @@
</tr>
<tr>
<td>
- <a id="classboost_1_1circular__buffer_14cd3a019a9d99b4e29918b51c2181a07" name=
- "classboost_1_1circular__buffer_14cd3a019a9d99b4e29918b51c2181a07"></a><code><b><a href=
+ <a id="classboost_1_1circular__buffer_1027201797868c6274feb6712f670a132" name=
+ "classboost_1_1circular__buffer_1027201797868c6274feb6712f670a132"></a><code><b><a href=
"#classboost_1_1circular__buffer_1a8397191092f5bacee991b623ca4b910">const_reference</a> back()
const;</b></code><br>
<br>
@@ -2703,7 +2753,7 @@
<b>See Also:</b>
</dt>
<dd>
- <code><a href="#classboost_1_1circular__buffer_13261c47e81bb5e447fb0d70f096728b8">front()
+ <code><a href="#classboost_1_1circular__buffer_10df8595d83bb9d8a7ce50aabc678f90b">front()
const</a></code>
</dd>
</dl>
@@ -2910,15 +2960,15 @@
</tr>
<tr>
<td>
- <a id="classboost_1_1circular__buffer_1586cfbdef335f1d3d31faacec63f7b04" name=
- "classboost_1_1circular__buffer_1586cfbdef335f1d3d31faacec63f7b04"></a><code><b><a href=
+ <a id="classboost_1_1circular__buffer_10f4b157e27b1170a571417986b239945" name=
+ "classboost_1_1circular__buffer_10f4b157e27b1170a571417986b239945"></a><code><b><a href=
"#classboost_1_1circular__buffer_11885d7f475b7e7a74c95b2448d243025">const_array_range</a> array_one()
const;</b></code><br>
<br>
Get the first continuous array of the internal buffer.
<p>
This method in combination with <code><a href=
- "#classboost_1_1circular__buffer_191a0e2c33c0e5b4d7b8c497847bc29ce">array_two() const</a></code> can be
+ "#classboost_1_1circular__buffer_1bb8eb0f298ad2012c55c5303e1f174d5">array_two() const</a></code> can be
useful when passing the stored data into a legacy C API as an array.
</p>
<dl>
@@ -2967,7 +3017,7 @@
<b>See Also:</b>
</dt>
<dd>
- <code><a href="#classboost_1_1circular__buffer_191a0e2c33c0e5b4d7b8c497847bc29ce">array_two()
+ <code><a href="#classboost_1_1circular__buffer_1bb8eb0f298ad2012c55c5303e1f174d5">array_two()
const</a></code>; <code><a href=
"#classboost_1_1circular__buffer_1957cccdcb0c4ef7d80a34a990065818d">array_one()</a></code> for more
details how to pass data into a legacy C API.
@@ -2977,15 +3027,15 @@
</tr>
<tr>
<td>
- <a id="classboost_1_1circular__buffer_191a0e2c33c0e5b4d7b8c497847bc29ce" name=
- "classboost_1_1circular__buffer_191a0e2c33c0e5b4d7b8c497847bc29ce"></a><code><b><a href=
+ <a id="classboost_1_1circular__buffer_1bb8eb0f298ad2012c55c5303e1f174d5" name=
+ "classboost_1_1circular__buffer_1bb8eb0f298ad2012c55c5303e1f174d5"></a><code><b><a href=
"#classboost_1_1circular__buffer_11885d7f475b7e7a74c95b2448d243025">const_array_range</a> array_two()
const;</b></code><br>
<br>
Get the second continuous array of the internal buffer.
<p>
This method in combination with <code><a href=
- "#classboost_1_1circular__buffer_1586cfbdef335f1d3d31faacec63f7b04">array_one() const</a></code> can be
+ "#classboost_1_1circular__buffer_10f4b157e27b1170a571417986b239945">array_one() const</a></code> can be
useful when passing the stored data into a legacy C API as an array.
</p>
<dl>
@@ -3035,7 +3085,7 @@
<b>See Also:</b>
</dt>
<dd>
- <code><a href="#classboost_1_1circular__buffer_1586cfbdef335f1d3d31faacec63f7b04">array_one()
+ <code><a href="#classboost_1_1circular__buffer_10f4b157e27b1170a571417986b239945">array_one()
const</a></code>
</dd>
</dl>
@@ -3057,7 +3107,7 @@
</dt>
<dd>
<code>&(*this)[0] < &(*this)[1] < ... < &(*this)[<a href=
- "#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> - 1]</code>
+ "#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> - 1]</code>
</dd>
</dl>
<dl>
@@ -3132,8 +3182,8 @@
</tr>
<tr>
<td>
- <a id="classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213" name=
- "classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213"></a><code><b><a href=
+ <a id="classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32" name=
+ "classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32"></a><code><b><a href=
"#classboost_1_1circular__buffer_19ba12c0142a21a7d960877c22fa3ea00">size_type</a> size()
const;</b></code><br>
<br>
@@ -3184,10 +3234,10 @@
</dt>
<dd>
<code><a href=
- "#classboost_1_1circular__buffer_1da435a5884cad746ed5cd55bcb892035">capacity()</a></code>,
+ "#classboost_1_1circular__buffer_15ebab2b2538d733790b5752582728e77">capacity()</a></code>,
<code><a href=
- "#classboost_1_1circular__buffer_195158ed4d4b03794068e259f85291995">max_size()</a></code>,
- <code>reserve()</code>,
+ "#classboost_1_1circular__buffer_157e2d506bc274b2a63fbe1b8fcafebd7">max_size()</a></code>,
+ <code>reserve()</code>,
<code><a href="#classboost_1_1circular__buffer_180c2e2e66a8fa9d0b7adc1b54921a8c3">resize(size_type,
const_reference)</a></code>
</dd>
@@ -3196,8 +3246,8 @@
</tr>
<tr>
<td>
- <a id="classboost_1_1circular__buffer_195158ed4d4b03794068e259f85291995" name=
- "classboost_1_1circular__buffer_195158ed4d4b03794068e259f85291995"></a><code><b><a href=
+ <a id="classboost_1_1circular__buffer_157e2d506bc274b2a63fbe1b8fcafebd7" name=
+ "classboost_1_1circular__buffer_157e2d506bc274b2a63fbe1b8fcafebd7"></a><code><b><a href=
"#classboost_1_1circular__buffer_19ba12c0142a21a7d960877c22fa3ea00">size_type</a> max_size()
const;</b></code><br>
<br>
@@ -3248,18 +3298,18 @@
<b>See Also:</b>
</dt>
<dd>
- <code>size()</code>,
+ <code>size()</code>,
<code><a href=
- "#classboost_1_1circular__buffer_1da435a5884cad746ed5cd55bcb892035">capacity()</a></code>,
- <code>reserve()</code>
+ "#classboost_1_1circular__buffer_15ebab2b2538d733790b5752582728e77">capacity()</a></code>,
+ <code>reserve()</code>
</dd>
</dl>
</td>
</tr>
<tr>
<td>
- <a id="classboost_1_1circular__buffer_105acab2b9a0b41044b5241cfc9d87663" name=
- "classboost_1_1circular__buffer_105acab2b9a0b41044b5241cfc9d87663"></a><code><b>bool empty()
+ <a id="classboost_1_1circular__buffer_15be1c2a005ec9828549ef6dd7ebed583" name=
+ "classboost_1_1circular__buffer_15be1c2a005ec9828549ef6dd7ebed583"></a><code><b>bool empty()
const;</b></code><br>
<br>
Is the <code>circular_buffer</code> empty?
@@ -3309,15 +3359,15 @@
<b>See Also:</b>
</dt>
<dd>
- <code>full()</code>
+ <code>full()</code>
</dd>
</dl>
</td>
</tr>
<tr>
<td>
- <a id="classboost_1_1circular__buffer_174a305e473c0bba9dcf30abb68bff909" name=
- "classboost_1_1circular__buffer_174a305e473c0bba9dcf30abb68bff909"></a><code><b>bool full()
+ <a id="classboost_1_1circular__buffer_1fd0eef8ba91210d1575404b7e3e8207a" name=
+ "classboost_1_1circular__buffer_1fd0eef8ba91210d1575404b7e3e8207a"></a><code><b>bool full()
const;</b></code><br>
<br>
Is the <code>circular_buffer</code> full?
@@ -3367,15 +3417,15 @@
<b>See Also:</b>
</dt>
<dd>
- <code>empty()</code>
+ <code>empty()</code>
</dd>
</dl>
</td>
</tr>
<tr>
<td>
- <a id="classboost_1_1circular__buffer_17e144e8c7acd8e30c08bfb03391a2338" name=
- "classboost_1_1circular__buffer_17e144e8c7acd8e30c08bfb03391a2338"></a><code><b><a href=
+ <a id="classboost_1_1circular__buffer_10a02c4fbc53385e98569e810be9843de" name=
+ "classboost_1_1circular__buffer_10a02c4fbc53385e98569e810be9843de"></a><code><b><a href=
"#classboost_1_1circular__buffer_19ba12c0142a21a7d960877c22fa3ea00">size_type</a> reserve()
const;</b></code><br>
<br>
@@ -3386,8 +3436,8 @@
<b>Returns:</b>
</dt>
<dd>
- <code>capacity() -
- size()</code>
+ <code>capacity() -
+ size()</code>
</dd>
</dl>
<dl>
@@ -3428,17 +3478,17 @@
</dt>
<dd>
<code><a href=
- "#classboost_1_1circular__buffer_1da435a5884cad746ed5cd55bcb892035">capacity()</a></code>,
- <code>size()</code>,
- <code>max_size()</code>
+ "#classboost_1_1circular__buffer_15ebab2b2538d733790b5752582728e77">capacity()</a></code>,
+ <code>size()</code>,
+ <code>max_size()</code>
</dd>
</dl>
</td>
</tr>
<tr>
<td>
- <a id="classboost_1_1circular__buffer_1da435a5884cad746ed5cd55bcb892035" name=
- "classboost_1_1circular__buffer_1da435a5884cad746ed5cd55bcb892035"></a><code><b><a href=
+ <a id="classboost_1_1circular__buffer_15ebab2b2538d733790b5752582728e77" name=
+ "classboost_1_1circular__buffer_15ebab2b2538d733790b5752582728e77"></a><code><b><a href=
"#classboost_1_1circular__buffer_1dc642ff2be4db0be1a457810e5d09595">capacity_type</a> capacity()
const;</b></code><br>
<br>
@@ -3488,10 +3538,10 @@
<b>See Also:</b>
</dt>
<dd>
- <code>reserve()</code>,
- <code>size()</code>,
+ <code>reserve()</code>,
+ <code>size()</code>,
<code><a href=
- "#classboost_1_1circular__buffer_195158ed4d4b03794068e259f85291995">max_size()</a></code>,
+ "#classboost_1_1circular__buffer_157e2d506bc274b2a63fbe1b8fcafebd7">max_size()</a></code>,
<code><a href=
"#classboost_1_1circular__buffer_161714204ef5172d156e2c7eccd04998f">set_capacity(capacity_type)</a></code>
</dd>
@@ -3511,14 +3561,14 @@
<b>Effect:</b>
</dt>
<dd>
- <code>capacity() ==
+ <code>capacity() ==
new_capacity && <a href=
- "#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> <=
+ "#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> <=
new_capacity</code><br>
<br>
If the current number of elements stored in the <code>circular_buffer</code> is greater than the
desired new capacity then number of <code>[<a href=
- "#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> - new_capacity]</code>
+ "#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> - new_capacity]</code>
<b>last</b> elements will be removed and the new size will be equal to <code>new_capacity</code>.
</dd>
</dl>
@@ -3573,7 +3623,7 @@
</dt>
<dd>
Linear (in <code>min[<a href=
- "#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a>, new_capacity]</code>).
+ "#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a>, new_capacity]</code>).
</dd>
</dl>
<dl>
@@ -3603,9 +3653,9 @@
<b>Effect:</b>
</dt>
<dd>
- <code>size() ==
+ <code>size() ==
new_size && <a href=
- "#classboost_1_1circular__buffer_1da435a5884cad746ed5cd55bcb892035">capacity()</a> >=
+ "#classboost_1_1circular__buffer_15ebab2b2538d733790b5752582728e77">capacity()</a> >=
new_size</code><br>
<br>
If the new size is greater than the current size, copies of <code>item</code> will be inserted at the
@@ -3614,7 +3664,7 @@
<code>new_size</code>.<br>
If the current number of elements stored in the <code>circular_buffer</code> is greater than the
desired new size then number of <code>[<a href=
- "#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> - new_size]</code>
+ "#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> - new_size]</code>
<b>last</b> elements will be removed. (The capacity will remain unchanged.)
</dd>
</dl>
@@ -3709,14 +3759,14 @@
<b>Effect:</b>
</dt>
<dd>
- <code>capacity() ==
+ <code>capacity() ==
new_capacity && <a href=
- "#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> <=
+ "#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> <=
new_capacity</code><br>
<br>
If the current number of elements stored in the <code>circular_buffer</code> is greater than the
desired new capacity then number of <code>[<a href=
- "#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> - new_capacity]</code>
+ "#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> - new_capacity]</code>
<b>first</b> elements will be removed and the new size will be equal to <code>new_capacity</code>.
</dd>
</dl>
@@ -3771,7 +3821,7 @@
</dt>
<dd>
Linear (in <code>min[<a href=
- "#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a>, new_capacity]</code>).
+ "#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a>, new_capacity]</code>).
</dd>
</dl>
<dl>
@@ -3801,9 +3851,9 @@
<b>Effect:</b>
</dt>
<dd>
- <code>size() ==
+ <code>size() ==
new_size && <a href=
- "#classboost_1_1circular__buffer_1da435a5884cad746ed5cd55bcb892035">capacity()</a> >=
+ "#classboost_1_1circular__buffer_15ebab2b2538d733790b5752582728e77">capacity()</a> >=
new_size</code><br>
<br>
If the new size is greater than the current size, copies of <code>item</code> will be inserted at the
@@ -3812,7 +3862,7 @@
<code>new_size</code>.<br>
If the current number of elements stored in the <code>circular_buffer</code> is greater than the
desired new size then number of <code>[<a href=
- "#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> - new_size]</code>
+ "#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> - new_size]</code>
<b>first</b> elements will be removed. (The capacity will remain unchanged.)
</dd>
</dl>
@@ -3999,8 +4049,8 @@
<b>Effect:</b>
</dt>
<dd>
- <code>capacity() == n
- && size() == n
+ <code>capacity() == n
+ && size() == n
&& (*this)[0] == item && (*this)[1] == item && ... && (*this) [n - 1]
== item</code>
</dd>
@@ -4072,9 +4122,9 @@
<b>See Also:</b>
</dt>
<dd>
- <code>operator=</code>,
- <code><a href="#classboost_1_1circular__buffer_1aa10b4e4ec1f1c5918931b04b31d43ca">assign(capacity_type,
- size_type, const_reference)</a></code>, <code><a href=
+ <code>operator=</code>, <code><a href=
+ "#classboost_1_1circular__buffer_1aa10b4e4ec1f1c5918931b04b31d43ca">assign(capacity_type, size_type,
+ const_reference)</a></code>, <code><a href=
"#classboost_1_1circular__buffer_1253302d9bda5d7efbc4a6c311de3790c">assign(InputIterator,
InputIterator)</a></code>, <code><a href=
"#classboost_1_1circular__buffer_11edb80acdf1f7f1df8217d57256e41f6">assign(capacity_type,
@@ -4111,9 +4161,9 @@
<b>Effect:</b>
</dt>
<dd>
- <code>capacity() ==
+ <code>capacity() ==
capacity && <a href=
- "#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> == n &&
+ "#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> == n &&
(*this)[0] == item && (*this)[1] == item && ... && (*this) [n - 1] ==
item</code>
</dd>
@@ -4195,8 +4245,8 @@
<b>See Also:</b>
</dt>
<dd>
- <code>operator=</code>,
- <code><a href="#classboost_1_1circular__buffer_19ba4a81df16f386d31b04b49c82d1ada">assign(size_type,
+ <code>operator=</code>, <code><a href=
+ "#classboost_1_1circular__buffer_19ba4a81df16f386d31b04b49c82d1ada">assign(size_type,
const_reference)</a></code>, <code><a href=
"#classboost_1_1circular__buffer_1253302d9bda5d7efbc4a6c311de3790c">assign(InputIterator,
InputIterator)</a></code>, <code><a href=
@@ -4233,9 +4283,9 @@
<b>Effect:</b>
</dt>
<dd>
- <code>capacity() ==
+ <code>capacity() ==
std::distance(first, last) && <a href=
- "#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> == std::distance(first,
+ "#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> == std::distance(first,
last) && (*this)[0]== *first && (*this)[1] == *(first + 1) && ... &&
(*this)[std::distance(first, last) - 1] == *(last - 1)</code>
</dd>
@@ -4307,8 +4357,8 @@
<b>See Also:</b>
</dt>
<dd>
- <code>operator=</code>,
- <code><a href="#classboost_1_1circular__buffer_19ba4a81df16f386d31b04b49c82d1ada">assign(size_type,
+ <code>operator=</code>, <code><a href=
+ "#classboost_1_1circular__buffer_19ba4a81df16f386d31b04b49c82d1ada">assign(size_type,
const_reference)</a></code>, <code><a href=
"#classboost_1_1circular__buffer_1aa10b4e4ec1f1c5918931b04b31d43ca">assign(capacity_type, size_type,
const_reference)</a></code>, <code><a href=
@@ -4348,9 +4398,9 @@
<b>Effect:</b>
</dt>
<dd>
- <code>capacity() ==
+ <code>capacity() ==
capacity && <a href=
- "#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> <=
+ "#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> <=
std::distance(first, last) && (*this)[0]== *(last - capacity) && (*this)[1] == *(last -
capacity + 1) && ... && (*this)[capacity - 1] == *(last - 1)</code><br>
<br>
@@ -4438,8 +4488,8 @@
<b>See Also:</b>
</dt>
<dd>
- <code>operator=</code>,
- <code><a href="#classboost_1_1circular__buffer_19ba4a81df16f386d31b04b49c82d1ada">assign(size_type,
+ <code>operator=</code>, <code><a href=
+ "#classboost_1_1circular__buffer_19ba4a81df16f386d31b04b49c82d1ada">assign(size_type,
const_reference)</a></code>, <code><a href=
"#classboost_1_1circular__buffer_1aa10b4e4ec1f1c5918931b04b31d43ca">assign(capacity_type, size_type,
const_reference)</a></code>, <code><a href=
@@ -4539,7 +4589,7 @@
<b>Effect:</b>
</dt>
<dd>
- if <code>capacity()
+ if <code>capacity()
> 0</code> then <code><a href=
"#classboost_1_1circular__buffer_1d985d974020f88bb4255d8edbae0a30a">back()</a> == item</code><br>
If the <code>circular_buffer</code> is full, the first element will be removed. If the capacity is
@@ -4621,7 +4671,7 @@
<b>Effect:</b>
</dt>
<dd>
- if <code>capacity()
+ if <code>capacity()
> 0</code> then <code><a href=
"#classboost_1_1circular__buffer_10d5fdeabeb352f47d1f7bb1ea8d9819f">front()</a> == item</code><br>
If the <code>circular_buffer</code> is full, the last element will be removed. If the capacity is
@@ -4978,11 +5028,11 @@
<dd>
The number of <code>min[n, (pos - <a href=
"#classboost_1_1circular__buffer_158d1ede2e85f5d46eda8db3f0c4efef0">begin()</a>) + <a href=
- "#classboost_1_1circular__buffer_17e144e8c7acd8e30c08bfb03391a2338">reserve()</a>]</code> elements will
+ "#classboost_1_1circular__buffer_10a02c4fbc53385e98569e810be9843de">reserve()</a>]</code> elements will
be inserted at the position <code>pos</code>.<br>
The number of <code>min[pos - <a href=
"#classboost_1_1circular__buffer_158d1ede2e85f5d46eda8db3f0c4efef0">begin()</a>, max[0, n - <a href=
- "#classboost_1_1circular__buffer_17e144e8c7acd8e30c08bfb03391a2338">reserve()</a>]]</code> elements
+ "#classboost_1_1circular__buffer_10a02c4fbc53385e98569e810be9843de">reserve()</a>]]</code> elements
will be overwritten at the beginning of the <code>circular_buffer</code>.<br>
(See <i>Example</i> for the explanation.)
</dd>
@@ -5058,7 +5108,7 @@
</dt>
<dd>
Linear (in <code>min[<a href=
- "#classboost_1_1circular__buffer_1da435a5884cad746ed5cd55bcb892035">capacity()</a>, std::distance(pos,
+ "#classboost_1_1circular__buffer_15ebab2b2538d733790b5752582728e77">capacity()</a>, std::distance(pos,
<a href="#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a>) + n]</code>).
</dd>
</dl>
@@ -5132,12 +5182,12 @@
<dd>
Elements from the range <code>[first + max[0, distance(first, last) - (pos - <a href=
"#classboost_1_1circular__buffer_158d1ede2e85f5d46eda8db3f0c4efef0">begin()</a>) - <a href=
- "#classboost_1_1circular__buffer_17e144e8c7acd8e30c08bfb03391a2338">reserve()</a>], last)</code> will
+ "#classboost_1_1circular__buffer_10a02c4fbc53385e98569e810be9843de">reserve()</a>], last)</code> will
be inserted at the position <code>pos</code>.<br>
The number of <code>min[pos - <a href=
"#classboost_1_1circular__buffer_158d1ede2e85f5d46eda8db3f0c4efef0">begin()</a>, max[0, distance(first,
last) - <a href=
- "#classboost_1_1circular__buffer_17e144e8c7acd8e30c08bfb03391a2338">reserve()</a>]]</code> elements
+ "#classboost_1_1circular__buffer_10a02c4fbc53385e98569e810be9843de">reserve()</a>]]</code> elements
will be overwritten at the beginning of the <code>circular_buffer</code>.<br>
(See <i>Example</i> for the explanation.)
</dd>
@@ -5215,7 +5265,7 @@
Linear (in <code>[std::distance(pos, <a href=
"#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a>) + std::distance(first,
last)]</code>; in <code>min[<a href=
- "#classboost_1_1circular__buffer_1da435a5884cad746ed5cd55bcb892035">capacity()</a>, std::distance(pos,
+ "#classboost_1_1circular__buffer_15ebab2b2538d733790b5752582728e77">capacity()</a>, std::distance(pos,
<a href="#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a>) +
std::distance(first, last)]</code> if the <code>InputIterator</code> is a <a href=
"http://www.sgi.com/tech/stl/RandomAccessIterator.html">RandomAccessIterator</a>).
@@ -5413,11 +5463,11 @@
<dd>
The number of <code>min[n, (<a href=
"#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a> - pos) + <a href=
- "#classboost_1_1circular__buffer_17e144e8c7acd8e30c08bfb03391a2338">reserve()</a>]</code> elements will
+ "#classboost_1_1circular__buffer_10a02c4fbc53385e98569e810be9843de">reserve()</a>]</code> elements will
be inserted before the position <code>pos</code>.<br>
The number of <code>min[<a href=
"#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a> - pos, max[0, n -
- reserve()]]</code>
+ reserve()]]</code>
elements will be overwritten at the end of the <code>circular_buffer</code>.<br>
(See <i>Example</i> for the explanation.)
</dd>
@@ -5491,7 +5541,7 @@
</dt>
<dd>
Linear (in <code>min[<a href=
- "#classboost_1_1circular__buffer_1da435a5884cad746ed5cd55bcb892035">capacity()</a>,
+ "#classboost_1_1circular__buffer_15ebab2b2538d733790b5752582728e77">capacity()</a>,
std::distance(begin(),
pos) + n]</code>).
</dd>
@@ -5566,12 +5616,12 @@
<dd>
Elements from the range <code>[first, last - max[0, distance(first, last) - (<a href=
"#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a> - pos) - <a href=
- "#classboost_1_1circular__buffer_17e144e8c7acd8e30c08bfb03391a2338">reserve()</a>])</code> will be
+ "#classboost_1_1circular__buffer_10a02c4fbc53385e98569e810be9843de">reserve()</a>])</code> will be
inserted before the position <code>pos</code>.<br>
The number of <code>min[<a href=
"#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a> - pos, max[0,
distance(first, last) - <a href=
- "#classboost_1_1circular__buffer_17e144e8c7acd8e30c08bfb03391a2338">reserve()</a>]]</code> elements
+ "#classboost_1_1circular__buffer_10a02c4fbc53385e98569e810be9843de">reserve()</a>]]</code> elements
will be overwritten at the end of the <code>circular_buffer</code>.<br>
(See <i>Example</i> for the explanation.)
</dd>
@@ -5647,7 +5697,7 @@
Linear (in <code>[std::distance(<a href=
"#classboost_1_1circular__buffer_158d1ede2e85f5d46eda8db3f0c4efef0">begin()</a>, pos) +
std::distance(first, last)]</code>; in <code>min[<a href=
- "#classboost_1_1circular__buffer_1da435a5884cad746ed5cd55bcb892035">capacity()</a>,
+ "#classboost_1_1circular__buffer_15ebab2b2538d733790b5752582728e77">capacity()</a>,
std::distance(begin(),
pos) + std::distance(first, last)]</code> if the <code>InputIterator</code> is a <a href=
"http://www.sgi.com/tech/stl/RandomAccessIterator.html">RandomAccessIterator</a>).
@@ -6161,7 +6211,7 @@
<b>Effect:</b>
</dt>
<dd>
- <code>size() ==
+ <code>size() ==
0</code>
</dd>
</dl>
@@ -6261,8 +6311,8 @@
<b>Returns:</b>
</dt>
<dd>
- <code>lhs.size() ==
- rhs.size() &&
+ <code>lhs.size() ==
+ rhs.size() &&
<a href="http://www.sgi.com/tech/stl/equal.html">std::equal</a>(lhs.<a href=
"#classboost_1_1circular__buffer_158d1ede2e85f5d46eda8db3f0c4efef0">begin()</a>, lhs.<a href=
"#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a>, rhs.<a href=
@@ -6803,25 +6853,17 @@
version and came with many good ideas and improvements. Also, I would like to thank Howard Hinnant, Nigel Stewart
and everyone who participated at the formal review for valuable comments and ideas.
</p>
+ <h2>
+ <a name="relnotes" id="relnotes">Release Notes</a>
+ </h2>
<hr size="1">
- <table id="footer" width="100%" border="0">
- <tr valign="top">
- <td valign="top" align="left">
- <p>
- <small>Copyright © 2003-2007 Jan Gaspar</small>
- </p>
- <p>
- <small>Use, modification, and distribution is subject to the Boost Software License, Version 1.0.<br>
- (See accompanying file <code>LICENSE_1_0.txt</code> or copy at <a href=
- "http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt>)</small>
- </p>
- </td>
- <td valign="top" align="right">
- <a href="http://validator.w3.org/check?uri=referer"><img border="0" src=
- "http://www.w3.org/Icons/valid-html401" alt="This is a Valid HTML 4.01 Transitional Document." height="31"
- width="88"></a>
- </td>
- </tr>
- </table>
+ <p>
+ <small>Copyright © 2003-2007 Jan Gaspar</small>
+ </p>
+ <p>
+ <small>Use, modification, and distribution is subject to the Boost Software License, Version 1.0.<br>
+ (See accompanying file <code>LICENSE_1_0.txt</code> or copy at <a href=
+ "http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt>)</small>
+ </p>
</body>
</html>
Modified: branches/proto/v4/libs/circular_buffer/doc/space_optimized.html
==============================================================================
--- branches/proto/v4/libs/circular_buffer/doc/space_optimized.html (original)
+++ branches/proto/v4/libs/circular_buffer/doc/space_optimized.html 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -35,7 +35,8 @@
<a href="#constructors">Constructors and Destructor</a><br>
<a href="#methods">Specific Public Member Functions</a><br>
<a href="#see">See also</a><br>
- Acknowledgements
+ Acknowledgements<br>
+ Release Notes
<h2>
<a name="description" id="description">Description</a>
</h2>
@@ -136,24 +137,24 @@
"#classboost_1_1circular__buffer__space__optimized_16839c3ea656ff0f800e38096748fe8ac">~circular_buffer_space_optimized</a>();
allocator_type <a href=
-"circular_buffer.html#classboost_1_1circular__buffer_15693ba52e58ef90f1d914cbb63143cd3">get_allocator</a>() const;
+"circular_buffer.html#classboost_1_1circular__buffer_1a20b7d0e7a4da0af13286df9f53d660c">get_allocator</a>() const;
allocator_type& <a href=
"circular_buffer.html#classboost_1_1circular__buffer_1af7758a36ac2f84a3024b50b4fc7e098">get_allocator</a>();
iterator <a href=
"circular_buffer.html#classboost_1_1circular__buffer_158d1ede2e85f5d46eda8db3f0c4efef0">begin</a>();
iterator end();
const_iterator <a href=
-"circular_buffer.html#classboost_1_1circular__buffer_1ee6c38b2ecdc8dfec79975dbc685c80b">begin</a>() const;
+"circular_buffer.html#classboost_1_1circular__buffer_10640d3d41c13b6089b6f169224cf1038">begin</a>() const;
const_iterator <a href=
-"circular_buffer.html#classboost_1_1circular__buffer_19813e1d191cd04c4cfc100bbc4733e92">end</a>() const;
+"circular_buffer.html#classboost_1_1circular__buffer_17890810d07bc595cfb87f9c47cb075ac">end</a>() const;
reverse_iterator <a href=
"circular_buffer.html#classboost_1_1circular__buffer_1db3d6b10b6763549f54d2627228fa7aa">rbegin</a>();
reverse_iterator <a href=
"circular_buffer.html#classboost_1_1circular__buffer_1cff9236a50107188b8942847a4dc2697">rend</a>();
const_reverse_iterator <a href=
-"circular_buffer.html#classboost_1_1circular__buffer_146a8356a1aec6abca9c44cfc60b3bb10">rbegin</a>() const;
+"circular_buffer.html#classboost_1_1circular__buffer_1765d91bf48341907418433a1e3aab026">rbegin</a>() const;
const_reverse_iterator <a href=
-"circular_buffer.html#classboost_1_1circular__buffer_1a09f7111dde9f52a4d8babfcdef7e798">rend</a>() const;
+"circular_buffer.html#classboost_1_1circular__buffer_108dbf538b00a14daf5582ece80746fc3">rend</a>() const;
reference <a href=
"circular_buffer.html#classboost_1_1circular__buffer_1d219f0d3203fb43b964a8cf63f1865cd">operator[]</a>(size_type index);
const_reference <a href=
@@ -167,30 +168,30 @@
reference <a href=
"circular_buffer.html#classboost_1_1circular__buffer_1d985d974020f88bb4255d8edbae0a30a">back</a>();
const_reference <a href=
-"circular_buffer.html#classboost_1_1circular__buffer_13261c47e81bb5e447fb0d70f096728b8">front</a>() const;
+"circular_buffer.html#classboost_1_1circular__buffer_10df8595d83bb9d8a7ce50aabc678f90b">front</a>() const;
const_reference <a href=
-"circular_buffer.html#classboost_1_1circular__buffer_14cd3a019a9d99b4e29918b51c2181a07">back</a>() const;
+"circular_buffer.html#classboost_1_1circular__buffer_1027201797868c6274feb6712f670a132">back</a>() const;
array_range <a href=
"circular_buffer.html#classboost_1_1circular__buffer_1957cccdcb0c4ef7d80a34a990065818d">array_one</a>();
array_range <a href=
"circular_buffer.html#classboost_1_1circular__buffer_1f5081a54afbc2dfc1a7fb20329df7d5b">array_two</a>();
const_array_range <a href=
-"circular_buffer.html#classboost_1_1circular__buffer_1586cfbdef335f1d3d31faacec63f7b04">array_one</a>() const;
+"circular_buffer.html#classboost_1_1circular__buffer_10f4b157e27b1170a571417986b239945">array_one</a>() const;
const_array_range <a href=
-"circular_buffer.html#classboost_1_1circular__buffer_191a0e2c33c0e5b4d7b8c497847bc29ce">array_two</a>() const;
+"circular_buffer.html#classboost_1_1circular__buffer_1bb8eb0f298ad2012c55c5303e1f174d5">array_two</a>() const;
pointer <a href=
"circular_buffer.html#classboost_1_1circular__buffer_1ea728bf57f91aa8946eddf76ce816a4e">linearize</a>();
size_type <a href=
-"circular_buffer.html#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size</a>() const;
+"circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size</a>() const;
size_type <a href=
-"circular_buffer.html#classboost_1_1circular__buffer_195158ed4d4b03794068e259f85291995">max_size</a>() const;
+"circular_buffer.html#classboost_1_1circular__buffer_157e2d506bc274b2a63fbe1b8fcafebd7">max_size</a>() const;
bool <a href=
-"circular_buffer.html#classboost_1_1circular__buffer_105acab2b9a0b41044b5241cfc9d87663">empty</a>() const;
- bool full() const;
+"circular_buffer.html#classboost_1_1circular__buffer_15be1c2a005ec9828549ef6dd7ebed583">empty</a>() const;
+ bool full() const;
size_type <a href=
-"#classboost_1_1circular__buffer__space__optimized_100d0c06a38f789ae760709cc86420ae4">reserve</a>() const;
+"#classboost_1_1circular__buffer__space__optimized_170eec72a6e8d088b58e26ac7e2dd7c9f">reserve</a>() const;
const capacity_type& <a href=
-"#classboost_1_1circular__buffer__space__optimized_1ea8a89fbae5e03b364ac28e5dc49e353">capacity</a>() const;
+"#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity</a>() const;
void <a href=
"#classboost_1_1circular__buffer__space__optimized_149f28bc5b33d2062b9f6a33b48264e3f">set_capacity</a>(const capacity_type& capacity_ctrl);
void <a href=
@@ -342,7 +343,7 @@
<code>capacity >= min_capacity</code>
</dd>
</dl>The <code><a href=
- "#classboost_1_1circular__buffer__space__optimized_1ea8a89fbae5e03b364ac28e5dc49e353">capacity()</a></code>
+ "#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a></code>
represents the capacity of the <code>circular_buffer_space_optimized</code> and the
<code>min_capacity()</code> determines the minimal allocated size of its internal buffer. The converting
constructor of the <code>capacity_control</code> allows implicit conversion from
@@ -368,23 +369,19 @@
"circular_buffer.html#classboost_1_1circular__buffer_14e07c6ddfe89debe384e59bed06e7cb7">allocator_type</a>&
alloc = allocator_type());</b></code><br>
<br>
- Create an empty space optimized circular buffer with a maximum capacity.
+ Create an empty space optimized circular buffer with zero capacity.
<dl>
<dt>
<b>Effect:</b>
</dt>
<dd>
<code><a href=
- "#classboost_1_1circular__buffer__space__optimized_1ea8a89fbae5e03b364ac28e5dc49e353">capacity()</a>.capacity()
- == <a href=
- "circular_buffer.html#classboost_1_1circular__buffer_195158ed4d4b03794068e259f85291995">max_size()</a>
- && <a href=
- "#classboost_1_1circular__buffer__space__optimized_1ea8a89fbae5e03b364ac28e5dc49e353">capacity()</a>.min_capacity()
+ "#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.capacity()
== 0 && <a href=
- "circular_buffer.html#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> ==
- 0</code><br>
- <br>
- There is no memory allocated in the internal buffer.
+ "#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.min_capacity()
+ == 0 && <a href=
+ "circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> ==
+ 0</code>
</dd>
</dl>
<dl>
@@ -418,6 +415,15 @@
Constant.
</dd>
</dl>
+ <dl>
+ <dt>
+ <b>Warning:</b>
+ </dt>
+ <dd>
+ Since Boost version 1.36 the behaviour of this constructor has changed. Now it creates a space
+ optimized circular buffer with zero capacity.
+ </dd>
+ </dl>
</td>
</tr>
<tr>
@@ -437,9 +443,9 @@
</dt>
<dd>
<code><a href=
- "#classboost_1_1circular__buffer__space__optimized_1ea8a89fbae5e03b364ac28e5dc49e353">capacity()</a> ==
+ "#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a> ==
capacity_ctrl && <a href=
- "circular_buffer.html#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> ==
+ "circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> ==
0</code><br>
<br>
The amount of allocated memory in the internal buffer is <code>capacity_ctrl.min_capacity()</code>.
@@ -508,9 +514,9 @@
</dt>
<dd>
<code><a href=
- "#classboost_1_1circular__buffer__space__optimized_1ea8a89fbae5e03b364ac28e5dc49e353">capacity()</a> ==
+ "#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a> ==
capacity_ctrl && <a href=
- "#classboost_1_1circular__buffer__space__optimized_15f5e6fb070d2484eaa037cdf4ffd69a8">full()</a>
+ "#classboost_1_1circular__buffer__space__optimized_142f4a13c50904a4ac0bf746c88451954">full()</a>
&& (*this)[0] == item && (*this)[1] == item && ... && (*this)
[capacity_ctrl.capacity() - 1] == item</code><br>
<br>
@@ -603,9 +609,9 @@
</dt>
<dd>
<code><a href=
- "#classboost_1_1circular__buffer__space__optimized_1ea8a89fbae5e03b364ac28e5dc49e353">capacity()</a> ==
+ "#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a> ==
capacity_ctrl && <a href=
- "circular_buffer.html#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> == n
+ "circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> == n
&& (*this)[0] == item && (*this)[1] == item && ... && (*this)[n - 1] ==
item</code><br>
<br>
@@ -765,11 +771,11 @@
</dt>
<dd>
<code><a href=
- "#classboost_1_1circular__buffer__space__optimized_1ea8a89fbae5e03b364ac28e5dc49e353">capacity()</a>.capacity()
+ "#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.capacity()
== std::distance(first, last) && <a href=
- "#classboost_1_1circular__buffer__space__optimized_1ea8a89fbae5e03b364ac28e5dc49e353">capacity()</a>.min_capacity()
+ "#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.min_capacity()
== 0 && <a href=
- "#classboost_1_1circular__buffer__space__optimized_15f5e6fb070d2484eaa037cdf4ffd69a8">full()</a>
+ "#classboost_1_1circular__buffer__space__optimized_142f4a13c50904a4ac0bf746c88451954">full()</a>
&& (*this)[0]== *first && (*this)[1] == *(first + 1) && ... &&
(*this)[std::distance(first, last) - 1] == *(last - 1)</code><br>
<br>
@@ -862,9 +868,9 @@
</dt>
<dd>
<code><a href=
- "#classboost_1_1circular__buffer__space__optimized_1ea8a89fbae5e03b364ac28e5dc49e353">capacity()</a> ==
+ "#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a> ==
capacity_ctrl && <a href=
- "circular_buffer.html#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a>
+ "circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a>
<= std::distance(first, last) && (*this)[0]== (last - capacity_ctrl.capacity()) &&
(*this)[1] == *(last - capacity_ctrl.capacity() + 1) && ... &&
(*this)[capacity_ctrl.capacity() - 1] == *(last - 1)</code><br>
@@ -1008,8 +1014,8 @@
<table id="table_methods" border="1" cellpadding="3">
<tr>
<td>
- <a id="classboost_1_1circular__buffer__space__optimized_15f5e6fb070d2484eaa037cdf4ffd69a8" name=
- "classboost_1_1circular__buffer__space__optimized_15f5e6fb070d2484eaa037cdf4ffd69a8"></a><code><b>bool
+ <a id="classboost_1_1circular__buffer__space__optimized_142f4a13c50904a4ac0bf746c88451954" name=
+ "classboost_1_1circular__buffer__space__optimized_142f4a13c50904a4ac0bf746c88451954"></a><code><b>bool
full() const;</b></code><br>
<br>
Is the <code>circular_buffer_space_optimized</code> full?
@@ -1060,15 +1066,15 @@
</dt>
<dd>
<code><a href=
- "circular_buffer.html#classboost_1_1circular__buffer_105acab2b9a0b41044b5241cfc9d87663">empty()</a></code>
+ "circular_buffer.html#classboost_1_1circular__buffer_15be1c2a005ec9828549ef6dd7ebed583">empty()</a></code>
</dd>
</dl>
</td>
</tr>
<tr>
<td>
- <a id="classboost_1_1circular__buffer__space__optimized_100d0c06a38f789ae760709cc86420ae4" name=
- "classboost_1_1circular__buffer__space__optimized_100d0c06a38f789ae760709cc86420ae4"></a><code><b><a href=
+ <a id="classboost_1_1circular__buffer__space__optimized_170eec72a6e8d088b58e26ac7e2dd7c9f" name=
+ "classboost_1_1circular__buffer__space__optimized_170eec72a6e8d088b58e26ac7e2dd7c9f"></a><code><b><a href=
"circular_buffer.html#classboost_1_1circular__buffer_19ba12c0142a21a7d960877c22fa3ea00">size_type</a>
reserve() const;</b></code><br>
<br>
@@ -1080,9 +1086,9 @@
</dt>
<dd>
<code><a href=
- "#classboost_1_1circular__buffer__space__optimized_1ea8a89fbae5e03b364ac28e5dc49e353">capacity()</a>.capacity()
+ "#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.capacity()
- <a href=
- "circular_buffer.html#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a></code>
+ "circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a></code>
</dd>
</dl>
<dl>
@@ -1123,19 +1129,19 @@
</dt>
<dd>
<code><a href=
- "#classboost_1_1circular__buffer__space__optimized_1ea8a89fbae5e03b364ac28e5dc49e353">capacity()</a></code>,
+ "#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a></code>,
<code><a href=
- "circular_buffer.html#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a></code>,
+ "circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a></code>,
<code><a href=
- "circular_buffer.html#classboost_1_1circular__buffer_195158ed4d4b03794068e259f85291995">max_size()</a></code>
+ "circular_buffer.html#classboost_1_1circular__buffer_157e2d506bc274b2a63fbe1b8fcafebd7">max_size()</a></code>
</dd>
</dl>
</td>
</tr>
<tr>
<td>
- <a id="classboost_1_1circular__buffer__space__optimized_1ea8a89fbae5e03b364ac28e5dc49e353" name=
- "classboost_1_1circular__buffer__space__optimized_1ea8a89fbae5e03b364ac28e5dc49e353"></a><code><b>const
+ <a id="classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa" name=
+ "classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa"></a><code><b>const
<a href=
"#classboost_1_1circular__buffer__space__optimized_1051350e031c50c8b4a7ca1e1902e92f0">capacity_type</a>&
capacity() const;</b></code><br>
@@ -1188,11 +1194,11 @@
</dt>
<dd>
<code><a href=
- "#classboost_1_1circular__buffer__space__optimized_100d0c06a38f789ae760709cc86420ae4">reserve()</a></code>,
+ "#classboost_1_1circular__buffer__space__optimized_170eec72a6e8d088b58e26ac7e2dd7c9f">reserve()</a></code>,
<code><a href=
- "circular_buffer.html#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a></code>,
+ "circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a></code>,
<code><a href=
- "circular_buffer.html#classboost_1_1circular__buffer_195158ed4d4b03794068e259f85291995">max_size()</a></code>,
+ "circular_buffer.html#classboost_1_1circular__buffer_157e2d506bc274b2a63fbe1b8fcafebd7">max_size()</a></code>,
<code><a href=
"#classboost_1_1circular__buffer__space__optimized_149f28bc5b33d2062b9f6a33b48264e3f">set_capacity(const
capacity_type&)</a></code>
@@ -1216,14 +1222,14 @@
</dt>
<dd>
<code><a href=
- "#classboost_1_1circular__buffer__space__optimized_1ea8a89fbae5e03b364ac28e5dc49e353">capacity()</a> ==
+ "#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a> ==
capacity_ctrl && <a href=
- "circular_buffer.html#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a>
+ "circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a>
<= capacity_ctrl.capacity()</code><br>
<br>
If the current number of elements stored in the <code>circular_buffer_space_optimized</code> is greater
than the desired new capacity then number of <code>[<a href=
- "circular_buffer.html#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> -
+ "circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> -
capacity_ctrl.capacity()]</code> <b>last</b> elements will be removed and the new size will be equal to
<code>capacity_ctrl.capacity()</code>.<br>
<br>
@@ -1283,7 +1289,7 @@
</dt>
<dd>
Linear (in <code>min[<a href=
- "circular_buffer.html#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a>,
+ "circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a>,
capacity_ctrl.capacity()]</code>).
</dd>
</dl>
@@ -1337,9 +1343,9 @@
</dt>
<dd>
<code><a href=
- "circular_buffer.html#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> ==
+ "circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> ==
new_size && <a href=
- "#classboost_1_1circular__buffer__space__optimized_1ea8a89fbae5e03b364ac28e5dc49e353">capacity()</a>.capacity()
+ "#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.capacity()
>= new_size</code><br>
<br>
If the new size is greater than the current size, copies of <code>item</code> will be inserted at the
@@ -1349,7 +1355,7 @@
<br>
If the current number of elements stored in the <code>circular_buffer_space_optimized</code> is greater
than the desired new size then number of <code>[<a href=
- "circular_buffer.html#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> -
+ "circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> -
new_size]</code> <b>last</b> elements will be removed. (The capacity will remain unchanged.)<br>
<br>
The amount of allocated memory in the internal buffer may be accommodated as necessary.
@@ -1449,14 +1455,14 @@
</dt>
<dd>
<code><a href=
- "#classboost_1_1circular__buffer__space__optimized_1ea8a89fbae5e03b364ac28e5dc49e353">capacity()</a> ==
+ "#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a> ==
capacity_ctrl && <a href=
- "circular_buffer.html#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a>
+ "circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a>
<= capacity_ctrl</code><br>
<br>
If the current number of elements stored in the <code>circular_buffer_space_optimized</code> is greater
than the desired new capacity then number of <code>[<a href=
- "circular_buffer.html#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> -
+ "circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> -
capacity_ctrl.capacity()]</code> <b>first</b> elements will be removed and the new size will be equal
to <code>capacity_ctrl.capacity()</code>.<br>
<br>
@@ -1516,7 +1522,7 @@
</dt>
<dd>
Linear (in <code>min[<a href=
- "circular_buffer.html#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a>,
+ "circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a>,
capacity_ctrl.capacity()]</code>).
</dd>
</dl>
@@ -1551,9 +1557,9 @@
</dt>
<dd>
<code><a href=
- "circular_buffer.html#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> ==
+ "circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> ==
new_size && <a href=
- "#classboost_1_1circular__buffer__space__optimized_1ea8a89fbae5e03b364ac28e5dc49e353">capacity()</a>.capacity()
+ "#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.capacity()
>= new_size</code><br>
<br>
If the new size is greater than the current size, copies of <code>item</code> will be inserted at the
@@ -1563,7 +1569,7 @@
<br>
If the current number of elements stored in the <code>circular_buffer_space_optimized</code> is greater
than the desired new size then number of <code>[<a href=
- "circular_buffer.html#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> -
+ "circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> -
new_size]</code> <b>first</b> elements will be removed. (The capacity will remain unchanged.)<br>
<br>
The amount of allocated memory in the internal buffer may be accommodated as necessary.
@@ -1760,11 +1766,11 @@
</dt>
<dd>
<code><a href=
- "#classboost_1_1circular__buffer__space__optimized_1ea8a89fbae5e03b364ac28e5dc49e353">capacity()</a>.capacity()
+ "#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.capacity()
== n && <a href=
- "#classboost_1_1circular__buffer__space__optimized_1ea8a89fbae5e03b364ac28e5dc49e353">capacity()</a>.min_capacity()
+ "#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.min_capacity()
== 0 && <a href=
- "circular_buffer.html#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> == n
+ "circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> == n
&& (*this)[0] == item && (*this)[1] == item && ... && (*this) [n - 1]
== item</code><br>
<br>
@@ -1839,9 +1845,7 @@
<b>See Also:</b>
</dt>
<dd>
- <code><a href=
- "#classboost_1_1circular__buffer__space__optimized_177e35432c5e69b7a16ef7d937950e7a8">operator=</a></code>,
- <code><a href=
+ <code>operator=</code>, <code><a href=
"#classboost_1_1circular__buffer__space__optimized_1108055ae3f6b1635e1428b0455902cbf">assign(capacity_type,
size_type, const_reference)</a></code>, <code><a href=
"#classboost_1_1circular__buffer__space__optimized_1417de2c2419c44d83a92c463762df5fb">assign(InputIterator,
@@ -1884,9 +1888,9 @@
</dt>
<dd>
<code><a href=
- "#classboost_1_1circular__buffer__space__optimized_1ea8a89fbae5e03b364ac28e5dc49e353">capacity()</a> ==
+ "#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a> ==
capacity_ctrl && <a href=
- "circular_buffer.html#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> == n
+ "circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> == n
&& (*this)[0] == item && (*this)[1] == item && ... && (*this) [n - 1]
== item</code><br>
<br>
@@ -1971,9 +1975,7 @@
<b>See Also:</b>
</dt>
<dd>
- <code><a href=
- "#classboost_1_1circular__buffer__space__optimized_177e35432c5e69b7a16ef7d937950e7a8">operator=</a></code>,
- <code><a href=
+ <code>operator=</code>, <code><a href=
"#classboost_1_1circular__buffer__space__optimized_17ca4fda9526d0dad99706763c3b2d9f1">assign(size_type,
const_reference)</a></code>, <code><a href=
"#classboost_1_1circular__buffer__space__optimized_1417de2c2419c44d83a92c463762df5fb">assign(InputIterator,
@@ -2012,11 +2014,11 @@
</dt>
<dd>
<code><a href=
- "#classboost_1_1circular__buffer__space__optimized_1ea8a89fbae5e03b364ac28e5dc49e353">capacity()</a>.capacity()
+ "#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.capacity()
== std::distance(first, last) && <a href=
- "#classboost_1_1circular__buffer__space__optimized_1ea8a89fbae5e03b364ac28e5dc49e353">capacity()</a>.min_capacity()
+ "#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.min_capacity()
== 0 && <a href=
- "circular_buffer.html#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> ==
+ "circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> ==
std::distance(first, last) && (*this)[0]== *first && (*this)[1] == *(first + 1)
&& ... && (*this)[std::distance(first, last) - 1] == *(last - 1)</code><br>
<br>
@@ -2091,9 +2093,7 @@
<b>See Also:</b>
</dt>
<dd>
- <code><a href=
- "#classboost_1_1circular__buffer__space__optimized_177e35432c5e69b7a16ef7d937950e7a8">operator=</a></code>,
- <code><a href=
+ <code>operator=</code>, <code><a href=
"#classboost_1_1circular__buffer__space__optimized_17ca4fda9526d0dad99706763c3b2d9f1">assign(size_type,
const_reference)</a></code>, <code><a href=
"#classboost_1_1circular__buffer__space__optimized_1108055ae3f6b1635e1428b0455902cbf">assign(capacity_type,
@@ -2135,9 +2135,9 @@
</dt>
<dd>
<code><a href=
- "#classboost_1_1circular__buffer__space__optimized_1ea8a89fbae5e03b364ac28e5dc49e353">capacity()</a> ==
+ "#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a> ==
capacity_ctrl && <a href=
- "circular_buffer.html#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a>
+ "circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a>
<= std::distance(first, last) && (*this)[0]== *(last - capacity) && (*this)[1] ==
*(last - capacity + 1) && ... && (*this)[capacity - 1] == *(last - 1)</code><br>
<br>
@@ -2229,9 +2229,7 @@
<b>See Also:</b>
</dt>
<dd>
- <code><a href=
- "#classboost_1_1circular__buffer__space__optimized_177e35432c5e69b7a16ef7d937950e7a8">operator=</a></code>,
- <code><a href=
+ <code>operator=</code>, <code><a href=
"#classboost_1_1circular__buffer__space__optimized_17ca4fda9526d0dad99706763c3b2d9f1">assign(size_type,
const_reference)</a></code>, <code><a href=
"#classboost_1_1circular__buffer__space__optimized_1108055ae3f6b1635e1428b0455902cbf">assign(capacity_type,
@@ -2336,7 +2334,7 @@
</dt>
<dd>
if <code><a href=
- "#classboost_1_1circular__buffer__space__optimized_1ea8a89fbae5e03b364ac28e5dc49e353">capacity()</a>.capacity()
+ "#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.capacity()
> 0</code> then <code><a href=
"circular_buffer.html#classboost_1_1circular__buffer_1d985d974020f88bb4255d8edbae0a30a">back()</a> ==
item</code><br>
@@ -2429,7 +2427,7 @@
</dt>
<dd>
if <code><a href=
- "#classboost_1_1circular__buffer__space__optimized_1ea8a89fbae5e03b364ac28e5dc49e353">capacity()</a>.capacity()
+ "#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.capacity()
> 0</code> then <code><a href=
"circular_buffer.html#classboost_1_1circular__buffer_10d5fdeabeb352f47d1f7bb1ea8d9819f">front()</a> ==
item</code><br>
@@ -2820,12 +2818,12 @@
The number of <code>min[n, (pos - <a href=
"circular_buffer.html#classboost_1_1circular__buffer_158d1ede2e85f5d46eda8db3f0c4efef0">begin()</a>) +
<a href=
- "#classboost_1_1circular__buffer__space__optimized_100d0c06a38f789ae760709cc86420ae4">reserve()</a>]</code>
+ "#classboost_1_1circular__buffer__space__optimized_170eec72a6e8d088b58e26ac7e2dd7c9f">reserve()</a>]</code>
elements will be inserted at the position <code>pos</code>.<br>
The number of <code>min[pos - <a href=
"circular_buffer.html#classboost_1_1circular__buffer_158d1ede2e85f5d46eda8db3f0c4efef0">begin()</a>,
max[0, n - <a href=
- "#classboost_1_1circular__buffer__space__optimized_100d0c06a38f789ae760709cc86420ae4">reserve()</a>]]</code>
+ "#classboost_1_1circular__buffer__space__optimized_170eec72a6e8d088b58e26ac7e2dd7c9f">reserve()</a>]]</code>
elements will be overwritten at the beginning of the <code>circular_buffer_space_optimized</code>.<br>
(See <i>Example</i> for the explanation.)<br>
<br>
@@ -2906,9 +2904,9 @@
</dt>
<dd>
Linear (in <code>min[<a href=
- "#classboost_1_1circular__buffer__space__optimized_1ea8a89fbae5e03b364ac28e5dc49e353">capacity()</a>.capacity(),
+ "#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.capacity(),
<a href=
- "circular_buffer.html#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> +
+ "circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> +
n]</code>).
</dd>
</dl>
@@ -2986,12 +2984,12 @@
Elements from the range <code>[first + max[0, distance(first, last) - (pos - <a href=
"circular_buffer.html#classboost_1_1circular__buffer_158d1ede2e85f5d46eda8db3f0c4efef0">begin()</a>) -
<a href=
- "#classboost_1_1circular__buffer__space__optimized_100d0c06a38f789ae760709cc86420ae4">reserve()</a>],
+ "#classboost_1_1circular__buffer__space__optimized_170eec72a6e8d088b58e26ac7e2dd7c9f">reserve()</a>],
last)</code> will be inserted at the position <code>pos</code>.<br>
The number of <code>min[pos - <a href=
"circular_buffer.html#classboost_1_1circular__buffer_158d1ede2e85f5d46eda8db3f0c4efef0">begin()</a>,
max[0, distance(first, last) - <a href=
- "#classboost_1_1circular__buffer__space__optimized_100d0c06a38f789ae760709cc86420ae4">reserve()</a>]]</code>
+ "#classboost_1_1circular__buffer__space__optimized_170eec72a6e8d088b58e26ac7e2dd7c9f">reserve()</a>]]</code>
elements will be overwritten at the beginning of the <code>circular_buffer_space_optimized</code>.<br>
(See <i>Example</i> for the explanation.)<br>
<br>
@@ -3072,11 +3070,11 @@
</dt>
<dd>
Linear (in <code>[<a href=
- "circular_buffer.html#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> +
+ "circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> +
std::distance(first, last)]</code>; in <code>min[<a href=
- "#classboost_1_1circular__buffer__space__optimized_1ea8a89fbae5e03b364ac28e5dc49e353">capacity()</a>.capacity(),
+ "#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.capacity(),
<a href=
- "circular_buffer.html#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> +
+ "circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> +
std::distance(first, last)]</code> if the <code>InputIterator</code> is a <a href=
"http://www.sgi.com/tech/stl/RandomAccessIterator.html">RandomAccessIterator</a>).
</dd>
@@ -3291,12 +3289,12 @@
The number of <code>min[n, (<a href=
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a> -
pos) + <a href=
- "#classboost_1_1circular__buffer__space__optimized_100d0c06a38f789ae760709cc86420ae4">reserve()</a>]</code>
+ "#classboost_1_1circular__buffer__space__optimized_170eec72a6e8d088b58e26ac7e2dd7c9f">reserve()</a>]</code>
elements will be inserted before the position <code>pos</code>.<br>
The number of <code>min[<a href=
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a> -
pos, max[0, n - <a href=
- "#classboost_1_1circular__buffer__space__optimized_100d0c06a38f789ae760709cc86420ae4">reserve()</a>]]</code>
+ "#classboost_1_1circular__buffer__space__optimized_170eec72a6e8d088b58e26ac7e2dd7c9f">reserve()</a>]]</code>
elements will be overwritten at the end of the <code>circular_buffer_space_optimized</code>.<br>
(See <i>Example</i> for the explanation.)<br>
<br>
@@ -3377,9 +3375,9 @@
</dt>
<dd>
Linear (in <code>min[<a href=
- "#classboost_1_1circular__buffer__space__optimized_1ea8a89fbae5e03b364ac28e5dc49e353">capacity()</a>.capacity(),
+ "#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.capacity(),
<a href=
- "circular_buffer.html#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> +
+ "circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> +
n]</code>).
</dd>
</dl>
@@ -3457,12 +3455,12 @@
Elements from the range <code>[first, last - max[0, distance(first, last) - (<a href=
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a> -
pos) - <a href=
- "#classboost_1_1circular__buffer__space__optimized_100d0c06a38f789ae760709cc86420ae4">reserve()</a>])</code>
+ "#classboost_1_1circular__buffer__space__optimized_170eec72a6e8d088b58e26ac7e2dd7c9f">reserve()</a>])</code>
will be inserted before the position <code>pos</code>.<br>
The number of <code>min[<a href=
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a> -
pos, max[0, distance(first, last) - <a href=
- "#classboost_1_1circular__buffer__space__optimized_100d0c06a38f789ae760709cc86420ae4">reserve()</a>]]</code>
+ "#classboost_1_1circular__buffer__space__optimized_170eec72a6e8d088b58e26ac7e2dd7c9f">reserve()</a>]]</code>
elements will be overwritten at the end of the <code><a href=
"circular_buffer.html#classboost_1_1circular__buffer">circular_buffer</a></code>.<br>
(See <i>Example</i> for the explanation.)<br>
@@ -3544,11 +3542,11 @@
</dt>
<dd>
Linear (in <code>[<a href=
- "circular_buffer.html#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> +
+ "circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> +
std::distance(first, last)]</code>; in <code>min[<a href=
- "#classboost_1_1circular__buffer__space__optimized_1ea8a89fbae5e03b364ac28e5dc49e353">capacity()</a>.capacity(),
+ "#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.capacity(),
<a href=
- "circular_buffer.html#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> +
+ "circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> +
std::distance(first, last)]</code> if the <code>InputIterator</code> is a <a href=
"http://www.sgi.com/tech/stl/RandomAccessIterator.html">RandomAccessIterator</a>).
</dd>
@@ -4098,7 +4096,7 @@
</dt>
<dd>
<code><a href=
- "circular_buffer.html#classboost_1_1circular__buffer_1d666f694897465b0d4d7cdd8ddcbc213">size()</a> ==
+ "circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> ==
0</code><br>
<br>
The amount of allocated memory in the internal buffer may be predictively decreased.
@@ -4175,24 +4173,13 @@
The idea of the space optimized circular buffer has been introduced by Pavel Vozenilek.
</p>
<hr size="1">
- <table id="footer" border="0" width="100%">
- <tr>
- <td align="left" valign="top">
- <p>
- <small>Copyright © 2003-2007 Jan Gaspar</small>
- </p>
- <p>
- <small>Use, modification, and distribution is subject to the Boost Software License, Version 1.0.<br>
- (See accompanying file <code>LICENSE_1_0.txt</code> or copy at <a href=
- "http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt>)</small>
- </p>
- </td>
- <td align="right" valign="top">
- <a href="http://validator.w3.org/check?uri=referer"><img border="0" src=
- "http://www.w3.org/Icons/valid-html401" alt="This is a Valid HTML 4.01 Transitional Document." height="31"
- width="88"></a>
- </td>
- </tr>
- </table>
+ <p>
+ <small>Copyright © 2003-2007 Jan Gaspar</small>
+ </p>
+ <p>
+ <small>Use, modification, and distribution is subject to the Boost Software License, Version 1.0.<br>
+ (See accompanying file <code>LICENSE_1_0.txt</code> or copy at <a href=
+ "http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt>)</small>
+ </p>
</body>
</html>
Deleted: branches/proto/v4/libs/circular_buffer/doc/valid-html40.png
==============================================================================
Binary file. No diff available.
Modified: branches/proto/v4/libs/circular_buffer/test/common.ipp
==============================================================================
--- branches/proto/v4/libs/circular_buffer/test/common.ipp (original)
+++ branches/proto/v4/libs/circular_buffer/test/common.ipp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -769,6 +769,17 @@
void constructor_test() {
+ CB_CONTAINER<MyInteger> cb0;
+ BOOST_CHECK(cb0.capacity() == 0);
+ BOOST_CHECK(cb0.size() == 0);
+
+ cb0.push_back(1);
+ cb0.push_back(2);
+ cb0.push_back(3);
+
+ BOOST_CHECK(cb0.size() == 0);
+ BOOST_CHECK(cb0.capacity() == 0);
+
CB_CONTAINER<MyInteger> cb1(3);
CB_CONTAINER<MyInteger> cb2(3, 2);
vector<int> v;
@@ -780,6 +791,7 @@
CB_CONTAINER<MyInteger> cb3(v.begin(), v.end());
CB_CONTAINER<MyInteger> cb4(3, v.begin(), v.end());
CB_CONTAINER<MyInteger> cb5(10, v.begin(), v.end());
+ CB_CONTAINER<MyInteger> cb6(10, 3, MyInteger(2));
BOOST_CHECK(cb1.size() == 0);
BOOST_CHECK(cb1.capacity() == 3);
@@ -803,19 +815,29 @@
BOOST_CHECK(!cb5.full());
BOOST_CHECK(cb5[0] == 1);
BOOST_CHECK(cb5[4] == 5);
+ BOOST_CHECK(cb6.size() == 3);
+ BOOST_CHECK(cb6.capacity() == 10);
+ BOOST_CHECK(!cb6.full());
+ BOOST_CHECK(cb6[0] == 2);
+ BOOST_CHECK(cb6[2] == 2);
cb5.push_back(6);
+ cb6.push_back(6);
BOOST_CHECK(cb5[5] == 6);
+ BOOST_CHECK(cb5[0] == 1);
BOOST_CHECK(cb5.size() == 6);
+ BOOST_CHECK(cb6[3] == 6);
+ BOOST_CHECK(cb6.size() == 4);
+ BOOST_CHECK(cb6[0] == 2);
#if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)
- CB_CONTAINER<int> cb6(MyInputIterator(v.begin()), MyInputIterator(v.end()));
- CB_CONTAINER<int> cb7(3, MyInputIterator(v.begin()), MyInputIterator(v.end()));
+ CB_CONTAINER<int> cb7(MyInputIterator(v.begin()), MyInputIterator(v.end()));
+ CB_CONTAINER<int> cb8(3, MyInputIterator(v.begin()), MyInputIterator(v.end()));
- BOOST_CHECK(cb6.capacity() == 5);
- BOOST_CHECK(cb7.capacity() == 3);
+ BOOST_CHECK(cb7.capacity() == 5);
+ BOOST_CHECK(cb8.capacity() == 3);
#endif // #if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)
@@ -824,6 +846,7 @@
generic_test(cb3);
generic_test(cb4);
generic_test(cb5);
+ generic_test(cb6);
}
void assign_test() {
@@ -894,6 +917,9 @@
CB_CONTAINER<MyInteger> cb2 = cb1;
BOOST_CHECK(cb1 == cb2);
+ BOOST_CHECK(cb2.capacity() == 4);
+ BOOST_CHECK(cb2[0] == 2);
+ BOOST_CHECK(cb2[3] == 5);
CB_CONTAINER<MyInteger> cb3(20);
cb1.pop_back();
@@ -901,6 +927,7 @@
cb3 = cb2;
cb3 = cb3;
cb4 = cb1;
+ CB_CONTAINER<MyInteger> cb5 = cb1;
BOOST_CHECK(cb3 == cb2);
BOOST_CHECK(cb4 == cb1);
@@ -911,11 +938,16 @@
BOOST_CHECK(cb4.capacity() == 4);
BOOST_CHECK(!cb4.full());
BOOST_CHECK(*(cb4.end() - 1) == 4);
+ BOOST_CHECK(cb1 == cb5);
+ BOOST_CHECK(cb5.capacity() == 4);
+ BOOST_CHECK(cb2[0] == 2);
+ BOOST_CHECK(cb2[2] == 4);
generic_test(cb1);
generic_test(cb2);
generic_test(cb3);
generic_test(cb4);
+ generic_test(cb5);
}
void swap_test() {
Modified: branches/proto/v4/libs/circular_buffer/test/space_optimized_test.cpp
==============================================================================
--- branches/proto/v4/libs/circular_buffer/test/space_optimized_test.cpp (original)
+++ branches/proto/v4/libs/circular_buffer/test/space_optimized_test.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -62,7 +62,7 @@
circular_buffer_space_optimized<int>::capacity_type c1 = 10;
circular_buffer_space_optimized<int>::capacity_type c2 =
- circular_buffer_space_optimized<int>::capacity_type(20, 5);
+ circular_buffer_space_optimized<int>::capacity_type(20, 5);
circular_buffer_space_optimized<int>::capacity_type c3 = c2;
BOOST_CHECK(c1.capacity() == 10);
@@ -78,10 +78,10 @@
BOOST_CHECK(c1.min_capacity() == 5);
}
-void some_constructors_test() {
+void specific_constructors_test() {
cb_space_optimized cb1;
- BOOST_CHECK(cb1.capacity() == cb1.max_size());
+ BOOST_CHECK(cb1.capacity() == 0);
BOOST_CHECK(cb1.capacity().min_capacity() == 0);
BOOST_CHECK(cb1.internal_capacity() == 0);
BOOST_CHECK(cb1.size() == 0);
@@ -90,10 +90,15 @@
cb1.push_back(2);
cb1.push_back(3);
- BOOST_CHECK(cb1.size() == 3);
- BOOST_CHECK(cb1.capacity() == cb1.max_size());
+ BOOST_CHECK(cb1.size() == 0);
+ BOOST_CHECK(cb1.capacity() == 0);
+
+ vector<int> v;
+ v.push_back(1);
+ v.push_back(2);
+ v.push_back(3);
- cb_space_optimized cb2(cb1.begin(), cb1.end());
+ cb_space_optimized cb2(v.begin(), v.end());
BOOST_CHECK(cb2.capacity() == 3);
BOOST_CHECK(cb2.capacity().min_capacity() == 0);
@@ -183,7 +188,7 @@
tests->add(BOOST_TEST_CASE(&min_capacity_test));
tests->add(BOOST_TEST_CASE(&capacity_control_test));
- tests->add(BOOST_TEST_CASE(&some_constructors_test));
+ tests->add(BOOST_TEST_CASE(&specific_constructors_test));
tests->add(BOOST_TEST_CASE(&shrink_to_fit_test));
tests->add(BOOST_TEST_CASE(&iterator_invalidation_test));
Modified: branches/proto/v4/libs/config/doc/guidelines.qbk
==============================================================================
--- branches/proto/v4/libs/config/doc/guidelines.qbk (original)
+++ branches/proto/v4/libs/config/doc/guidelines.qbk 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -87,8 +87,8 @@
[section Adding New Defect Macros]
-When you need to add a new defect macro -either to fix a problem with an
-existing library, or when adding a new library- distil the issue down to
+When you need to add a new defect macro - either to fix a problem with an
+existing library, or when adding a new library - distil the issue down to
a simple test case; often, at this point other (possibly better) workarounds
may become apparent. Secondly always post the test case code to the boost
mailing list and invite comments; remember that C++ is complex and that
@@ -107,7 +107,7 @@
These comments are processed by the autoconf script, so make sure the format
follows the one given. The file should be named "`boost_no_foo.ipp`", where foo
-is the defect description -try and keep the file name under the Mac 30 character
+is the defect description - try and keep the file name under the Mac 30 character
filename limit though. You will also need to provide a function prototype
"`int test()`" that is declared in a namespace with the same name as the macro,
but in all lower case, and which returns zero on success:
@@ -126,14 +126,14 @@
Once the test code is in place in libs/config/test, updating the configuration
test system proceeds as:
-* cd into `libs/config/tools` and run `bjam --v2` : this generates the `.cpp`
-file test cases from the `.ipp` file, updates the Jamfile, `config_test.cpp` and
-`config_info.cpp`.
-* cd into `libs/config/test` and run `bjam --v2 `['MACRONAME]` compiler-list` : where
+* cd into `libs/config/tools` and run `bjam` : this generates the `.cpp`
+file test cases from the `.ipp` file, updates the
+libs/config/test/all/Jamfile.v2, `config_test.cpp` and `config_info.cpp`.
+* cd into `libs/config/test/all` and run `bjam `['MACRONAME]` compiler-list` : where
['MACRONAME] is the name of the new macro, and `compiler-list` is the list of
compilers to test with. You should see the tests pass with those compilers
that don't have the defect, and fail with those that do.
-* cd into `libs/config/test` and `run bjam --v2 config_info config_test compiler-list` :
+* cd into `libs/config/test` and run `bjam config_info config_test compiler-list` :
`config_info` should build and run cleanly for all the compilers in `compiler-list`
while `config_test` should fail for those that have the defect, and pass for those
that do not.
@@ -194,7 +194,7 @@
compiler/standard library/platform is added.
The compiler/platform/standard library selection code is set up so that unknown
-platforms are ignored and assumed to be fully standards compliant -this gives
+platforms are ignored and assumed to be fully standards compliant - this gives
unknown platforms a "sporting chance" of working "as is" even without running
the configure script.
Modified: branches/proto/v4/libs/config/doc/html/boost_config/acknowledgements.html
==============================================================================
--- branches/proto/v4/libs/config/doc/html/boost_config/acknowledgements.html (original)
+++ branches/proto/v4/libs/config/doc/html/boost_config/acknowledgements.html 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -13,8 +13,8 @@
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
<td align="center">Home</td>
<td align="center">Libraries</td>
-<td align="center">People</td>
-<td align="center">FAQ</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
<td align="center">More</td>
</tr></table>
<hr>
Modified: branches/proto/v4/libs/config/doc/html/boost_config/boost_macro_reference.html
==============================================================================
--- branches/proto/v4/libs/config/doc/html/boost_config/boost_macro_reference.html (original)
+++ branches/proto/v4/libs/config/doc/html/boost_config/boost_macro_reference.html 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -14,8 +14,8 @@
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
<td align="center">Home</td>
<td align="center">Libraries</td>
-<td align="center">People</td>
-<td align="center">FAQ</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
<td align="center">More</td>
</tr></table>
<hr>
Modified: branches/proto/v4/libs/config/doc/html/boost_config/guidelines_for_boost_authors.html
==============================================================================
--- branches/proto/v4/libs/config/doc/html/boost_config/guidelines_for_boost_authors.html (original)
+++ branches/proto/v4/libs/config/doc/html/boost_config/guidelines_for_boost_authors.html 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -14,8 +14,8 @@
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
<td align="center">Home</td>
<td align="center">Libraries</td>
-<td align="center">People</td>
-<td align="center">FAQ</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
<td align="center">More</td>
</tr></table>
<hr>
@@ -188,8 +188,8 @@
New Defect Macros</a>
</h3></div></div></div>
<p>
- When you need to add a new defect macro -either to fix a problem with an
- existing library, or when adding a new library- distil the issue down to
+ When you need to add a new defect macro - either to fix a problem with an
+ existing library, or when adding a new library - distil the issue down to
a simple test case; often, at this point other (possibly better) workarounds
may become apparent. Secondly always post the test case code to the boost
mailing list and invite comments; remember that C++ is complex and that sometimes
@@ -213,7 +213,7 @@
<p>
These comments are processed by the autoconf script, so make sure the format
follows the one given. The file should be named "<code class="computeroutput"><span class="identifier">boost_no_foo</span><span class="special">.</span><span class="identifier">ipp</span></code>",
- where foo is the defect description -try and keep the file name under the
+ where foo is the defect description - try and keep the file name under the
Mac 30 character filename limit though. You will also need to provide a function
prototype "<code class="computeroutput"><span class="keyword">int</span> <span class="identifier">test</span><span class="special">()</span></code>" that is declared in a namespace with
the same name as the macro, but in all lower case, and which returns zero
@@ -236,14 +236,13 @@
</p>
<div class="itemizedlist"><ul type="disc">
<li>
- cd into <code class="computeroutput"><span class="identifier">libs</span><span class="special">/</span><span class="identifier">config</span><span class="special">/</span><span class="identifier">tools</span></code> and run <code class="computeroutput"><span class="identifier">bjam</span>
- <span class="special">--</span><span class="identifier">v2</span></code>
+ cd into <code class="computeroutput"><span class="identifier">libs</span><span class="special">/</span><span class="identifier">config</span><span class="special">/</span><span class="identifier">tools</span></code> and run <code class="computeroutput"><span class="identifier">bjam</span></code>
: this generates the <code class="computeroutput"><span class="special">.</span><span class="identifier">cpp</span></code>
- file test cases from the <code class="computeroutput"><span class="special">.</span><span class="identifier">ipp</span></code> file, updates the Jamfile, <code class="computeroutput"><span class="identifier">config_test</span><span class="special">.</span><span class="identifier">cpp</span></code> and <code class="computeroutput"><span class="identifier">config_info</span><span class="special">.</span><span class="identifier">cpp</span></code>.
+ file test cases from the <code class="computeroutput"><span class="special">.</span><span class="identifier">ipp</span></code> file, updates the libs/config/test/all/Jamfile.v2,
+ <code class="computeroutput"><span class="identifier">config_test</span><span class="special">.</span><span class="identifier">cpp</span></code> and <code class="computeroutput"><span class="identifier">config_info</span><span class="special">.</span><span class="identifier">cpp</span></code>.
</li>
<li>
- cd into <code class="computeroutput"><span class="identifier">libs</span><span class="special">/</span><span class="identifier">config</span><span class="special">/</span><span class="identifier">test</span></code> and run <code class="computeroutput"><span class="identifier">bjam</span>
- <span class="special">--</span><span class="identifier">v2</span>
+ cd into <code class="computeroutput"><span class="identifier">libs</span><span class="special">/</span><span class="identifier">config</span><span class="special">/</span><span class="identifier">test</span><span class="special">/</span><span class="identifier">all</span></code> and run <code class="computeroutput"><span class="identifier">bjam</span>
</code><span class="emphasis"><em>MACRONAME</em></span><code class="computeroutput"> <span class="identifier">compiler</span><span class="special">-</span><span class="identifier">list</span></code>
: where <span class="emphasis"><em>MACRONAME</em></span> is the name of the new macro, and
<code class="computeroutput"><span class="identifier">compiler</span><span class="special">-</span><span class="identifier">list</span></code> is the list of compilers to test
@@ -251,11 +250,10 @@
the defect, and fail with those that do.
</li>
<li>
- cd into <code class="computeroutput"><span class="identifier">libs</span><span class="special">/</span><span class="identifier">config</span><span class="special">/</span><span class="identifier">test</span></code> and <code class="computeroutput"><span class="identifier">run</span>
- <span class="identifier">bjam</span> <span class="special">--</span><span class="identifier">v2</span> <span class="identifier">config_info</span>
- <span class="identifier">config_test</span> <span class="identifier">compiler</span><span class="special">-</span><span class="identifier">list</span></code>
- : <code class="computeroutput"><span class="identifier">config_info</span></code> should build
- and run cleanly for all the compilers in <code class="computeroutput"><span class="identifier">compiler</span><span class="special">-</span><span class="identifier">list</span></code>
+ cd into <code class="computeroutput"><span class="identifier">libs</span><span class="special">/</span><span class="identifier">config</span><span class="special">/</span><span class="identifier">test</span></code> and run <code class="computeroutput"><span class="identifier">bjam</span>
+ <span class="identifier">config_info</span> <span class="identifier">config_test</span>
+ <span class="identifier">compiler</span><span class="special">-</span><span class="identifier">list</span></code> : <code class="computeroutput"><span class="identifier">config_info</span></code>
+ should build and run cleanly for all the compilers in <code class="computeroutput"><span class="identifier">compiler</span><span class="special">-</span><span class="identifier">list</span></code>
while <code class="computeroutput"><span class="identifier">config_test</span></code> should
fail for those that have the defect, and pass for those that do not.
</li>
@@ -344,9 +342,9 @@
</p>
<p>
The compiler/platform/standard library selection code is set up so that unknown
- platforms are ignored and assumed to be fully standards compliant -this gives
- unknown platforms a "sporting chance" of working "as is"
- even without running the configure script.
+ platforms are ignored and assumed to be fully standards compliant - this
+ gives unknown platforms a "sporting chance" of working "as
+ is" even without running the configure script.
</p>
<p>
When adding or modifying the individual mini-configs, assume that future,
Modified: branches/proto/v4/libs/config/doc/html/boost_config/rationale.html
==============================================================================
--- branches/proto/v4/libs/config/doc/html/boost_config/rationale.html (original)
+++ branches/proto/v4/libs/config/doc/html/boost_config/rationale.html 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -14,8 +14,8 @@
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
<td align="center">Home</td>
<td align="center">Libraries</td>
-<td align="center">People</td>
-<td align="center">FAQ</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
<td align="center">More</td>
</tr></table>
<hr>
Modified: branches/proto/v4/libs/config/doc/html/index.html
==============================================================================
--- branches/proto/v4/libs/config/doc/html/index.html (original)
+++ branches/proto/v4/libs/config/doc/html/index.html 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -12,8 +12,8 @@
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center">Home</td>
<td align="center">Libraries</td>
-<td align="center">People</td>
-<td align="center">FAQ</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
<td align="center">More</td>
</tr></table>
<hr>
@@ -28,7 +28,7 @@
</h3></div></div></div>
<div><p class="copyright">Copyright © 2001 -2007 Beman Dawes, Vesa Karvonen, John Maddock</p></div>
<div><div class="legalnotice">
-<a name="id437611"></a><p>
+<a name="id447424"></a><p>
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)
</p>
@@ -960,7 +960,7 @@
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: April 21, 2008 at 11:41:47 GMT</small></p></td>
+<td align="left"><p><small>Last revised: May 27, 2008 at 16:07:04 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>
Deleted: branches/proto/v4/libs/filesystem/src/exception.cpp
==============================================================================
--- branches/proto/v4/libs/filesystem/src/exception.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
+++ (empty file)
@@ -1,166 +0,0 @@
-// Exception implementation file -------------------------------------------//
-
-// Copyright 2002 Beman Dawes
-// Copyright 2001 Dietmar Kuehl
-// 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)
-
-// See library home page at http://www.boost.org/libs/filesystem
-
-//----------------------------------------------------------------------------//
-
-// define BOOST_FILESYSTEM_SOURCE so that <boost/filesystem/config.hpp> knows
-// the library is being built (possibly exporting rather than importing code)
-#define BOOST_FILESYSTEM_SOURCE
-
-#include <boost/filesystem/config.hpp>
-#include <boost/filesystem/path.hpp>
-#include <boost/cerrno.hpp>
-
-namespace fs = boost::filesystem;
-
-#include <cstring> // SGI MIPSpro compilers need this
-
-# ifdef BOOST_NO_STDC_NAMESPACE
- namespace std { using ::strerror; }
-# endif
-
-
-# if defined( BOOST_WINDOWS_API )
-# include "windows.h"
-# endif
-
-//----------------------------------------------------------------------------//
-
-namespace
-{
-#ifdef BOOST_WINDOWS_API
- struct ec_xlate { fs::system_error_type sys_ec; fs::errno_type ec; };
- const ec_xlate ec_table[] =
- {
- // see WinError.h comments for descriptions of errors
-
- // most common errors first to speed sequential search
- { ERROR_FILE_NOT_FOUND, ENOENT },
- { ERROR_PATH_NOT_FOUND, ENOENT },
-
- // alphabetical for easy maintenance
- { 0, 0 }, // no error
- { ERROR_ACCESS_DENIED, EACCES },
- { ERROR_ALREADY_EXISTS, EEXIST },
- { ERROR_BAD_UNIT, ENODEV },
- { ERROR_BUFFER_OVERFLOW, ENAMETOOLONG },
- { ERROR_BUSY, EBUSY },
- { ERROR_BUSY_DRIVE, EBUSY },
- { ERROR_CANNOT_MAKE, EACCES },
- { ERROR_CANTOPEN, EIO },
- { ERROR_CANTREAD, EIO },
- { ERROR_CANTWRITE, EIO },
- { ERROR_CURRENT_DIRECTORY, EACCES },
- { ERROR_DEV_NOT_EXIST, ENODEV },
- { ERROR_DEVICE_IN_USE, EBUSY },
- { ERROR_DIR_NOT_EMPTY, ENOTEMPTY },
- { ERROR_DIRECTORY, EINVAL }, // WinError.h: "The directory name is invalid"
- { ERROR_DISK_FULL, ENOSPC },
- { ERROR_FILE_EXISTS, EEXIST },
- { ERROR_HANDLE_DISK_FULL, ENOSPC },
- { ERROR_INVALID_ACCESS, EACCES },
- { ERROR_INVALID_DRIVE, ENODEV },
- { ERROR_INVALID_FUNCTION, ENOSYS },
- { ERROR_INVALID_HANDLE, EBADHANDLE },
- { ERROR_INVALID_NAME, EINVAL },
- { ERROR_LOCK_VIOLATION, EACCES },
- { ERROR_LOCKED, EACCES },
- { ERROR_NOACCESS, EACCES },
- { ERROR_NOT_ENOUGH_MEMORY, ENOMEM },
- { ERROR_NOT_READY, EAGAIN },
- { ERROR_NOT_SAME_DEVICE, EXDEV },
- { ERROR_OPEN_FAILED, EIO },
- { ERROR_OPEN_FILES, EBUSY },
- { ERROR_OUTOFMEMORY, ENOMEM },
- { ERROR_READ_FAULT, EIO },
- { ERROR_SEEK, EIO },
- { ERROR_SHARING_VIOLATION, EACCES },
- { ERROR_TOO_MANY_OPEN_FILES, ENFILE },
- { ERROR_WRITE_FAULT, EIO },
- { ERROR_WRITE_PROTECT, EROFS },
- { 0,EOTHER }
- };
-#endif
-
-} // unnamed namespace
-
-namespace boost
-{
- namespace filesystem
- {
-# ifdef BOOST_WINDOWS_API
-
- BOOST_FILESYSTEM_DECL
- errno_type lookup_errno( system_error_type sys_err_code )
- {
- for ( const ec_xlate * cur = &ec_table[0];
- cur != ec_table
- + sizeof(ec_table)/sizeof(ec_xlate); ++cur )
- {
- if ( sys_err_code == cur->sys_ec ) return cur->ec;
- }
- return EOTHER;
- }
-
- BOOST_FILESYSTEM_DECL void
- system_message( system_error_type sys_err_code, std::string & target )
- {
- LPVOID lpMsgBuf;
- ::FormatMessageA(
- FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL,
- sys_err_code,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
- (LPSTR) &lpMsgBuf,
- 0,
- NULL
- );
- target += static_cast<LPCSTR>(lpMsgBuf);
- ::LocalFree( lpMsgBuf ); // free the buffer
- while ( target.size()
- && (target[target.size()-1] == '\n' || target[target.size()-1] == '\r') )
- target.erase( target.size()-1 );
- }
-
-# ifndef BOOST_FILESYSTEM_NARROW_ONLY
- BOOST_FILESYSTEM_DECL void
- system_message( system_error_type sys_err_code, std::wstring & target )
- {
- LPVOID lpMsgBuf;
- ::FormatMessageW(
- FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL,
- sys_err_code,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
- (LPWSTR) &lpMsgBuf,
- 0,
- NULL
- );
- target += static_cast<LPCWSTR>(lpMsgBuf);
- ::LocalFree( lpMsgBuf ); // free the buffer
- while ( target.size()
- && (target[target.size()-1] == L'\n' || target[target.size()-1] == L'\r') )
- target.erase( target.size()-1 );
- }
-# endif
-# else
- void
- system_message( system_error_type sys_err_code, std::string & target )
- {
- target += std::strerror( sys_err_code );
- }
-# endif
-
- } // namespace filesystem
-} // namespace boost
Modified: branches/proto/v4/libs/filesystem/test/convenience_test.cpp
==============================================================================
--- branches/proto/v4/libs/filesystem/test/convenience_test.cpp (original)
+++ branches/proto/v4/libs/filesystem/test/convenience_test.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -8,10 +8,7 @@
// See library home page at http://www.boost.org/libs/filesystem
-// VC++ 8.0 warns on various less-than-safe practices.
-// See http://msdn.microsoft.com/msdnmag/issues/05/05/SafeCandC/default.aspx
-// But at least in VC++ 8.0 betas, their own libraries use the problem
-// practices. So turn off the warnings.
+#include <boost/config/warning_disable.hpp>
#include <boost/filesystem/convenience.hpp>
namespace fs = boost::filesystem;
Modified: branches/proto/v4/libs/filesystem/test/fstream_test.cpp
==============================================================================
--- branches/proto/v4/libs/filesystem/test/fstream_test.cpp (original)
+++ branches/proto/v4/libs/filesystem/test/fstream_test.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -7,10 +7,6 @@
// See library home page at http://www.boost.org/libs/filesystem
-// VC++ 8.0 warns on various less-than-safe practices.
-// See http://msdn.microsoft.com/msdnmag/issues/05/05/SafeCandC/default.aspx
-// But at least in VC++ 8.0 betas, their own libraries use the problem
-// practices. So turn off the warnings.
#include <boost/config/warning_disable.hpp>
#include <boost/filesystem/fstream.hpp>
Modified: branches/proto/v4/libs/filesystem/test/operations_test.cpp
==============================================================================
--- branches/proto/v4/libs/filesystem/test/operations_test.cpp (original)
+++ branches/proto/v4/libs/filesystem/test/operations_test.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -7,11 +7,8 @@
// See library home page at http://www.boost.org/libs/filesystem
-// VC++ 8.0 warns on various less-than-safe practices.
-// See http://msdn.microsoft.com/msdnmag/issues/05/05/SafeCandC/default.aspx
-// But at least in VC++ 8.0 betas, their own libraries use the problem
-// practices. So turn off the warnings.
#include <boost/config/warning_disable.hpp>
+
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/convenience.hpp>
#include <boost/cerrno.hpp>
Modified: branches/proto/v4/libs/filesystem/test/wide_test.cpp
==============================================================================
--- branches/proto/v4/libs/filesystem/test/wide_test.cpp (original)
+++ branches/proto/v4/libs/filesystem/test/wide_test.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -8,10 +8,6 @@
// See library home page at http://www.boost.org/libs/filesystem
-// VC++ 8.0 warns on various less-than-safe practices.
-// See http://msdn.microsoft.com/msdnmag/issues/05/05/SafeCandC/default.aspx
-// But at least in VC++ 8.0 betas, their own libraries use the problem
-// practices. So turn off the warnings.
#include <boost/config/warning_disable.hpp>
#include <boost/filesystem/config.hpp>
@@ -111,7 +107,7 @@
if ( convertor.out(
state, src.c_str(), src.c_str()+src.size(), from_next, work.get(),
work.get()+work_size, to_next ) != std::codecvt_base::ok )
- boost::throw_exception( "to_external conversion error" );
+ boost::throw_exception( std::runtime_error("to_external conversion error") );
*to_next = '\0';
return std::string( work.get() );
}
Modified: branches/proto/v4/libs/functional/hash/doc/Jamfile.v2
==============================================================================
--- branches/proto/v4/libs/functional/hash/doc/Jamfile.v2 (original)
+++ branches/proto/v4/libs/functional/hash/doc/Jamfile.v2 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -8,6 +8,8 @@
<xsl:param>admon.graphics.path=images/
<xsl:param>navig.graphics.path=images/
<xsl:param>html.stylesheet=boostbook.css
+ <xsl:param>boost.root=../../../../..
+ <xsl:param>boost.libraries=../../../../libraries.htm
<xsl:param>chunk.first.sections=1
<xsl:param>chunk.section.depth=2
<xsl:param>generate.section.toc.level=2
Modified: branches/proto/v4/libs/functional/hash/doc/ref.xml
==============================================================================
--- branches/proto/v4/libs/functional/hash/doc/ref.xml (original)
+++ branches/proto/v4/libs/functional/hash/doc/ref.xml 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -406,6 +406,8 @@
</method>
</struct-specialization>
+ <free-function-group name="Support functions (Boost extension).">
+
<!--
boost::hash_combine
-->
@@ -500,6 +502,10 @@
</para></throws>
</overloaded-function>
+ </free-function-group>
+
+ <free-function-group name="Overloadable hash implementation (Boost extension).">
+
<!--
boost::hash_value - integers
-->
@@ -797,6 +803,7 @@
</informaltable>
</returns>
</overloaded-function>
+ </free-function-group>
</namespace>
</header>
</library-reference>
Modified: branches/proto/v4/libs/interprocess/doc/interprocess.qbk
==============================================================================
--- branches/proto/v4/libs/interprocess/doc/interprocess.qbk (original)
+++ branches/proto/v4/libs/interprocess/doc/interprocess.qbk 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -3096,6 +3096,8 @@
//
managed_shared_memory segment (open_only, "MySharedMemory");//Shared memory object name[c++]
+[c++]
+
//1. If the segment was previously created
// equivalent to "open_only".
//2. Otherwise, equivalent to "open_only" (size is ignored)
@@ -3258,6 +3260,21 @@
we will use managed shared memory in our examples. We can do the same with
memory mapped files or other managed memory segment classes.
+[section:copy_on_write Opening managed shared memory and mapped files with Copy On Write mode]
+
+When mapping a memory segment based on shared memory or files, there is an option to
+open them using `open_copy_on_write` option. This option is similar to `open_only` but
+every change the programmer does with this managed segment is kept private to this process
+and is not translated to the underlying device (shared memory or file).
+
+The underlying shared memory or file is opened as read-only so several processes can
+share an initial managed segment and make private changes to it. Here's an example:
+
+[import ../example/doc_managed_copy_on_write.cpp]
+[doc_managed_copy_on_write]
+
+[endsect]
+
[section:allocate_deallocate Allocating fragments of a managed memory segment]
If a basic raw-byte allocation is needed from a managed memory
@@ -3888,7 +3905,7 @@
* If the parameter `command` only contains the value `expand_bwd` (with optional
additional `nothrow_allocation`), the allocator will try to increase the size of
the memory block referenced by pointer `reuse_ptr` only moving the start of the
- block to a returned new position new_ptr. If it's not possible, it will try to
+ block to a returned new position `new_ptr`. If it's not possible, it will try to
move the start of the block as much as possible as long as this results in
`size(new_ptr) >= limit_size`. Success is reported only if this results in
`limit_size <= size(new_ptr)`.
@@ -3896,7 +3913,7 @@
* If the parameter `command` only contains the value `allocate_new` (with optional
additional `nothrow_allocation`), the allocator will try to allocate memory for
`preferred_size` objects. If it's not possible it will try to allocate memory for
- at least limit_size` objects.
+ at least `limit_size` objects.
* If the parameter `command` only contains a combination of `expand_fwd` and
`allocate_new`, (with optional additional `nothrow_allocation`) the allocator will
@@ -3951,8 +3968,8 @@
* If the user chooses `char` as template argument and a backwards expansion is
performed, although properly aligned, the returned buffer might not be
suitable because the distance between the new beginning and the old beginning
- might not multiple of the type the user wants to construct, because due to internal
- restriction the expansion can be slightly bigger than the requested. [*When
+ might not multiple of the type the user wants to construct, since due to internal
+ restrictions the expansion can be slightly bigger than the requested bytes. [*When
performing backwards expansion, if you have already constructed objects in the
old buffer, make sure to specify correctly the type.]
@@ -6456,6 +6473,9 @@
[section:release_notes_boost_1_36_00 Boost 1.36 Release]
* Added anonymous shared memory for UNIX systems.
+* Fixed erroneous `void` return types from `flat_map::erase()` functions.
+* Fixed missing move semantics on managed memory classes.
+* Added copy_on_write option for shared memory and mapped file managed classes.
[endsect]
Modified: branches/proto/v4/libs/interprocess/example/doc_file_mapping.cpp
==============================================================================
--- branches/proto/v4/libs/interprocess/example/doc_file_mapping.cpp (original)
+++ branches/proto/v4/libs/interprocess/example/doc_file_mapping.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -56,7 +56,6 @@
std::cout << ex.what() << std::endl;
return 1;
}
- std::remove("file.bin");
return 0;
}
//]
Modified: branches/proto/v4/libs/interprocess/example/doc_message_queueA.cpp
==============================================================================
--- branches/proto/v4/libs/interprocess/example/doc_message_queueA.cpp (original)
+++ branches/proto/v4/libs/interprocess/example/doc_message_queueA.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -35,11 +35,9 @@
}
}
catch(interprocess_exception &ex){
- message_queue::remove("message_queue");
std::cout << ex.what() << std::endl;
return 1;
}
- message_queue::remove("message_queue");
return 0;
}
Modified: branches/proto/v4/libs/interprocess/example/doc_shared_memory.cpp
==============================================================================
--- branches/proto/v4/libs/interprocess/example/doc_shared_memory.cpp (original)
+++ branches/proto/v4/libs/interprocess/example/doc_shared_memory.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -38,7 +38,6 @@
std::cout << ex.what() << std::endl;
return 1;
}
- shared_memory_object::remove("shared_memory");
return 0;
}
//]
Modified: branches/proto/v4/libs/interprocess/example/doc_shared_memory2.cpp
==============================================================================
--- branches/proto/v4/libs/interprocess/example/doc_shared_memory2.cpp (original)
+++ branches/proto/v4/libs/interprocess/example/doc_shared_memory2.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -33,12 +33,13 @@
}
}
std::cout << "Test successful!" << std::endl;
+ shared_memory_object::remove("shared_memory");
}
catch(interprocess_exception &ex){
std::cout << "Unexpected exception: " << ex.what() << std::endl;
+ shared_memory_object::remove("shared_memory");
return 1;
}
-
return 0;
}
//]
Modified: branches/proto/v4/libs/interprocess/proj/to-do.txt
==============================================================================
--- branches/proto/v4/libs/interprocess/proj/to-do.txt (original)
+++ branches/proto/v4/libs/interprocess/proj/to-do.txt 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -52,3 +52,9 @@
-> barrier_test fails on MacOS X on PowerPC.
-> void allocator instantiations fail.
+
+-> Read-only managed classes. They should avoid internal locking and map memory as read-only
+
+-> add private_read_only to mapped_region to support MAP_PRIVATE plus PROT_READ
+
+-> add contiguous_elements option to burst allocation
Modified: branches/proto/v4/libs/interprocess/proj/vc7ide/Interprocess.sln
==============================================================================
--- branches/proto/v4/libs/interprocess/proj/vc7ide/Interprocess.sln (original)
+++ branches/proto/v4/libs/interprocess/proj/vc7ide/Interprocess.sln 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -443,6 +443,14 @@
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "intersegment_ptr_test", "intersegment_ptr_test.vcproj", "{5E81CD01-4FA2-2A96-84FE-DA631CA20962}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doc_managed_copy_on_write", "doc_managed_copy_on_write.vcproj", "{8E0C437E-3613-FD46-F3AE-876A0731CA85}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
@@ -895,6 +903,14 @@
{58CCE183-6092-48FE-A4F7-BA0D3A792639}.Debug.Build.0 = Debug|Win32
{58CCE183-6092-48FE-A4F7-BA0D3A792639}.Release.ActiveCfg = Release|Win32
{58CCE183-6092-48FE-A4F7-BA0D3A792639}.Release.Build.0 = Release|Win32
+ {5E81CD01-4FA2-2A96-84FE-DA631CA20962}.Debug.ActiveCfg = Debug|Win32
+ {5E81CD01-4FA2-2A96-84FE-DA631CA20962}.Debug.Build.0 = Debug|Win32
+ {5E81CD01-4FA2-2A96-84FE-DA631CA20962}.Release.ActiveCfg = Release|Win32
+ {5E81CD01-4FA2-2A96-84FE-DA631CA20962}.Release.Build.0 = Release|Win32
+ {8E0C437E-3613-FD46-F3AE-876A0731CA85}.Debug.ActiveCfg = Debug|Win32
+ {8E0C437E-3613-FD46-F3AE-876A0731CA85}.Debug.Build.0 = Debug|Win32
+ {8E0C437E-3613-FD46-F3AE-876A0731CA85}.Release.ActiveCfg = Release|Win32
+ {8E0C437E-3613-FD46-F3AE-876A0731CA85}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
Modified: branches/proto/v4/libs/interprocess/test/cached_adaptive_pool_test.cpp
==============================================================================
--- branches/proto/v4/libs/interprocess/test/cached_adaptive_pool_test.cpp (original)
+++ branches/proto/v4/libs/interprocess/test/cached_adaptive_pool_test.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -11,6 +11,7 @@
#include <boost/interprocess/detail/config_begin.hpp>
#include <boost/interprocess/managed_shared_memory.hpp>
#include <boost/interprocess/containers/list.hpp>
+#include <boost/interprocess/containers/vector.hpp>
#include <boost/interprocess/allocators/cached_adaptive_pool.hpp>
#include "print_container.hpp"
#include "dummy_test_allocator.hpp"
Modified: branches/proto/v4/libs/interprocess/test/cached_node_allocator_test.cpp
==============================================================================
--- branches/proto/v4/libs/interprocess/test/cached_node_allocator_test.cpp (original)
+++ branches/proto/v4/libs/interprocess/test/cached_node_allocator_test.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -11,6 +11,7 @@
#include <boost/interprocess/detail/config_begin.hpp>
#include <boost/interprocess/managed_shared_memory.hpp>
#include <boost/interprocess/containers/list.hpp>
+#include <boost/interprocess/containers/vector.hpp>
#include <boost/interprocess/allocators/cached_node_allocator.hpp>
#include "print_container.hpp"
#include "dummy_test_allocator.hpp"
Modified: branches/proto/v4/libs/interprocess/test/file_mapping_test.cpp
==============================================================================
--- branches/proto/v4/libs/interprocess/test/file_mapping_test.cpp (original)
+++ branches/proto/v4/libs/interprocess/test/file_mapping_test.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -122,6 +122,13 @@
}
}
}
+ {
+ //Now test move semantics
+ file_mapping mapping(test::get_process_id_name(), read_only);
+ file_mapping move_ctor(move(mapping));
+ file_mapping move_assign;
+ move_assign = move(move_ctor);
+ }
}
catch(std::exception &exc){
std::remove(test::get_process_id_name());
Modified: branches/proto/v4/libs/interprocess/test/managed_mapped_file_test.cpp
==============================================================================
--- branches/proto/v4/libs/interprocess/test/managed_mapped_file_test.cpp (original)
+++ branches/proto/v4/libs/interprocess/test/managed_mapped_file_test.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -89,6 +89,35 @@
}
{
+ {
+ //Map preexisting file again in copy-on-write
+ managed_mapped_file mfile(open_copy_on_write, FileName);
+
+ //Check vector is still there
+ MyVect *mfile_vect = mfile.find<MyVect>("MyVector").first;
+ if(!mfile_vect)
+ return -1;
+
+ //Erase vector
+ mfile.destroy_ptr(mfile_vect);
+
+ //Make sure vector is erased
+ mfile_vect = mfile.find<MyVect>("MyVector").first;
+ if(mfile_vect)
+ return -1;
+ }
+ //Now check vector is still in the file
+ {
+ //Map preexisting file again in copy-on-write
+ managed_mapped_file mfile(open_copy_on_write, FileName);
+
+ //Check vector is still there
+ MyVect *mfile_vect = mfile.find<MyVect>("MyVector").first;
+ if(!mfile_vect)
+ return -1;
+ }
+ }
+ {
std::size_t old_free_memory;
{
//Map preexisting file again in memory
@@ -162,6 +191,13 @@
if(next_file_size <= final_file_size)
return -1;
}
+ {
+ //Now test move semantics
+ managed_mapped_file original(open_only, FileName);
+ managed_mapped_file move_ctor(move(original));
+ managed_mapped_file move_assign;
+ move_assign = move(move_ctor);
+ }
}
std::remove(FileName);
Modified: branches/proto/v4/libs/interprocess/test/managed_shared_memory_test.cpp
==============================================================================
--- branches/proto/v4/libs/interprocess/test/managed_shared_memory_test.cpp (original)
+++ branches/proto/v4/libs/interprocess/test/managed_shared_memory_test.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -84,7 +84,35 @@
if(!shmem_vect)
return -1;
}
+ {
+ {
+ //Map preexisting shmem again in copy-on-write
+ managed_shared_memory shmem(open_copy_on_write, ShmemName);
+
+ //Check vector is still there
+ MyVect *shmem_vect = shmem.find<MyVect>("MyVector").first;
+ if(!shmem_vect)
+ return -1;
+
+ //Erase vector
+ shmem.destroy_ptr(shmem_vect);
+
+ //Make sure vector is erased
+ shmem_vect = shmem.find<MyVect>("MyVector").first;
+ if(shmem_vect)
+ return -1;
+ }
+ //Now check vector is still in the shmem
+ {
+ //Map preexisting shmem again in copy-on-write
+ managed_shared_memory shmem(open_copy_on_write, ShmemName);
+ //Check vector is still there
+ MyVect *shmem_vect = shmem.find<MyVect>("MyVector").first;
+ if(!shmem_vect)
+ return -1;
+ }
+ }
{
std::size_t old_free_memory;
{
@@ -159,6 +187,13 @@
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(move(original));
+ managed_shared_memory move_assign;
+ move_assign = move(move_ctor);
+ }
}
shared_memory_object::remove(ShmemName);
Modified: branches/proto/v4/libs/interprocess/test/managed_windows_shared_memory_test.cpp
==============================================================================
--- branches/proto/v4/libs/interprocess/test/managed_windows_shared_memory_test.cpp (original)
+++ branches/proto/v4/libs/interprocess/test/managed_windows_shared_memory_test.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -72,20 +72,59 @@
//Construct a vector in the shared memory
w_shm_vect = w_shm.construct<MyVect> ("MyVector") (myallocator);
- //Map preexisting segment again in memory
- managed_windows_shared_memory w_shm_new(open_only, MemName);
-
- //Check vector is still there
- w_shm_vect = w_shm_new.find<MyVect>("MyVector").first;
- if(!w_shm_vect)
- return -1;
-
- if(w_shm_new.get_size() != w_shm.get_size())
- return 1;
- //Destroy and check it is not present
- w_shm_new.destroy_ptr(w_shm_vect);
- if(0 != w_shm_new.find<MyVect>("MyVector").first)
- return 1;
+ {
+ //Map preexisting segment again in memory
+ managed_windows_shared_memory w_shm_new(open_only, MemName);
+
+ //Check vector is still there
+ w_shm_vect = w_shm_new.find<MyVect>("MyVector").first;
+ if(!w_shm_vect)
+ return -1;
+
+ if(w_shm_new.get_size() != w_shm.get_size())
+ return 1;
+
+ {
+ {
+ //Map preexisting shmem again in copy-on-write
+ managed_windows_shared_memory shmem(open_copy_on_write, MemName);
+
+ //Check vector is still there
+ MyVect *shmem_vect = shmem.find<MyVect>("MyVector").first;
+ if(!shmem_vect)
+ return -1;
+
+ //Erase vector
+ shmem.destroy_ptr(shmem_vect);
+
+ //Make sure vector is erased
+ shmem_vect = shmem.find<MyVect>("MyVector").first;
+ if(shmem_vect)
+ return -1;
+ }
+ //Now check vector is still in the s
+ {
+ //Map preexisting shmem again in copy-on-write
+ managed_windows_shared_memory shmem(open_copy_on_write, MemName);
+
+ //Check vector is still there
+ MyVect *shmem_vect = shmem.find<MyVect>("MyVector").first;
+ if(!shmem_vect)
+ return -1;
+ }
+ }
+
+ //Destroy and check it is not present
+ w_shm_new.destroy_ptr(w_shm_vect);
+ if(0 != w_shm_new.find<MyVect>("MyVector").first)
+ return 1;
+
+ //Now test move semantics
+ managed_windows_shared_memory original(open_only, MemName);
+ managed_windows_shared_memory move_ctor(move(original));
+ managed_windows_shared_memory move_assign;
+ move_assign = move(move_ctor);
+ }
}
return 0;
Modified: branches/proto/v4/libs/interprocess/test/mapped_file_test.cpp
==============================================================================
--- branches/proto/v4/libs/interprocess/test/mapped_file_test.cpp (original)
+++ branches/proto/v4/libs/interprocess/test/mapped_file_test.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -74,6 +74,11 @@
//Overwrite all memory
std::memset(file1.get_user_address(), 0, file1.get_user_size());
+
+ //Now test move semantics
+ mapped_file move_ctor(move(file1));
+ mapped_file move_assign;
+ move_assign = move(move_ctor);
}
std::remove(FileName);
return 0;
Modified: branches/proto/v4/libs/interprocess/test/node_allocator_test.cpp
==============================================================================
--- branches/proto/v4/libs/interprocess/test/node_allocator_test.cpp (original)
+++ branches/proto/v4/libs/interprocess/test/node_allocator_test.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -11,6 +11,7 @@
#include <boost/interprocess/detail/config_begin.hpp>
#include <boost/interprocess/managed_shared_memory.hpp>
#include <boost/interprocess/containers/list.hpp>
+#include <boost/interprocess/containers/vector.hpp>
#include <boost/interprocess/allocators/node_allocator.hpp>
#include "print_container.hpp"
#include "dummy_test_allocator.hpp"
Modified: branches/proto/v4/libs/interprocess/test/node_pool_test.hpp
==============================================================================
--- branches/proto/v4/libs/interprocess/test/node_pool_test.hpp (original)
+++ branches/proto/v4/libs/interprocess/test/node_pool_test.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -25,7 +25,7 @@
struct test_node_pool
{
static bool allocate_then_deallocate(NodePool &pool);
- static bool deallocate_free_chunks(NodePool &pool);
+ static bool deallocate_free_blocks(NodePool &pool);
};
template <class NodePool>
@@ -60,7 +60,7 @@
return false;
}
- pool.deallocate_free_chunks();
+ pool.deallocate_free_blocks();
if(0 != pool.num_free_nodes()){
return false;
@@ -70,11 +70,11 @@
}
template <class NodePool>
-bool test_node_pool<NodePool>::deallocate_free_chunks(NodePool &pool)
+bool test_node_pool<NodePool>::deallocate_free_blocks(NodePool &pool)
{
- const std::size_t max_chunks = 10;
- const std::size_t max_nodes = max_chunks*pool.get_real_num_node();
- const std::size_t nodes_per_chunk = pool.get_real_num_node();
+ const std::size_t max_blocks = 10;
+ const std::size_t max_nodes = max_blocks*pool.get_real_num_node();
+ const std::size_t nodes_per_block = pool.get_real_num_node();
std::vector<void*> nodes;
@@ -93,25 +93,25 @@
return false;
}
- //Now deallocate one of each chunk per iteration
- for(std::size_t node_i = 0; node_i < nodes_per_chunk; ++node_i){
- //Deallocate a node per chunk
- for(std::size_t i = 0; i < max_chunks; ++i){
- pool.deallocate_node(nodes[i*nodes_per_chunk + node_i]);
+ //Now deallocate one of each block per iteration
+ for(std::size_t node_i = 0; node_i < nodes_per_block; ++node_i){
+ //Deallocate a node per block
+ for(std::size_t i = 0; i < max_blocks; ++i){
+ pool.deallocate_node(nodes[i*nodes_per_block + node_i]);
}
//Check that the free count is correct
- if(max_chunks*(node_i+1) != pool.num_free_nodes()){
+ if(max_blocks*(node_i+1) != pool.num_free_nodes()){
return false;
}
- //Now try to deallocate free chunks
- pool.deallocate_free_chunks();
+ //Now try to deallocate free blocks
+ pool.deallocate_free_blocks();
- //Until we don't deallocate the last node of every chunk
+ //Until we don't deallocate the last node of every block
//no node should be deallocated
- if(node_i != (nodes_per_chunk - 1)){
- if(max_chunks*(node_i+1) != pool.num_free_nodes()){
+ if(node_i != (nodes_per_block - 1)){
+ if(max_blocks*(node_i+1) != pool.num_free_nodes()){
return false;
}
}
@@ -149,7 +149,7 @@
//Now call each test
if(!test_node_pool_t::allocate_then_deallocate(*p))
return false;
- if(!test_node_pool_t::deallocate_free_chunks(*p))
+ if(!test_node_pool_t::deallocate_free_blocks(*p))
return false;
}
shared_memory_object::remove(test::get_process_id_name());
Modified: branches/proto/v4/libs/interprocess/test/private_adaptive_pool_test.cpp
==============================================================================
--- branches/proto/v4/libs/interprocess/test/private_adaptive_pool_test.cpp (original)
+++ branches/proto/v4/libs/interprocess/test/private_adaptive_pool_test.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -11,6 +11,7 @@
#include <boost/interprocess/detail/config_begin.hpp>
#include <boost/interprocess/managed_shared_memory.hpp>
#include <boost/interprocess/containers/list.hpp>
+#include <boost/interprocess/containers/vector.hpp>
#include <boost/interprocess/allocators/private_adaptive_pool.hpp>
#include "print_container.hpp"
#include "dummy_test_allocator.hpp"
Modified: branches/proto/v4/libs/interprocess/test/private_node_allocator_test.cpp
==============================================================================
--- branches/proto/v4/libs/interprocess/test/private_node_allocator_test.cpp (original)
+++ branches/proto/v4/libs/interprocess/test/private_node_allocator_test.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -11,6 +11,7 @@
#include <boost/interprocess/detail/config_begin.hpp>
#include <boost/interprocess/managed_shared_memory.hpp>
#include <boost/interprocess/containers/list.hpp>
+#include <boost/interprocess/containers/vector.hpp>
#include <boost/interprocess/allocators/private_node_allocator.hpp>
#include "print_container.hpp"
#include "dummy_test_allocator.hpp"
Modified: branches/proto/v4/libs/interprocess/test/shared_memory_mapping_test.cpp
==============================================================================
--- branches/proto/v4/libs/interprocess/test/shared_memory_mapping_test.cpp (original)
+++ branches/proto/v4/libs/interprocess/test/shared_memory_mapping_test.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -136,6 +136,13 @@
}
}
}
+ {
+ //Now test move semantics
+ shared_memory_object mapping(open_only, test::get_process_id_name(), read_write);
+ shared_memory_object move_ctor(move(mapping));
+ shared_memory_object move_assign;
+ move_assign = move(move_ctor);
+ }
}
catch(std::exception &exc){
shared_memory_object::remove(test::get_process_id_name());
Modified: branches/proto/v4/libs/interprocess/test/shared_memory_test.cpp
==============================================================================
--- branches/proto/v4/libs/interprocess/test/shared_memory_test.cpp (original)
+++ branches/proto/v4/libs/interprocess/test/shared_memory_test.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -74,6 +74,11 @@
//Overwrite all memory
std::memset(shm1.get_user_address(), 0, shm1.get_user_size());
+
+ //Now test move semantics
+ shared_memory move_ctor(move(shm1));
+ shared_memory move_assign;
+ move_assign = move(move_ctor);
}
}
catch(std::exception &ex){
Modified: branches/proto/v4/libs/interprocess/test/user_buffer_test.cpp
==============================================================================
--- branches/proto/v4/libs/interprocess/test/user_buffer_test.cpp (original)
+++ branches/proto/v4/libs/interprocess/test/user_buffer_test.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -62,6 +62,18 @@
//Named new capable heap mem allocator
wmanaged_heap_memory heap_buffer(memsize);
+ //Test move semantics
+ {
+ wmanaged_external_buffer user_default;
+ wmanaged_external_buffer temp_external(move(user_buffer));
+ user_default = move(temp_external);
+ user_buffer = move(user_default);
+ wmanaged_heap_memory heap_default;
+ wmanaged_heap_memory temp_heap(move(heap_buffer));
+ heap_default = move(temp_heap);
+ heap_buffer = move(heap_default);
+ }
+
//Initialize memory
user_buffer.reserve_named_objects(100);
heap_buffer.reserve_named_objects(100);
Modified: branches/proto/v4/libs/interprocess/test/vector_test.hpp
==============================================================================
--- branches/proto/v4/libs/interprocess/test/vector_test.hpp (original)
+++ branches/proto/v4/libs/interprocess/test/vector_test.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -15,9 +15,6 @@
#include <iostream>
#include <functional>
-#include <boost/interprocess/managed_shared_memory.hpp>
-#include <boost/interprocess/containers/vector.hpp>
-#include <boost/interprocess/indexes/flat_map_index.hpp>
#include <boost/interprocess/exceptions.hpp>
#include <boost/interprocess/detail/move_iterator.hpp>
#include <boost/interprocess/detail/move.hpp>
@@ -25,6 +22,7 @@
#include "check_equal_containers.hpp"
#include "movable_int.hpp"
#include <string>
+#include <vector>
#include "get_process_id_name.hpp"
namespace boost{
Modified: branches/proto/v4/libs/intrusive/doc/intrusive.qbk
==============================================================================
--- branches/proto/v4/libs/intrusive/doc/intrusive.qbk (original)
+++ branches/proto/v4/libs/intrusive/doc/intrusive.qbk 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -141,7 +141,7 @@
* The use of dynamic allocation to create copies of passed values can be a performance
and size bottleneck in some applications. Normally, dynamic allocation imposes
- a size overhead for each allocation to store bookeeping information and a
+ a size overhead for each allocation to store bookkeeping information and a
synchronization to protected concurrent allocation from different threads.
* Only copies of objects are stored in non-intrusive containers. Hence copy
@@ -160,7 +160,7 @@
equivalent container of pointers: iteration is faster.
* Intrusive containers offer better exception guarantees than non-intrusive containers.
- In some situation intrusives containers offer a no-throw guarantee that can't be
+ In some situations intrusive containers offer a no-throw guarantee that can't be
achieved with non-intrusive containers.
* The computation of an iterator to an element from a pointer or reference to that element
@@ -168,19 +168,19 @@
linear complexity).
* Intrusive containers offer predictability when inserting and erasing objects since no
- memory managed is done with intrusive containers. Memory management usually is not a predicable
+ memory management is done with intrusive containers. Memory management usually is not a predictable
operation so complexity guarantees from non-intrusive containers are looser than the guarantees
offered by intrusive containers.
Intrusive containers have also downsides:
* Each type stored in an intrusive container needs additional memory holding the
- maintenance information needed by the container. Hence, whenever a certain type shall
+ maintenance information needed by the container. Hence, whenever a certain type will
be stored in an intrusive container [*you have to change the definition of that type]
appropriately. Although this task is easy with [*Boost.Intrusive], touching the
definition of a type is sometimes a crucial issue.
-* In intrusive containers you don't store a copy of an object, [*but they rather the original object
+* In intrusive containers you don't store a copy of an object, [*but rather the original object
is linked with other objects in the container]. Objects don't need copy-constructors or assignment
operators to be stored in intrusive containers. But you have to take care of possible side effects,
whenever you change the contents of an object (this is especially important for
@@ -194,14 +194,14 @@
can be disposed before is erased from the container.
* [*Boost.Intrusive] containers are [*non-copyable and non-assignable]. Since intrusive
- containers don't have allocation capabilities, these operations have no sense. However,
- swapping can be used to implement move-capabilities. To ease the implementation of
+ containers don't have allocation capabilities, these operations make no sense. However,
+ swapping can be used to implement move capabilities. To ease the implementation of
copy constructors and assignment operators of classes storing [*Boost.Intrusive]
containers, [*Boost.Intrusive] offers special cloning functions. See
[link intrusive.clone_from Cloning [*Boost.Intrusive] containers] section for more information.
-* Analyzing thread-safety of a program that uses containers is harder with intrusive containers, becuase
- the container might be modified indirectly without an explicitly call to a container member.
+* Analyzing the thread safety of a program that uses containers is harder with intrusive containers, because
+ the container might be modified indirectly without an explicit call to a container member.
[table Summay of intrusive containers advantages and disadvantages
[[Issue] [Intrusive] [Non-intrusive]]
@@ -233,8 +233,8 @@
If you plan to insert a class in an intrusive container, you have to make some decisions
influencing the class definition itself. Each class that will be used in an intrusive
container needs some appropriate data members storing the information needed by the
-container. We will take a simple intrusive container, like an intrusive list
-([classref boost::intrusive::list boost::intrusive::list]) for the following
+container. We will take a simple intrusive container, the intrusive list
+([classref boost::intrusive::list boost::intrusive::list]), for the following
examples, but all [*Boost.Intrusive] containers are very similar. To compile
the example using [classref boost::intrusive::list boost::intrusive::list],
just include:
@@ -312,7 +312,7 @@
[link intrusive.value_traits Containers with custom ValueTraits] section.
[*If no option is specified, the container will be configured to use the base
hook with the default tag].
- Some options configured for the hook (the type of the pointers, link mode...)
+ Some options configured for the hook (the type of the pointers, link mode, etc.)
will be propagated to the container.
* [*`constant_time_size<bool Enabled>`]: Specifies if a constant time `size()`
@@ -326,7 +326,7 @@
is requested.
The user normally will not need to change this type, but some
containers can have a `size_type` that might be different from `std::size_t`
- (for example, STL-like containers, use the `size_type` defined by their allocator).
+ (for example, STL-like containers use the `size_type` defined by their allocator).
[*Boost.Intrusive] can be used to implement such containers specifying the
the type of the size. By default the type is `std::size_t`.
@@ -428,8 +428,8 @@
[section:usage_both_hooks Using both hooks]
-You can insert the same object in several intrusive containers at the same time, just
-using one hook for each container. This is a full example using base and member hooks:
+You can insert the same object in several intrusive containers at the same time,
+using one hook per container. This is a full example using base and member hooks:
[import ../example/doc_how_to_use.cpp]
[doc_how_to_use_code]
@@ -456,7 +456,7 @@
[section:usage_when When to use?]
Intrusive containers can be used for highly optimized algorithms, where speed is a crucial
-issue and...
+issue and:
* additional memory management should be avoided.
* the programmer needs to efficiently track the construction and destruction of objects.
@@ -467,24 +467,24 @@
* localization of data (e.g. for cache hit optimization) leads to measureable effects.
The last point is important if you have a lot of containers over a set of elements. E.g. if
-you have a vector of objects (say, `std::vector<Object>`) and you also have a list
+you have a vector of objects (say, `std::vector<Object>`), and you also have a list
storing a subset of those objects (`std::list<Object*>`), then operating on an Object
-from the list iterator (`std::list<Object*>::iterator`) needs two steps:
+from the list iterator (`std::list<Object*>::iterator`) requires two steps:
* Access from the iterator (usually on the stack) to the list node storing a pointer to `Object`.
* Access from the pointer to `Object` to the Object stored in the vector.
While the objects themselves are tightly packed in the memory of the vector
-(vector's memory is guaranteed to be contiguous), and form something
-like a data block, list nodes can stay dispersed in the heap memory.
-Hence depending on your system you can get a lot of cache misses. The same doesn't hold
-for an intrusive list. Indeed, dereferencing an an iterator from an intrusive list is performed in
+(a vector's memory is guaranteed to be contiguous), and form something
+like a data block, list nodes may be dispersed in the heap memory.
+Hence depending on your system you might get a lot of cache misses. The same doesn't hold
+for an intrusive list. Indeed, dereferencing an iterator from an intrusive list is performed in
the same two steps as described above. But the list node is already embedded in the Object, so
the memory is directly tracked from the iterator to the Object.
It's also possible to use intrusive containers when the objects to be stored can
have different or unknown size. This allows storing base and derived objects
-in the same container as shown in the following example:
+in the same container, as shown in the following example:
[import ../example/doc_window.cpp]
[doc_window_code]
@@ -493,7 +493,7 @@
they are often more difficult to use than their STL-counterparts. That's why you
should avoid them in public interfaces of libraries. Classes to be stored in intrusive
containers must change their implementation to store the hook and this is not always
-posible or desirable.
+possible or desirable.
[endsect]
@@ -504,13 +504,13 @@
[variablelist Brief Concepts Summary
[[Node Algorithms][A class containing typedefs and static functions that define
- basic operations that can be applied to a groups of nodes. It's independent
- from the node definition, and it's configured taking a NodeTraits template
+ basic operations that can be applied to a group of nodes. It's independent
+ from the node definition and configured using a NodeTraits template
parameter that describes the node.]]
-[[Node Traits][A class that stores basic information and operations to insert a node in a group of nodes.]]
+[[Node Traits][A class that stores basic information and operations to insert a node into a group of nodes.]]
[[Hook][A class that a user must add as a base class or as a member to make the user class compatible with intrusive containers.]]
[[Intrusive Container][A class that stores user classes that have the needed hooks. It takes a ValueTraits template parameter as configuration information.]]
-[[Pseudo-Intrusive Container][Similar to an intrusive container but a pseudo-intrusive container needs additional memory (e.g. an auxiliary array) to work.]]
+[[Semi-Intrusive Container][Similar to an intrusive container but a semi-intrusive container needs additional memory (e.g. an auxiliary array) to work.]]
[[Value Traits][A class containing typedefs and operations to obtain the node to be used by Node Algorithms from the user class and the inverse.]]
]
@@ -528,7 +528,7 @@
small for user classes (usually the size of two pointers). Many operations have
constant time complexity.
-* [*set/multiset/rbtree]: A `std::set/std::multiset` like intrusive associative containers
+* [*set/multiset/rbtree]: `std::set/std::multiset` like intrusive associative containers
based on red-black trees.
The size overhead is moderate for user classes (usually the size of three pointers).
Many operations have logarithmic time complexity.
@@ -538,7 +538,7 @@
The size overhead is moderate for user classes (usually the size of three pointers).
Many operations have logarithmic time complexity.
-* [*splay_set/splay_multiset/splaytree]: A `std::set/std::multiset` like intrusive associative
+* [*splay_set/splay_multiset/splaytree]: `std::set/std::multiset` like intrusive associative
containers based on splay trees. Splay trees have no constant operations, but they
have some interesting caching properties.
The size overhead is moderate for user classes (usually the size of three pointers).
@@ -546,27 +546,27 @@
* [*sg_set/sg_multiset/sgtree]: A `std::set/std::multiset` like intrusive associative
containers based on scapegoat trees. Scapegoat can be configured with the desired
- balance factor to achieve the desised rebalancing frequency/search time compromise.
+ balance factor to achieve the desired rebalancing frequency/search time compromise.
The size overhead is moderate for user classes (usually the size of three pointers).
Many operations have logarithmic time complexity.
-[*Boost.Intrusive] also offers pseudo-intrusive containers:
+[*Boost.Intrusive] also offers semi-intrusive containers:
-* [*unordered_set/unordered_multiset]: A `std::tr1::unordered_set/std::tr1::unordered_multiset`
+* [*unordered_set/unordered_multiset]: `std::tr1::unordered_set/std::tr1::unordered_multiset`
like intrusive unordered associative containers.
The size overhead is moderate for user classes (an average of two pointers per element).
- Many operations have an amortized constant time complexity.
+ Many operations have amortized constant time complexity.
Most of these intrusive containers can be configured with constant or linear time
size:
-* [*Linear time size]: The intrusive container doesn't hold a size member that it's
-updated with every insertion/erasure. This implies that the `size()` function has not constant
+* [*Linear time size]: The intrusive container doesn't hold a size member that is
+updated with every insertion/erasure. This implies that the `size()` function doesn't have constant
time complexity. On the other hand, the container is smaller, and some operations, like
-`splice()` taking a range of iterators in linked lists have constant time complexity
+`splice()` taking a range of iterators in linked lists, have constant time complexity
instead of linear complexity.
-* [*Constant time size]: The intrusive container holds a size member that it's updated
+* [*Constant time size]: The intrusive container holds a size member that is updated
with every insertion/erasure. This implies that the `size()` function has constant time
complexity. On the other hand, increases the size of the container, and some operations,
like `splice()` taking a range of iterators, have linear time complexity in linked lists.
@@ -585,15 +585,15 @@
container. When erasing an element from the container, the container puts the hook
in the safe state again. This allows a safer use mode and it can be used to detect
programming errors. It implies an slight performance overhead in some operations
- and can convert some constant time operations in linear time operations.
+ and can convert some constant time operations to linear time operations.
* [*Auto-unlink hooks]: The hook destructor removes the object from the container
automatically and the user can safely unlink the object from the container without
- having any reference to the container.
+ referring to the container.
* [*Non-raw pointers]: If the user wants to use smart pointers instead of raw pointers,
[*Boost.Intrusive] hooks can
- be configured to use any type of pointers. This configuration information is also
+ be configured to use any type of pointer. This configuration information is also
transmitted to the containers, so all the internal pointers used by intrusive containers
configured with these hooks will be smart pointers. As an example,
[*Boost.Interprocess] defines an smart pointer compatible with shared memory,
@@ -611,19 +611,19 @@
[c++]
- //Configuring explicity the safe mode
+ //Configuring the safe mode explicitly
class Foo : public list_base_hook< link_mode<safe_link> >
{};
-Thanks to the safe-mode the user can detect without any external reference, if the object
-is actually inserted in a container. Let's review the basic features of the safe-mode:
+With the safe mode the user can detect if the object
+is actually inserted in a container without any external reference. Let's review the basic features of the safe mode:
-* Hooks' constructor puts the hook in a well-known default state.
+* Hook's constructor puts the hook in a well-known default state.
-* Hooks' destructor checks if the hook is in the well-known default state. If not,
+* Hook's destructor checks if the hook is in the well-known default state. If not,
an assertion is raised.
-* Every time an object is being inserted in the intrusive container, the container
+* Every time an object is inserted in the intrusive container, the container
checks if the hook is in the well-known default state. If not,
an assertion is raised.
@@ -631,9 +631,9 @@
puts the erased object in the well-known default state.
With these features, without any external reference the user can know if the object
-has been inserted in a container calling the `is_linked()` member function.
+has been inserted in a container by calling the `is_linked()` member function.
If the object is not actually inserted
-in a container, the hook is in the default state and if it's inserted in a container, the
+in a container, the hook is in the default state, and if it is inserted in a container, the
hook is not in the default state.
[endsect]
@@ -655,7 +655,7 @@
* `BOOST_INTRUSIVE_SAFE_HOOK_DESTRUCTOR_ASSERT`: This assertion will be
used in hooks' destructors to check that the hook is in a default state.
-If any of these macros is not redefined, the assertion will be defaul to `BOOST_ASSERT`.
+If any of these macros is not redefined, the assertion will default to `BOOST_ASSERT`.
[endsect]
@@ -670,17 +670,17 @@
* When the destructor of the hook is called, the hook checks if the node is inserted
in a container. If so, the hook removes the node from the container.
* The hook has a member function called `unlink()` that can be used to unlink the
- node from the container at any moment, without having any reference to the container,
- if the user want to do so.
+ node from the container at any time, without having any reference to the container,
+ if the user wants to do so.
-These hooks have exactly the same size overhead as their analogue non auto-unlinking
+These hooks have exactly the same size overhead as their analog non auto-unlinking
hooks, but they have a restriction: they can only be used with
[link intrusive.presenting_containers non-constant time containers].
There is a reason for this:
* Auto-unlink hooks don't store any reference to the container where they are inserted.
* Only containers with non constant-time `size()` allow removing an object from the container
- without using any reference to the container.
+ without referring to the container.
This auto-unlink feature is useful in certain applications
but it must be used [*very carefuly]:
@@ -696,11 +696,11 @@
* Hooks' constructors put the hook in a well-known default state.
-* Every time an object is being inserted in the intrusive container, the container
- checks if the hook is the well-known default state. If not,
+* Every time an object is inserted in the intrusive container, the container
+ checks if the hook is in the well-known default state. If not,
an assertion is raised.
-* Every time an object is being erased from the intrusive container, the container
+* Every time an object is erased from an intrusive container, the container
puts the erased object in the well-known default state.
[endsect]
@@ -763,9 +763,9 @@
[classref boost::intrusive::slist slist] is the simplest intrusive container of
[*Boost.Intrusive]: a singly linked list. The memory overhead
-that imposes is 1 pointer per node. The size of an empty, non constant-time size
-[classref boost::intrusive::slist slist], is the size of 1 pointer. This
-lightweight memory overhead comes with its drawbacks, though: many operations have
+it imposes is 1 pointer per node. The size of an empty, non constant-time size
+[classref boost::intrusive::slist slist] is the size of 1 pointer. This
+lightweight memory overhead comes with drawbacks, though: many operations have
linear time complexity, even some that usually are constant time, like
[classref boost::intrusive::slist::swap swap]. [classref boost::intrusive::slist slist]
only provides forward iterators.
@@ -773,7 +773,7 @@
For most cases, a doubly linked list is preferrable because it offers more
constant-time functions with a slightly bigger size overhead.
However, for some applications like
-constructing more elaborated containers, singly linked lists are essential
+constructing more elaborate containers, singly linked lists are essential
because of their low size overhead.
[section:slist_hooks slist hooks]
@@ -831,8 +831,8 @@
* [*`base_hook<class Hook>`] / [*`member_hook<class T, class Hook, Hook T::* PtrToMember>`] /
[*`value_traits<class ValueTraits>`]: To specify the hook type or value traits used
- to configure the container (to know about value traits go to the section
- titled [link intrusive.value_traits Containers with custom ValueTraits].
+ to configure the container. (To learn about value traits go to the section
+ [link intrusive.value_traits Containers with custom ValueTraits].)
* [*`constant_time_size<bool Enabled>`]: To activate the constant-time `size()` operation.
Default: `constant_time_size<true>`
@@ -872,10 +872,10 @@
[section:list Intrusive doubly linked list: list]
[classref boost::intrusive::list list] is a doubly linked list. The memory overhead
-that imposes is 2 pointers per node. An empty, non constant-time size [classref boost::intrusive::list list]
-has also the size of 2 pointers. [classref boost::intrusive::list list]
+it imposes is 2 pointers per node. An empty, non constant-time size [classref boost::intrusive::list list]
+also has the size of 2 pointers. [classref boost::intrusive::list list]
has many more constant-time operations than [classref boost::intrusive::slist slist]
-and provides bidirectional iterator. It's recommendable to use use
+and provides a bidirectional iterator. It is recommended to use
[classref boost::intrusive::list list] instead of
[classref boost::intrusive::slist slist] if the size overhead is acceptable:
@@ -933,8 +933,8 @@
* [*`base_hook<class Hook>`] / [*`member_hook<class T, class Hook, Hook T::* PtrToMember>`] /
[*`value_traits<class ValueTraits>`]: To specify the hook type or value traits used
- to configure the container (to know about value traits go to the section
- titled [link intrusive.value_traits Containers with custom ValueTraits].
+ to configure the container. (To learn about value traits go to the section
+ [link intrusive.value_traits Containers with custom ValueTraits].)
* [*`constant_time_size<bool Enabled>`]: To activate the constant-time `size()` operation.
Default: `constant_time_size<true>`
@@ -974,7 +974,7 @@
has also the size of 3 pointers and an integer (3 pointers when optimized for size).
These containers have logarithmic complexity in many
operations like
-searches, insertions, erasures, etc... [classref boost::intrusive::set set] and
+searches, insertions, erasures, etc. [classref boost::intrusive::set set] and
[classref boost::intrusive::multiset multiset] are the
intrusive equivalents of standard `std::set` and `std::multiset` containers.
@@ -1056,8 +1056,8 @@
* [*`base_hook<class Hook>`] / [*`member_hook<class T, class Hook, Hook T::* PtrToMember>`] /
[*`value_traits<class ValueTraits>`]: To specify the hook type or value traits used
- to configure the container (to know about value traits go to the section
- titled [link intrusive.value_traits Containers with custom ValueTraits].
+ to configure the container. (To learn about value traits go to the section
+ [link intrusive.value_traits Containers with custom ValueTraits].)
* [*`constant_time_size<bool Enabled>`]: To activate the constant-time `size()` operation.
Default: `constant_time_size<true>`
@@ -1084,17 +1084,17 @@
[endsect]
-[section:unordered_set_unordered_multiset Pseudo-Intrusive unordered associative containers: unordered_set, unordered_multiset]
+[section:unordered_set_unordered_multiset Semi-Intrusive unordered associative containers: unordered_set, unordered_multiset]
[*Boost.Intrusive] also offers hashed containers that can be very useful to implement
fast-lookup containers. These containers
([classref boost::intrusive::unordered_set unordered_set] and [classref boost::intrusive::unordered_multiset unordered_multiset])
-are pseudo-intrusive containers: they need additional memory apart from the hook
+are semi-intrusive containers: they need additional memory apart from the hook
stored in the `value_type`. This additional
memory must be passed in the constructor of the container.
Unlike C++ TR1 unordered associative containers (which are also hashed containers),
-the contents of these pseudo-intrusive containers are not rehashed to maintain a
+the contents of these semi-intrusive containers are not rehashed to maintain a
load factor: that would require memory management and intrusive containers don't
implement any memory management at all. However, the user can request an explicit
rehashing passing a new bucket array.
@@ -1241,8 +1241,8 @@
* [*`base_hook<class Hook>`] / [*`member_hook<class T, class Hook, Hook T::* PtrToMember>`] /
[*`value_traits<class ValueTraits>`]: To specify the hook type or value traits used
- to configure the container (to know about value traits go to the section
- titled [link intrusive.value_traits Containers with custom ValueTraits].
+ to configure the container. (To learn about value traits go to the section
+ [link intrusive.value_traits Containers with custom ValueTraits].)
* [*`constant_time_size<bool Enabled>`]: To activate the constant-time `size()` operation.
Default: `constant_time_size<true>`
@@ -1324,9 +1324,9 @@
Boost.Intrusive associative containers). However, there are other interesting data
structures that offer some advantages (and also disadvantages).
-Splay trees are self-adjusting binary search trees used tipically in caches, memory
+Splay trees are self-adjusting binary search trees used typically in caches, memory
allocators and other applications, because splay trees have a "caching effect": recently
-accessed elements have better access times that elements accessed less frequently.
+accessed elements have better access times than elements accessed less frequently.
For more information on splay trees see [@http://en.wikipedia.org/wiki/Splay_tree Wikipedia entry].
[*Boost.Intrusive] offers 3 containers based on splay trees:
@@ -1338,19 +1338,19 @@
that offers functions both to insert unique and multiple keys.
The memory overhead of these containers with Boost.Intrusive hooks is usually 3 pointers.
-An empty, non constant-time size splay container has also the size of 3 pointers.
+An empty, non constant-time size splay container has also a size of 3 pointers.
[section:splay_set_multiset_disadvantages Advantages and disadvantages of splay tree based containers]
Splay tree based intrusive containers have logarithmic complexity in many
-operations like searches, insertions, erasures, etc... but if some elements are
+operations like searches, insertions, erasures, etc., but if some elements are
more frequently accessed than others, splay trees perform faster searches than equivalent
balanced binary trees (such as red-black trees).
The caching effect offered by splay trees comes with a cost: the tree must be
rebalanced when an element is searched. This disallows const versions of search
functions like `find()`, `lower_bound()`, `upper_bound()`, `equal_range()`,
-`count()`...
+`count()`, etc.
Because of this, splay-tree based associative containers are not drop-in
replacements of [classref boost::intrusive::set set]/
@@ -1423,8 +1423,8 @@
* [*`base_hook<class Hook>`] / [*`member_hook<class T, class Hook, Hook T::* PtrToMember>`] /
[*`value_traits<class ValueTraits>`]: To specify the hook type or value traits used
- to configure the container (to know about value traits go to the section
- titled [link intrusive.value_traits Containers with custom ValueTraits].
+ to configure the container. (To learn about value traits go to the section
+ [link intrusive.value_traits Containers with custom ValueTraits].)
* [*`constant_time_size<bool Enabled>`]: To activate the constant-time `size()` operation.
Default: `constant_time_size<true>`
@@ -1448,10 +1448,10 @@
These hooks can be used by other intrusive containers like
intrusive scapegoat containers
[classref boost::intrusive::sg_set sg_set] and
-[classref boost::intrusive::sg_multiset sg_multiset] so a programmer
+[classref boost::intrusive::sg_multiset sg_multiset]. A programmer
might prefer using a binary search tree hook so that the same type
-can be introduced in some situations in an splay container but that
-can also be introduced in other compatible containers as well when
+can be inserted in some situations in an splay container but
+also inserted in other compatible containers when
the hook is not being used in an splay container.
[classref boost::intrusive::bs_set_base_hook bs_set_base_hook] and
@@ -1479,7 +1479,7 @@
Similar to red-black trees, AVL trees are balanced binary trees.
AVL trees are often compared with red-black trees because they support the same set of operations
-and because red-black trees also take O(log n) time for the basic operations.
+and because both take O(log n) time for basic operations.
AVL trees are more rigidly balanced than Red-Black trees, leading to slower insertion and
removal but faster retrieval, so AVL trees perform better
than red-black trees for lookup-intensive applications.
@@ -1500,7 +1500,7 @@
An empty, non constant-time size [classref boost::intrusive::avl_set avl_set],
[classref boost::intrusive::avl_multiset avl_multiset] or
[classref boost::intrusive::avltree avltree]
-has also the size of 3 pointers and an integer (3 pointers when optimized for size).
+also has a size of 3 pointers and an integer (3 pointers when optimized for size).
[section:avl_set_multiset_hooks avl_set, avl_multiset and avltree hooks]
@@ -1571,8 +1571,8 @@
* [*`base_hook<class Hook>`] / [*`member_hook<class T, class Hook, Hook T::* PtrToMember>`] /
[*`value_traits<class ValueTraits>`]: To specify the hook type or value traits used
- to configure the container (to know about value traits go to the section
- titled [link intrusive.value_traits Containers with custom ValueTraits].
+ to configure the container. (To learn about value traits go to the section
+ [link intrusive.value_traits Containers with custom ValueTraits].)
* [*`constant_time_size<bool Enabled>`]: To activate the constant-time `size()` operation.
Default: `constant_time_size<true>`
@@ -1722,8 +1722,8 @@
* [*`base_hook<class Hook>`] / [*`member_hook<class T, class Hook, Hook T::* PtrToMember>`] /
[*`value_traits<class ValueTraits>`]: To specify the hook type or value traits used
- to configure the container (to know about value traits go to the section
- titled [link intrusive.value_traits Containers with custom ValueTraits].
+ to configure the container. (To learn about value traits go to the section
+ [link intrusive.value_traits Containers with custom ValueTraits].)
* [*`size_type<bool Enabled>`]: To specify the type that will be used to store the size
of the container. Default: `size_type<std::size_t>`
@@ -1786,9 +1786,9 @@
have some inefficiencies caused by the interface: the user can only operate with `value_type`
objects. When using these containers we must use `iterator find(const value_type &value)`
to find a value. The same happens in other functions
-like `equal_range`, `lower_bound`, `upper_bound`...
+like `equal_range`, `lower_bound`, `upper_bound`, etc.
-However, sometimes the object to be searched it's quite expensive to construct:
+However, sometimes the object to be searched is quite expensive to construct:
[import ../example/doc_assoc_optimized_code.cpp]
[doc_assoc_optimized_code_normal_find]
@@ -1805,7 +1805,7 @@
Sometimes this interface limitation is severe, because
we [*might not have enough information to construct the object] but we might
-[*have enough information to find the object]. In this case, a name it's enough
+[*have enough information to find the object]. In this case, a name is enough
to search `Expensive` in the container but constructing an `Expensive`
might require more information that the user might not have.
@@ -1862,7 +1862,7 @@
`insert_check` is similar to a normal `insert` but:
* `insert_check` can be used with arbitrary keys
-* if the insertion is possible (there is no equivalent value) collects all the needed information
+* if the insertion is possible (there is no equivalent value) `insert_check` collects all the needed information
in an `insert_commit_data` structure, so that `insert_commit`:
* [*does not execute] further comparisons
* can be executed with [*constant-time complexity]
@@ -1871,7 +1871,7 @@
These functions must be used with care, since
no other insertion or erasure must be executed between an `insert_check` and an `insert_commit`
pair. Otherwise, the behaviour is undefined.
-`insert_check` and `insert_commit` will come handy
+`insert_check` and `insert_commit` will come in handy
for developers programming efficient non-intrusive associative containers.
See [classref boost::intrusive::set set]
and [classref boost::intrusive::unordered_set unordered_set] reference for more information about
@@ -1917,9 +1917,9 @@
With this function the user can efficiently remove and destroy elements if the disposer
function destroys an object: `remove_and_dispose_if`
-will call "disposer" function object for every removed element. [classref boost::intrusive::list list] offers
+will call the "disposer" function object for every removed element. [classref boost::intrusive::list list] offers
more functions taking a disposer function object as argument, like `erase_and_dispose`, `clear_and_dispose`,
-`remove_and_dispose`...
+`remove_and_dispose`, etc.
Note that the disposing function does not need to just destroy the object. It can
implement any other operation like inserting the remove object in another container.
@@ -1946,7 +1946,7 @@
To ease the implementation of copy constructors and assignment operators of classes containing [*Boost.Intrusive]
containers, all [*Boost.Intrusive] containers offer an special cloning function called `clone_from`.
-Apart from the container to be cloned, `clone_from` takes two function objects as arguments. For example, the
+Apart from the container to be cloned, `clone_from` takes two function objects as arguments. For example, consider the
`clone_from` member function of [classref boost::intrusive::list list]:
[c++]
@@ -1965,8 +1965,8 @@
The cloning function works as follows:
-* First clears and disposes all the elements from *this using the disposer function object.
-* After that starts cloning all the elements of the source container using the cloner function object.
+* First it clears and disposes all the elements from *this using the disposer function object.
+* After that it starts cloning all the elements of the source container using the cloner function object.
* If any operation in the cloning function (for example, the cloner function object) throws,
all the constructed elements are disposed using the disposer function object.
@@ -1998,7 +1998,7 @@
[section:smart_pointers_requirements Requirements for smart pointers compatible with Boost.Intrusive]
-Not every smart pointer is compatible with [*Boost.Intrusive], the smart pointer must
+Not every smart pointer is compatible with [*Boost.Intrusive]; the smart pointer must
have the following features:
* It must support the same operations as a raw pointer, except casting.
@@ -2008,7 +2008,7 @@
The conversion from the smart pointer to a raw pointer must be implemented following
Boost smart pointer `detail::get_pointer()` function. This function will be found using
-ADL. For example, for `boost::interprocess::offset_ptr` `detail::get_pointer` is defined
+ADL. For example, for `boost::interprocess::offset_ptr`, `detail::get_pointer` is defined
as follows:
[c++]
@@ -2056,8 +2056,8 @@
have their `s_local_iterator_to` static alternatives.
Alternative static functions are available under certain circunstances
-explained in the [link intrusive.value_traits.stateful_value_traits Stateful value traits] section,
-but the programmer uses hooks provided by [*Boost.Intrusive], those functions
+explained in the [link intrusive.value_traits.stateful_value_traits Stateful value traits] section;
+if the programmer uses hooks provided by [*Boost.Intrusive], those functions
will be available.
Let's see an small function that shows the use of `iterator_to` and
@@ -2075,11 +2075,11 @@
* [*Node Algorithms]: A set of static functions that implement basic operations
on a group of nodes: initialize a node, link_mode_type a node to a group of nodes,
- unlink a node from another group of nodes... For example, a circular
+ unlink a node from another group of nodes, etc. For example, a circular
singly linked list is a group of nodes, where each node has a pointer to the
next node. [*Node Algorithms] just require a [*NodeTraits]
template parameter and they can work with any [*NodeTraits] class that fulfills
- the needed interface. As an example, here is a class that implements algorithms
+ the needed interface. As an example, here is a class that implements operations7'
to manage a group of nodes forming a circular singly linked list:
[c++]
@@ -2116,11 +2116,11 @@
};
* [*Node Traits]: A class that encapsulates the basic information and
- operations on a node that forms a group of nodes:
- the type of the node, a function to obtain the pointer to the next node...
- [*Node Traits] are the configuration information [*Node Algorithms]
- need. Each type of [*Node Algorithms] expects an interface that compatible
- [*Node Traits] must implement.
+ operations on a node within a group of nodes:
+ the type of the node, a function to obtain the pointer to the next node, etc.
+ [*Node Traits] specify the configuration information [*Node Algorithms]
+ need. Each type of [*Node Algorithm] expects an interface that compatible
+ [*Node Traits] classes must implement.
As an example, this is the definition of a [*Node Traits] class that
is compatible with the previously presented `my_slist_algorithms`:
@@ -2149,7 +2149,7 @@
* [*Hook]: A class that the user must add as a base class or as a member to his own
class to make that class insertable in an intrusive container. Usually the hook
- contains a node object, that will be used to form the group of nodes:
+ contains a node object that will be used to form the group of nodes:
For example, the following class is a [*Hook] that the user can add as a base class,
to make the user class compatible with a singly linked list container:
@@ -2189,9 +2189,9 @@
* [*Intrusive Container]: A container that offers an STL-like interface to store
user objects. An intrusive container can be templatized to store different
- value types that use different hooks. An intrusive container is also more elaborated
+ value types that use different hooks. An intrusive container is also more elaborate
than a group of nodes: it can store the number of elements to achieve constant-time
- size information, it can offer debugging facilities...
+ size information, it can offer debugging facilities, etc.
For example, an [classref boost::intrusive::slist slist] container
(intrusive singly linked list) should
be able to hold `MyClass` objects that might have decided to store the hook
@@ -2223,7 +2223,7 @@
// ...
};
-* [*Pseudo-Intrusive Container]: A pseudo-intrusive container is similar to an
+* [*Semi-Intrusive Container]: A semi-intrusive container is similar to an
intrusive container, but apart from the values to be inserted in the container,
it needs additional memory (for example, auxiliary arrays or indexes).
@@ -2383,7 +2383,7 @@
An empty tree is formed by a node whose pointer to the parent node is null,
-the pointers to the left and right nodes to itself and whose color is red.
+the left and right node pointers point to itself, and whose color is red.
[classref boost::intrusive::rbtree_algorithms rbtree_algorithms]
is configured with a NodeTraits class, which encapsulates
the information about the node to be manipulated. NodeTraits must support the
@@ -2454,7 +2454,7 @@
An empty tree is formed by a node whose pointer to the parent node is null,
-the pointers to the left and right nodes to itself.
+and whose left and right nodes pointers point to itself.
[classref boost::intrusive::splaytree_algorithms splaytree_algorithms]
is configured with a NodeTraits class, which encapsulates
the information about the node to be manipulated. NodeTraits must support the
@@ -2638,7 +2638,7 @@
`ValueTraits` contains
all the information to glue the `value_type` of the containers and the node to be
used in node algorithms, since these types can be different. Apart from this,
-`ValueTraits` also store information about the link policy of the values to be inserted.
+`ValueTraits` also stores information about the link policy of the values to be inserted.
Instead of using [*Boost.Intrusive] predefined hooks
a user might want to develop customized containers, for example, using nodes that are
@@ -2652,7 +2652,7 @@
[section:value_traits_interface ValueTraits interface]
-`ValueTraits` have the following interface:
+`ValueTraits` has the following interface:
[c++]
@@ -2678,9 +2678,9 @@
Let's explain each type and function:
-* [*['node_traits]]: The node configuration that it's needed by node algorithms.
+* [*['node_traits]]: The node configuration that is needed by node algorithms.
These node traits and algorithms are
- described in the previous chapter: [link intrusive.node_algorithms Nodes Algorithms].
+ described in the previous chapter: [link intrusive.node_algorithms Node Algorithms].
* If my_value_traits is meant to be used with [classref boost::intrusive::slist slist],
`node_traits` should follow
@@ -2708,13 +2708,13 @@
same type, the `to_node_ptr` and `to_value_ptr` functions are trivial.
* [*['pointer]]: The type of a pointer to a `value_type`. It must be the same pointer type
- as `node_ptr`: If `node_ptr` is `node *` `pointer` must be `value_type*`. If
+ as `node_ptr`: If `node_ptr` is `node*`, `pointer` must be `value_type*`. If
`node_ptr` is `smart_ptr<node_traits::node>`, `pointer` must be `smart_ptr<value_type>`.
This can be generically achieved using `boost::pointer_to_other` utility from [*Boost SmartPointers]
defined in `<boost/pointer_to_other.hpp>`.
* [*['const_pointer]]: The type of a pointer to a `const value_type`. It must be the same pointer type
- as `node_ptr`: If `node_ptr` is `node *` `const_pointer` must be `const value_type*`. If
+ as `node_ptr`: If `node_ptr` is `node*`, `const_pointer` must be `const value_type*`. If
`node_ptr` is `smart_ptr<node_traits::node>`, `const_pointer` must be `smart_ptr<const value_type>`
This can be generically achieved using `boost::pointer_to_other` utility from [*Boost SmartPointers]
defined in `<boost/pointer_to_other.hpp>`.
@@ -2724,32 +2724,31 @@
These are the possible types:
* [*`normal_link`]: If this linking policy is specified in a `ValueTraits` class
- as the link, containers
+ as the link mode, containers
configured with such `ValueTraits` won't set the hooks
of the erased values to a default state. Containers also won't
check that the hooks of the new values are default initialized.
- normal_link,
- * [*`safe_link`]: If this linking policy is specified in a `ValueTraits` class
- as the link, containers
- configured with such `ValueTraits` will set the hooks
+ * [*`safe_link`]: If this linking policy is specified as the link mode
+ in a `ValueTraits` class, containers
+ configured with this `ValueTraits` will set the hooks
of the erased values to a default state. Containers also will
check that the hooks of the new values are default initialized.
* [*`auto_unlink`]: Same as "safe_link" but containers with
constant-time size features won't be
compatible with `ValueTraits` configured with this policy.
- Containers also know that the a value can be silently erased from
+ Containers also know that a value can be silently erased from
the container without using any function provided by the containers.
* [*['static node_ptr to_node_ptr (value_type &value)]] and
[*['static const_node_ptr to_node_ptr (const value_type &value)]]:
- These function take a reference to a value_type and return a pointer to the node
+ These functions take a reference to a value_type and return a pointer to the node
to be used with node algorithms.
* [*['static pointer to_value_ptr (node_ptr n)]] and
[*['static const_pointer to_value_ptr (const_node_ptr n)]]:
- These function take a pointer to a node and return a pointer to the value
+ These functions take a pointer to a node and return a pointer to the value
that contains the node.
[endsect]
@@ -2761,7 +2760,7 @@
That legacy type has two pointers that can be used to build singly and doubly linked
lists: in singly linked lists we only need a pointer, whereas in doubly
linked lists, we need two pointers. Since we only have two pointers, we can't insert
-the object in a singly and doubly linked list at the same time.
+the object in both a singly and a doubly linked list at the same time.
This is the definition of the old node:
[import ../example/doc_value_traits.cpp]
@@ -2773,7 +2772,7 @@
[doc_value_traits_value_traits]
-Defining a value traits class that just defines `value_type` as
+Defining a value traits class that simply defines `value_type` as
`legacy_node_traits::node` is a common approach when defining customized
intrusive containers, so [*Boost.Intrusive] offers a templatized
[classref boost::intrusive::trivial_value_traits trivial_value_traits] class
@@ -2794,7 +2793,7 @@
[doc_value_traits_test]
As seen, several key elements of [*Boost.Intrusive] can be reused with custom user types,
-if the user does not want to use provided [*Boost.Intrusive] facilities.
+if the user does not want to use the provided [*Boost.Intrusive] facilities.
[endsect]
@@ -2814,7 +2813,7 @@
[doc_advanced_value_traits_code]
Now we'll define two different types that will be inserted in intrusive lists and
-we'll define a templatized `ValueTraits` that will work for both types:
+a templatized `ValueTraits` that will work for both types:
[doc_advanced_value_traits_value_traits]
@@ -2825,7 +2824,7 @@
[doc_advanced_value_traits_containers]
All [*Boost.Intrusive] containers using predefined hooks use this technique to minimize code size:
-all the possible [classref boost::intrusive::list list] containers
+all possible [classref boost::intrusive::list list] containers
created with predefined hooks that define the same `VoidPointer` type
share the same list algorithms.
@@ -2833,7 +2832,7 @@
[section:simplifying_value_traits Simplifying value traits definition]
-The previous example can be further simplified using
+The previous example can be further simplified using the
[classref boost::intrusive::derivation_value_traits derivation_value_traits]
class to define a value traits class with a value that stores the
`simple_node` as a base class:
@@ -2869,8 +2868,8 @@
Until now all shown custom value traits are stateless, that is, [*the transformation between nodes
and values is implemented in terms of static functions]. It's possible to use [*stateful] value traits
-so that we can even separate nodes and values and [*avoid modifying types to insert nodes].
-[*Boost.Intrusive] differentiates between stateful and stateless value traits checking if the ValueTraits
+so that we can separate nodes and values and [*avoid modifying types to insert nodes].
+[*Boost.Intrusive] differentiates between stateful and stateless value traits by checking if the ValueTraits
class is empty:
* If the class is empty, a [*stateless] value traits is assumed.
@@ -2880,20 +2879,20 @@
Using stateful value traits it's possible to create containers of non-copyable/moveble objects [*without modifying]
the definition of the class to be inserted. This interesting property is achieved without using global variables
-(stateless value traits could use global variables to achieve the same property), so:
+(stateless value traits could use global variables to achieve the same goal), so:
* [*Thread-safety guarantees]: Better thread-safety guarantees can be achieved with stateful
- value traits, since accessing to global resources might require syncronization primitives that
- can be avoided when using the internal state.
+ value traits, since accessing global resources might require syncronization primitives that
+ can be avoided when using internal state.
* [*Flexibility]: A stateful value traits type can be configured at run-time.
-* [*Run-time polimorphism]: A value traits might implement node <-> value
+* [*Run-time polymorphism]: A value traits might implement node <-> value
transformations as virtual functions. A single container type could be
configured at run-time to use different node <-> value relatioships.
Stateful value traits have many advantages but also some downsides:
* [*Performance]: Value traits operations should be very efficient since they are basic operations used by containers.
- [*A heavy node <-> value transformation can downgrade intrusive containers' performance].
+ [*A heavy node <-> value transformation will hurt intrusive containers' performance].
* [*Exception guarantees]: The stateful ValueTraits must maintain no-throw guarantees, otherwise, the
container invariants won't be preserved.
* [*Static functions]: Some static functions offered by intrusive containers are not
@@ -2914,31 +2913,31 @@
[section:thread_safety Thread safety guarantees]
-Intrusive containers have similar same thread-safety guarantees than STL containers.
+Intrusive containers have thread safety guarantees similar to STL containers.
-* Several threads can have read or write access to different instances is safe as long as inserted
+* Several threads having read or write access to different instances is safe as long as inserted
objects are different.
* Concurrent read-only access to the same container is safe.
Some Intrusive hooks (auto-unlink hooks, for example) modify containers without
having a reference to them: this is considered a write access to the container.
-Other functions, like checking if an objects is already inserted in a containers using the `is_linked()`
-member of safe hooks is a read-access to the container without having a reference to them, so no other
+Other functions, like checking if an object is already inserted in a container using the `is_linked()`
+member of safe hooks, constitute read access on the container without having a reference to it, so no other
thread should have write access (direct or indirect) to that container.
Since the same object can be inserted in several containers at the same time using different hooks,
-the thread safety of [*Boost.Intrusive] is related to the containers and also the object whose lifetime
+the thread safety of [*Boost.Intrusive] is related to the containers and also to the object whose lifetime
is manually managed by the user.
As we can see, the analysis of the thread-safety of a program using [*Boost.Intrusive] is harder
than with non-intrusive containers.
-To analyze the thread-safety, take in care the following points:
+To analyze the thread safety, consider the following points:
-* Auto-unlink hook's destructor and `unlink()` functions modify the container indirectly.
-* Safe mode and auto-unlink hook's `is_linked()` function is a read access to the container.
-* Inserting an object in several containers that will be modified by different threads has no thread-safety
+* The auto-unlink hook's destructor and `unlink()` functions modify the container indirectly.
+* The safe mode and auto-unlink hooks' `is_linked()` functions are a read access to the container.
+* Inserting an object in containers that will be modified by different threads has no thread safety
guarantee, although in most platforms it will be thread-safe without locking.
[endsect]
@@ -2946,12 +2945,12 @@
[section:obtaining_same_type_reducing_space Obtaining the same types and reducing symbol length]
The flexible option specification mechanism used by [*Boost.Intrusive] for hooks and containers
-has also a couple of downsides:
+has a couple of downsides:
-* If a user specifies the same options in different order or specifies some options and lefts the
- rest as defaults the type of the created container/hook will be different. Sometimes
- this is annoying, because two programmers specifying the same options might end with incompatible
- types. For example, the following two lists, although they're using the same options, have not
+* If a user specifies the same options in different order or specifies some options and leaves the
+ rest as defaults, the type of the created container/hook will be different. Sometimes
+ this is annoying, because two programmers specifying the same options might end up with incompatible
+ types. For example, the following two lists, although using the same options, do not have
the same type:
[c++]
@@ -2969,12 +2968,12 @@
* Option specifiers lead to long template symbols for classes and functions. Option specifiers themselves
are verbose and without variadic templates, several default template parameters are assigned for
non-specified options. Object and debugging information files can grow and compilation times
- might suffer a bit if long names are produced.
+ may suffer if long names are produced.
-To solve these issues [*Boost.Intrusive] offers some helper metafunctions that that reduce symbol lengths
-and create the same type if the same options (either explicitly or implicitly) are used. This also
-improves compilation times. All containers and hooks have their respective `make_xxx` versions.
-Previous shown example can be rewritten like this to obtain the same list type:
+To solve these issues [*Boost.Intrusive] offers some helper metafunctions that reduce symbol lengths
+and create the same type if the same options (either explicitly or implicitly) are used. These also
+improve compilation times. All containers and hooks have their respective `make_xxx` versions.
+The previously shown example can be rewritten like this to obtain the same list type:
[c++]
@@ -2992,8 +2991,8 @@
//Implicitly specify constant-time size and size type
typedef make_list<T>::type List2;
-Produced symbol lengths and compilation times are usually shorter and object/debug files are smaller.
-If you are a programmer concerned with file sizes and compilation times, this option is your choice.
+Produced symbol lengths and compilation times will usually be shorter and object/debug files smaller.
+If you are concerned with file sizes and compilation times, this option is your best choice.
[endsect]
@@ -3022,26 +3021,26 @@
and intrusive containers to avoid instantiating node algorithms for each
user type. For example, a single class of red-black algorithms will be instantiated
to implement all set and multiset containers using raw pointers. This way,
-[*Boost.Intrusive] wants to avoid any code size overhead associated with templates.
+[*Boost.Intrusive] seeks to avoid any code size overhead associated with templates.
Apart from that, [*Boost.Intrusive] implements some size improvements: for example,
red-black trees embed the color bit in the parent pointer lower bit, if nodes
-are two-byte aligned. The possibility to avoid constant-time size operations can
-save some size on containers, and this extra size optimization is noticeable
+are two-byte aligned. The option to forgo constant-time size operations can
+reduce container size, and this extra size optimization is noticeable
when the container is empty or contains few values.
[endsect]
-[section: Boost.Intrusive as basic building block]
+[section: Boost.Intrusive as a basic building block]
-[*Boost.Intrusive] should be a basic building block to build more complex containers
-and this guideline has motivated many design decisions. For example, the possibility
-to have more than one hook per user type opens the possibility to implement multi-index
+[*Boost.Intrusive] can be a basic building block to build more complex containers
+and this potential has motivated many design decisions. For example, the ability
+to have more than one hook per user type opens the opportunity to implement multi-index
containers on top of [*Boost.Intrusive].
[*Boost.Intrusive] containers implement advanced functions taking function objects
-as arguments (`clone_from`, `erase_and_dispose`, `insert_check`...). These
-functions come handy when implementing non-intrusive containers
+as arguments (`clone_from`, `erase_and_dispose`, `insert_check`, etc.). These
+functions come in handy when implementing non-intrusive containers
(for example, STL-like containers) on top of intrusive containers.
[endsect]
@@ -3051,9 +3050,9 @@
[*Boost.Intrusive] offers a wide range of containers but also allows the
construction of custom containers reusing [*Boost.Intrusive] elements.
The programer might want to use node algorithms directly or
-build special hooks that take advantage of its application environment.
+build special hooks that take advantage of an application environment.
-For example, the programmer can use can customize parts of [*Boost.Intrusive]
+For example, the programmer can customize parts of [*Boost.Intrusive]
to manage old data structures whose definition can't be changed.
[endsect]
@@ -3062,25 +3061,25 @@
[section:performance Performance]
-[*Boost.Intrusive] containers offer speed improvements comparing to non-intrusive containers,
-basically because:
+[*Boost.Intrusive] containers offer speed improvements compared to non-intrusive containers
+primarily because:
-* We can minimize memory allocation/deallocation calls.
-* We obtain better memory locality.
+* They minimize memory allocation/deallocation calls.
+* They obtain better memory locality.
-This section will show some performance tests comparing some operations on
+This section will show performance tests comparing some operations on
`boost::intrusive::list` and `std::list`:
* Insertions using `push_back` and container destruction will show the
overhead associated with memory allocation/deallocation.
-* `reverse` member function will show the advantages of the compact
+* The `reverse` member function will show the advantages of the compact
memory representation that can be achieved with intrusive containers.
-* `sort` and `write access` tests will show the advantage of intrusive containers
- minimizing the memory accesses when comparing them with containers of pointers.
+* The `sort` and `write access` tests will show the advantage of intrusive containers
+ minimizing memory accesses compared to containers of pointers.
Given an object of type `T`, [classref boost::intrusive::list boost::intrusive::list<T>]
can replace `std::list<T>` to avoid memory allocation overhead,
-or it can replace `std::list<T*>` when the user wants to obtain containers with
+or it can replace `std::list<T*>` when the user wants containers with
polymorphic values or wants to share values between several containers.
Because of this versatility, the performance tests will be executed for 6 different
list types:
@@ -3112,7 +3111,7 @@
and also derives from `test_class`.
`func_ptr_adaptor` is just a functor adaptor to convert function objects taking
-`test_list` objects to funtion objects taking pointers to them.
+`test_list` objects to function objects taking pointers to them.
You can find the full test code code in the
[@../../libs/intrusive/perf/perf_list.cpp perf_list.cpp] source file.
@@ -3120,9 +3119,9 @@
[section:performance_results_push_back Back insertion and destruction]
The first test will measure the benefits we can obtain with intrusive containers
-avoiding memory allocations and deallocations . All the objects to be
+avoiding memory allocations and deallocations. All the objects to be
inserted in intrusive containers are allocated in a single allocation call,
-whereas `std::list` will need to allocate memory for every and deallocate it
+whereas `std::list` will need to allocate memory for each object and deallocate it
for every erasure (or container destruction).
Let's compare the code to be executed for each container type for different insertion tests:
@@ -3180,29 +3179,29 @@
The results are logical: intrusive lists just need one allocation. The destruction
time of the `normal_link` intrusive container is trivial (complexity: `O(1)`),
-whereas `safe_link` and `auto_unlink` intrusive containers need to put the hook of
-erased values' in the default state (complexity: `O(NumElements)`). That's why
+whereas `safe_link` and `auto_unlink` intrusive containers need to put the hooks of
+erased values in the default state (complexity: `O(NumElements)`). That's why
`normal_link` intrusive list shines in this test.
-Non-intrusive containers need to make much more allocations and that's why they are
-lagging behind. The `disperse pointer list` needs to make `NumElements*2` allocations,
+Non-intrusive containers need to make many more allocations and that's why they
+lag behind. The `disperse pointer list` needs to make `NumElements*2` allocations,
so the result is not surprising.
-Linux test shows that standard containers perform very well against intrusive containers
-with big objects. Nearly the same GCC version in MinGW performs worse, so maybe the
-a good memory allocator is the reason for these excelent results.
+The Linux test shows that standard containers perform very well against intrusive containers
+with big objects. Nearly the same GCC version in MinGW performs worse, so maybe
+a good memory allocator is the reason for these excellent results.
[endsect]
[section:performance_results_reversing Reversing]
The next test measures the time needed to complete calls to the member function `reverse()`.
-Values (`test_class` and `itest_class`) and lists are created like explained in the
+Values (`test_class` and `itest_class`) and lists are created as explained in the
previous section.
Note that for pointer lists, `reverse` [*does not need to access `test_class` values
stored in another list or vector],
-since this function just needs to adjust internal pointers, so in theory, all tested
+since this function just needs to adjust internal pointers, so in theory all tested
lists need to perform the same operations.
These are the results:
@@ -3260,18 +3259,18 @@
l.push_back(&objects.back());
}
-For big values the compact pointer list wins because when reversing doesn't need access
-to the values stored in another container. Since all the allocations for nodes of
-this pointer list are likely to be near (since there is no other allocation in the
+For big objects the compact pointer list wins because the reversal test doesn't need access
+to values stored in another container. Since all the allocations for nodes of
+this pointer list are likely to be close (since there is no other allocation in the
process until the pointer list is created) locality is better than with intrusive
-containers. The dispersed pointer list, like with small values, has poor locality.
+containers. The dispersed pointer list, as with small values, has poor locality.
[endsect]
[section:performance_results_sorting Sorting]
-The next test measures the time needed to complete calls the member function
-`sort(Pred pred)`. Values (`test_class` and `itest_class`) and lists are created like explained in the
+The next test measures the time needed to complete calls to the member function
+`sort(Pred pred)`. Values (`test_class` and `itest_class`) and lists are created as explained in the
first section. The values will be sorted in ascending and descenting order each
iteration. For example, if ['l] is a list:
@@ -3298,7 +3297,7 @@
Note that for pointer lists, `sort` will take a function object that [*will access
`test_class` values stored in another list or vector], so pointer lists will suffer
an extra indirection: they will need to access the `test_class` values stored in
-another container to compare to elements.
+another container to compare two elements.
These are the results:
@@ -3335,16 +3334,16 @@
The results show that intrusive containers are faster than standard
containers. We can see that the pointer
list holding pointers to values stored in a vector is quite fast, so the extra
-indirection that needs to access the value is minimized because all the values
-are tightly stored, improving cache. The disperse list, on the other hand, is
-slower because the indirection to access to values stored in the object list is
-more expensive than the access to values stored in a vector.
+indirection that is needed to access the value is minimized because all the values
+are tightly stored, improving caching. The disperse list, on the other hand, is
+slower because the indirection to access values stored in the object list is
+more expensive than accessing values stored in a vector.
[endsect]
[section:performance_results_write_access Write access]
-The next test measures the time needed to iterate all the elements of a list, and
+The next test measures the time needed to iterate through all the elements of a list, and
increment the value of the internal `i_` member:
[c++]
@@ -3353,7 +3352,7 @@
for(; it != end; ++it)
++(it->i_);
-Values (`test_class` and `itest_class`) and lists are created like explained in
+Values (`test_class` and `itest_class`) and lists are created as explained in
the first section. Note that for pointer lists, the iteration will suffer
an extra indirection: they will need to access the `test_class` values stored in
another container:
@@ -3396,9 +3395,9 @@
[[Standard disperse pointer list] [6118 / 12453] [2.67 / 1.62]]
]
-Like with the read access test, the results show that intrusive containers outperform
+As with the read access test, the results show that intrusive containers outperform
all other containers if the values are tightly packed in a vector.
-The disperse list is again the slowest one.
+The disperse list is again the slowest.
[endsect]
@@ -3406,7 +3405,7 @@
Intrusive containers can offer performance benefits that can not be achieved with
equivalent non-intrusive containers. Memory locality improvements are noticeable
-when objects to be inserted are small. Minimizing memory allocation/deallocation calls is also
+when the objects to be inserted are small. Minimizing memory allocation/deallocation calls is also
an important factor and intrusive containers make this simple if the user allocates
all the objects to be inserted in intrusive containers in containers like `std::vector` or `std::deque`.
@@ -3431,7 +3430,7 @@
[section:tested_compilers Tested compilers]
-[*Boost.Intrusive] has been tested in the following compilers/platforms:
+[*Boost.Intrusive] has been tested on the following compilers/platforms:
* Visual 7.1/WinXP
* Visual 8.0/WinXP
@@ -3448,7 +3447,7 @@
[section:references References]
* SGI's [@http://www.sgi.com/tech/stl/ STL Programmer's Guide].
- [*Boost.Intrusive] is based on STL concepts and interface.
+ [*Boost.Intrusive] is based on STL concepts and interfaces.
* Dr. Dobb's, September 1, 2005: [@http://www.ddj.com/architect/184402007 ['Implementing Splay Trees in C++] ].
[*Boost.Intrusive] splay containers code is based on this article.
@@ -3476,13 +3475,13 @@
* [*Joaquin M. Lopez Munoz] for his thorough review, help, and ideas.
* [*Cory Nelson], [*Daniel James], [*Dave Harris], [*Guillaume Melquiond],
- [*Henri Bavestrello], [*Herve Bronnimann], [*Kai Bruning], [*Kevin Sopp],
+ [*Henri Bavestrello], [*Hervé Bronnimann], [*Kai Bruning], [*Kevin Sopp],
[*Paul Rose], [*Pavel Vozelinek], [*Howard Hinnant], [*Olaf Krzikalla],
[*Samuel Debionne], [*Stjepan Rajko], [*Thorsten Ottosen], [*Tobias Schwinger],
[*Tom Brinkman] and [*Steven Watanabe]
for their comments and reviews in the Boost.Intrusive formal review.
-* Thanks to of [*Julienne Walker] and [*The EC Team] ([@http://eternallyconfuzzled.com])
+* Thanks to [*Julienne Walker] and [*The EC Team] ([@http://eternallyconfuzzled.com])
for their great algorithms.
* Thanks to [*Daniel K. O.] for his AVL tree rebalancing code.
Modified: branches/proto/v4/libs/intrusive/proj/vc7ide/to-do.txt
==============================================================================
--- branches/proto/v4/libs/intrusive/proj/vc7ide/to-do.txt (original)
+++ branches/proto/v4/libs/intrusive/proj/vc7ide/to-do.txt 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -8,4 +8,5 @@
Improve the use of cache_begin to unordered containers:
-> Speed up rehash
+Add erase(iterator, iterator, difference_type) to lists to obtain constant-time erase.
Modified: branches/proto/v4/libs/intrusive/test/unordered_multiset_test.cpp
==============================================================================
--- branches/proto/v4/libs/intrusive/test/unordered_multiset_test.cpp (original)
+++ branches/proto/v4/libs/intrusive/test/unordered_multiset_test.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -10,7 +10,6 @@
// See http://www.boost.org/libs/intrusive for documentation.
//
/////////////////////////////////////////////////////////////////////////////
-
#include <boost/intrusive/detail/config_begin.hpp>
#include <boost/intrusive/unordered_set.hpp>
#include <boost/intrusive/detail/pointer_to_other.hpp>
Modified: branches/proto/v4/libs/iostreams/doc/classes/bzip2.html
==============================================================================
--- branches/proto/v4/libs/iostreams/doc/classes/bzip2.html (original)
+++ branches/proto/v4/libs/iostreams/doc/classes/bzip2.html 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -292,6 +292,7 @@
int main()
{
<SPAN CLASS="keyword">using</SPAN> <SPAN CLASS="keyword">namespace</SPAN> std;
+ <SPAN CLASS="keyword">using</SPAN> <SPAN CLASS="keyword">namespace</SPAN> boost::iostreams;
ifstream file(<SPAN CLASS="literal">"hello.bz2"</SPAN>, ios_base::in | ios_base::binary);
filtering_streambuf<input> in;
Modified: branches/proto/v4/libs/iostreams/src/zlib.cpp
==============================================================================
--- branches/proto/v4/libs/iostreams/src/zlib.cpp (original)
+++ branches/proto/v4/libs/iostreams/src/zlib.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -128,12 +128,12 @@
dest_begin = next_out;
}
-int zlib_base::deflate(int flush)
+int zlib_base::xdeflate(int flush)
{
return ::deflate(static_cast<z_stream*>(stream_), flush);
}
-int zlib_base::inflate(int flush)
+int zlib_base::xinflate(int flush)
{
return ::inflate(static_cast<z_stream*>(stream_), flush);
}
@@ -154,7 +154,7 @@
void zlib_base::do_init
( const zlib_params& p, bool compress,
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
- zlib::alloc_func /* alloc */, zlib::free_func /* free*/,
+ zlib::xalloc_func /* alloc */, zlib::xfree_func /* free*/,
#endif
void* derived )
{
Modified: branches/proto/v4/libs/iostreams/test/Jamfile.v2
==============================================================================
--- branches/proto/v4/libs/iostreams/test/Jamfile.v2 (original)
+++ branches/proto/v4/libs/iostreams/test/Jamfile.v2 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -55,6 +55,9 @@
[ test-iostreams filtering_stream_test.cpp ]
[ test-iostreams finite_state_filter_test.cpp ]
[ test-iostreams flush_test.cpp ]
+ [ test-iostreams
+ grep_test.cpp
+ /boost/regex//boost_regex ]
[ test-iostreams invert_test.cpp ]
[ test-iostreams line_filter_test.cpp ]
[ test-iostreams mapped_file_test.cpp
Modified: branches/proto/v4/libs/iostreams/test/tee_test.cpp
==============================================================================
--- branches/proto/v4/libs/iostreams/test/tee_test.cpp (original)
+++ branches/proto/v4/libs/iostreams/test/tee_test.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -27,6 +27,36 @@
void read_write_test()
{
{
+ test_file src1, src2;
+ temp_file dest;
+ filtering_istream first, second;
+ first.push(tee(file_sink(dest.name(), out_mode)));
+ first.push(file_source(src1.name(), in_mode));
+ second.push(file_source(src2.name(), in_mode));
+ compare_streams_in_chars(first, second); // ignore return value
+ first.reset();
+ BOOST_CHECK_MESSAGE(
+ compare_files(dest.name(), src1.name()),
+ "failed reading from a tee_filter in chars"
+ );
+ }
+
+ {
+ test_file src1, src2;
+ temp_file dest;
+ filtering_istream first, second;
+ first.push(tee(file_sink(dest.name(), out_mode)));
+ first.push(file_source(src1.name(), in_mode));
+ second.push(file_source(src2.name(), in_mode));
+ compare_streams_in_chunks(first, second); // ignore return value
+ first.reset();
+ BOOST_CHECK_MESSAGE(
+ compare_files(dest.name(), src1.name()),
+ "failed reading from a tee_filter in chunks"
+ );
+ }
+
+ {
temp_file dest1;
temp_file dest2;
filtering_ostream out;
@@ -55,6 +85,36 @@
}
{
+ test_file src1, src2;
+ temp_file dest;
+ filtering_istream first, second;
+ first.push( tee( file_source(src1.name(), in_mode),
+ file_sink(dest.name(), out_mode) ) );
+ second.push(file_source(src2.name(), in_mode));
+ compare_streams_in_chars(first, second); // ignore return value
+ first.reset();
+ BOOST_CHECK_MESSAGE(
+ compare_files(dest.name(), src1.name()),
+ "failed reading from a tee_device in chars"
+ );
+ }
+
+ {
+ test_file src1, src2;
+ temp_file dest;
+ filtering_istream first, second;
+ first.push( tee( file_source(src1.name(), in_mode),
+ file_sink(dest.name(), out_mode) ) );
+ second.push(file_source(src2.name(), in_mode));
+ compare_streams_in_chunks(first, second); // ignore return value
+ first.reset();
+ BOOST_CHECK_MESSAGE(
+ compare_files(dest.name(), src1.name()),
+ "failed reading from a tee_device in chunks"
+ );
+ }
+
+ {
temp_file dest1;
temp_file dest2;
filtering_ostream out;
Modified: branches/proto/v4/libs/math/build/Jamfile.v2
==============================================================================
--- branches/proto/v4/libs/math/build/Jamfile.v2 (original)
+++ branches/proto/v4/libs/math/build/Jamfile.v2 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -3,6 +3,8 @@
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt.
+import testing ;
+
C99_SOURCES = acosh
asinh
atanh
@@ -49,6 +51,8 @@
sph_neumann
;
+compile has_long_double_support.cpp ;
+
lib boost_math_tr1 : ../src/tr1/$(TR1_SOURCES).cpp
:
<link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
@@ -62,6 +66,7 @@
lib boost_math_tr1l : ../src/tr1/$(TR1_SOURCES)l.cpp
:
<link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
+ <dependency>has_long_double_support
;
lib boost_math_c99 : ../src/tr1/$(C99_SOURCES).cpp
@@ -77,5 +82,9 @@
lib boost_math_c99l : ../src/tr1/$(C99_SOURCES)l.cpp
:
<link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
+ <dependency>has_long_double_support
;
+
+boost-install boost_math_c99 boost_math_c99f boost_math_c99l boost_math_tr1 boost_math_tr1f boost_math_tr1l ;
+
Modified: branches/proto/v4/libs/math/test/Jamfile.v2
==============================================================================
--- branches/proto/v4/libs/math/test/Jamfile.v2 (original)
+++ branches/proto/v4/libs/math/test/Jamfile.v2 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -389,10 +389,17 @@
run test_tr1.cpp
../build//boost_math_tr1
../build//boost_math_tr1f
- ../build//boost_math_tr1l
../build//boost_math_c99
../build//boost_math_c99f
+ ;
+
+run test_tr1.cpp
+ ../build//boost_math_tr1l
../build//boost_math_c99l
+ : : :
+ <define>TEST_LD=1
+ :
+ test_tr1_long_double
;
compile compile_test/compl_abs_incl_test.cpp ;
Modified: branches/proto/v4/libs/math/test/test_tr1.cpp
==============================================================================
--- branches/proto/v4/libs/math/test/test_tr1.cpp (original)
+++ branches/proto/v4/libs/math/test/test_tr1.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -18,6 +18,7 @@
void test_values(float, const char* name)
{
std::cout << "Testing type " << name << std::endl;
+#ifndef TEST_LD
//
// First the C99 math functions:
//
@@ -645,12 +646,14 @@
BOOST_CHECK_CLOSE_FRACTION(tr1::sph_legendre(3, 2, static_cast<float>(0.5)), static_cast<float>(0.2061460599687871330692286791802688341213L), eps * 5000);
BOOST_CHECK_CLOSE_FRACTION(tr1::sph_legendre(40, 15, static_cast<float>(0.75)), static_cast<float>(-0.406036847302819452666908966769096223205057182668333862900509L), eps * 5000);
+#endif
}
void test_values(double, const char* name)
{
std::cout << "Testing type " << name << std::endl;
+#ifndef TEST_LD
double eps = boost::math::tools::epsilon<double>();
BOOST_CHECK_CLOSE(tr1::acosh(std::cosh(0.5)), 0.5, 500 * eps);
BOOST_CHECK_CLOSE(tr1::asinh(std::sinh(0.5)), 0.5, 500 * eps);
@@ -963,10 +966,12 @@
BOOST_CHECK_CLOSE_FRACTION(tr1::sph_legendre(3, 2, static_cast<double>(0.5)), static_cast<double>(0.2061460599687871330692286791802688341213L), eps * 5000);
BOOST_CHECK_CLOSE_FRACTION(tr1::sph_legendre(40, 15, static_cast<double>(0.75)), static_cast<double>(-0.406036847302819452666908966769096223205057182668333862900509L), eps * 5000);
+#endif
}
void test_values(long double, const char* name)
{
+#ifdef TEST_LD
#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
std::cout << "Testing type " << name << std::endl;
@@ -1028,14 +1033,14 @@
BOOST_CHECK(tr1::roundl(2.5L) == 3.0L);
BOOST_CHECK(tr1::roundl(2.25L) == 2.0L);
- BOOST_CHECK(tr1::nextafterf(1.0L, 2.0L) > 1.0L);
- BOOST_CHECK(tr1::nextafterf(1.0L, -2.0L) < 1.0L);
- BOOST_CHECK(tr1::nextafterf(tr1::nextafterf(1.0L, 2.0L), -2.0L) == 1.0L);
- BOOST_CHECK(tr1::nextafterf(tr1::nextafterf(1.0L, -2.0L), 2.0L) == 1.0L);
- BOOST_CHECK(tr1::nextafterf(1.0L, 2.0L) > 1.0L);
- BOOST_CHECK(tr1::nextafterf(1.0L, -2.0L) < 1.0L);
- BOOST_CHECK(tr1::nextafterf(tr1::nextafterf(1.0L, 2.0L), -2.0L) == 1.0L);
- BOOST_CHECK(tr1::nextafterf(tr1::nextafterf(1.0L, -2.0L), 2.0L) == 1.0L);
+ BOOST_CHECK(tr1::nextafterl(1.0L, 2.0L) > 1.0L);
+ BOOST_CHECK(tr1::nextafterl(1.0L, -2.0L) < 1.0L);
+ BOOST_CHECK(tr1::nextafterl(tr1::nextafterl(1.0L, 2.0L), -2.0L) == 1.0L);
+ BOOST_CHECK(tr1::nextafterl(tr1::nextafterl(1.0L, -2.0L), 2.0L) == 1.0L);
+ BOOST_CHECK(tr1::nextafterl(1.0L, 2.0L) > 1.0L);
+ BOOST_CHECK(tr1::nextafterl(1.0L, -2.0L) < 1.0L);
+ BOOST_CHECK(tr1::nextafterl(tr1::nextafterl(1.0L, 2.0L), -2.0L) == 1.0L);
+ BOOST_CHECK(tr1::nextafterl(tr1::nextafterl(1.0L, -2.0L), 2.0L) == 1.0L);
BOOST_CHECK(tr1::truncl(2.5L) == 2.0L);
BOOST_CHECK(tr1::truncl(2.25L) == 2.0L);
@@ -1595,15 +1600,19 @@
BOOST_CHECK_CLOSE_FRACTION(tr1::sph_legendre(3L, 2L, static_cast<long double>(0.5L)), static_cast<long double>(0.2061460599687871330692286791802688341213L), eps * 5000L);
BOOST_CHECK_CLOSE_FRACTION(tr1::sph_legendre(40L, 15L, static_cast<long double>(0.75L)), static_cast<long double>(-0.406036847302819452666908966769096223205057182668333862900509L), eps * 5000L);
#endif
+#endif
}
int test_main(int, char* [])
{
+#ifndef TEST_LD
test_values(1.0f, "float");
test_values(1.0, "double");
+#else
#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
test_values(1.0L, "long double");
#endif
+#endif
return 0;
}
Modified: branches/proto/v4/libs/system/test/error_code_test.cpp
==============================================================================
--- branches/proto/v4/libs/system/test/error_code_test.cpp (original)
+++ branches/proto/v4/libs/system/test/error_code_test.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -9,14 +9,7 @@
//----------------------------------------------------------------------------//
-// VC++ 8.0 warns on usage of certain Standard Library and API functions that
-// can cause buffer overruns or other possible security issues if misused.
-// See http://msdn.microsoft.com/msdnmag/issues/05/05/SafeCandC/default.aspx
-// But the wording of the warning is misleading and unsettling, there are no
-// portable alternative functions, and VC++ 8.0's own libraries use the
-// functions in question. So turn off the warnings.
-#define _CRT_SECURE_NO_DEPRECATE
-#define _SCL_SECURE_NO_DEPRECATE
+#include <boost/config/warning_disable.hpp>
#include <boost/test/minimal.hpp>
#include <boost/system/error_code.hpp>
Modified: branches/proto/v4/libs/system/test/header_only_test.cpp
==============================================================================
--- branches/proto/v4/libs/system/test/header_only_test.cpp (original)
+++ branches/proto/v4/libs/system/test/header_only_test.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -9,14 +9,7 @@
//----------------------------------------------------------------------------//
-// VC++ 8.0 warns on usage of certain Standard Library and API functions that
-// can cause buffer overruns or other possible security issues if misused.
-// See http://msdn.microsoft.com/msdnmag/issues/05/05/SafeCandC/default.aspx
-// But the wording of the warning is misleading and unsettling, there are no
-// portable altersystem functions, and VC++ 8.0's own libraries use the
-// functions in question. So turn off the warnings.
-#define _CRT_SECURE_NO_DEPRECATE
-#define _SCL_SECURE_NO_DEPRECATE
+#include <boost/config/warning_disable.hpp>
#define BOOST_ERROR_CODE_HEADER_ONLY
Modified: branches/proto/v4/libs/system/test/system_error_test.cpp
==============================================================================
--- branches/proto/v4/libs/system/test/system_error_test.cpp (original)
+++ branches/proto/v4/libs/system/test/system_error_test.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -9,14 +9,7 @@
//----------------------------------------------------------------------------//
-// VC++ 8.0 warns on usage of certain Standard Library and API functions that
-// can cause buffer overruns or other possible security issues if misused.
-// See http://msdn.microsoft.com/msdnmag/issues/05/05/SafeCandC/default.aspx
-// But the wording of the warning is misleading and unsettling, there are no
-// portable alternative functions, and VC++ 8.0's own libraries use the
-// functions in question. So turn off the warnings.
-#define _CRT_SECURE_NO_DEPRECATE
-#define _SCL_SECURE_NO_DEPRECATE
+#include <boost/config/warning_disable.hpp>
#include <boost/test/minimal.hpp>
#include <boost/system/system_error.hpp>
Modified: branches/proto/v4/libs/thread/doc/changes.qbk
==============================================================================
--- branches/proto/v4/libs/thread/doc/changes.qbk (original)
+++ branches/proto/v4/libs/thread/doc/changes.qbk 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -52,4 +52,6 @@
* The broken `boost::read_write_mutex` has been replaced with __shared_mutex__.
+* __mutex__ is now never recursive. For Boost releases prior to 1.35 __mutex__ was recursive on Windows and not on POSIX platforms.
+
[endsect]
Modified: branches/proto/v4/libs/thread/src/pthread/thread.cpp
==============================================================================
--- branches/proto/v4/libs/thread/src/pthread/thread.cpp (original)
+++ branches/proto/v4/libs/thread/src/pthread/thread.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -28,6 +28,9 @@
{
namespace detail
{
+ thread_data_base::~thread_data_base()
+ {}
+
struct thread_exit_callback_node
{
boost::detail::thread_exit_function_base* func;
@@ -119,7 +122,7 @@
{
void* thread_proxy(void* param)
{
- boost::shared_ptr<boost::detail::thread_data_base> thread_info = static_cast<boost::detail::thread_data_base*>(param)->self;
+ boost::detail::thread_data_ptr thread_info = static_cast<boost::detail::thread_data_base*>(param)->self;
thread_info->self.reset();
detail::set_current_thread_data(thread_info.get());
try
@@ -153,6 +156,10 @@
void run()
{}
+
+ private:
+ externally_launched_thread(externally_launched_thread&);
+ void operator=(externally_launched_thread&);
};
detail::thread_data_base* make_external_thread_data()
@@ -196,47 +203,6 @@
detach();
}
- thread::thread(detail::thread_move_t<thread> x)
- {
- lock_guard<mutex> lock(x->thread_info_mutex);
- thread_info=x->thread_info;
- x->thread_info.reset();
- }
-
- thread& thread::operator=(detail::thread_move_t<thread> x)
- {
- thread new_thread(x);
- swap(new_thread);
- return *this;
- }
-
- thread::operator detail::thread_move_t<thread>()
- {
- return move();
- }
-
- detail::thread_move_t<thread> thread::move()
- {
- detail::thread_move_t<thread> x(*this);
- return x;
- }
-
- void thread::swap(thread& x)
- {
- thread_info.swap(x.thread_info);
- }
-
-
- bool thread::operator==(const thread& other) const
- {
- return get_id()==other.get_id();
- }
-
- bool thread::operator!=(const thread& other) const
- {
- return !operator==(other);
- }
-
detail::thread_data_ptr thread::get_thread_info() const
{
lock_guard<mutex> l(thread_info_mutex);
@@ -361,57 +327,61 @@
}
}
- void thread::sleep(const system_time& st)
+ namespace this_thread
{
- detail::thread_data_base* const thread_info=detail::get_current_thread_data();
- if(thread_info)
+ void sleep(const system_time& st)
{
- unique_lock<mutex> lk(thread_info->sleep_mutex);
- while(thread_info->sleep_condition.timed_wait(lk,st));
- }
- else
- {
- xtime const xt=get_xtime(st);
-
- for (int foo=0; foo < 5; ++foo)
+ detail::thread_data_base* const thread_info=detail::get_current_thread_data();
+
+ if(thread_info)
+ {
+ unique_lock<mutex> lk(thread_info->sleep_mutex);
+ while(thread_info->sleep_condition.timed_wait(lk,st));
+ }
+ else
{
+ xtime const xt=get_xtime(st);
+
+ for (int foo=0; foo < 5; ++foo)
+ {
# if defined(BOOST_HAS_PTHREAD_DELAY_NP)
- timespec ts;
- to_timespec_duration(xt, ts);
- BOOST_VERIFY(!pthread_delay_np(&ts));
+ timespec ts;
+ to_timespec_duration(xt, ts);
+ BOOST_VERIFY(!pthread_delay_np(&ts));
# elif defined(BOOST_HAS_NANOSLEEP)
- timespec ts;
- to_timespec_duration(xt, ts);
+ timespec ts;
+ to_timespec_duration(xt, ts);
- // nanosleep takes a timespec that is an offset, not
- // an absolute time.
- nanosleep(&ts, 0);
+ // nanosleep takes a timespec that is an offset, not
+ // an absolute time.
+ nanosleep(&ts, 0);
# else
- mutex mx;
- mutex::scoped_lock lock(mx);
- condition cond;
- cond.timed_wait(lock, xt);
+ mutex mx;
+ mutex::scoped_lock lock(mx);
+ condition cond;
+ cond.timed_wait(lock, xt);
# endif
- xtime cur;
- xtime_get(&cur, TIME_UTC);
- if (xtime_cmp(xt, cur) <= 0)
- return;
+ xtime cur;
+ xtime_get(&cur, TIME_UTC);
+ if (xtime_cmp(xt, cur) <= 0)
+ return;
+ }
}
}
- }
- void thread::yield()
- {
+ void yield()
+ {
# if defined(BOOST_HAS_SCHED_YIELD)
- BOOST_VERIFY(!sched_yield());
+ BOOST_VERIFY(!sched_yield());
# elif defined(BOOST_HAS_PTHREAD_YIELD)
- BOOST_VERIFY(!pthread_yield());
+ BOOST_VERIFY(!pthread_yield());
# else
- xtime xt;
- xtime_get(&xt, TIME_UTC);
- sleep(xt);
+ xtime xt;
+ xtime_get(&xt, TIME_UTC);
+ sleep(xt);
# endif
+ }
}
unsigned thread::hardware_concurrency()
@@ -622,85 +592,85 @@
}
}
- thread_group::thread_group()
- {
- }
-
- thread_group::~thread_group()
- {
- // We shouldn't have to scoped_lock here, since referencing this object
- // from another thread while we're deleting it in the current thread is
- // going to lead to undefined behavior any way.
- for (std::list<thread*>::iterator it = m_threads.begin();
- it != m_threads.end(); ++it)
- {
- delete (*it);
- }
- }
-
- thread* thread_group::create_thread(const function0<void>& threadfunc)
- {
- // No scoped_lock required here since the only "shared data" that's
- // modified here occurs inside add_thread which does scoped_lock.
- std::auto_ptr<thread> thrd(new thread(threadfunc));
- add_thread(thrd.get());
- return thrd.release();
- }
-
- void thread_group::add_thread(thread* thrd)
- {
- mutex::scoped_lock scoped_lock(m_mutex);
-
- // For now we'll simply ignore requests to add a thread object multiple
- // times. Should we consider this an error and either throw or return an
- // error value?
- std::list<thread*>::iterator it = std::find(m_threads.begin(),
- m_threads.end(), thrd);
- BOOST_ASSERT(it == m_threads.end());
- if (it == m_threads.end())
- m_threads.push_back(thrd);
- }
-
- void thread_group::remove_thread(thread* thrd)
- {
- mutex::scoped_lock scoped_lock(m_mutex);
-
- // For now we'll simply ignore requests to remove a thread object that's
- // not in the group. Should we consider this an error and either throw or
- // return an error value?
- std::list<thread*>::iterator it = std::find(m_threads.begin(),
- m_threads.end(), thrd);
- BOOST_ASSERT(it != m_threads.end());
- if (it != m_threads.end())
- m_threads.erase(it);
- }
-
- void thread_group::join_all()
- {
- mutex::scoped_lock scoped_lock(m_mutex);
- for (std::list<thread*>::iterator it = m_threads.begin();
- it != m_threads.end(); ++it)
- {
- (*it)->join();
- }
- }
-
- void thread_group::interrupt_all()
- {
- boost::lock_guard<mutex> guard(m_mutex);
+// thread_group::thread_group()
+// {
+// }
+
+// thread_group::~thread_group()
+// {
+// // We shouldn't have to scoped_lock here, since referencing this object
+// // from another thread while we're deleting it in the current thread is
+// // going to lead to undefined behavior any way.
+// for (std::list<thread*>::iterator it = m_threads.begin();
+// it != m_threads.end(); ++it)
+// {
+// delete (*it);
+// }
+// }
+
+// thread* thread_group::create_thread(const function0<void>& threadfunc)
+// {
+// // No scoped_lock required here since the only "shared data" that's
+// // modified here occurs inside add_thread which does scoped_lock.
+// std::auto_ptr<thread> thrd(new thread(threadfunc));
+// add_thread(thrd.get());
+// return thrd.release();
+// }
+
+// void thread_group::add_thread(thread* thrd)
+// {
+// mutex::scoped_lock scoped_lock(m_mutex);
+
+// // For now we'll simply ignore requests to add a thread object multiple
+// // times. Should we consider this an error and either throw or return an
+// // error value?
+// std::list<thread*>::iterator it = std::find(m_threads.begin(),
+// m_threads.end(), thrd);
+// BOOST_ASSERT(it == m_threads.end());
+// if (it == m_threads.end())
+// m_threads.push_back(thrd);
+// }
+
+// void thread_group::remove_thread(thread* thrd)
+// {
+// mutex::scoped_lock scoped_lock(m_mutex);
+
+// // For now we'll simply ignore requests to remove a thread object that's
+// // not in the group. Should we consider this an error and either throw or
+// // return an error value?
+// std::list<thread*>::iterator it = std::find(m_threads.begin(),
+// m_threads.end(), thrd);
+// BOOST_ASSERT(it != m_threads.end());
+// if (it != m_threads.end())
+// m_threads.erase(it);
+// }
+
+// void thread_group::join_all()
+// {
+// mutex::scoped_lock scoped_lock(m_mutex);
+// for (std::list<thread*>::iterator it = m_threads.begin();
+// it != m_threads.end(); ++it)
+// {
+// (*it)->join();
+// }
+// }
+
+// void thread_group::interrupt_all()
+// {
+// boost::lock_guard<mutex> guard(m_mutex);
- for(std::list<thread*>::iterator it=m_threads.begin(),end=m_threads.end();
- it!=end;
- ++it)
- {
- (*it)->interrupt();
- }
- }
+// for(std::list<thread*>::iterator it=m_threads.begin(),end=m_threads.end();
+// it!=end;
+// ++it)
+// {
+// (*it)->interrupt();
+// }
+// }
- size_t thread_group::size() const
- {
- return m_threads.size();
- }
+// size_t thread_group::size() const
+// {
+// return m_threads.size();
+// }
}
Modified: branches/proto/v4/libs/thread/src/win32/thread.cpp
==============================================================================
--- branches/proto/v4/libs/thread/src/win32/thread.cpp (original)
+++ branches/proto/v4/libs/thread/src/win32/thread.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -81,25 +81,6 @@
}
- void thread::yield()
- {
- this_thread::yield();
- }
-
- void thread::sleep(const system_time& target)
- {
- system_time const now(get_system_time());
-
- if(target<=now)
- {
- this_thread::yield();
- }
- else
- {
- this_thread::sleep(target-now);
- }
- }
-
namespace detail
{
struct thread_exit_callback_node
@@ -164,26 +145,24 @@
set_current_thread_data(0);
}
- }
-
-
- unsigned __stdcall thread::thread_start_function(void* param)
- {
- detail::thread_data_base* const thread_info(reinterpret_cast<detail::thread_data_base*>(param));
- set_current_thread_data(thread_info);
- try
+ unsigned __stdcall thread_start_function(void* param)
{
- thread_info->run();
- }
- catch(thread_interrupted const&)
- {
- }
- catch(...)
- {
- std::terminate();
+ detail::thread_data_base* const thread_info(reinterpret_cast<detail::thread_data_base*>(param));
+ set_current_thread_data(thread_info);
+ try
+ {
+ thread_info->run();
+ }
+ catch(thread_interrupted const&)
+ {
+ }
+ catch(...)
+ {
+ std::terminate();
+ }
+ run_thread_exit_callbacks();
+ return 0;
}
- run_thread_exit_callbacks();
- return 0;
}
thread::thread()
@@ -247,36 +226,6 @@
detach();
}
- thread::thread(detail::thread_move_t<thread> x)
- {
- lock_guard<mutex> lock(x->thread_info_mutex);
- thread_info=x->thread_info;
- x->thread_info=0;
- }
-
- thread& thread::operator=(detail::thread_move_t<thread> x)
- {
- thread new_thread(x);
- swap(new_thread);
- return *this;
- }
-
- thread::operator detail::thread_move_t<thread>()
- {
- return move();
- }
-
- detail::thread_move_t<thread> thread::move()
- {
- detail::thread_move_t<thread> x(*this);
- return x;
- }
-
- void thread::swap(thread& x)
- {
- thread_info.swap(x.thread_info);
- }
-
thread::id thread::get_id() const
{
return thread::id(get_thread_info());
Modified: branches/proto/v4/libs/thread/test/Jamfile.v2
==============================================================================
--- branches/proto/v4/libs/thread/test/Jamfile.v2 (original)
+++ branches/proto/v4/libs/thread/test/Jamfile.v2 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -22,16 +22,16 @@
: requirements <library>/boost/test//boost_unit_test_framework/<link>static
<threading>multi
;
-
+
rule thread-run ( sources )
{
return
- [ run $(sources) ../build//boost_thread ]
- [ run $(sources) ../src/tss_null.cpp ../build//boost_thread/<link>static
- : : : : $(sources[1]:B)_lib ]
- ;
+ [ run $(sources) ../build//boost_thread ]
+ [ run $(sources) ../src/tss_null.cpp ../build//boost_thread/<link>static
+ : : : : $(sources[1]:B)_lib ]
+ ;
}
-
+
{
test-suite "threads"
: [ thread-run test_thread.cpp ]
@@ -39,6 +39,7 @@
[ thread-run test_hardware_concurrency.cpp ]
[ thread-run test_thread_move.cpp ]
[ thread-run test_thread_launching.cpp ]
+ [ thread-run test_thread_mf.cpp ]
[ thread-run test_move_function.cpp ]
[ thread-run test_mutex.cpp ]
[ thread-run test_condition_notify_one.cpp ]
@@ -48,11 +49,12 @@
[ thread-run test_tss.cpp ]
[ thread-run test_once.cpp ]
[ thread-run test_xtime.cpp ]
- [ thread-run test_barrier.cpp ]
+ [ thread-run test_barrier.cpp ]
[ thread-run test_shared_mutex.cpp ]
[ thread-run test_shared_mutex_part_2.cpp ]
[ thread-run test_shared_mutex_timed_locks.cpp ]
[ thread-run test_lock_concept.cpp ]
+ [ thread-run test_generic_locks.cpp ]
[ compile-fail no_implicit_move_from_lvalue_thread.cpp ]
[ compile-fail no_implicit_assign_from_lvalue_thread.cpp ]
;
Modified: branches/proto/v4/libs/thread/test/test_move_function.cpp
==============================================================================
--- branches/proto/v4/libs/thread/test/test_move_function.cpp (original)
+++ branches/proto/v4/libs/thread/test/test_move_function.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -80,7 +80,7 @@
BOOST_CHECK(l.mutex()==&m);
}
-namespace user
+namespace user_test_ns
{
template<typename T>
T move(T& t)
@@ -103,9 +103,9 @@
void test_move_for_user_defined_type_unaffected()
{
- user::nc src;
- user::nc dest=move(src);
- BOOST_CHECK(user::move_called);
+ user_test_ns::nc src;
+ user_test_ns::nc dest=move(src);
+ BOOST_CHECK(user_test_ns::move_called);
}
boost::unit_test_framework::test_suite* init_unit_test_suite(int, char*[])
Modified: branches/proto/v4/libs/thread/test/test_thread_launching.cpp
==============================================================================
--- branches/proto/v4/libs/thread/test/test_thread_launching.cpp (original)
+++ branches/proto/v4/libs/thread/test/test_thread_launching.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 Anthony Williams
+// Copyright (C) 2007-8 Anthony Williams
//
// 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)
@@ -23,6 +23,20 @@
BOOST_CHECK(normal_function_called);
}
+int nfoa_res=0;
+
+void normal_function_one_arg(int i)
+{
+ nfoa_res=i;
+}
+
+void test_thread_function_one_argument()
+{
+ boost::thread function(normal_function_one_arg,42);
+ function.join();
+ BOOST_CHECK_EQUAL(42,nfoa_res);
+}
+
struct callable_no_args
{
static bool called;
@@ -82,7 +96,8 @@
void test_thread_callable_object_one_argument()
{
- boost::thread callable(callable_one_arg(),42);
+ callable_one_arg func;
+ boost::thread callable(func,42);
callable.join();
BOOST_CHECK(callable_one_arg::called);
BOOST_CHECK_EQUAL(callable_one_arg::called_arg,42);
@@ -150,6 +165,47 @@
BOOST_CHECK_EQUAL(callable_multiple_arg::called_two_arg2,dbl);
}
+struct X
+{
+ bool function_called;
+ int arg_value;
+
+ X():
+ function_called(false),
+ arg_value(0)
+ {}
+
+
+ void f0()
+ {
+ function_called=true;
+ }
+
+ void f1(int i)
+ {
+ arg_value=i;
+ }
+
+};
+
+void test_thread_member_function_no_arguments()
+{
+ X x;
+
+ boost::thread function(&X::f0,&x);
+ function.join();
+ BOOST_CHECK(x.function_called);
+}
+
+
+void test_thread_member_function_one_argument()
+{
+ X x;
+ boost::thread function(&X::f1,&x,42);
+ function.join();
+ BOOST_CHECK_EQUAL(42,x.arg_value);
+}
+
boost::unit_test_framework::test_suite* init_unit_test_suite(int, char*[])
{
@@ -157,9 +213,12 @@
BOOST_TEST_SUITE("Boost.Threads: thread launching test suite");
test->add(BOOST_TEST_CASE(test_thread_function_no_arguments));
+ test->add(BOOST_TEST_CASE(test_thread_function_one_argument));
test->add(BOOST_TEST_CASE(test_thread_callable_object_no_arguments));
test->add(BOOST_TEST_CASE(test_thread_callable_object_ref_no_arguments));
test->add(BOOST_TEST_CASE(test_thread_callable_object_one_argument));
test->add(BOOST_TEST_CASE(test_thread_callable_object_multiple_arguments));
+ test->add(BOOST_TEST_CASE(test_thread_member_function_no_arguments));
+ test->add(BOOST_TEST_CASE(test_thread_member_function_one_argument));
return test;
}
Modified: branches/proto/v4/libs/unordered/doc/ref.xml
==============================================================================
--- branches/proto/v4/libs/unordered/doc/ref.xml (original)
+++ branches/proto/v4/libs/unordered/doc/ref.xml 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -264,12 +264,11 @@
<method-group name="modifiers">
<method name="emplace">
<template>
- <template-type-parameter name="Args">
+ <template-type-parameter name="Args" pack="1">
</template-type-parameter>
- <template-varargs></template-varargs>
</template>
- <parameter name="args">
- <paramtype>Args&&...</paramtype>
+ <parameter name="args" pack="1">
+ <paramtype>Args&&</paramtype>
</parameter>
<type>std::pair<iterator, bool></type>
<description>
@@ -289,15 +288,14 @@
</method>
<method name="emplace">
<template>
- <template-type-parameter name="Args">
+ <template-type-parameter name="Args" pack="1">
</template-type-parameter>
- <template-varargs></template-varargs>
</template>
<parameter name="hint">
<paramtype>const_iterator</paramtype>
</parameter>
- <parameter name="args">
- <paramtype>Args&&...</paramtype>
+ <parameter name="args" pack="1">
+ <paramtype>Args&&</paramtype>
</parameter>
<type>iterator</type>
<description>
@@ -1013,12 +1011,11 @@
<method-group name="modifiers">
<method name="emplace">
<template>
- <template-type-parameter name="Args">
+ <template-type-parameter name="Args" pack="1">
</template-type-parameter>
- <template-varargs></template-varargs>
</template>
- <parameter name="args">
- <paramtype>Args&&...</paramtype>
+ <parameter name="args" pack="1">
+ <paramtype>Args&&</paramtype>
</parameter>
<type>iterator</type>
<description>
@@ -1037,15 +1034,14 @@
</method>
<method name="emplace">
<template>
- <template-type-parameter name="Args">
+ <template-type-parameter name="Args" pack="1">
</template-type-parameter>
- <template-varargs></template-varargs>
</template>
<parameter name="hint">
<paramtype>const_iterator</paramtype>
</parameter>
- <parameter name="args">
- <paramtype>Args&&...</paramtype>
+ <parameter name="args" pack="1">
+ <paramtype>Args&&</paramtype>
</parameter>
<type>iterator</type>
<description>
@@ -1772,12 +1768,11 @@
<method-group name="modifiers">
<method name="emplace">
<template>
- <template-type-parameter name="Args">
+ <template-type-parameter name="Args" pack="1">
</template-type-parameter>
- <template-varargs></template-varargs>
</template>
- <parameter name="args">
- <paramtype>Args&&...</paramtype>
+ <parameter name="args" pack="1">
+ <paramtype>Args&&</paramtype>
</parameter>
<type>std::pair<iterator, bool></type>
<description>
@@ -1797,15 +1792,14 @@
</method>
<method name="emplace">
<template>
- <template-type-parameter name="Args">
+ <template-type-parameter name="Args" pack="1">
</template-type-parameter>
- <template-varargs></template-varargs>
</template>
<parameter name="hint">
<paramtype>const_iterator</paramtype>
</parameter>
- <parameter name="args">
- <paramtype>Args&&...</paramtype>
+ <parameter name="args" pack="1">
+ <paramtype>Args&&</paramtype>
</parameter>
<type>iterator</type>
<description>
@@ -2572,12 +2566,11 @@
<method-group name="modifiers">
<method name="emplace">
<template>
- <template-type-parameter name="Args">
+ <template-type-parameter name="Args" pack="1">
</template-type-parameter>
- <template-varargs></template-varargs>
</template>
- <parameter name="args">
- <paramtype>Args&&...</paramtype>
+ <parameter name="args" pack="1">
+ <paramtype>Args&&</paramtype>
</parameter>
<type>iterator</type>
<description>
@@ -2596,15 +2589,14 @@
</method>
<method name="emplace">
<template>
- <template-type-parameter name="Args">
+ <template-type-parameter name="Args" pack="1">
</template-type-parameter>
- <template-varargs></template-varargs>
</template>
<parameter name="hint">
<paramtype>const_iterator</paramtype>
</parameter>
- <parameter name="args">
- <paramtype>Args&&...</paramtype>
+ <parameter name="args" pack="1">
+ <paramtype>Args&&</paramtype>
</parameter>
<type>iterator</type>
<description>
Modified: branches/proto/v4/libs/unordered/test/helpers/strong.hpp
==============================================================================
--- branches/proto/v4/libs/unordered/test/helpers/strong.hpp (original)
+++ branches/proto/v4/libs/unordered/test/helpers/strong.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -11,7 +11,7 @@
#include "./metafunctions.hpp"
#include "./equivalent.hpp"
#include "./list.hpp"
-#include "../objects/exception.hpp"
+#include "./exception_test.hpp"
namespace test
{
Modified: branches/proto/v4/libs/unordered/test/helpers/test.hpp
==============================================================================
--- branches/proto/v4/libs/unordered/test/helpers/test.hpp (original)
+++ branches/proto/v4/libs/unordered/test/helpers/test.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -16,10 +16,13 @@
#include <boost/test/minimal.hpp>
#include <boost/preprocessor/cat.hpp>
+#include <iostream>
#define UNORDERED_AUTO_TEST(x) \
struct BOOST_PP_CAT(x, _type) : public ::test::registered_test_base { \
- BOOST_PP_CAT(x, _type)() { \
+ BOOST_PP_CAT(x, _type)() \
+ : ::test::registered_test_base(BOOST_PP_STRINGIZE(x)) \
+ { \
::test::test_list::add_test(this); \
} \
void run(); \
@@ -31,6 +34,8 @@
namespace test {
struct registered_test_base {
registered_test_base* next;
+ char const* name;
+ explicit registered_test_base(char const* n) : name(n) {}
virtual void run() = 0;
virtual ~registered_test_base() {}
};
@@ -58,8 +63,12 @@
}
static inline void run_tests() {
- for(registered_test_base* i = first(); i; i = i->next)
+ for(registered_test_base* i = first(); i; i = i->next) {
+ std::cout<<"Running "<<i->name<<"\n"<<std::flush;
i->run();
+ std::cerr<<std::flush;
+ std::cout<<std::flush;
+ }
}
}
}
Modified: branches/proto/v4/libs/unordered/test/objects/test.hpp
==============================================================================
--- branches/proto/v4/libs/unordered/test/objects/test.hpp (original)
+++ branches/proto/v4/libs/unordered/test/objects/test.hpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -11,7 +11,8 @@
#include <cstddef>
#include <iostream>
#include "../helpers/fwd.hpp"
-#include "memory.hpp"
+#include "../helpers/count.hpp"
+#include "./memory.hpp"
#include <map>
namespace test
@@ -25,7 +26,7 @@
template <class T> class allocator;
object generate(object const*);
- class object
+ class object : globally_counted_object
{
friend class hash;
friend class equal_to;
Modified: branches/proto/v4/libs/unordered/test/unordered/Jamfile.v2
==============================================================================
--- branches/proto/v4/libs/unordered/test/unordered/Jamfile.v2 (original)
+++ branches/proto/v4/libs/unordered/test/unordered/Jamfile.v2 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -21,7 +21,7 @@
[ run equivalent_keys_tests.cpp ]
[ run constructor_tests.cpp ]
[ run copy_tests.cpp ]
- [ run move_tests.cpp ]
+ [ run move_tests.cpp : : : <test-info>always_show_run_output ]
[ run assign_tests.cpp ]
[ run insert_tests.cpp ]
[ run insert_stable_tests.cpp ]
Modified: branches/proto/v4/libs/unordered/test/unordered/bucket_tests.cpp
==============================================================================
--- branches/proto/v4/libs/unordered/test/unordered/bucket_tests.cpp (original)
+++ branches/proto/v4/libs/unordered/test/unordered/bucket_tests.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -16,7 +16,7 @@
test::seed_t seed(54635);
template <class X>
-void bucket_tests(X* = 0)
+void tests(X* = 0)
{
typedef BOOST_DEDUCED_TYPENAME X::size_type size_type;
typedef BOOST_DEDUCED_TYPENAME X::const_local_iterator const_local_iterator;
@@ -55,7 +55,7 @@
boost::unordered_map<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_map;
boost::unordered_multimap<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_multimap;
-UNORDERED_TEST(bucket_tests, ((test_set)(test_multiset)(test_map)(test_multimap)))
+UNORDERED_TEST(tests, ((test_set)(test_multiset)(test_map)(test_multimap)))
}
Modified: branches/proto/v4/libs/unordered/test/unordered/load_factor_tests.cpp
==============================================================================
--- branches/proto/v4/libs/unordered/test/unordered/load_factor_tests.cpp (original)
+++ branches/proto/v4/libs/unordered/test/unordered/load_factor_tests.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -20,7 +20,7 @@
test::seed_t seed(783656);
template <class X>
-void load_factor_tests(X* = 0)
+void set_load_factor_tests(X* = 0)
{
X x;
@@ -71,7 +71,7 @@
boost::unordered_map<int, int>* int_map_ptr;
boost::unordered_multimap<int, int>* int_multimap_ptr;
-UNORDERED_TEST(load_factor_tests,
+UNORDERED_TEST(set_load_factor_tests,
((int_set_ptr)(int_multiset_ptr)(int_map_ptr)(int_multimap_ptr))
)
Modified: branches/proto/v4/libs/unordered/test/unordered/move_tests.cpp
==============================================================================
--- branches/proto/v4/libs/unordered/test/unordered/move_tests.cpp (original)
+++ branches/proto/v4/libs/unordered/test/unordered/move_tests.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -23,15 +23,15 @@
template<class T>
T create(test::random_values<T> const& v,
- BOOST_DEDUCED_TYPENAME T::value_type const*& first) {
+ test::object_count& count) {
T x(v.begin(), v.end());
- first = &*x.begin();
+ count = test::global_object_count;
return x;
}
template<class T>
T create(test::random_values<T> const& v,
- BOOST_DEDUCED_TYPENAME T::value_type const*& first,
+ test::object_count& count,
BOOST_DEDUCED_TYPENAME T::hasher hf,
BOOST_DEDUCED_TYPENAME T::key_equal eq,
BOOST_DEDUCED_TYPENAME T::allocator_type al,
@@ -39,7 +39,7 @@
T x(0, hf, eq, al);
x.max_load_factor(mlf);
x.insert(v.begin(), v.end());
- first = &*x.begin();
+ count = test::global_object_count;
return x;
}
@@ -62,9 +62,9 @@
{
test::random_values<T> v(1000);
- BOOST_DEDUCED_TYPENAME T::value_type const* first = 0;
- T y(create(v, first));
- BOOST_CHECK(first == &*y.begin());
+ test::object_count count;
+ T y(create(v, count));
+ BOOST_CHECK(count == test::global_object_count);
test::check_container(y, v);
test::check_equivalent_keys(y);
}
@@ -75,10 +75,10 @@
{
{
test::random_values<T> v(500);
- BOOST_DEDUCED_TYPENAME T::value_type const* first = 0;
+ test::object_count count;
T y;
- y = create(v, first);
- BOOST_CHECK(first == &*y.begin());
+ y = create(v, count);
+ BOOST_CHECK(count == test::global_object_count);
test::check_container(y, v);
test::check_equivalent_keys(y);
}
@@ -95,12 +95,12 @@
BOOST_DEDUCED_TYPENAME T::allocator_type al(1);
BOOST_DEDUCED_TYPENAME T::allocator_type al2(2);
- BOOST_DEDUCED_TYPENAME T::value_type const* first;
+ test::object_count count;
{
test::random_values<T> v(500);
- T y(create(v, first, hf, eq, al, 0.5));
- BOOST_CHECK(first == &*y.begin());
+ T y(create(v, count, hf, eq, al, 0.5));
+ BOOST_CHECK(count == test::global_object_count);
test::check_container(y, v);
BOOST_CHECK(test::equivalent(y.hash_function(), hf));
BOOST_CHECK(test::equivalent(y.key_eq(), eq));
@@ -112,8 +112,8 @@
{
// TODO: To do this correctly requires the fancy new allocator stuff.
test::random_values<T> v(500);
- T y(create(v, first, hf, eq, al, 2.0), al2);
- BOOST_CHECK(first != &*y.begin());
+ T y(create(v, count, hf, eq, al, 2.0), al2);
+ BOOST_CHECK(count != test::global_object_count);
test::check_container(y, v);
BOOST_CHECK(test::equivalent(y.hash_function(), hf));
BOOST_CHECK(test::equivalent(y.key_eq(), eq));
@@ -124,8 +124,8 @@
{
test::random_values<T> v(25);
- T y(create(v, first, hf, eq, al, 1.0), al);
- BOOST_CHECK(first == &*y.begin());
+ T y(create(v, count, hf, eq, al, 1.0), al);
+ BOOST_CHECK(count == test::global_object_count);
test::check_container(y, v);
BOOST_CHECK(test::equivalent(y.hash_function(), hf));
BOOST_CHECK(test::equivalent(y.key_eq(), eq));
Modified: branches/proto/v4/libs/unordered/test/unordered/rehash_tests.cpp
==============================================================================
--- branches/proto/v4/libs/unordered/test/unordered/rehash_tests.cpp (original)
+++ branches/proto/v4/libs/unordered/test/unordered/rehash_tests.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -55,19 +55,15 @@
tracker.compare(x);
}
-template <class X>
-void rehash_tests(X* ptr = 0)
-{
- rehash_empty_test1(ptr);
- rehash_test1(ptr);
-}
-
boost::unordered_set<int>* int_set_ptr;
boost::unordered_multiset<int>* int_multiset_ptr;
boost::unordered_map<int, int>* int_map_ptr;
boost::unordered_multimap<int, int>* int_multimap_ptr;
-UNORDERED_TEST(rehash_tests,
+UNORDERED_TEST(rehash_empty_test1,
+ ((int_set_ptr)(int_multiset_ptr)(int_map_ptr)(int_multimap_ptr))
+)
+UNORDERED_TEST(rehash_test1,
((int_set_ptr)(int_multiset_ptr)(int_map_ptr)(int_multimap_ptr))
)
Modified: branches/proto/v4/libs/unordered/test/unordered/unnecessary_copy_tests.cpp
==============================================================================
--- branches/proto/v4/libs/unordered/test/unordered/unnecessary_copy_tests.cpp (original)
+++ branches/proto/v4/libs/unordered/test/unordered/unnecessary_copy_tests.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -15,7 +15,19 @@
static int moves;
count_copies() : tag_(0) { ++copies; }
explicit count_copies(int tag) : tag_(tag) { ++copies; }
- count_copies(count_copies const&, count_copies const& x) : tag_(x.tag_) { ++copies; }
+
+ // This bizarre constructor is an attempt to confuse emplace.
+ //
+ // unordered_map<count_copies, count_copies> x:
+ // x.emplace(count_copies(1), count_copies(2));
+ // x.emplace(count_copies(1), count_copies(2), count_copies(3));
+ //
+ // The first emplace should use the single argument constructor twice.
+ // The second emplace should use the single argument contructor for
+ // the key, and this constructor for the value.
+ count_copies(count_copies const&, count_copies const& x)
+ : tag_(x.tag_) { ++copies; }
+
count_copies(count_copies const& x) : tag_(x.tag_) { ++copies; }
#if defined(BOOST_HAS_RVALUE_REFS)
count_copies(count_copies&& x) : tag_(x.tag_) {
Modified: branches/proto/v4/libs/utility/value_init.htm
==============================================================================
--- branches/proto/v4/libs/utility/value_init.htm (original)
+++ branches/proto/v4/libs/utility/value_init.htm 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -28,12 +28,12 @@
</ul>
<dl class="page-index">
- <dt>Types</dt>
+ <dt>Types and objects</dt>
</dl>
<ul>
<li>template class value_initialized<T>
</li>
- <li>class initialized_value
</li>
+ <li>initialized_value
</li>
</ul>
<a href="#acknowledgements">Acknowledgements</a><br>
@@ -53,7 +53,7 @@
Moreover, <code>value_initialized</code> offers a workaround to various
compiler issues regarding value-initialization.
-Furthermore a convenience class, <code>initialized_value</code> is provided,
+Furthermore, a <code>const</code> object, <code>initialized_value</code> is provided,
to avoid repeating the type name when retrieving the value from a
<code>value_initialized<T></code> object.
<br>
@@ -123,12 +123,12 @@
</pre>
</p>
<p>
-The convenience class initialized_value
+The <code>const</code> object initialized_value
allows value-initializing a variable as follows:
<pre>
- T var = initialized_value();
+ T var = initialized_value ;
</pre>
-This form of initialization is also very similar to <code>T4 var4 = T4()</code>,
+This form of initialization is semantically equivalent to <code>T4 var4 = T4()</code>,
but robust against the aforementioned compiler issues.
</p>
@@ -249,7 +249,7 @@
its internal data, prior to constructing the object that it contains.
</p>
-<h2><a name="types"></a>Types</h2>
+<h2><a name="types"></a>Types and objects</h2>
<h2><a name="val_init"><code>template class value_initialized<T></code></a></h2>
@@ -312,19 +312,22 @@
<pre>value_initialized<int> x ;<br>get(x) = 1 ; // OK<br><br>value_initialized<int const> cx ;<br>get(x) = 1 ; // ERROR: Cannot modify a const object<br><br>value_initialized<int> const x_c ;<br>get(x_c) = 1 ; // ERROR: Cannot modify a const object<br><br>value_initialized<int const> const cx_c ;<br>get(cx_c) = 1 ; // ERROR: Cannot modify a const object<br></pre>
-<h2><a name="initialized_value"><code>class initialized_value</code></a></h2>
+<h2><a name="initialized_value"><code>initialized_value</code></a></h2>
<pre>
namespace boost {
-class initialized_value
+class initialized_value_t
{
public :
template <class T> operator T() const ;
};
+
+initialized_value_t const initialized_value = {} ;
+
} // namespace boost
</pre>
-The class <code>initialized_value</code> provides a convenient way to get
+<code>initialized_value</code> provides a convenient way to get
an initialized value: its conversion operator provides an appropriate
<em>value-initialized</em> object for any CopyConstructible type.
@@ -343,7 +346,7 @@
more like <code>Namespace::Template<Arg>::Type</code>.
Instead, one could use <code>initialized_value</code> as follows:
<pre>
- T var = initialized_value();
+ T var = initialized_value ;
</pre>
<h3><a name="references">References</a></h3>
@@ -368,13 +371,15 @@
<p>value_initialized was reimplemented by Fernando Cacciola and Niels Dekker
for Boost release version 1.35 (2008), offering a workaround to various compiler issues.
</p>
+<p>initialized_value was written by Niels Dekker, and added to Boost release version 1.36 (2008).
+ </p>
<p>Developed by <a href="mailto:fernando_cacciola_at_[hidden]">Fernando Cacciola</a>,
the latest version of this file can be found at <a
href="http://www.boost.org">www.boost.org</a>.
</p>
<hr>
-<p>Revised 16 January 2008</p>
+<p>Revised 23 May 2008</p>
<p>© Copyright Fernando Cacciola, 2002, 2008.</p>
Modified: branches/proto/v4/libs/utility/value_init_test.cpp
==============================================================================
--- branches/proto/v4/libs/utility/value_init_test.cpp (original)
+++ branches/proto/v4/libs/utility/value_init_test.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -7,7 +7,8 @@
// Test program for "boost/utility/value_init.hpp"
//
// 21 Ago 2002 (Created) Fernando Cacciola
-// 18 Feb 2008 (Added tests regarding compiler issues and initialized_value) Fernando Cacciola, Niels Dekker
+// 15 Jan 2008 (Added tests regarding compiler issues) Fernando Cacciola, Niels Dekker
+// 23 May 2008 (Added tests regarding initialized_value) Niels Dekker
#include <cstring> // For memcmp.
#include <iostream>
@@ -183,7 +184,7 @@
template<class T>
void check_initialized_value ( T const& y )
{
- T initializedValue = boost::initialized_value() ;
+ T initializedValue = boost::initialized_value ;
BOOST_CHECK ( y == initializedValue ) ;
}
Modified: branches/proto/v4/libs/xpressive/proto/test/toy_spirit.cpp
==============================================================================
--- branches/proto/v4/libs/xpressive/proto/test/toy_spirit.cpp (original)
+++ branches/proto/v4/libs/xpressive/proto/test/toy_spirit.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -7,6 +7,7 @@
#include <cctype>
#include <string>
+#include <cstring>
#include <iostream>
#include <boost/assert.hpp>
#include <boost/mpl/assert.hpp>
Modified: branches/proto/v4/tools/boostbook/doc/reference.dtdxml
==============================================================================
--- branches/proto/v4/tools/boostbook/doc/reference.dtdxml (original)
+++ branches/proto/v4/tools/boostbook/doc/reference.dtdxml 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -17,6 +17,7 @@
<attpurpose name="filename">The name of the file associated with this element</attpurpose>
<attpurpose name="specifiers">The specifiers for this function, e.g., <code>inline</code>, <code>static</code>, etc.</attpurpose>
<attpurpose name="cv">cv-qualifiers for this method, e.g., <code>const volatile</code></attpurpose>
+<attpurpose name="pack">Set to '1' if the parameter is a parameter pack.</attpurpose>
<entity name="boost.class.content"
type="param"
@@ -533,11 +534,16 @@
<attlist name="template-type-parameter">
<attdecl>
name CDATA #REQUIRED
+ pack CDATA #IMPLIED
%boost.common.attrib;</attdecl>
<attribute name="last-revision"
type="#IMPLIED"
value="CDATA"
default=""/>
+<attribute name="pack"
+ type="#IMPLIED"
+ value="CDATA"
+ default=""/>
<attribute name="name"
type="#REQUIRED"
value="CDATA"
@@ -825,6 +831,7 @@
<attlist name="inherit">
<attdecl>
access CDATA #REQUIRED
+ pack CDATA #IMPLIED
%boost.common.attrib;</attdecl>
<attribute name="last-revision"
type="#IMPLIED"
@@ -840,6 +847,12 @@
type="#IMPLIED"
value="CDATA"
default=""/>
+<attribute name="pack"
+ type="#IMPLIED"
+ value="CDATA"
+ default="">
+ <purpose>Set to '1' if this is a pack exapansion.</purpose>
+</attribute>
<attribute name="xml:base"
type="#IMPLIED"
value="CDATA"
@@ -1656,7 +1669,9 @@
</element>
<attlist name="template-arg">
-<attdecl> %boost.common.attrib;</attdecl>
+<attdecl>
+ pack CDATA #IMPLIED
+ %boost.common.attrib;</attdecl>
<attribute name="last-revision"
type="#IMPLIED"
value="CDATA"
@@ -1665,6 +1680,12 @@
type="#IMPLIED"
value="CDATA"
default=""/>
+<attribute name="pack"
+ type="#IMPLIED"
+ value="CDATA"
+ default="">
+ <purpose>Set to '1' if this is a pack exapansion.</purpose>
+</attribute>
<attribute name="xml:base"
type="#IMPLIED"
value="CDATA"
@@ -2159,11 +2180,16 @@
<attlist name="parameter">
<attdecl>
- name CDATA #IMPLIED</attdecl>
+ name CDATA #IMPLIED
+ pack CDATA #IMPLIED</attdecl>
<attribute name="name"
type="#IMPLIED"
value="CDATA"
default=""/>
+<attribute name="pack"
+ type="#IMPLIED"
+ value="CDATA"
+ default=""/>
</attlist>
<element name="signature"
@@ -2709,11 +2735,16 @@
<attlist name="template-nontype-parameter">
<attdecl>
name CDATA #REQUIRED
+ pack CDATA #IMPLIED
%boost.common.attrib;</attdecl>
<attribute name="last-revision"
type="#IMPLIED"
value="CDATA"
default=""/>
+<attribute name="pack"
+ type="#IMPLIED"
+ value="CDATA"
+ default=""/>
<attribute name="name"
type="#REQUIRED"
value="CDATA"
Modified: branches/proto/v4/tools/boostbook/doc/reference.xml
==============================================================================
--- branches/proto/v4/tools/boostbook/doc/reference.xml (original)
+++ branches/proto/v4/tools/boostbook/doc/reference.xml 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -288,6 +288,7 @@
<tbody>
<row><entry>last-revision</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Set to $Date$ to keep "last revised" information in sync with CVS changes</entry></row>
+<row><entry>pack</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Set to '1' if the parameter is a parameter pack.</entry></row>
<row><entry>name</entry><entry>#REQUIRED</entry><entry>CDATA</entry><entry>The name of the element being declared to referenced</entry></row>
<row><entry>id</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>A global identifier for this element</entry></row>
<row><entry>xml:base</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Implementation detail used by XIncludes</entry></row>
@@ -550,6 +551,7 @@
<row><entry>last-revision</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Set to $Date$ to keep "last revised" information in sync with CVS changes</entry></row>
<row><entry>access</entry><entry>#REQUIRED</entry><entry>CDATA</entry><entry>The access specifier ("public", "private", or "protected") of the inheritance.</entry></row>
<row><entry>id</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>A global identifier for this element</entry></row>
+<row><entry>pack</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Set to '1' if this is a pack exapansion.</entry></row>
<row><entry>xml:base</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Implementation detail used by XIncludes</entry></row>
</tbody>
</tgroup>
@@ -1300,6 +1302,7 @@
<row><entry>last-revision</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Set to $Date$ to keep "last revised" information in sync with CVS changes</entry></row>
<row><entry>id</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>A global identifier for this element</entry></row>
+<row><entry>pack</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Set to '1' if this is a pack exapansion.</entry></row>
<row><entry>xml:base</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Implementation detail used by XIncludes</entry></row>
</tbody>
</tgroup>
@@ -1806,6 +1809,7 @@
<tbody>
<row><entry>name</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>The name of the element being declared to referenced</entry></row>
+<row><entry>pack</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Set to '1' if the parameter is a parameter pack.</entry></row>
</tbody>
</tgroup>
</informaltable>
@@ -2299,6 +2303,7 @@
<tbody>
<row><entry>last-revision</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Set to $Date$ to keep "last revised" information in sync with CVS changes</entry></row>
+<row><entry>pack</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Set to '1' if the parameter is a parameter pack.</entry></row>
<row><entry>name</entry><entry>#REQUIRED</entry><entry>CDATA</entry><entry>The name of the element being declared to referenced</entry></row>
<row><entry>id</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>A global identifier for this element</entry></row>
<row><entry>xml:base</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Implementation detail used by XIncludes</entry></row>
Modified: branches/proto/v4/tools/boostbook/dtd/boostbook.dtd
==============================================================================
--- branches/proto/v4/tools/boostbook/dtd/boostbook.dtd (original)
+++ branches/proto/v4/tools/boostbook/dtd/boostbook.dtd 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -167,11 +167,13 @@
<!ELEMENT template-type-parameter (default?, purpose?)>
<!ATTLIST template-type-parameter
name CDATA #REQUIRED
+ pack CDATA #IMPLIED
%boost.common.attrib;>
<!ELEMENT template-nontype-parameter (type, default?, purpose?)>
<!ATTLIST template-nontype-parameter
name CDATA #REQUIRED
+ pack CDATA #IMPLIED
%boost.common.attrib;>
<!ELEMENT template-varargs EMPTY>
@@ -181,7 +183,9 @@
<!ATTLIST specialization %boost.common.attrib;>
<!ELEMENT template-arg ANY>
-<!ATTLIST template-arg %boost.common.attrib;>
+<!ATTLIST template-arg
+ pack CDATA #IMPLIED
+ %boost.common.attrib;>
<!ELEMENT default ANY>
<!ATTLIST default %boost.common.attrib;>
@@ -189,6 +193,7 @@
<!ELEMENT inherit (type, purpose?)>
<!ATTLIST inherit
access CDATA #IMPLIED
+ pack CDATA #IMPLIED
%boost.common.attrib;>
<!ELEMENT purpose ANY>
@@ -397,7 +402,8 @@
<!ELEMENT parameter (paramtype, default?, description?)>
<!ATTLIST parameter
- name CDATA #IMPLIED>
+ name CDATA #IMPLIED
+ pack CDATA #IMPLIED>
<!ELEMENT programlisting ANY>
<!ATTLIST programlisting
Modified: branches/proto/v4/tools/boostbook/xsl/annotation.xsl
==============================================================================
--- branches/proto/v4/tools/boostbook/xsl/annotation.xsl (original)
+++ branches/proto/v4/tools/boostbook/xsl/annotation.xsl 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -28,14 +28,16 @@
<xsl:choose>
<xsl:when test="count(key('named-entities', $name))=1
and ($translated-name=$name)">
- <xsl:call-template name="fully-qualified-name">
+ <xsl:call-template name="fully-qualified-id">
<xsl:with-param name="node" select="."/>
- <xsl:with-param name="separator" select="'.'"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
+ <xsl:call-template name="fully-qualified-id">
+ <xsl:with-param name="node" select="."/>
+ </xsl:call-template>
+ <xsl:text>_</xsl:text>
<xsl:value-of select="generate-id(.)"/>
- <xsl:text>-bb</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Modified: branches/proto/v4/tools/boostbook/xsl/chunk-common.xsl
==============================================================================
--- branches/proto/v4/tools/boostbook/xsl/chunk-common.xsl (original)
+++ branches/proto/v4/tools/boostbook/xsl/chunk-common.xsl 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -28,7 +28,7 @@
<xsl:choose>
<xsl:when test="not($recursive)">
<!-- translate dots into directory separators, and replace illegal file path characters with underscores -->
- <xsl:value-of select="translate(normalize-space(translate($basename, '._<>\:*?"|', '/ ' )), ' ', '_')"/>
+ <xsl:value-of select="translate(normalize-space(translate($basename, '.<>\:*?"|', '/ ' )), ' ', '_')"/>
<xsl:value-of select="$html.ext"/>
</xsl:when>
<xsl:otherwise>
Modified: branches/proto/v4/tools/boostbook/xsl/function.xsl
==============================================================================
--- branches/proto/v4/tools/boostbook/xsl/function.xsl (original)
+++ branches/proto/v4/tools/boostbook/xsl/function.xsl 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -363,6 +363,9 @@
<xsl:if test="$parameters">
<!-- Information for this parameter -->
<xsl:variable name="parameter" select="$parameters[position()=1]"/>
+ <xsl:variable name="pack">
+ <xsl:if test="$parameter/@pack=1"><xsl:text>...</xsl:text></xsl:if>
+ </xsl:variable>
<xsl:variable name="name">
<xsl:if test="$include-names and $parameter/@name != ''">
<xsl:text> </xsl:text><xsl:value-of select="$parameter/@name"/>
@@ -393,7 +396,7 @@
</xsl:choose>
</xsl:variable>
- <xsl:variable name="text" select="concat($type, $name, $default)"/>
+ <xsl:variable name="text" select="concat($type, $pack, $name, $default)"/>
<xsl:variable name="end-column"
select="$column + string-length($prefix) + string-length($text)"/>
@@ -410,6 +413,7 @@
mode="annotation">
<xsl:with-param name="highlight" select="true()"/>
</xsl:apply-templates>
+ <xsl:value-of select="$pack"/>
<xsl:value-of select="$name"/>
<xsl:copy-of select="$default"/>
</xsl:when>
@@ -446,6 +450,7 @@
mode="annotation">
<xsl:with-param name="highlight" select="true()"/>
</xsl:apply-templates>
+ <xsl:value-of select="$pack"/>
<xsl:value-of select="$name"/>
<xsl:value-of select="$default"/>
</xsl:when>
Modified: branches/proto/v4/tools/boostbook/xsl/global.xsl
==============================================================================
--- branches/proto/v4/tools/boostbook/xsl/global.xsl (original)
+++ branches/proto/v4/tools/boostbook/xsl/global.xsl 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -68,9 +68,8 @@
<xsl:text>;</xsl:text>
</xsl:template>
<xsl:template match="data-member" mode="generate.id">
- <xsl:call-template name="fully-qualified-name">
+ <xsl:call-template name="fully-qualified-id">
<xsl:with-param name="node" select="."/>
- <xsl:with-param name="separator" select="'.'"/>
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>
Modified: branches/proto/v4/tools/boostbook/xsl/lookup.xsl
==============================================================================
--- branches/proto/v4/tools/boostbook/xsl/lookup.xsl (original)
+++ branches/proto/v4/tools/boostbook/xsl/lookup.xsl 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -15,12 +15,6 @@
<xsl:template name="generate.id">
<xsl:param name="node" select="."/>
<xsl:apply-templates select="$node" mode="generate.id"/>
- <xsl:if test="$node/ancestor-or-self::class-specialization|
- $node/ancestor-or-self::struct-specialization|
- $node/ancestor-or-self::union-specialization">
- <xsl:text>_</xsl:text>
- <xsl:value-of select="generate-id($node)"/>
- </xsl:if>
</xsl:template>
<xsl:template match="*" mode="generate.id">
@@ -128,6 +122,23 @@
</xsl:choose>
</xsl:template>
+ <!-- Build the fully-qualified id of the given node -->
+ <xsl:template name="fully-qualified-id">
+ <xsl:param name="node"/>
+ <xsl:variable name="name">
+ <xsl:apply-templates select="$node" mode="fully-qualified-name">
+ <xsl:with-param name="separator" select="'@'"/>
+ </xsl:apply-templates>
+ </xsl:variable>
+ <xsl:value-of select="translate(normalize-space(translate($name, '.', ' ')), ' @', '_.')"/>
+ <xsl:if test="$node/ancestor-or-self::class-specialization|
+ $node/ancestor-or-self::struct-specialization|
+ $node/ancestor-or-self::union-specialization">
+ <xsl:text>_</xsl:text>
+ <xsl:value-of select="generate-id($node)"/>
+ </xsl:if>
+ </xsl:template>
+
<!-- Build the fully-qualified name of the given node -->
<xsl:template name="fully-qualified-name">
<xsl:param name="node"/>
@@ -183,29 +194,25 @@
<xsl:value-of select="@name"/>
</xsl:template>
- <xsl:template name="print-specialization-name">
+ <xsl:template match="template-arg" mode="print-name">
+ <xsl:if test="position() > 1">
+ <xsl:text>, </xsl:text>
+ </xsl:if>
+ <xsl:value-of select="text()"/>
+ <xsl:if test="@pack=1">
+ <xsl:text>...</xsl:text>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template
+ match="struct-specialization|class-specialization|union-specialization"
+ mode="print-name">
<xsl:value-of select="@name"/>
<xsl:text><</xsl:text>
- <xsl:value-of select="specialization/template-arg[position() = 1]/text()"/>
- <xsl:for-each select="specialization/template-arg[position() > 1]">
- <xsl:text>,</xsl:text>
- <xsl:value-of select="text()"/>
- </xsl:for-each>
+ <xsl:apply-templates select="specialization/template-arg" mode="print-name"/>
<xsl:text>></xsl:text>
</xsl:template>
- <xsl:template match="struct-specialization" mode="print-name">
- <xsl:call-template name="print-specialization-name"/>
- </xsl:template>
-
- <xsl:template match="class-specialization" mode="print-name">
- <xsl:call-template name="print-specialization-name"/>
- </xsl:template>
-
- <xsl:template match="union-specialization" mode="print-name">
- <xsl:call-template name="print-specialization-name"/>
- </xsl:template>
-
<xsl:template name="name-matches-node">
<!-- The name we are looking for -->
<xsl:param name="name"/>
Modified: branches/proto/v4/tools/boostbook/xsl/macro.xsl
==============================================================================
--- branches/proto/v4/tools/boostbook/xsl/macro.xsl (original)
+++ branches/proto/v4/tools/boostbook/xsl/macro.xsl 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -73,5 +73,9 @@
<xsl:template match="macro" mode="generate.id">
<xsl:value-of select="@name"/>
+ <xsl:if test="count(key('named-entities', @name))!=1">
+ <xsl:text>_</xsl:text>
+ <xsl:value-of select="generate-id(.)"/>
+ </xsl:if>
</xsl:template>
</xsl:stylesheet>
Modified: branches/proto/v4/tools/boostbook/xsl/navbar.xsl
==============================================================================
--- branches/proto/v4/tools/boostbook/xsl/navbar.xsl (original)
+++ branches/proto/v4/tools/boostbook/xsl/navbar.xsl 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -117,12 +117,12 @@
</xsl:variable>
<xsl:variable name="people_link">
<xsl:call-template name="href.target.relative">
- <xsl:with-param name="target" select="concat( $boost.website, '/people/people.htm' )"/>
+ <xsl:with-param name="target" select="concat( $boost.website, '/users/people.html' )"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="faq_link">
<xsl:call-template name="href.target.relative">
- <xsl:with-param name="target" select="concat( $boost.website, '/more/faq.htm' )"/>
+ <xsl:with-param name="target" select="concat( $boost.website, '/users/faq.html' )"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="more_link">
@@ -151,7 +151,7 @@
<xsl:template name = "header.navdata-vert">
<xsl:variable name="home_link">
<xsl:call-template name="href.target.relative">
- <xsl:with-param name="target" select="concat( $boost.root, '/index.htm' )"/>
+ <xsl:with-param name="target" select="concat( $boost.root, '/index.html' )"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="libraries_link">
@@ -161,12 +161,12 @@
</xsl:variable>
<xsl:variable name="people_link">
<xsl:call-template name="href.target.relative">
- <xsl:with-param name="target" select="concat( $boost.root, '/people/people.htm' )"/>
+ <xsl:with-param name="target" select="concat( $boost.website, '/users/people.html' )"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="faq_link">
<xsl:call-template name="href.target.relative">
- <xsl:with-param name="target" select="concat( $boost.root, '/more/faq.htm' )"/>
+ <xsl:with-param name="target" select="concat( $boost.website, '/users/faq.html' )"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="more_link">
Modified: branches/proto/v4/tools/boostbook/xsl/template.xsl
==============================================================================
--- branches/proto/v4/tools/boostbook/xsl/template.xsl (original)
+++ branches/proto/v4/tools/boostbook/xsl/template.xsl 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -314,6 +314,7 @@
<xsl:text>typename</xsl:text>
</xsl:otherwise>
</xsl:choose>
+ <xsl:if test="$parameter/@pack=1"><xsl:text>...</xsl:text></xsl:if>
<xsl:text> </xsl:text>
<xsl:call-template name="template.parameter.name">
@@ -388,6 +389,7 @@
<xsl:value-of select="$parameter/type/*|$parameter/type/text()"/>
</xsl:otherwise>
</xsl:choose>
+ <xsl:if test="$parameter/@pack=1"><xsl:text>...</xsl:text></xsl:if>
<xsl:text> </xsl:text>
<xsl:call-template name="template.parameter.name">
@@ -438,6 +440,9 @@
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:apply-templates mode="highlight"/>
+ <xsl:if test="@pack=1">
+ <xsl:text>...</xsl:text>
+ </xsl:if>
</xsl:template>
</xsl:stylesheet>
Modified: branches/proto/v4/tools/boostbook/xsl/type.xsl
==============================================================================
--- branches/proto/v4/tools/boostbook/xsl/type.xsl (original)
+++ branches/proto/v4/tools/boostbook/xsl/type.xsl 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -27,51 +27,37 @@
<xsl:param name="boost.compact.typedef">1</xsl:param>
<xsl:template match="class|struct|union" mode="generate.id">
- <xsl:call-template name="fully-qualified-name">
+ <xsl:call-template name="fully-qualified-id">
<xsl:with-param name="node" select="."/>
- <xsl:with-param name="separator" select="'.'"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="class-specialization|struct-specialization|union-specialization" mode="generate.id">
- <xsl:call-template name="fully-qualified-name">
+ <xsl:call-template name="fully-qualified-id">
<xsl:with-param name="node" select="."/>
- <xsl:with-param name="separator" select="'.'"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="typedef" mode="generate.id">
- <xsl:call-template name="fully-qualified-name">
+ <xsl:call-template name="fully-qualified-id">
<xsl:with-param name="node" select="."/>
- <xsl:with-param name="separator" select="'.'"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="enum" mode="generate.id">
- <xsl:call-template name="fully-qualified-name">
+ <xsl:call-template name="fully-qualified-id">
<xsl:with-param name="node" select="."/>
- <xsl:with-param name="separator" select="'.'"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="enumvalue" mode="generate.id">
- <xsl:call-template name="fully-qualified-name">
+ <xsl:call-template name="fully-qualified-id">
<xsl:with-param name="node" select="parent::enum"/>
- <xsl:with-param name="separator" select="'.'"/>
</xsl:call-template>
<xsl:text>.</xsl:text>
<xsl:value-of select="@name"/>
</xsl:template>
- <xsl:template match="function | overloaded-function" mode="generate.id">
- <xsl:call-template name="fully-qualified-name">
- <xsl:with-param name="node" select="."/>
- <xsl:with-param name="separator" select="'.'"/>
- </xsl:call-template>
- <xsl:text>_</xsl:text>
- <xsl:value-of select="generate-id(.)"/>
- </xsl:template>
-
<!-- Display the full name of the current node, e.g., "Class
template function". -->
<xsl:template name="type.display.name">
@@ -547,6 +533,8 @@
</xsl:otherwise>
</xsl:choose>
+ <xsl:if test="@pack=1"><xsl:text>...</xsl:text></xsl:if>
+
<!-- Output a comma if not at the end -->
<xsl:if test="position() < $n">
<xsl:text>,</xsl:text>
@@ -640,6 +628,7 @@
<xsl:apply-templates mode="annotation">
<xsl:with-param name="highlight" select="true()"/>
</xsl:apply-templates>
+ <xsl:if test="@pack=1"><xsl:text>...</xsl:text></xsl:if>
</xsl:template>
<!-- Find the maximum length of the types in typedefs -->
Modified: branches/proto/v4/tools/build/v2/build/feature.jam
==============================================================================
--- branches/proto/v4/tools/build/v2/build/feature.jam (original)
+++ branches/proto/v4/tools/build/v2/build/feature.jam 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -118,7 +118,15 @@
{
error = free features cannot be propagated ;
}
-
+ else
+ {
+ local m = [ MATCH (.*=.*) : $(values) ] ;
+ if $(m[1])
+ {
+ error = "feature value may not contain '='" ;
+ }
+ }
+
if $(error)
{
errors.error $(error)
Modified: branches/proto/v4/tools/build/v2/doc/src/tasks.xml
==============================================================================
--- branches/proto/v4/tools/build/v2/doc/src/tasks.xml (original)
+++ branches/proto/v4/tools/build/v2/doc/src/tasks.xml 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -10,21 +10,20 @@
<title>Common tasks</title>
<para>This section describes main targets types that Boost.Build supports
- of-of-the-box. Unless otherwise noted, all mentioned main target rules
- have the common signature, described in <xref
- linkend="bbv2.advanced.targets"/>.
+ out-of-the-box. Unless otherwise noted, all mentioned main target rules have
+ the common signature, described in <xref linkend="bbv2.advanced.targets"/>.
</para>
-
+
<section id="bbv2.tasks.programs">
<title>Programs</title>
<indexterm><primary>exe</primary></indexterm>
- <para>Programs are created using the <code>exe</code> rule, which
- follows the <link linkend="bbv2.main-target-rule-syntax">common
- syntax</link>. For example:
+ <para>Programs are created using the <code>exe</code> rule, which follows
+ the <link linkend="bbv2.main-target-rule-syntax">common syntax</link>.
+ For example:
<programlisting>
-exe hello : hello.cpp some_library.lib /some_project//library
- : <threading>multi
+exe hello : hello.cpp some_library.lib /some_project//library
+ : <threading>multi
;
</programlisting>
This will create an executable file from the sources -- in this case,
@@ -35,7 +34,7 @@
</para>
<tip>
- <para>
+ <para>
On Windows, if an application uses dynamic libraries, and both
the application and the libraries are built by Boost.Build, its not
possible to immediately run the application, because the
@@ -44,9 +43,9 @@
manually, or place the application and the libraries to the same
directory. See <xref linkend="bbv2.tasks.installing"/>.
</para>
- <!-- We should be emphasizing the use of the built-in testing
- rules rather than continually discussing these quirks of
- running programs with dynamic libraries. -->
+ <!-- We should be emphasizing the use of the built-in testing rules
+ rather than continually discussing these quirks of running programs
+ with dynamic libraries. -->
</tip>
</section>
@@ -55,27 +54,27 @@
<para>Libraries are created using the <code>lib</code> rule, which
follows the <link linkend="bbv2.main-target-rule-syntax">common
- syntax</link>. For example:
+ syntax</link>. For example:
<programlisting>
lib helpers : helpers.cpp : <include>boost : : <include>. ;
</programlisting>
</para>
<!-- Add one sentence that says what the above does. -->
- <para>In the most common case, the <code>lib</code> creates a library
- from the specified sources. Depending on the value of
- <link> feature the library will be either static or
- shared. There are two other cases. First is when the library is
- installed somewhere in compiler's search paths, and should be
- searched by the compiler (typically, using the <option>-l</option>
- option). The second case is where the library is available as a
- prebuilt file and the full path is known.
+ <para>
+ In the most common case, the <code>lib</code> creates a library from the
+ specified sources. Depending on the value of <link> feature the
+ library will be either static or shared. There are two other cases.
+ First is when the library is installed somewhere in compiler's search
+ paths, and should be searched by the compiler (typically, using the
+ <option>-l</option> option). The second case is where the library is
+ available as a prebuilt file and the full path is known.
<!-- But the first case is also prebuilt. This is confusingly phrased. -->
- </para>
-
+ </para>
+
<para>
The syntax for these case is given below:
<programlisting>
-lib z : : <name>z <search>/home/ghost ;
+lib z : : <name>z <search>/home/ghost ;
lib compress : : <file>/opt/libs/compress.a ;
</programlisting>
The <code>name</code> property specifies the name that should be
@@ -106,7 +105,7 @@
release or debug versions.
<!-- explain -->
</para>
-
+
<para>
For convenience, the following syntax is allowed:
<programlisting>
@@ -115,18 +114,19 @@
</programlisting>
and is does exactly the same as:
<programlisting>
-lib z : : <name>z ;
-lib gui : : <name>gui ;
-lib db : : <name>db ;
-lib aux : : <name>aux ;
+lib z : : <name>z ;
+lib gui : : <name>gui ;
+lib db : : <name>db ;
+lib aux : : <name>aux ;
</programlisting>
</para>
-
- <para>When a library uses another library you should put that other
- library in the list of sources. This will do the right thing in all
- cases. For portability, you should specify library dependencies even
- for searched and prebuilt libraries, othewise, static linking on
- Unix won't work. For example:
+
+ <para>
+ When a library uses another library you should put that other library in
+ the list of sources. This will do the right thing in all cases. For
+ portability, you should specify library dependencies even for searched
+ and prebuilt libraries, othewise, static linking on Unix will not work.
+ For example:
<programlisting>
lib z ;
lib png : z : <name>png ;
@@ -134,15 +134,16 @@
</para>
<note>
- <para>When a library (say, <code>a</code>), that has another
- library, (say, <code>b</code>)
+ <para>
+ When a library (say, <code>a</code>), that has another library, (say,
+ <code>b</code>)
<!-- how can a library "have" a library? -->
is linked dynamically, the <code>b</code>
- library will be incorporated
+ library will be incorporated
<!-- Incorporated? Be precise. -->
in <code>a</code>. (If <code>b</code>
- is dynamic library as well, then <code>a</code> will only refer to
- it, and not include any extra code.)
+ is dynamic library as well, then <code>a</code> will only refer to it,
+ and not include any extra code.)
<!-- Don't parenthesize a whole sentence. -->
When the <code>a</code>
library is linked statically, Boost.Build will assure that all
@@ -150,9 +151,10 @@
<code>b</code>.
</para>
</note>
-
- <para>One feature of Boost.Build that is very important for libraries
- is usage requirements.
+
+ <para>
+ One feature of Boost.Build that is very important for libraries is usage
+ requirements.
<!-- Rephrase that. But then, it's much too late for an
introduction of usage requirements - you've already
discussed them many times. -->
@@ -161,7 +163,7 @@
lib helpers : helpers.cpp : : : <include>. ;
</programlisting>
then the compiler include path for all targets that use
- <code>helpers</code> will contain the directory
+ <code>helpers</code> will contain the directory
<!-- The rest of this sentence is unintelligible -->
where the target is defined.path to "helpers.cpp". The user
only needs to add <code>helpers</code> to the list of sources,
@@ -185,7 +187,7 @@
<code>a</code> library won't even refer to <code>b</code>.
</para>
</note>
-
+
</section>
<section id="bbv2.tasks.alias">
@@ -213,13 +215,13 @@
alias threads : /boost/thread//boost_thread : <link>static ;
</programlisting>
and use only the <code>threads</code> alias in your Jamfiles.
- </para>
+ </para>
<para>
You can also specify usage requirements for the
<code>alias</code> target. If you write the following:
<programlisting>
-alias header_only_library : : : : <include>/usr/include/header_only_library ;
+alias header_only_library : : : : <include>/usr/include/header_only_library ;
</programlisting>
then using <code>header_only_library</code> in sources will only add an
include path. Also note that when an alias has sources, their usage
@@ -233,7 +235,7 @@
will compile <filename>main.cpp</filename> with additional includes
required for using the specified static libraries.
</para>
-
+
</section>
<section id="bbv2.tasks.installing">
@@ -270,19 +272,19 @@
install dist : hello helpers : <variant>release:<location>dist/release
<variant>debug:<location>dist/debug ;
install dist2 : hello helpers : <location>$(DIST) ;
-</programlisting>
+</programlisting>
See also <link linkend="bbv2.reference.variants.propcond">conditional
properties</link> and <link linkend="bbv2.faq.envar">environment variables</link>
</para>
<bridgehead>Installing with all dependencies</bridgehead>
-
+
<para>
Specifying the names of all libraries to install can be boring. The
<code>install</code> allows you to specify only the top-level executable
targets to install, and automatically install all dependencies:
<programlisting>
-install dist : hello
+install dist : hello
: <install-dependencies>on <install-type>EXE
<install-type>LIB
;
@@ -304,16 +306,16 @@
<indexterm><primary>install-source-root</primary></indexterm>
<para>By default, the <code>install</code> rules will stip paths from
it's sources. So, if sources include <filename>a/b/c.hpp</filename>,
- the <filename>a/b</filename> part will be ignored. To make the
+ the <filename>a/b</filename> part will be ignored. To make the
<code>install</code> rule preserve the directory hierarchy you need
to use the <code>install-source-root</code> feature to specify the
root of the hierarchy you are installing. Relative paths from that
root will be preserved. For example, if you write:
<programlisting>
-install headers
- : a/b/c.h
- : <location>/tmp <install-source-root>a
+install headers
+ : a/b/c.h
+ : <location>/tmp <install-source-root>a
;
</programlisting>
@@ -323,7 +325,7 @@
<para>The <link linkend="bbv2.reference.glob-tree">glob-tree</link> rule
can be used to find all files below a given directory, making
it easy to install entire directory tree.</para>
-
+
<bridgehead>Installing into Several Directories</bridgehead>
<para>The <link linkend="bbv2.tasks.alias"><code>alias</code></link>
@@ -336,26 +338,26 @@
</programlisting>
</para>
- <para>Because the <code>install</code> rule just copies targets, most
- free features <footnote><para>see the definition of "free" in <xref
- linkend="bbv2.reference.features.attributes"/>.</para></footnote>
- have no effect when used in requirements of the <code>install</code> rule.
- The only two which matter are
- <link linkend="bbv2.builtin.features.dependency">
- <varname>dependency</varname></link> and, on Unix,
- <link linkend="bbv2.reference.features.dll-path"><varname>dll-path</varname></link>.
+ <para>
+ Because the <code>install</code> rule just copies targets, most free
+ features <footnote><para>see the definition of "free" in
+ <xref linkend="bbv2.reference.features.attributes"/>.</para></footnote>
+ have no effect when used in requirements of the <code>install</code> rule.
+ The only two which matter are <link
+ linkend="bbv2.builtin.features.dependency"><varname>dependency</varname>
+ </link> and, on Unix, <link linkend="bbv2.reference.features.dll-path">
+ <varname>dll-path</varname></link>.
</para>
<note>
<para>
(Unix specific). On Unix, executables built with Boost.Build typically
- contain the list of paths to all used dynamic libraries. For
- installing, this is not desired, so Boost.Build relinks the executable
- with an empty list of paths. You can also specify additional paths for
- installed executables with the <varname>dll-path</varname> feature.
+ contain the list of paths to all used dynamic libraries. For installing,
+ this is not desired, so Boost.Build relinks the executable with an empty
+ list of paths. You can also specify additional paths for installed
+ executables with the <varname>dll-path</varname> feature.
</para>
</note>
-
</section>
@@ -363,9 +365,10 @@
<title>Testing</title>
- <para>Boost.Build has convenient support for running unit tests. The
- simplest way is the <code>unit-test</code> rule, which follows the
- <link linkend="bbv2.main-target-rule-syntax">common syntax</link>. For
+ <para>
+ Boost.Build has convenient support for running unit tests. The simplest
+ way is the <code>unit-test</code> rule, which follows the <link
+ linkend="bbv2.main-target-rule-syntax">common syntax</link>. For
example:
<programlisting>
unit-test helpers_test : helpers_test.cpp helpers ;
@@ -380,22 +383,22 @@
can't miss a unit test failure.
</para>
- <para>By default, the executable is run directly. Sometimes, it's
+ <para>By default, the executable is run directly. Sometimes, it's
desirable to run the executable using some helper command. You should use the
<literal>testing.launcher</literal> property to specify the name of the
helper command. For example, if you write:
</para>
<programlisting>
-unit-test helpers_test
- : helpers_test.cpp helpers
+unit-test helpers_test
+ : helpers_test.cpp helpers
: <emphasis role="bold"><testing.launcher>valgrind</emphasis>
- ;
+ ;
</programlisting>
<para>The command used to run the executable will be:</para>
<screen>
-<emphasis role="bold">valgrind</emphasis> bin/$toolset/debug/helpers_test
+<emphasis role="bold">valgrind</emphasis> bin/$toolset/debug/helpers_test
</screen>
-
+
<para>There are few specialized testing rules, listed below:
<programlisting>
rule compile ( sources : requirements * : target-name ? )
@@ -403,7 +406,7 @@
rule link ( sources + : requirements * : target-name ? )
rule link-fail ( sources + : requirements * : target-name ? )
</programlisting>
- They are are given a list of sources and requirements.
+ They are are given a list of sources and requirements.
If the target name is not provided, the name of the first
source file is used instead. The <literal>compile*</literal>
tests try to compile the passed source. The <literal>link*</literal>
@@ -415,10 +418,10 @@
</para>
<para>There are two specialized rules for running applications, which
- are more powerful than the <code>unit-test</code> rule. The
+ are more powerful than the <code>unit-test</code> rule. The
<code>run</code> rule has the following signature:
<programlisting>
-rule run ( sources + : args * : input-files * : requirements * : target-name ?
+rule run ( sources + : args * : input-files * : requirements * : target-name ?
: default-build * )
</programlisting>
The rule builds application from the provided sources and runs it,
@@ -430,15 +433,15 @@
directory. The <code>run-fail</code> rule is identical to the
<code>run</code> rule, except that it expects that the run fails.
</para>
-
+
<para>All rules described in this section, if executed successfully,
create a special manifest file to indicate that the test passed.
For the <code>unit-test</code> rule the files is named
<filename><replaceable>target-name</replaceable>.passed</filename> and
- for the other rules it is called
+ for the other rules it is called
<filename><replaceable>target-name</replaceable>.test</filename>.
The <code>run*</code> rules also capture all output from the program,
- and store it in a file named
+ and store it in a file named
<filename><replaceable>target-name</replaceable>.output</filename>.</para>
<para>The <code>run</code> and the <code>run-fail</code> rules, if
@@ -451,12 +454,12 @@
the <literal>--dump-tests</literal> command-line option. The output
will consist of lines of the form:
<screen>
-boost-test(<replaceable>test-type</replaceable>) <replaceable>path</replaceable> : <replaceable>sources</replaceable>
- </screen>
+boost-test(<replaceable>test-type</replaceable>) <replaceable>path</replaceable> : <replaceable>sources</replaceable>
+ </screen>
</para>
<para>It is possible to process the list of tests, the output of
- bjam during command run, and the presense/absense of the
+ bjam during command run, and the presense/absense of the
<filename>*.test</filename> files created when test passes into
human-readable status table of tests. Such processing utilities
are not included in Boost.Build.</para>
@@ -467,53 +470,64 @@
<title>Custom commands</title>
- <para>When you use most of main target rules, Boost.Build automatically
- figures what commands to run and it what order. As soon as you want
- to use new file types, or support new tools, one approach is to
- extend Boost.Build to smoothly support them, as documented in
- <xref linkend="bbv2.extender"/>. However, if there's a single
- place where the new tool is used, it might be easier to just
- explicitly specify the commands to run.</para>
-
- <para>Three main target rules can be used for that. The
- <functionname>make</functionname> rule allows you to construct
- a single file from any number of source file, by running a
- command you specify. The <functionname>notfile</functionname> rule
- allows you to run an arbitrary command, without creating any files.
- Finaly, the <functionname>generate</functionname> rule allows you
- to describe transformation using Boost.Build's virtual targets.
- This is higher-level than file names that the make rule operates with,
- and allows you to create more than one target, or create differently
- named targets depending on properties, or use more than one
- tool.</para>
-
- <para>The <functionname>make</functionname> rule is used when you want to
- create one file from a number of sources using some specific command.
- The <functionname>notfile</functionname> is used to unconditionally run
- a command.
+ <para>
+ When you use most of main target rules, Boost.Build automatically
+ figures what commands to run and it what order. As soon as you want to
+ use new file types, or support new tools, one approach is to extend
+ Boost.Build to smoothly support them, as documented in
+ <xref linkend="bbv2.extender"/>. However, if there's a single place
+ where the new tool is used, it might be easier to just explicitly
+ specify the commands to run.
+ </para>
+
+ <para>
+ <!-- This paragraph requires links to where the terms 'virtual target'
+ & 'target' are defined. -->
+ Three main target rules can be used for that. The <functionname>make
+ </functionname> rule allows you to construct a single file from any
+ number of source file, by running a command you specify. The
+ <functionname>notfile</functionname> rule allows you to run an arbitrary
+ command, without creating any files. And finaly, the <functionname>
+ generate</functionname> rule allows you to describe transformation using
+ Boost.Build's virtual targets. This is higher-level than file names that
+ the <functionname>make</functionname> rule operates with and allows you
+ to create more than one target, create differently named targets
+ depending on properties or use more than one tool.
+ </para>
+
+ <para>
+ The <functionname>make</functionname> rule is used when you want to
+ create one file from a number of sources using some specific command.
+ The <functionname>notfile</functionname> is used to unconditionally run
+ a command.
</para>
+ <!-- We need to specify somewhere that the user can get rules like make,
+ notfile & generate defined in his Jamfiles by importing an appropriate
+ Boost.Build module. Also, each of those rules should get a separate
+ documentation page explicitly listing which module needs to be imported
+ for them to become accessible. -->
+
<para>
- Suppose you want to create file <filename>file.out</filename> from
- file <filename>file.in</filename> by running command
- <command>in2out</command>. Here's how you'd do this in Boost.Build:
+ Suppose you want to create file <filename>file.out</filename> from file
+ <filename>file.in</filename> by running command
+ <command>in2out</command>. Here is how you would do this in Boost.Build:
<programlisting>
+make file.out : file.in : @in2out ;
actions in2out
{
in2out $(<) $(>)
}
-make file.out : file.in : @in2out ;
</programlisting>
- If you run <command>bjam</command> and <filename>file.out</filename>
+ If you run <command>bjam</command> and <filename>file.out</filename>
does not exist, Boost.Build will run the <command>in2out</command>
- command to create that file. For more details on specifying actions,
- see <xref linkend="bbv2.advanced.jam_language.actions"/>.
+ command to create that file. For more details on specifying actions, see
+ <xref linkend="bbv2.advanced.jam_language.actions"/>.
</para>
-
<para>
- It could be that you just want to run some command unconditionally,
- and that command does not create any specific files. The, you can use
+ It could be that you just want to run some command unconditionally, and
+ that command does not create any specific files. For that you can use
the <functionname>notfile</functionname> rule. For example:
<programlisting>
notfile echo_something : @echo ;
@@ -527,97 +541,118 @@
Boost.Build will unconditionally run the action.
</para>
- <para>The <functionname>generate</functionname> rule is used when
- you want to express transformations using Boost.Build's virtual targets,
- as opposed to just filenames. The <functionname>generate</functionname>
- rule has the standard main target rule signature, but you are required
- to specify the <literal>generating-rule</literal> property. The value
- of the property should be in the form
- <literal>@<replaceable>rule-name</replaceable></literal> and the named
- rule should have the following signature:
- <programlisting>
+ <para>
+ <!-- This paragraph requires links to where terms like 'virtual target',
+ 'target', 'project-target' & 'property-set' are defined. -->
+ The <functionname>generate</functionname> rule is used when you want to
+ express transformations using Boost.Build's virtual targets, as opposed
+ to just filenames. The <functionname>generate</functionname> rule has
+ the standard main target rule signature, but you are required to specify
+ the <literal>generating-rule</literal> property. The value of the
+ property should be in the form
+ <literal>@<replaceable>rule-name</replaceable></literal>, the named rule
+ should have the following signature:
+<programlisting>
rule generating-rule ( project name : property-set : sources * )
- </programlisting>
- and will be called with an instance of the <code>project-target</code>
- class, the name of the main target, an instance of the
- <code>property-set</code> class containing build properties,
- and the list of instances of the <code>virtual-target</code> class
- corresponding to sources.
- The rule must return a list of <code>virtual-target</code> instances.
- The interface of the <code>virtual-target</code> class can be learned
- by looking at the <filename>build/virtual-target.jam</filename> file.
- The <filename>generate</filename> example in Boost.Build distribution
- illustrates how the <literal>generate</literal> rule can be used.
+</programlisting>
+ and will be called with an instance of the <code>project-target</code>
+ class, the name of the main target, an instance of the
+ <code>property-set</code> class containing build properties, and the
+ list of instances of the <code>virtual-target</code> class corresponding
+ to sources. The rule must return a list of <code>virtual-target</code>
+ instances. The interface of the <code>virtual-target</code> class can be
+ learned by looking at the <filename>build/virtual-target.jam</filename>
+ file. The <filename>generate</filename> example contained in the
+ Boost.Build distribution illustrates how the <literal>generate</literal>
+ rule can be used.
</para>
-
+
</section>
<section id="bbv2.reference.precompiled_headers">
<title>Precompiled Headers</title>
- <para>Precompiled headers is a mechanism to speed up compilation
- by creating a partially processed version of some header files,
- and then using that version during compilations rather then
- repeatedly parsing the original headers. Boost.Build supports
- precompiled headers with gcc and msvc toolsets.</para>
+ <para>
+ Precompiled headers is a mechanism to speed up compilation by creating a
+ partially processed version of some header files, and then using that
+ version during compilations rather then repeatedly parsing the original
+ headers. Boost.Build supports precompiled headers with gcc and msvc
+ toolsets.
+ </para>
+
+ <para>
+ To use precompiled headers, follow the following steps:
+ </para>
- <para>To use precompiled headers, follow these steps:</para>
<orderedlist>
- <listitem><para>Create a header that includes big headers used by your project.
- It's better to include only headers that are sufficiently stable —
- like headers from the compiler, and external libraries. Please wrap
- the header in <code>#ifdef BOOST_BUILD_PCH_ENABLED</code>, so that
- the potentially expensive inclusion of headers is not done
- when PCH is not enabled. Include the new header at the top of your
- source files.</para></listitem>
-
- <listitem><para>Declare a new Boost.Build target for the precompiled header
- and add that precompiled header to the sources of the target whose compilation
- you want to speed up:
- <programlisting>
-cpp-pch pch : pch.hpp ;
-exe main : main.cpp pch ;</programlisting>
- You can use the <code>c-pch</code> if you want to use the precompiled
- header in C programs.
+ <listitem><para>
+ Create a header that includes headers used by your project that you
+ want precompiled. It is better to include only headers that are
+ sufficiently stable — like headers from the compiler and
+ external libraries. Please wrap the header in <code>#ifdef
+ BOOST_BUILD_PCH_ENABLED</code>, so that the potentially expensive
+ inclusion of headers is not done when PCH is not enabled. Include the
+ new header at the top of your source files.
</para></listitem>
+ <listitem><para>
+ Declare a new Boost.Build target for the precompiled header and add
+ that precompiled header to the sources of the target whose compilation
+ you want to speed up:
+<programlisting>
+cpp-pch pch : pch.hpp ;
+exe main : main.cpp pch ;
+</programlisting>
+ You can use the <functionname>c-pch</functionname> rule if you want to
+ use the precompiled header in C programs.
+ </para></listitem>
</orderedlist>
- <para>The <filename>pch</filename> example in Boost.Build distribution
- can be used as reference.</para>
- <para>Please note the following:</para>
+ <para>
+ The <filename>pch</filename> example in Boost.Build distribution can be
+ used as reference.
+ </para>
+
+ <para>
+ Please note the following:
+ </para>
+
<itemizedlist>
- <listitem><para>The inclusion of the precompiled header must be the
- first thing in a source file, before any code or preprocessor directives.
+ <listitem><para>
+ The inclusion of the precompiled header must be the first thing in a
+ source file, before any code or preprocessor directives.
+ </para></listitem>
+
+ <listitem><para>
+ The build properties used to compile the source files and the
+ precompiled header must be the same. Consider using project
+ requirements to assure this.
</para></listitem>
- <listitem><para>The build properties used to compile the source files
- and the precompiled header must be the same. Consider using
- project requirements to assure this.
+ <listitem><para>
+ Precompiled headers must be used purely as a way to improve
+ compilation time, not to save the number of <code>#include</code>
+ statements. If a source file needs to include some header, explicitly
+ include it in the source file, even if the same header is included
+ from the precompiled header. This makes sure that your project will
+ build even if precompiled headers are not supported.
</para></listitem>
- <listitem><para>Precompiled headers must be used purely as a way to
- improve compilation time, not to save the number of <code>#include</code>
- statements. If a source file needs to include some header, explicitly include
- it in the source file, even if the same header is included from
- the precompiled header. This makes sure that your project will build
- even if precompiled headers are not supported.</para></listitem>
-
- <listitem><para>On the gcc compiler, the name of the header being
- precompiled must be equal to the name of the <code>cpp-pch</code>
- target. This is gcc requirement.</para></listitem>
-
- <listitem><para>Prior to version 4.2, the gcc compiler did not
- handle anonymous namespaces in precompiled headers, which
- limit their utility. See the <ulink url="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29085">bug
- report</ulink> for details.</para></listitem>
-
+ <listitem><para>
+ On the gcc compiler, the name of the header being precompiled must be
+ equal to the name of the <code>cpp-pch</code> target. This is a gcc
+ requirement.
+ </para></listitem>
+
+ <listitem><para>
+ Prior to version 4.2, the gcc compiler did not allow anonymous
+ namespaces in precompiled headers, which limits their utility. See the
+ <ulink url="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29085">bug
+ report</ulink> for details.
+ </para></listitem>
</itemizedlist>
-
-
</section>
-
<section id="bbv2.reference.generated_headers">
<title>Generated headers</title>
@@ -625,7 +660,7 @@
automatically. For example, for C++ files, all <literal>#include</literal>
statements are found and handled. The only aspect where user help
might be needed is implicit dependency on generated files.</para>
-
+
<para>By default, Boost.Build handles such dependencies within one
main target. For example, assume that main target "app" has two
sources, "app.cpp" and "parser.y". The latter source is converted
@@ -634,13 +669,13 @@
since "parser.h" will be generated into a build directory, the
path to that directory will automatically added to include
path.</para>
-
+
<para>Making this mechanism work across main target boundaries is
possible, but imposes certain overhead. For that reason, if
there's implicit dependency on files from other main targets, the
<literal><implicit-dependency></literal> [ link ] feature must
be used, for example:</para>
-
+
<programlisting>
lib parser : parser.y ;
exe app : app.cpp : <implicit-dependency>parser ;
@@ -652,14 +687,14 @@
targets from "parser" as potential dependencies.
</para>
</section>
-
+
</chapter>
<!--
Local Variables:
mode: xml
- sgml-indent-data: t
+ sgml-indent-data: t
sgml-parent-document: ("userman.xml" "chapter")
sgml-set-face: t
End:
Modified: branches/proto/v4/tools/build/v2/index.html
==============================================================================
--- branches/proto/v4/tools/build/v2/index.html (original)
+++ branches/proto/v4/tools/build/v2/index.html 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -112,7 +112,7 @@
<li><b>Standalone</b>. Boost.Build's only dependency is a C compiler,
so it's easy to setup. You can even include all of Boost.Build in your
- project. Boost.Build does not use depend on C++ Boost in any way.</li>
+ project. Boost.Build does not depend on C++ Boost in any way.</li>
</ul>
<h2>Status and future</h2>
Modified: branches/proto/v4/tools/build/v2/tools/intel-win.jam
==============================================================================
--- branches/proto/v4/tools/build/v2/tools/intel-win.jam (original)
+++ branches/proto/v4/tools/build/v2/tools/intel-win.jam 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -73,6 +73,9 @@
local major = $(m[1]) ;
local C++FLAGS ;
+
+ C++FLAGS += /nologo ;
+
# Reduce the number of spurious error messages
C++FLAGS += /Qwn5 /Qwd985 ;
Modified: branches/proto/v4/tools/build/v2/tools/qt4.jam
==============================================================================
--- branches/proto/v4/tools/build/v2/tools/qt4.jam (original)
+++ branches/proto/v4/tools/build/v2/tools/qt4.jam 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -160,12 +160,14 @@
# dependency scanner for wrapped files.
type.set-scanner QRC : qrc-scanner ;
+
+ # List of all Qt libraries
+ local all-libraries = QtCore QtGui QtNetwork QtXml QtSql QtSvg QtOpenGL Qt3Support QtTest QtAssistantClient QtDesigner QtUiTools QtDBus QtScript QtHelp QtXmlPatterns QtWebKit phonon ;
# Test for a buildable Qt.
if [ glob $(.prefix)/Jamroot ]
{
# Import all Qt Modules
- local all-libraries = QtCore QtGui QtNetwork QtXml QtSql QtSvg QtOpenGL Qt3Support QtTest QtAssistantClient QtDesigner QtUiTools QtDBus QtScript ;
for local l in $(all-libraries)
{
alias $(l)
@@ -173,7 +175,6 @@
:
:
: <allow>qt4 ;
- explicit $(l) ;
}
}
else
@@ -399,23 +400,6 @@
<include>$(.incprefix)/QtTest
;
- # AssistantClient Support
- lib QtAssistantClient : QtGui
- : # requirements
- <name>QtAssistantClient$(suffix_version)
- : # default-build
- : # usage-requirements
- <include>$(.incprefix)/QtAssistant
- ;
- lib QtAssistantClient : QtGui
- : # requirements
- <name>QtAssistantClient$(suffix_debug)$(suffix_version)
- <variant>debug
- : # default-build
- : # usage-requirements
- <include>$(.incprefix)/QtAssistant
- ;
-
# Qt designer library
lib QtDesigner : QtGui QtXml
: # requirements
@@ -435,6 +419,7 @@
;
# Support for dynamic Widgets (Qt 4.1)
+ # Static library without version number
lib QtUiTools : QtGui QtXml
: # requirements
<name>QtUiTools
@@ -484,7 +469,107 @@
: # usage-requirements
<include>$(.incprefix)/QtScript
;
- }
+
+ # WebKit (Qt 4.4)
+ lib QtWebKit : QtGui
+ : # requirements
+ <name>QtWebKit$(suffix_version)
+ : # default-build
+ : # usage-requirements
+ <define>QT_WEBKIT_LIB
+ <include>$(.incprefix)/QtWebKit
+ ;
+ lib QtWebKit : QtGui
+ : # requirements
+ <name>QtWebKit$(suffix_debug)$(suffix_version)
+ <variant>debug
+ : # default-build
+ : # usage-requirements
+ <define>QT_WEBKIT_LIB
+ <include>$(.incprefix)/QtWebKit
+ ;
+
+ # Phonon Multimedia (Qt 4.4)
+ lib phonon : QtGui QtXml
+ : # requirements
+ <name>phonon$(suffix_version)
+ : # default-build
+ : # usage-requirements
+ <define>QT_PHONON_LIB
+ <include>$(.incprefix)/phonon
+ ;
+ lib phonon : QtGui QtXml
+ : # requirements
+ <name>phonon$(suffix_debug)$(suffix_version)
+ <variant>debug
+ : # default-build
+ : # usage-requirements
+ <define>QT_PHONON_LIB
+ <include>$(.incprefix)/phonon
+ ;
+
+ # XmlPatterns-Engine (Qt 4.4)
+ lib QtXmlPatterns : QtNetwork
+ : # requirements
+ <name>QtXmlPatterns$(suffix_version)
+ : # default-build
+ : # usage-requirements
+ <define>QT_XMLPATTERNS_LIB
+ <include>$(.incprefix)/QtXmlPatterns
+ ;
+ lib QtXmlPatterns : QtNetwork
+ : # requirements
+ <name>QtXmlPatterns$(suffix_debug)$(suffix_version)
+ <variant>debug
+ : # default-build
+ : # usage-requirements
+ <define>QT_XMLPATTERNS_LIB
+ <include>$(.incprefix)/QtXmlPatterns
+ ;
+
+ # Help-Engine (Qt 4.4)
+ lib QtHelp : QtGui QtSql QtXml
+ : # requirements
+ <name>QtHelp$(suffix_version)
+ : # default-build
+ : # usage-requirements
+ <include>$(.incprefix)/QtHelp
+ ;
+ lib QtHelp : QtGui QtSql QtXml
+ : # requirements
+ <name>QtHelp$(suffix_debug)$(suffix_version)
+ <variant>debug
+ : # default-build
+ : # usage-requirements
+ <include>$(.incprefix)/QtHelp
+ ;
+
+ # AssistantClient Support
+ # Compat library
+ # Pre-4.4 help system, use QtHelp for new programs
+ lib QtAssistantClient : QtGui
+ : # requirements
+ <name>QtAssistantClient$(suffix_version)
+ : # default-build
+ : # usage-requirements
+ <include>$(.incprefix)/QtAssistant
+ ;
+ lib QtAssistantClient : QtGui
+ : # requirements
+ <name>QtAssistantClient$(suffix_debug)$(suffix_version)
+ <variant>debug
+ : # default-build
+ : # usage-requirements
+ <include>$(.incprefix)/QtAssistant
+ ;
+ }
+
+ # Make library names explicit so that a simple <use>qt4 will not bring in everything.
+ # And some components like QtDBus/Phonon may not be available on some platforms.
+ for local l in $(all-libraries)
+ {
+ explicit $(l) ;
+ }
}
project.pop-current ;
Modified: branches/proto/v4/tools/inspect/link_check.cpp
==============================================================================
--- branches/proto/v4/tools/inspect/link_check.cpp (original)
+++ branches/proto/v4/tools/inspect/link_check.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -20,21 +20,27 @@
"\\s*=\\s*(['\"])(.*?)\\1",
boost::regbase::normal | boost::regbase::icase);
+ // Regular expression for parsing URLS from:
+ // http://tools.ietf.org/html/rfc3986#appendix-B
+ boost::regex url_decompose_regex(
+ "^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$",
+ boost::regbase::normal);
+
// Decode percent encoded characters and html escapsed ampersands,
// returns an empty string if there's an error.
// The urls should really be fully HTML decoded at the beginning.
- std::string decode_url(std::string const& path) {
+ std::string decode_url(std::string const& url_path) {
std::string::size_type pos = 0, next;
std::string result;
- result.reserve(path.length());
+ result.reserve(url_path.length());
- while((next = path.find_first_of("&%", pos)) != std::string::npos) {
- result.append(path, pos, next - pos);
+ while((next = url_path.find_first_of("&%", pos)) != std::string::npos) {
+ result.append(url_path, pos, next - pos);
pos = next;
- switch(path[pos]) {
+ switch(url_path[pos]) {
case '%': {
- if(path.length() - next < 3) return "";
- char hex[3] = { path[next + 1], path[next + 2], '\0' };
+ if(url_path.length() - next < 3) return "";
+ char hex[3] = { url_path[next + 1], url_path[next + 2], '\0' };
char* end_ptr;
result += (char) std::strtol(hex, &end_ptr, 16);
if(*end_ptr) return "";
@@ -42,7 +48,7 @@
break;
}
case '&': {
- if(path.substr(pos, 5) == "&") {
+ if(url_path.substr(pos, 5) == "&") {
result += '&'; pos += 5;
}
else {
@@ -53,7 +59,7 @@
}
}
- result.append(path, pos, path.length());
+ result.append(url_path, pos, url_path.length());
return result;
}
@@ -121,66 +127,111 @@
const path & source_path, bool no_link_errors )
// precondition: source_path.is_complete()
{
- if ( url[0] == '#'
- || url.find( "mailto:" ) == 0
- || url.find( "http:" ) == 0
- || url.find( "https:" ) == 0
- || url.find( "ftp:" ) == 0
- || url.find( "news:" ) == 0
- || url.find( "javascript:" ) == 0
- ) return;
-
- if ( url.find( "file:" ) == 0 )
- {
+ boost::smatch m;
+ if(!boost::regex_match(url, m, url_decompose_regex)) {
if(!no_link_errors) {
++m_invalid_errors;
- error( library_name, source_path, string(name()) + " invalid URL (hardwired file): " + url );
+ error( library_name, source_path, string(name()) + " invalid URL: " + url );
+ }
+ return;
+ }
+
+ bool scheme_matched = m[2].matched,
+ authority_matched = m[4].matched,
+ //query_matched = m[7].matched,
+ fragment_matched = m[9].matched;
+
+ std::string scheme(m[2]),
+ authority(m[4]),
+ url_path(m[5]),
+ //query(m[7]),
+ fragment(m[9]);
+
+ // Protocol checks
+ if(scheme_matched) {
+ if(scheme == "http" || scheme == "https") {
+ if(!authority_matched) {
+ if(!no_link_errors) {
+ ++m_invalid_errors;
+ error( library_name, source_path, string(name()) + " http protocol without hostname: " + url );
+ }
+ }
+
+ return;
+ }
+ else if(scheme == "file") {
+ if(!no_link_errors) {
+ ++m_invalid_errors;
+ error( library_name, source_path, string(name()) + " invalid URL (hardwired file): " + url );
+ }
+ }
+ else if(!(scheme == "mailto" || scheme == "ftp" || scheme == "news" || scheme == "javascript")) {
+ if(!no_link_errors) {
+ ++m_invalid_errors;
+ error( library_name, source_path, string(name()) + " unknown protocol: " + url );
+ }
}
+
return;
}
- // detect characters banned by RFC2396:
+ // Hostname without protocol.
+ if(authority_matched) {
+ if(!no_link_errors) {
+ ++m_invalid_errors;
+ error( library_name, source_path, string(name()) + " invalid URL (hostname without protocol): " + url );
+ }
+ }
+
+ // Check the fragment identifier
+ if(fragment_matched) {
+ if ( !no_link_errors && fragment.find( '#' ) != string::npos )
+ {
+ ++m_bookmark_errors;
+ error( library_name, source_path, string(name()) + " invalid bookmark: " + url );
+ }
+
+ // No more to do if it's just a fragment identifier
+ if(url_path.empty()) return;
+ }
+
+ // Detect characters banned by RFC2396:
if ( !no_link_errors && url.find_first_of( " <>\"{}|\\^[]'" ) != string::npos )
{
++m_invalid_errors;
error( library_name, source_path, string(name()) + " invalid character in URL: " + url );
}
- // strip url of bookmarks
- string plain_url( url );
- string::size_type pos( plain_url.find( '#' ) );
- if ( pos != string::npos )
- {
- plain_url.erase( pos );
- // detect characters banned by RFC2396 in bookmark:
- if ( !no_link_errors && url.find( '#', pos+1 ) != string::npos )
- {
- ++m_bookmark_errors;
- error( library_name, source_path, string(name()) + " invalid bookmark: " + url );
+ // Check that we actually have a path.
+ if(url_path.empty()) {
+ if(!no_link_errors) {
+ ++m_invalid_errors;
+ error( library_name, source_path, string(name()) + " invalid URL (empty path in relative url): " + url );
}
}
- string decoded_url = decode_url(plain_url);
- if(decoded_url.empty()) {
+ // Decode percent and ampersand encoded characters.
+ string decoded_path = decode_url(url_path);
+ if(decoded_path.empty()) {
if(!no_link_errors) {
++m_invalid_errors;
- error( library_name, source_path, string(name()) + " invalid URL: " + url );
+ error( library_name, source_path, string(name()) + " invalid URL (invalid character encodings): " + url );
}
return;
}
// strip url of references to current dir
- if ( decoded_url[0]=='.' && decoded_url[1]=='/' ) decoded_url.erase( 0, 2 );
+ if ( decoded_path[0]=='.' && decoded_path[1]=='/' ) decoded_path.erase( 0, 2 );
// url is relative source_path.branch()
// convert to target_path, which is_complete()
path target_path;
- try { target_path = source_path.branch_path() /= path( decoded_url, fs::no_check ); }
+ try { target_path = source_path.branch_path() /= path( decoded_path, fs::no_check ); }
catch ( const fs::filesystem_error & )
{
if(!no_link_errors) {
++m_invalid_errors;
- error( library_name, source_path, string(name()) + " invalid URL: " + url );
+ error( library_name, source_path, string(name()) + " invalid URL (error resolving path): " + url );
}
return;
}
Modified: branches/proto/v4/tools/jam/src/Jambase
==============================================================================
--- branches/proto/v4/tools/jam/src/Jambase (original)
+++ branches/proto/v4/tools/jam/src/Jambase 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -18,9 +18,10 @@
}
SLASH ?= / ;
-# Glob for patterns in the directories starting from the given
-# start directory, up to and including the root of the file-system.
-# We stop globbing as soon as we find at least one match.
+
+# Glob for patterns in the directories starting from the given start directory,
+# up to and including the root of the file-system. We stop globbing as soon as
+# we find at least one match.
#
rule find-to-root ( dir : patterns + )
{
@@ -33,6 +34,7 @@
return $(globs) ;
}
+
# This global will hold the location of the user's boost-build.jam file.
.boost-build-file = ;
@@ -42,16 +44,16 @@
# Remember the value of $(BOOST_BUILD_PATH) supplied to us by the user.
BOOST_BUILD_PATH.user-value = $(BOOST_BUILD_PATH) ;
-# On Unix only, when BOOST_BUILD_PATH is not supplied by user, put
-# sensible default value. This allowes Boost.Build to work without
-# any environment variables, which is good in itself and also
-# required by Debian Policy.
+# On Unix only, when BOOST_BUILD_PATH is not supplied by the user, set it to a
+# sensible default value. This allows Boost.Build to work without any
+# environment variables, which is good in itself and also required by the Debian
+# Policy.
if ! $(BOOST_BUILD_PATH) && $(UNIX)
{
BOOST_BUILD_PATH = /usr/share/boost-build ;
}
-
+
rule _poke ( module-name ? : variables + : value * )
{
module $(<)
@@ -60,41 +62,37 @@
}
}
-# This rule can be invoked from an optional user's boost-build.jam
-# file to both indicate where to find the build system files, and to
-# load them. The path indicated is relative to the location of the
-# boost-build.jam file.
+
+# This rule can be invoked from an optional user's boost-build.jam file to both
+# indicate where to find the build system files, and to load them. The path
+# indicated is relative to the location of the boost-build.jam file.
#
rule boost-build ( dir ? )
{
if $(.bootstrap-file)
{
- EXIT "Error: Illegal attempt to re-bootstrap the build system by invoking" ;
+ ECHO "Error: Illegal attempt to re-bootstrap the build system by invoking" ;
ECHO ;
ECHO " 'boost-build" $(dir) ";'" ;
ECHO ;
EXIT "Please consult the documentation at 'http://www.boost.org'." ;
}
-
- # Add the given directory to the path so we can find the build
- # system. If dir is empty, has no effect.
- #
+
+ # Add the given directory to the path so we can find the build system. If
+ # dir is empty, has no effect.
BOOST_BUILD_PATH = $(dir:R=$(.boost-build-file:D)) $(BOOST_BUILD_PATH) ;
-
- # We might have just modified the *global* value of BOOST_BUILD_PATH.
- # The code that loads the rest of Boost.Build, in particular the
- # site-config.jam and user-config.jam files uses os.environ, so we need to
- # update the value there.
+
+ # We might have just modified the *global* value of BOOST_BUILD_PATH. The
+ # code that loads the rest of Boost.Build, in particular the site-config.jam
+ # and user-config.jam configuration files uses os.environ, so we need to
+ # update the value there.
_poke .ENVIRON : BOOST_BUILD_PATH : $(BOOST_BUILD_PATH) ;
-
+
# Try to find the build system bootstrap file 'bootstrap.jam'.
- #
- local bootstrap-file =
- [ GLOB $(BOOST_BUILD_PATH) : bootstrap.jam ] ;
+ local bootstrap-file = [ GLOB $(BOOST_BUILD_PATH) : bootstrap.jam ] ;
.bootstrap-file = $(bootstrap-file[1]) ;
-
- # There is no boost-build.jam we can find, exit with an error
- #
+
+ # There is no bootstrap.jam we can find, exit with an error.
if ! $(.bootstrap-file)
{
ECHO "Unable to load Boost.Build: could not find build system." ;
@@ -108,44 +106,43 @@
ECHO ;
EXIT "Please consult the documentation at 'http://www.boost.org'." ;
}
-
+
if [ MATCH .*(--debug-configuration).* : $(ARGV) ]
{
- ECHO "notice: loading Boost.Build from"
- [ NORMALIZE_PATH $(.bootstrap-file:D) ] ;
+ ECHO "notice: loading Boost.Build from"
+ [ NORMALIZE_PATH $(.bootstrap-file:D) ] ;
}
-
+
# Load the build system, now that we know where to start from.
- #
include $(.bootstrap-file) ;
}
if [ MATCH .*(bjam).* : $(ARGV[1]:BL) ]
- || $(BOOST_ROOT) # A temporary measure so Jam works with Boost.Build v1
+ || $(BOOST_ROOT) # A temporary measure so Jam works with Boost.Build v1.
{
- # We attempt to load "boost-build.jam" by searching from the current invocation directory
- # up to the root of the file-system.
+ # We attempt to load "boost-build.jam" by searching from the current
+ # invocation directory up to the root of the file-system.
#
- # boost-build.jam is expected to invoke the "boost-build" rule to
- # load the Boost.Build files.
-
+ # boost-build.jam is expected to invoke the "boost-build" rule to load the
+ # Boost.Build files.
+
local search-path = $(BOOST_BUILD_PATH) $(BOOST_ROOT) ;
-
+
local boost-build-files =
[ find-to-root [ PWD ] : boost-build.jam ]
- # Another temporary measure so Jam works with Boost.Build v1
+ # Another temporary measure so Jam works with Boost.Build v1.
[ GLOB $(search-path) : boost-build.jam ] ;
-
+
.boost-build-file = $(boost-build-files[1]) ;
-
- # There is no boost-build.jam we can find, exit with an error, and information.
- #
+
+ # There is no boost-build.jam we can find, exit with an error, and
+ # information.
if ! $(.boost-build-file)
{
ECHO "Unable to load Boost.Build: could not find \"boost-build.jam\"" ;
ECHO --------------------------------------------------------------- ;
-
+
if ! [ MATCH .*(bjam).* : $(ARGV[1]:BL) ]
{
ECHO "BOOST_ROOT must be set, either in the environment, or " ;
@@ -158,23 +155,21 @@
ECHO "and in these directories from BOOST_BUILD_PATH and BOOST_ROOT: "$(search-path:J=", ")"." ;
EXIT "Please consult the documentation at 'http://www.boost.org'." ;
}
-
- if [ MATCH .*(--debug-configuration).* : $(ARGV) ]
+
+ if [ MATCH .*(--debug-configuration).* : $(ARGV) ]
{
- ECHO "notice: found boost-build.jam at"
- [ NORMALIZE_PATH $(.boost-build-file) ] ;
+ ECHO "notice: found boost-build.jam at"
+ [ NORMALIZE_PATH $(.boost-build-file) ] ;
}
-
+
# Now load the boost-build.jam to get the build system loaded. This
# incidentaly loads the users jamfile and attempts to build targets.
#
- # We also set it up so we can tell wether we are loading the new V2
- # system or the the old V1 system.
- #
+ # We also set it up so we can tell whether we are loading the new V2 system
+ # or the the old V1 system.
include $(.boost-build-file) ;
-
+
# Check that, at minimum, the bootstrap file was found.
- #
if ! $(.bootstrap-file)
{
ECHO "Unable to load Boost.Build" ;
@@ -211,7 +206,7 @@
# 01/08/95 (seiwald) - Shell now handled with awk, not sed
# 01/09/95 (seiwald) - Install* now take dest directory as target
# 01/10/95 (seiwald) - All entries sorted.
-# 01/10/95 (seiwald) - NT support moved in, with LauraW's help.
+# 01/10/95 (seiwald) - NT support moved in, with LauraW's help.
# 01/10/95 (seiwald) - VMS support moved in.
# 02/06/95 (seiwald) - ObjectC++Flags and SubDirC++Flags added.
# 02/07/95 (seiwald) - Iron out when HDRSEARCH uses "" or SEARCH_SOURCE.
@@ -227,14 +222,14 @@
#
# all - parent of first, shell, files, lib, exe
# first - first dependent of 'all', for potential initialization
-# shell - parent of all Shell targets
+# shell - parent of all Shell targets
# files - parent of all File targets
# lib - parent of all Library targets
# exe - parent of all Main targets
# dirs - parent of all MkDir targets
# clean - removes all Shell, File, Library, and Main targets
# uninstall - removes all Install targets
-#
+#
# Rules defined by this file:
#
@@ -314,7 +309,7 @@
# EXIT - blurt out targets and exit
# INCLUDES - marks sources as headers for target (a codependency)
# NOCARE - don't panic if the target can't be built
-# NOUPDATE - create the target if needed but never update it
+# NOUPDATE - create the target if needed but never update it
# NOTFILE - ignore the timestamp of the target (it's not a file)
# TEMPORARY - target need not be present if sources haven't changed
#
@@ -347,35 +342,35 @@
#
local SUPPORTED_TOOLSETS = "BORLANDC" "VC7" "VISUALC" "VISUALC16" "INTELC" "WATCOM"
"MINGW" "LCC" ;
-
+
# this variable holds the current toolset
#
TOOLSET = "" ;
-
+
# if the JAM_TOOLSET environment variable is defined, check that it is
# one of our supported values
#
if $(JAM_TOOLSET)
{
local t ;
-
+
for t in $(SUPPORTED_TOOLSETS)
{
$(t) = $($(t):J=" ") ; # reconstitute paths with spaces in them
if $(t) = $(JAM_TOOLSET) { TOOLSET = $(t) ; }
}
-
+
if ! $(TOOLSET)
{
ECHO "The JAM_TOOLSET environment variable is defined but its value" ;
ECHO "is invalid, please use one of the following:" ;
ECHO ;
-
+
for t in $(SUPPORTED_TOOLSETS) { ECHO " " $(t) ; }
EXIT ;
}
}
-
+
# if TOOLSET is empty, we'll try to detect the toolset from other
# environment variables to remain backwards compatible with Jam 2.3
#
@@ -469,7 +464,7 @@
C++FLAGS ?= $(CCFLAGS) ;
LINK ?= $(CC) ;
LINKFLAGS ?= $(CCFLAGS) ;
- LINKLIBS ?=
+ LINKLIBS ?=
\"$(VISUALC16)\\lib\\mlibce.lib\"
\"$(VISUALC16)\\lib\\oldnames.lib\"
;
@@ -582,7 +577,7 @@
else if $(TOOLSET) = MINGW
{
ECHO "Compiler is GCC with Mingw" ;
-
+
AR ?= ar -ru ;
CC ?= gcc ;
CCFLAGS ?= "" ;
@@ -600,7 +595,7 @@
else if $(TOOLSET) = LCC
{
ECHO "Compiler is Win32-LCC" ;
-
+
AR ?= lcclib ;
CC ?= lcc ;
CCFLAGS ?= "" ;
@@ -616,7 +611,7 @@
{
#
# XXX: We need better comments here !!
-#
+#
EXIT On NT, set BCCROOT, MSVCNT, MINGW or MSVC to the root of the
Borland or Microsoft directories. ;
}
@@ -627,18 +622,18 @@
# the list of supported toolsets on Windows NT and Windows 95/98
#
local SUPPORTED_TOOLSETS = "EMX" "WATCOM" ;
-
+
# this variable holds the current toolset
#
TOOLSET = "" ;
-
+
# if the JAM_TOOLSET environment variable is defined, check that it is
# one of our supported values
#
if $(JAM_TOOLSET)
{
local t ;
-
+
for t in $(SUPPORTED_TOOLSETS)
{
$(t) = $($(t):J=" ") ; # reconstitute paths with spaces in them
@@ -650,12 +645,12 @@
ECHO "The JAM_TOOLSET environment variable is defined but its value" ;
ECHO "is invalid, please use one of the following:" ;
ECHO ;
-
+
for t in $(SUPPORTED_TOOLSETS) { ECHO " " $(t) ; }
EXIT ;
}
}
-
+
# if TOOLSET is empty, we'll try to detect the toolset from other
# environment variables to remain backwards compatible with Jam 2.3
#
@@ -698,7 +693,7 @@
SUFLIB ?= .lib ;
SUFOBJ ?= .obj ;
SUFEXE ?= .exe ;
-
+
if $(TOOLSET) = WATCOM
{
AR ?= wlib ;
@@ -769,7 +764,7 @@
SUFLIB ?= .olb ;
SUFOBJ ?= .obj ;
- switch $(OS)
+ switch $(OS)
{
case OPENVMS : CCFLAGS ?= /stand=vaxc ;
case VMS : LINKLIBS ?= sys$library:vaxcrtl.olb/lib ;
@@ -778,7 +773,7 @@
else if $(MAC)
{
local OPT ;
-
+
CW ?= "{CW}" ;
MACHDRS ?=
@@ -790,19 +785,19 @@
"$(CW):MacOS Support:Universal:Libraries:StubLibraries:Interfacelib"
"$(CW):MacOS Support:Universal:Libraries:StubLibraries:Mathlib" ;
- MPWLIBS ?=
+ MPWLIBS ?=
"$(CW):MacOS Support:Libraries:Runtime:Runtime PPC:MSL MPWCRuntime.lib"
"$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL C.PPC MPW.Lib" ;
- MPWNLLIBS ?=
+ MPWNLLIBS ?=
"$(CW):MacOS Support:Libraries:Runtime:Runtime PPC:MSL MPWCRuntime.lib"
"$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL C.PPC MPW(NL).Lib" ;
-
+
SIOUXHDRS ?= ;
-
- SIOUXLIBS ?=
+
+ SIOUXLIBS ?=
"$(CW):MacOS Support:Libraries:Runtime:Runtime PPC:MSL RuntimePPC.lib"
- "$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL SIOUX.PPC.Lib"
+ "$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL SIOUX.PPC.Lib"
"$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL C.PPC.Lib" ;
C++ ?= mwcppc ;
@@ -814,15 +809,15 @@
DOTDOT ?= "::" ;
HDRS ?= $(MACHDRS) $(MPWHDRS) ;
LINK ?= mwlinkppc ;
- LINKFLAGS ?= -mpwtool -warn ;
- LINKLIBS ?= $(MACLIBS) $(MPWLIBS) ;
+ LINKFLAGS ?= -mpwtool -warn ;
+ LINKLIBS ?= $(MACLIBS) $(MPWLIBS) ;
MKDIR ?= newfolder ;
MV ?= rename -y ;
NOARSCAN ?= true ;
OPTIM ?= ;
RM ?= delete -y ;
SLASH ?= ":" ;
- STDHDRS ?= ;
+ STDHDRS ?= ;
SUFLIB ?= .lib ;
SUFOBJ ?= .o ;
}
@@ -842,7 +837,7 @@
NOARSCAN ?= true ;
STDHDRS ?= /boot/develop/headers/posix ;
}
-else if $(OS) = BEOS
+else if $(OS) = BEOS
{
BINDIR ?= /boot/apps ;
CC ?= gcc ;
@@ -865,7 +860,7 @@
CC ?= gcc ;
YACC ?= "bison -y" ;
- case CYGWIN :
+ case CYGWIN :
CC ?= gcc ;
CCFLAGS += -D__cygwin__ ;
LEX ?= flex ;
@@ -895,12 +890,12 @@
C++ ?= gcc ;
CCFLAGS += -D_POSIX_SOURCE ;
HDRS += /usr/include ;
- RANLIB ?= "" ;
+ RANLIB ?= "" ;
NOARSCAN ?= true ;
NOARUPDATE ?= true ;
case MVS :
- RANLIB ?= "" ;
+ RANLIB ?= "" ;
case NEXT :
AR ?= libtool -o ;
@@ -1017,7 +1012,7 @@
YACCFILES ?= ;
YACCFLAGS ?= ;
- HDRPATTERN =
+ HDRPATTERN =
"^[ ]*#[ ]*include[ ]*[<\"]([^\">]*)[\">].*$" ;
OSFULL = $(OS)$(OSVER)$(OSPLAT) $(OS)$(OSPLAT) $(OS)$(OSVER) $(OS) ;
@@ -1137,7 +1132,7 @@
DEPENDS $(<) : $(>) ;
}
-rule GenFile
+rule GenFile
{
local _t = [ FGristSourceFiles $(<) ] ;
local _s = [ FAppendSuffix $(>[1]) : $(SUFEXE) ] ;
@@ -1188,11 +1183,11 @@
local s ;
- if $(HDRGRIST)
- {
+ if $(HDRGRIST)
+ {
s = $(>:G=$(HDRGRIST)) ;
- } else {
- s = $(>) ;
+ } else {
+ s = $(>) ;
}
INCLUDES $(<) : $(s) ;
@@ -1236,14 +1231,14 @@
Install $(tt) : $(i) ;
Chmod $(tt) ;
- if $(OWNER) && $(CHOWN)
- {
+ if $(OWNER) && $(CHOWN)
+ {
Chown $(tt) ;
OWNER on $(tt) = $(OWNER) ;
}
- if $(GROUP) && $(CHGRP)
- {
+ if $(GROUP) && $(CHGRP)
+ {
Chgrp $(tt) ;
GROUP on $(tt) = $(GROUP) ;
}
@@ -1344,11 +1339,11 @@
MakeLocate $(_l) $(_l)($(_s:BS)) : $(LOCATE_TARGET) ;
}
- if $(NOARSCAN)
- {
+ if $(NOARSCAN)
+ {
# If we can't scan the library to timestamp its contents,
# we have to just make the library depend directly on the
- # on-disk object files.
+ # on-disk object files.
DEPENDS $(_l) : $(_s) ;
}
@@ -1446,12 +1441,12 @@
NOUPDATE $(<) ;
- if $(<) != $(DOT) && ! $($(<)-mkdir)
+ if $(<) != $(DOT) && ! $($(<)-mkdir)
{
local s ;
# Cheesy gate to prevent multiple invocations on same dir
- # MkDir1 has the actions
+ # MkDir1 has the actions
# Arrange for jam dirs
$(<)-mkdir = true ;
@@ -1508,7 +1503,7 @@
# the regexp pattern $(HDRSCAN) and then invokes $(HDRRULE)
# with the scanned file as the target and the found headers
# as the sources. HDRSEARCH is the value of SEARCH used for
- # the found header files. Finally, if jam must deal with
+ # the found header files. Finally, if jam must deal with
# header files of the same name in different directories,
# they can be distinguished with HDRGRIST.
@@ -1603,17 +1598,17 @@
#
# SubDir TOP d1 [ ... ]
#
- # This introduces a Jamfile that is part of a project tree
+ # This introduces a Jamfile that is part of a project tree
# rooted at $(TOP). It (only once) includes the project-specific
# rules file $(TOP)/Jamrules and then sets search & locate stuff.
#
- # If the variable $(TOPRULES) is set (where TOP is the first arg
+ # If the variable $(TOPRULES) is set (where TOP is the first arg
# to SubDir), that file is included instead of $(TOP)/Jamrules.
#
- # d1 ... are the directory elements that lead to this directory
+ # d1 ... are the directory elements that lead to this directory
# from $(TOP). We construct the system dependent path from these
# directory elements in order to set search&locate stuff.
- #
+ #
if ! $($(<[1]))
{
@@ -1703,7 +1698,7 @@
}
_s = [ FDirName $(<[2-]) ] ;
-
+
include $(JAMFILE:D=$(_s):R=$($(<[1]))) ;
}
@@ -1761,13 +1756,13 @@
return $(_g) ;
}
-rule FGristFiles
+rule FGristFiles
{
if ! $(SOURCE_GRIST)
{
return $(<) ;
}
- else
+ else
{
return $(<:G=$(SOURCE_GRIST)) ;
}
@@ -1775,7 +1770,7 @@
rule FGristSourceFiles
{
- # Produce source file name name with grist in it,
+ # Produce source file name name with grist in it,
# if SOURCE_GRIST is set.
# Leave header files alone, because they have a global
@@ -1785,7 +1780,7 @@
{
return $(<) ;
}
- else
+ else
{
local _i _o ;
@@ -1826,10 +1821,10 @@
# path (using ../../ etc) back to that root directory.
# Sets result in $(<)
- if ! $(<[1])
+ if ! $(<[1])
{
_d = $(DOT) ;
- }
+ }
else
{
_d = $(DOTDOT) ;
@@ -1877,7 +1872,7 @@
else if $(MAC)
{
_s = $(DOT) ;
-
+
for _i in $(<)
{
_s = $(_i:R=$(_s)) ;
@@ -1885,7 +1880,7 @@
}
else
{
- _s = $(<[1]) ;
+ _s = $(<[1]) ;
for _i in $(<[2-])
{
@@ -1940,7 +1935,7 @@
rule FAppendSuffix
{
# E.g., "FAppendSuffix yacc lex foo.bat : $(SUFEXE) ;"
- # returns (yacc,lex,foo.bat) on Unix and
+ # returns (yacc,lex,foo.bat) on Unix and
# (yacc.exe,lex.exe,foo.bat) on NT.
if $(>)
@@ -1968,7 +1963,7 @@
rule unmakeDir
{
- if $(>[1]:D) && $(>[1]:D) != $(>[1]) && $(>[1]:D) != \\\\
+ if $(>[1]:D) && $(>[1]:D) != $(>[1]) && $(>[1]:D) != \\\\
{
unmakeDir $(<) : $(>[1]:D) $(>[1]:BS) $(>[2-]) ;
}
@@ -1982,10 +1977,10 @@
rule FConvertToSlashes
{
local _d, _s, _i ;
-
+
unmakeDir _d : $(<) ;
-
- _s = $(_d[1]) ;
+
+ _s = $(_d[1]) ;
for _i in $(_d[2-])
{
_s = $(_s)/$(_i) ;
@@ -2064,7 +2059,7 @@
actions Install
{
- $(CP) $(>) $(<)
+ $(CP) $(>) $(<)
}
actions Lex
@@ -2079,7 +2074,7 @@
actions Link bind NEEDLIBS
{
- $(LINK) $(LINKFLAGS) -o $(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS)
+ $(LINK) $(LINKFLAGS) -o $(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS)
}
actions MkDir1
@@ -2252,7 +2247,7 @@
{
actions together piecemeal Archive
{
- $(AR) $(<) +-$(>)
+ $(AR) $(<) +-$(>)
}
actions Cc
@@ -2279,7 +2274,7 @@
{
actions together piecemeal Archive
{
- $(AR) /out:$(<) $(>)
+ $(AR) /out:$(<) $(>)
}
actions Cc
@@ -2303,13 +2298,13 @@
# OS2 specific actions
#
-else if $(OS2)
+else if $(OS2)
{
if $(TOOLSET) = WATCOM
{
actions together piecemeal Archive
{
- $(AR) $(<) +-$(>)
+ $(AR) $(<) +-$(>)
}
actions Cc
@@ -2357,19 +2352,19 @@
else if $(VMS)
{
- actions updated together piecemeal Archive
+ actions updated together piecemeal Archive
{
lib/replace $(<) $(>[1]) ,$(>[2-])
}
actions Cc
- {
- $(CC)/obj=$(<) $(CCFLAGS) $(OPTIM) $(SLASHINC) $(>)
+ {
+ $(CC)/obj=$(<) $(CCFLAGS) $(OPTIM) $(SLASHINC) $(>)
}
actions C++
- {
- $(C++)/obj=$(<) $(C++FLAGS) $(OPTIM) $(SLASHINC) $(>)
+ {
+ $(C++)/obj=$(<) $(C++FLAGS) $(OPTIM) $(SLASHINC) $(>)
}
actions piecemeal together existing Clean
@@ -2409,7 +2404,7 @@
else if $(MAC)
{
- actions together Archive
+ actions together Archive
{
$(LINK) -library -o $(<) $(>)
}
@@ -2417,13 +2412,13 @@
actions Cc
{
set -e MWCincludes $(MACINC)
- $(CC) -o $(<) $(CCFLAGS) $(OPTIM) $(>)
+ $(CC) -o $(<) $(CCFLAGS) $(OPTIM) $(>)
}
actions C++
- {
+ {
set -e MWCincludes $(MACINC)
- $(CC) -o $(<) $(C++FLAGS) $(OPTIM) $(>)
+ $(CC) -o $(<) $(C++FLAGS) $(OPTIM) $(>)
}
actions Link bind NEEDLIBS
Modified: branches/proto/v4/tools/jam/src/builtins.c
==============================================================================
--- branches/proto/v4/tools/jam/src/builtins.c (original)
+++ branches/proto/v4/tools/jam/src/builtins.c 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -1737,7 +1737,7 @@
return NULL;
}
- m = bindmodule(module);
+ m = bindmodule(*module ? module : 0);
r = bindrule(rule, m);
/* Make pFunc owned */
Modified: branches/proto/v4/tools/jam/src/jambase.c
==============================================================================
--- branches/proto/v4/tools/jam/src/jambase.c (original)
+++ branches/proto/v4/tools/jam/src/jambase.c 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -34,7 +34,7 @@
"{\n",
"if $(.bootstrap-file)\n",
"{\n",
-"EXIT \"Error: Illegal attempt to re-bootstrap the build system by invoking\" ;\n",
+"ECHO \"Error: Illegal attempt to re-bootstrap the build system by invoking\" ;\n",
"ECHO ;\n",
"ECHO \" 'boost-build\" $(dir) \";'\" ;\n",
"ECHO ;\n",
@@ -42,8 +42,7 @@
"}\n",
"BOOST_BUILD_PATH = $(dir:R=$(.boost-build-file:D)) $(BOOST_BUILD_PATH) ;\n",
"_poke .ENVIRON : BOOST_BUILD_PATH : $(BOOST_BUILD_PATH) ;\n",
-"local bootstrap-file =\n",
-"[ GLOB $(BOOST_BUILD_PATH) : bootstrap.jam ] ;\n",
+"local bootstrap-file = [ GLOB $(BOOST_BUILD_PATH) : bootstrap.jam ] ;\n",
".bootstrap-file = $(bootstrap-file[1]) ;\n",
"if ! $(.bootstrap-file)\n",
"{\n",
@@ -60,13 +59,13 @@
"}\n",
"if [ MATCH .*(--debug-configuration).* : $(ARGV) ]\n",
"{\n",
-"ECHO \"notice: loading Boost.Build from\" \n",
+"ECHO \"notice: loading Boost.Build from\"\n",
"[ NORMALIZE_PATH $(.bootstrap-file:D) ] ;\n",
"}\n",
"include $(.bootstrap-file) ;\n",
"}\n",
"if [ MATCH .*(bjam).* : $(ARGV[1]:BL) ]\n",
-"|| $(BOOST_ROOT) # A temporary measure so Jam works with Boost.Build v1\n",
+"|| $(BOOST_ROOT) # A temporary measure so Jam works with Boost.Build v1.\n",
"{\n",
"local search-path = $(BOOST_BUILD_PATH) $(BOOST_ROOT) ;\n",
"local boost-build-files =\n",
@@ -88,9 +87,9 @@
"ECHO \"and in these directories from BOOST_BUILD_PATH and BOOST_ROOT: \"$(search-path:J=\", \")\".\" ;\n",
"EXIT \"Please consult the documentation at 'http://www.boost.org'.\" ;\n",
"}\n",
-"if [ MATCH .*(--debug-configuration).* : $(ARGV) ] \n",
+"if [ MATCH .*(--debug-configuration).* : $(ARGV) ]\n",
"{\n",
-"ECHO \"notice: found boost-build.jam at\" \n",
+"ECHO \"notice: found boost-build.jam at\"\n",
"[ NORMALIZE_PATH $(.boost-build-file) ] ;\n",
"}\n",
"include $(.boost-build-file) ;\n",
@@ -217,7 +216,7 @@
"C++FLAGS ?= $(CCFLAGS) ;\n",
"LINK ?= $(CC) ;\n",
"LINKFLAGS ?= $(CCFLAGS) ;\n",
-"LINKLIBS ?= \n",
+"LINKLIBS ?=\n",
"\\\"$(VISUALC16)\\\\lib\\\\mlibce.lib\\\"\n",
"\\\"$(VISUALC16)\\\\lib\\\\oldnames.lib\\\"\n",
";\n",
@@ -478,7 +477,7 @@
"SUFEXE ?= .exe ;\n",
"SUFLIB ?= .olb ;\n",
"SUFOBJ ?= .obj ;\n",
-"switch $(OS) \n",
+"switch $(OS)\n",
"{\n",
"case OPENVMS : CCFLAGS ?= /stand=vaxc ;\n",
"case VMS : LINKLIBS ?= sys$library:vaxcrtl.olb/lib ;\n",
@@ -495,16 +494,16 @@
"MACLIBS ?=\n",
"\"$(CW):MacOS Support:Universal:Libraries:StubLibraries:Interfacelib\"\n",
"\"$(CW):MacOS Support:Universal:Libraries:StubLibraries:Mathlib\" ;\n",
-"MPWLIBS ?= \n",
+"MPWLIBS ?=\n",
"\"$(CW):MacOS Support:Libraries:Runtime:Runtime PPC:MSL MPWCRuntime.lib\"\n",
"\"$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL C.PPC MPW.Lib\" ;\n",
-"MPWNLLIBS ?= \n",
+"MPWNLLIBS ?=\n",
"\"$(CW):MacOS Support:Libraries:Runtime:Runtime PPC:MSL MPWCRuntime.lib\"\n",
"\"$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL C.PPC MPW(NL).Lib\" ;\n",
"SIOUXHDRS ?= ;\n",
-"SIOUXLIBS ?= \n",
+"SIOUXLIBS ?=\n",
"\"$(CW):MacOS Support:Libraries:Runtime:Runtime PPC:MSL RuntimePPC.lib\"\n",
-"\"$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL SIOUX.PPC.Lib\" \n",
+"\"$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL SIOUX.PPC.Lib\"\n",
"\"$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL C.PPC.Lib\" ;\n",
"C++ ?= mwcppc ;\n",
"C++FLAGS ?= -w off -nomapcr ;\n",
@@ -515,15 +514,15 @@
"DOTDOT ?= \"::\" ;\n",
"HDRS ?= $(MACHDRS) $(MPWHDRS) ;\n",
"LINK ?= mwlinkppc ;\n",
-"LINKFLAGS ?= -mpwtool -warn ; \n",
-"LINKLIBS ?= $(MACLIBS) $(MPWLIBS) ; \n",
+"LINKFLAGS ?= -mpwtool -warn ;\n",
+"LINKLIBS ?= $(MACLIBS) $(MPWLIBS) ;\n",
"MKDIR ?= newfolder ;\n",
"MV ?= rename -y ;\n",
"NOARSCAN ?= true ;\n",
"OPTIM ?= ;\n",
"RM ?= delete -y ;\n",
"SLASH ?= \":\" ;\n",
-"STDHDRS ?= ; \n",
+"STDHDRS ?= ;\n",
"SUFLIB ?= .lib ;\n",
"SUFOBJ ?= .o ;\n",
"}\n",
@@ -543,7 +542,7 @@
"NOARSCAN ?= true ;\n",
"STDHDRS ?= /boot/develop/headers/posix ;\n",
"}\n",
-"else if $(OS) = BEOS \n",
+"else if $(OS) = BEOS\n",
"{\n",
"BINDIR ?= /boot/apps ;\n",
"CC ?= gcc ;\n",
@@ -564,7 +563,7 @@
"case AMIGA :\n",
"CC ?= gcc ;\n",
"YACC ?= \"bison -y\" ;\n",
-"case CYGWIN : \n",
+"case CYGWIN :\n",
"CC ?= gcc ;\n",
"CCFLAGS += -D__cygwin__ ;\n",
"LEX ?= flex ;\n",
@@ -589,11 +588,11 @@
"C++ ?= gcc ;\n",
"CCFLAGS += -D_POSIX_SOURCE ;\n",
"HDRS += /usr/include ;\n",
-"RANLIB ?= \"\" ; \n",
+"RANLIB ?= \"\" ;\n",
"NOARSCAN ?= true ;\n",
"NOARUPDATE ?= true ;\n",
"case MVS :\n",
-"RANLIB ?= \"\" ; \n",
+"RANLIB ?= \"\" ;\n",
"case NEXT :\n",
"AR ?= libtool -o ;\n",
"RANLIB ?= \"\" ;\n",
@@ -691,7 +690,7 @@
"YACC ?= ;\n",
"YACCFILES ?= ;\n",
"YACCFLAGS ?= ;\n",
-"HDRPATTERN = \n",
+"HDRPATTERN =\n",
"\"^[ ]*#[ ]*include[ ]*[<\\\"]([^\\\">]*)[\\\">].*$\" ;\n",
"OSFULL = $(OS)$(OSVER)$(OSPLAT) $(OS)$(OSPLAT) $(OS)$(OSVER) $(OS) ;\n",
"DEPENDS all : shell files lib exe obj ;\n",
@@ -777,7 +776,7 @@
"{\n",
"DEPENDS $(<) : $(>) ;\n",
"}\n",
-"rule GenFile \n",
+"rule GenFile\n",
"{\n",
"local _t = [ FGristSourceFiles $(<) ] ;\n",
"local _s = [ FAppendSuffix $(>[1]) : $(SUFEXE) ] ;\n",
@@ -803,11 +802,11 @@
"rule HdrRule\n",
"{\n",
"local s ;\n",
-"if $(HDRGRIST) \n",
-"{ \n",
+"if $(HDRGRIST)\n",
+"{\n",
"s = $(>:G=$(HDRGRIST)) ;\n",
-"} else { \n",
-"s = $(>) ; \n",
+"} else {\n",
+"s = $(>) ;\n",
"}\n",
"INCLUDES $(<) : $(s) ;\n",
"SEARCH on $(s) = $(HDRSEARCH) ;\n",
@@ -831,13 +830,13 @@
"Depends $(tt) : $(i) ;\n",
"Install $(tt) : $(i) ;\n",
"Chmod $(tt) ;\n",
-"if $(OWNER) && $(CHOWN) \n",
-"{ \n",
+"if $(OWNER) && $(CHOWN)\n",
+"{\n",
"Chown $(tt) ;\n",
"OWNER on $(tt) = $(OWNER) ;\n",
"}\n",
-"if $(GROUP) && $(CHGRP) \n",
-"{ \n",
+"if $(GROUP) && $(CHGRP)\n",
+"{\n",
"Chgrp $(tt) ;\n",
"GROUP on $(tt) = $(GROUP) ;\n",
"}\n",
@@ -910,8 +909,8 @@
"{\n",
"MakeLocate $(_l) $(_l)($(_s:BS)) : $(LOCATE_TARGET) ;\n",
"}\n",
-"if $(NOARSCAN) \n",
-"{ \n",
+"if $(NOARSCAN)\n",
+"{\n",
"DEPENDS $(_l) : $(_s) ;\n",
"}\n",
"else\n",
@@ -972,7 +971,7 @@
"rule MkDir\n",
"{\n",
"NOUPDATE $(<) ;\n",
-"if $(<) != $(DOT) && ! $($(<)-mkdir) \n",
+"if $(<) != $(DOT) && ! $($(<)-mkdir)\n",
"{\n",
"local s ;\n",
"$(<)-mkdir = true ;\n",
@@ -1157,13 +1156,13 @@
"}\n",
"return $(_g) ;\n",
"}\n",
-"rule FGristFiles \n",
+"rule FGristFiles\n",
"{\n",
"if ! $(SOURCE_GRIST)\n",
"{\n",
"return $(<) ;\n",
"}\n",
-"else \n",
+"else\n",
"{\n",
"return $(<:G=$(SOURCE_GRIST)) ;\n",
"}\n",
@@ -1174,7 +1173,7 @@
"{\n",
"return $(<) ;\n",
"}\n",
-"else \n",
+"else\n",
"{\n",
"local _i _o ;\n",
"for _i in $(<)\n",
@@ -1201,10 +1200,10 @@
"rule FSubDir\n",
"{\n",
"local _i _d ;\n",
-"if ! $(<[1]) \n",
+"if ! $(<[1])\n",
"{\n",
"_d = $(DOT) ;\n",
-"} \n",
+"}\n",
"else\n",
"{\n",
"_d = $(DOTDOT) ;\n",
@@ -1245,7 +1244,7 @@
"}\n",
"else\n",
"{\n",
-"_s = $(<[1]) ; \n",
+"_s = $(<[1]) ;\n",
"for _i in $(<[2-])\n",
"{\n",
"_s = $(_i:R=$(_s)) ;\n",
@@ -1301,7 +1300,7 @@
"}\n",
"rule unmakeDir\n",
"{\n",
-"if $(>[1]:D) && $(>[1]:D) != $(>[1]) && $(>[1]:D) != \\\\\\\\ \n",
+"if $(>[1]:D) && $(>[1]:D) != $(>[1]) && $(>[1]:D) != \\\\\\\\\n",
"{\n",
"unmakeDir $(<) : $(>[1]:D) $(>[1]:BS) $(>[2-]) ;\n",
"}\n",
@@ -1314,7 +1313,7 @@
"{\n",
"local _d, _s, _i ;\n",
"unmakeDir _d : $(<) ;\n",
-"_s = $(_d[1]) ; \n",
+"_s = $(_d[1]) ;\n",
"for _i in $(_d[2-])\n",
"{\n",
"_s = $(_s)/$(_i) ;\n",
@@ -1371,7 +1370,7 @@
"}\n",
"actions Install\n",
"{\n",
-"$(CP) $(>) $(<) \n",
+"$(CP) $(>) $(<)\n",
"}\n",
"actions Lex\n",
"{\n",
@@ -1383,7 +1382,7 @@
"}\n",
"actions Link bind NEEDLIBS\n",
"{\n",
-"$(LINK) $(LINKFLAGS) -o $(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS) \n",
+"$(LINK) $(LINKFLAGS) -o $(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS)\n",
"}\n",
"actions MkDir1\n",
"{\n",
@@ -1520,7 +1519,7 @@
"{\n",
"actions together piecemeal Archive\n",
"{\n",
-"$(AR) $(<) +-$(>) \n",
+"$(AR) $(<) +-$(>)\n",
"}\n",
"actions Cc\n",
"{\n",
@@ -1543,7 +1542,7 @@
"{\n",
"actions together piecemeal Archive\n",
"{\n",
-"$(AR) /out:$(<) $(>) \n",
+"$(AR) /out:$(<) $(>)\n",
"}\n",
"actions Cc\n",
"{\n",
@@ -1559,13 +1558,13 @@
"}\n",
"}\n",
"}\n",
-"else if $(OS2) \n",
+"else if $(OS2)\n",
"{\n",
"if $(TOOLSET) = WATCOM\n",
"{\n",
"actions together piecemeal Archive\n",
"{\n",
-"$(AR) $(<) +-$(>) \n",
+"$(AR) $(<) +-$(>)\n",
"}\n",
"actions Cc\n",
"{\n",
@@ -1602,17 +1601,17 @@
"}\n",
"else if $(VMS)\n",
"{\n",
-"actions updated together piecemeal Archive \n",
+"actions updated together piecemeal Archive\n",
"{\n",
"lib/replace $(<) $(>[1]) ,$(>[2-])\n",
"}\n",
"actions Cc\n",
-"{ \n",
-"$(CC)/obj=$(<) $(CCFLAGS) $(OPTIM) $(SLASHINC) $(>) \n",
+"{\n",
+"$(CC)/obj=$(<) $(CCFLAGS) $(OPTIM) $(SLASHINC) $(>)\n",
"}\n",
"actions C++\n",
-"{ \n",
-"$(C++)/obj=$(<) $(C++FLAGS) $(OPTIM) $(SLASHINC) $(>) \n",
+"{\n",
+"$(C++)/obj=$(<) $(C++FLAGS) $(OPTIM) $(SLASHINC) $(>)\n",
"}\n",
"actions piecemeal together existing Clean\n",
"{\n",
@@ -1641,19 +1640,19 @@
"}\n",
"else if $(MAC)\n",
"{\n",
-"actions together Archive \n",
+"actions together Archive\n",
"{\n",
"$(LINK) -library -o $(<) $(>)\n",
"}\n",
"actions Cc\n",
"{\n",
"set -e MWCincludes $(MACINC)\n",
-"$(CC) -o $(<) $(CCFLAGS) $(OPTIM) $(>) \n",
+"$(CC) -o $(<) $(CCFLAGS) $(OPTIM) $(>)\n",
"}\n",
"actions C++\n",
-"{ \n",
+"{\n",
"set -e MWCincludes $(MACINC)\n",
-"$(CC) -o $(<) $(C++FLAGS) $(OPTIM) $(>) \n",
+"$(CC) -o $(<) $(C++FLAGS) $(OPTIM) $(>)\n",
"}\n",
"actions Link bind NEEDLIBS\n",
"{\n",
Modified: branches/proto/v4/tools/quickbook/detail/actions.cpp
==============================================================================
--- branches/proto/v4/tools/quickbook/detail/actions.cpp (original)
+++ branches/proto/v4/tools/quickbook/detail/actions.cpp 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -684,7 +684,11 @@
{
boost::spirit::file_position const pos = first.get_position();
detail::outerr(pos.file,pos.line)
- << "Expanding template" << std::endl;
+ << "Expanding template:" << template_info[0] << std::endl
+ << "------------------begin------------------" << std::endl
+ << body
+ << "------------------end--------------------" << std::endl
+ << std::endl;
actions.pop(); // restore the actions' states
--actions.template_depth;
return;
@@ -1061,7 +1065,7 @@
fs::path include_search(fs::path const & current, std::string const & name)
{
fs::path path(name,fs::native);
-
+
// If the path is relative, try and resolve it.
if (!path.is_complete())
{
@@ -1070,7 +1074,7 @@
{
return current / path;
}
-
+
// Search in each of the include path locations.
BOOST_FOREACH(std::string const & p, include_path)
{
@@ -1082,7 +1086,7 @@
}
}
}
-
+
return path;
}
}
Modified: branches/proto/v4/tools/quickbook/doc/html/index.html
==============================================================================
--- branches/proto/v4/tools/quickbook/doc/html/index.html (original)
+++ branches/proto/v4/tools/quickbook/doc/html/index.html 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -10,10 +10,10 @@
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
-<td align="center">Home</td>
+<td align="center">Home</td>
<td align="center">Libraries</td>
-<td align="center">People</td>
-<td align="center">FAQ</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
<td align="center">More</td>
</tr></table>
<hr>
@@ -34,7 +34,7 @@
<div><p class="copyright">Copyright © 2002, 2004, 2006 Joel de Guzman,
Eric Niebler</p></div>
<div><div class="legalnotice">
-<a name="id385586"></a><p>
+<a name="id385774"></a><p>
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)
</p>
@@ -70,7 +70,7 @@
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: November 14, 2007 at 10:19:55 GMT</small></p></td>
+<td align="left"><p><small>Last revised: May 21, 2008 at 03:54:31 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>
Modified: branches/proto/v4/tools/quickbook/doc/html/quickbook/change_log.html
==============================================================================
--- branches/proto/v4/tools/quickbook/doc/html/quickbook/change_log.html (original)
+++ branches/proto/v4/tools/quickbook/doc/html/quickbook/change_log.html 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -12,10 +12,10 @@
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
-<td align="center">Home</td>
+<td align="center">Home</td>
<td align="center">Libraries</td>
-<td align="center">People</td>
-<td align="center">FAQ</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
<td align="center">More</td>
</tr></table>
<hr>
@@ -26,7 +26,7 @@
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="quickbook.change_log"></a> Change Log</h2></div></div></div>
<a name="quickbook.change_log.version_1_3"></a><h3>
-<a name="id386998"></a>
+<a name="id386592"></a>
<a href="change_log.html#quickbook.change_log.version_1_3">Version 1.3</a>
</h3>
<div class="itemizedlist"><ul type="disc">
@@ -94,7 +94,7 @@
</li>
</ul></div>
<a name="quickbook.change_log.version_1_4"></a><h3>
-<a name="id386285"></a>
+<a name="id387357"></a>
<a href="change_log.html#quickbook.change_log.version_1_4">Version 1.4</a>
</h3>
<div class="itemizedlist"><ul type="disc">
Modified: branches/proto/v4/tools/quickbook/doc/html/quickbook/editors.html
==============================================================================
--- branches/proto/v4/tools/quickbook/doc/html/quickbook/editors.html (original)
+++ branches/proto/v4/tools/quickbook/doc/html/quickbook/editors.html 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -12,10 +12,10 @@
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
-<td align="center">Home</td>
+<td align="center">Home</td>
<td align="center">Libraries</td>
-<td align="center">People</td>
-<td align="center">FAQ</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
<td align="center">More</td>
</tr></table>
<hr>
Modified: branches/proto/v4/tools/quickbook/doc/html/quickbook/editors/kde_support.html
==============================================================================
--- branches/proto/v4/tools/quickbook/doc/html/quickbook/editors/kde_support.html (original)
+++ branches/proto/v4/tools/quickbook/doc/html/quickbook/editors/kde_support.html 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -12,10 +12,10 @@
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
-<td align="center">Home</td>
+<td align="center">Home</td>
<td align="center">Libraries</td>
-<td align="center">People</td>
-<td align="center">FAQ</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
<td align="center">More</td>
</tr></table>
<hr>
@@ -26,7 +26,7 @@
<div class="titlepage"><div><div><h3 class="title">
<a name="quickbook.editors.kde_support"></a>KDE Support</h3></div></div></div>
<a name="quickbook.editors.kde_support.boost__hs__quickbook"></a><h4>
-<a name="id466261"></a>
+<a name="id466336"></a>
<a href="kde_support.html#quickbook.editors.kde_support.boost__hs__quickbook">boost::hs::quickbook</a>
</h4>
<p>
@@ -51,7 +51,7 @@
<span class="bold"><b>html generated from this .qbk file</b></span>
</p>
<div class="table">
-<a name="id466362"></a><p class="title"><b>Table 7. Code examples</b></p>
+<a name="id466438"></a><p class="title"><b>Table 7. Code examples</b></p>
<table class="table" summary="Code examples">
<colgroup>
<col>
@@ -140,7 +140,7 @@
</table>
</div>
<a name="quickbook.editors.kde_support.code_folding_"></a><h4>
-<a name="id466769"></a>
+<a name="id466844"></a>
<a href="kde_support.html#quickbook.editors.kde_support.code_folding_">Code Folding
</a>
</h4>
@@ -150,7 +150,7 @@
region can be folded or unfolded independently.
</p>
<a name="quickbook.editors.kde_support.auto_comment___uncomment_"></a><h4>
-<a name="id466801"></a>
+<a name="id466877"></a>
<a href="kde_support.html#quickbook.editors.kde_support.auto_comment___uncomment_">Auto
Comment / Uncomment </a>
</h4>
@@ -161,7 +161,7 @@
while being in it.
</p>
<a name="quickbook.editors.kde_support.styles_reference_"></a><h4>
-<a name="id466843"></a>
+<a name="id466918"></a>
<a href="kde_support.html#quickbook.editors.kde_support.styles_reference_">Styles reference
</a>
</h4>
@@ -398,7 +398,7 @@
</tbody>
</table></div>
<a name="quickbook.editors.kde_support.about_boost__hs"></a><h4>
-<a name="id467291"></a>
+<a name="id467367"></a>
<a href="kde_support.html#quickbook.editors.kde_support.about_boost__hs">About boost::hs</a>
</h4>
<p>
@@ -419,7 +419,7 @@
</p></td></tr>
</table></div>
<a name="quickbook.editors.kde_support.installing_boost__hs"></a><h4>
-<a name="id467359"></a>
+<a name="id467435"></a>
<a href="kde_support.html#quickbook.editors.kde_support.installing_boost__hs">Installing
boost::hs</a>
</h4>
Modified: branches/proto/v4/tools/quickbook/doc/html/quickbook/editors/scite.html
==============================================================================
--- branches/proto/v4/tools/quickbook/doc/html/quickbook/editors/scite.html (original)
+++ branches/proto/v4/tools/quickbook/doc/html/quickbook/editors/scite.html 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -12,10 +12,10 @@
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
-<td align="center">Home</td>
+<td align="center">Home</td>
<td align="center">Libraries</td>
-<td align="center">People</td>
-<td align="center">FAQ</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
<td align="center">More</td>
</tr></table>
<hr>
Modified: branches/proto/v4/tools/quickbook/doc/html/quickbook/faq.html
==============================================================================
--- branches/proto/v4/tools/quickbook/doc/html/quickbook/faq.html (original)
+++ branches/proto/v4/tools/quickbook/doc/html/quickbook/faq.html 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -12,10 +12,10 @@
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
-<td align="center">Home</td>
+<td align="center">Home</td>
<td align="center">Libraries</td>
-<td align="center">People</td>
-<td align="center">FAQ</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
<td align="center">More</td>
</tr></table>
<hr>
@@ -26,7 +26,7 @@
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="quickbook.faq"></a> Frequently Asked Questions</h2></div></div></div>
<a name="quickbook.faq.can_i_use_quickbook_for_non_boost_documentation_"></a><h3>
-<a name="id467511"></a>
+<a name="id467587"></a>
<a href="faq.html#quickbook.faq.can_i_use_quickbook_for_non_boost_documentation_">Can
I use QuickBook for non-Boost documentation?</a>
</h3>
@@ -68,7 +68,7 @@
;
</pre>
<a name="quickbook.faq.is_there_an_easy_way_to_convert_boostbook_docs_to_quickbook_"></a><h3>
-<a name="id467599"></a>
+<a name="id467675"></a>
<a href="faq.html#quickbook.faq.is_there_an_easy_way_to_convert_boostbook_docs_to_quickbook_">Is
there an easy way to convert BoostBook docs to QuickBook?</a>
</h3>
Modified: branches/proto/v4/tools/quickbook/doc/html/quickbook/install.html
==============================================================================
--- branches/proto/v4/tools/quickbook/doc/html/quickbook/install.html (original)
+++ branches/proto/v4/tools/quickbook/doc/html/quickbook/install.html 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -12,10 +12,10 @@
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
-<td align="center">Home</td>
+<td align="center">Home</td>
<td align="center">Libraries</td>
-<td align="center">People</td>
-<td align="center">FAQ</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
<td align="center">More</td>
</tr></table>
<hr>
Modified: branches/proto/v4/tools/quickbook/doc/html/quickbook/install/linux.html
==============================================================================
--- branches/proto/v4/tools/quickbook/doc/html/quickbook/install/linux.html (original)
+++ branches/proto/v4/tools/quickbook/doc/html/quickbook/install/linux.html 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -12,10 +12,10 @@
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
-<td align="center">Home</td>
+<td align="center">Home</td>
<td align="center">Libraries</td>
-<td align="center">People</td>
-<td align="center">FAQ</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
<td align="center">More</td>
</tr></table>
<hr>
Modified: branches/proto/v4/tools/quickbook/doc/html/quickbook/install/macosx.html
==============================================================================
--- branches/proto/v4/tools/quickbook/doc/html/quickbook/install/macosx.html (original)
+++ branches/proto/v4/tools/quickbook/doc/html/quickbook/install/macosx.html 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -12,10 +12,10 @@
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
-<td align="center">Home</td>
+<td align="center">Home</td>
<td align="center">Libraries</td>
-<td align="center">People</td>
-<td align="center">FAQ</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
<td align="center">More</td>
</tr></table>
<hr>
Modified: branches/proto/v4/tools/quickbook/doc/html/quickbook/install/windows.html
==============================================================================
--- branches/proto/v4/tools/quickbook/doc/html/quickbook/install/windows.html (original)
+++ branches/proto/v4/tools/quickbook/doc/html/quickbook/install/windows.html 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -12,10 +12,10 @@
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
-<td align="center">Home</td>
+<td align="center">Home</td>
<td align="center">Libraries</td>
-<td align="center">People</td>
-<td align="center">FAQ</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
<td align="center">More</td>
</tr></table>
<hr>
Modified: branches/proto/v4/tools/quickbook/doc/html/quickbook/intro.html
==============================================================================
--- branches/proto/v4/tools/quickbook/doc/html/quickbook/intro.html (original)
+++ branches/proto/v4/tools/quickbook/doc/html/quickbook/intro.html 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -12,10 +12,10 @@
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
-<td align="center">Home</td>
+<td align="center">Home</td>
<td align="center">Libraries</td>
-<td align="center">People</td>
-<td align="center">FAQ</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
<td align="center">More</td>
</tr></table>
<hr>
Modified: branches/proto/v4/tools/quickbook/doc/html/quickbook/ref.html
==============================================================================
--- branches/proto/v4/tools/quickbook/doc/html/quickbook/ref.html (original)
+++ branches/proto/v4/tools/quickbook/doc/html/quickbook/ref.html 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -11,10 +11,10 @@
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
-<td align="center">Home</td>
+<td align="center">Home</td>
<td align="center">Libraries</td>
-<td align="center">People</td>
-<td align="center">FAQ</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
<td align="center">More</td>
</tr></table>
<hr>
@@ -27,7 +27,7 @@
<p>
</p>
<div class="table">
-<a name="id467661"></a><p class="title"><b>Table 8. Syntax Compendium</b></p>
+<a name="id467737"></a><p class="title"><b>Table 8. Syntax Compendium</b></p>
<table class="table" summary="Syntax Compendium">
<colgroup>
<col>
Modified: branches/proto/v4/tools/quickbook/doc/html/quickbook/syntax.html
==============================================================================
--- branches/proto/v4/tools/quickbook/doc/html/quickbook/syntax.html (original)
+++ branches/proto/v4/tools/quickbook/doc/html/quickbook/syntax.html 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -12,10 +12,10 @@
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
-<td align="center">Home</td>
+<td align="center">Home</td>
<td align="center">Libraries</td>
-<td align="center">People</td>
-<td align="center">FAQ</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
<td align="center">More</td>
</tr></table>
<hr>
Modified: branches/proto/v4/tools/quickbook/doc/html/quickbook/syntax/block.html
==============================================================================
--- branches/proto/v4/tools/quickbook/doc/html/quickbook/syntax/block.html (original)
+++ branches/proto/v4/tools/quickbook/doc/html/quickbook/syntax/block.html 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -12,10 +12,10 @@
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
-<td align="center">Home</td>
+<td align="center">Home</td>
<td align="center">Libraries</td>
-<td align="center">People</td>
-<td align="center">FAQ</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
<td align="center">More</td>
</tr></table>
<hr>
@@ -644,27 +644,27 @@
[h6 Heading 6]
</pre>
<a name="quickbook.syntax.block.headings.heading_1"></a><h1>
-<a name="id459656"></a>
+<a name="id459731"></a>
<a href="block.html#quickbook.syntax.block.headings.heading_1">Heading 1</a>
</h1>
<a name="quickbook.syntax.block.headings.heading_2"></a><h2>
-<a name="id459680"></a>
+<a name="id459755"></a>
<a href="block.html#quickbook.syntax.block.headings.heading_2">Heading 2</a>
</h2>
<a name="quickbook.syntax.block.headings.heading_3"></a><h3>
-<a name="id459704"></a>
+<a name="id459780"></a>
<a href="block.html#quickbook.syntax.block.headings.heading_3">Heading 3</a>
</h3>
<a name="quickbook.syntax.block.headings.heading_4"></a><h4>
-<a name="id459729"></a>
+<a name="id459804"></a>
<a href="block.html#quickbook.syntax.block.headings.heading_4">Heading 4</a>
</h4>
<a name="quickbook.syntax.block.headings.heading_5"></a><h5>
-<a name="id459754"></a>
+<a name="id459829"></a>
<a href="block.html#quickbook.syntax.block.headings.heading_5">Heading 5</a>
</h5>
<a name="quickbook.syntax.block.headings.heading_6"></a><h5>
-<a name="id459779"></a>
+<a name="id459854"></a>
<a href="block.html#quickbook.syntax.block.headings.heading_6">Heading 6</a>
</h5>
<p>
@@ -802,7 +802,7 @@
Quickbook has some predefined macros that you can already use.
</p>
<div class="table">
-<a name="id460235"></a><p class="title"><b>Table 3. Predefined Macros</b></p>
+<a name="id460310"></a><p class="title"><b>Table 3. Predefined Macros</b></p>
<table class="table" summary="Predefined Macros">
<colgroup>
<col>
@@ -840,7 +840,7 @@
</td>
<td>
<p>
- 2007-Nov-14
+ 2008-May-21
</p>
</td>
</tr>
@@ -857,7 +857,7 @@
</td>
<td>
<p>
- 06:19:55 PM
+ 11:54:31 AM
</p>
</td>
</tr>
@@ -903,7 +903,7 @@
]
</pre>
<a name="quickbook.syntax.block.templates.template_identifier"></a><h5>
-<a name="id460416"></a>
+<a name="id460490"></a>
<a href="block.html#quickbook.syntax.block.templates.template_identifier">Template
Identifier</a>
</h5>
@@ -921,7 +921,7 @@
</li>
</ul></div>
<a name="quickbook.syntax.block.templates.formal_template_arguments"></a><h5>
-<a name="id460462"></a>
+<a name="id460537"></a>
<a href="block.html#quickbook.syntax.block.templates.formal_template_arguments">Formal
Template Arguments</a>
</h5>
@@ -941,7 +941,7 @@
of the template call.
</p>
<a name="quickbook.syntax.block.templates.template_body"></a><h5>
-<a name="id460581"></a>
+<a name="id460656"></a>
<a href="block.html#quickbook.syntax.block.templates.template_body">Template
Body</a>
</h5>
@@ -966,7 +966,7 @@
block level elements are not allowed in phrase templates.
</p>
<a name="quickbook.syntax.block.templates.template_expansion"></a><h5>
-<a name="id460640"></a>
+<a name="id460715"></a>
<a href="block.html#quickbook.syntax.block.templates.template_expansion">Template
Expansion</a>
</h5>
@@ -1017,7 +1017,7 @@
by the close parenthesis.
</p>
<a name="quickbook.syntax.block.templates.nullary_templates"></a><h5>
-<a name="id460747"></a>
+<a name="id460822"></a>
<a href="block.html#quickbook.syntax.block.templates.nullary_templates">Nullary
Templates</a>
</h5>
@@ -1100,7 +1100,7 @@
brackets, though.
</p>
<a name="quickbook.syntax.block.templates.simple_arguments"></a><h5>
-<a name="id460981"></a>
+<a name="id461056"></a>
<a href="block.html#quickbook.syntax.block.templates.simple_arguments">Simple
Arguments</a>
</h5>
@@ -1168,7 +1168,7 @@
what do you think man?
</p>
<a name="quickbook.syntax.block.templates.punctuation_templates"></a><h5>
-<a name="id461151"></a>
+<a name="id461226"></a>
<a href="block.html#quickbook.syntax.block.templates.punctuation_templates">Punctuation
Templates</a>
</h5>
@@ -1244,7 +1244,7 @@
will generate:
</p>
<div class="table">
-<a name="id461354"></a><p class="title"><b>Table 4. A Simple Table</b></p>
+<a name="id461429"></a><p class="title"><b>Table 4. A Simple Table</b></p>
<table class="table" summary="A Simple Table">
<colgroup>
<col>
@@ -1355,7 +1355,7 @@
and thus:
</p>
<div class="table">
-<a name="id461518"></a><p class="title"><b>Table 5. Table with fat cells</b></p>
+<a name="id461593"></a><p class="title"><b>Table 5. Table with fat cells</b></p>
<table class="table" summary="Table with fat cells">
<colgroup>
<col>
@@ -1430,7 +1430,7 @@
]
</pre>
<div class="table">
-<a name="id461636"></a><p class="title"><b>Table 6. Table with code</b></p>
+<a name="id461711"></a><p class="title"><b>Table 6. Table with code</b></p>
<table class="table" summary="Table with code">
<colgroup>
<col>
@@ -1570,7 +1570,7 @@
QuickBook's import facility provides a nice solution.
</p>
<a name="quickbook.syntax.block.import.example"></a><h5>
-<a name="id462059"></a>
+<a name="id462135"></a>
<a href="block.html#quickbook.syntax.block.import.example">Example</a>
</h5>
<p>
@@ -1667,7 +1667,7 @@
<p>
</p>
<a name="quickbook.syntax.block.import.code_snippet_markup"></a><h5>
-<a name="id462364"></a>
+<a name="id462439"></a>
<a href="block.html#quickbook.syntax.block.import.code_snippet_markup">Code
Snippet Markup</a>
</h5>
@@ -1688,7 +1688,7 @@
This too will not be visible in quickbook.
</p>
<a name="quickbook.syntax.block.import.special_comments"></a><h5>
-<a name="id462489"></a>
+<a name="id462565"></a>
<a href="block.html#quickbook.syntax.block.import.special_comments">Special
Comments</a>
</h5>
@@ -1736,7 +1736,7 @@
between the delimeters will simply be ignored.
</p>
<a name="quickbook.syntax.block.import.callouts"></a><h5>
-<a name="id462669"></a>
+<a name="id462744"></a>
<a href="block.html#quickbook.syntax.block.import.callouts">Callouts</a>
</h5>
<p>
Modified: branches/proto/v4/tools/quickbook/doc/html/quickbook/syntax/comments.html
==============================================================================
--- branches/proto/v4/tools/quickbook/doc/html/quickbook/syntax/comments.html (original)
+++ branches/proto/v4/tools/quickbook/doc/html/quickbook/syntax/comments.html 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -12,10 +12,10 @@
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
-<td align="center">Home</td>
+<td align="center">Home</td>
<td align="center">Libraries</td>
-<td align="center">People</td>
-<td align="center">FAQ</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
<td align="center">More</td>
</tr></table>
<hr>
Modified: branches/proto/v4/tools/quickbook/doc/html/quickbook/syntax/phrase.html
==============================================================================
--- branches/proto/v4/tools/quickbook/doc/html/quickbook/syntax/phrase.html (original)
+++ branches/proto/v4/tools/quickbook/doc/html/quickbook/syntax/phrase.html 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -12,10 +12,10 @@
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
-<td align="center">Home</td>
+<td align="center">Home</td>
<td align="center">Libraries</td>
-<td align="center">People</td>
-<td align="center">FAQ</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
<td align="center">More</td>
</tr></table>
<hr>
@@ -136,7 +136,7 @@
<p>
Unlike QuickBook's standard formatting scheme, the rules for simpler alternatives
are much stricter
- <sup>[<a name="id455996" href="#ftn.id455996">1</a>]</sup>
+ <sup>[<a name="id456069" href="#ftn.id456069">1</a>]</sup>
.
</p>
<div class="itemizedlist"><ul type="disc">
@@ -172,7 +172,7 @@
</li>
</ul></div>
<div class="table">
-<a name="id456079"></a><p class="title"><b>Table 1. More Formatting Samples</b></p>
+<a name="id456153"></a><p class="title"><b>Table 1. More Formatting Samples</b></p>
<table class="table" summary="More Formatting Samples">
<colgroup>
<col>
@@ -495,7 +495,7 @@
whereas a Python comment <tt class="computeroutput"><span class="comment">#looks like this</span></tt>.
</p>
<div class="table">
-<a name="id457060"></a><p class="title"><b>Table 2. Supported Source Modes</b></p>
+<a name="id457134"></a><p class="title"><b>Table 2. Supported Source Modes</b></p>
<table class="table" summary="Supported Source Modes">
<colgroup>
<col>
@@ -761,7 +761,7 @@
</pre>
<p>
will generate this
- <sup>[<a name="id457901" href="#ftn.id457901">2</a>]</sup>
+ <sup>[<a name="id457975" href="#ftn.id457975">2</a>]</sup>
.
</p>
<div class="section" lang="en">
@@ -814,22 +814,22 @@
</p>
<p>
Yes!
- <sup>[<a name="id458075" href="#ftn.id458075">3</a>]</sup>
+ <sup>[<a name="id458150" href="#ftn.id458150">3</a>]</sup>
</p>
</div>
<div class="footnotes">
<br><hr width="100" align="left">
-<div class="footnote"><p><sup>[<a name="ftn.id455996" href="#id455996">1</a>] </sup>
+<div class="footnote"><p><sup>[<a name="ftn.id456069" href="#id456069">1</a>] </sup>
Thanks to David Barrett, author of Qwiki,
for sharing these samples and teaching me these obscure formatting
rules. I wasn't sure at all if Spirit,
being more or less a formal EBNF parser, can handle the context sensitivity
and ambiguity.
</p></div>
-<div class="footnote"><p><sup>[<a name="ftn.id457901" href="#id457901">2</a>] </sup>
+<div class="footnote"><p><sup>[<a name="ftn.id457975" href="#id457975">2</a>] </sup>
A sample footnote
</p></div>
-<div class="footnote"><p><sup>[<a name="ftn.id458075" href="#id458075">3</a>] </sup>
+<div class="footnote"><p><sup>[<a name="ftn.id458150" href="#id458150">3</a>] </sup>
Conditional Generation makes quickbook turing complete.
</p></div>
</div>
Modified: branches/proto/v4/tools/quickbook/test/code-block-1.gold
==============================================================================
--- branches/proto/v4/tools/quickbook/test/code-block-1.gold (original)
+++ branches/proto/v4/tools/quickbook/test/code-block-1.gold 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -11,8 +11,7 @@
A code block with proper indentation ;-)
</para>
-<programlisting>
-<phrase role="preprocessor">#include</phrase> <phrase role="special"><</phrase><phrase role="identifier">iostream</phrase><phrase role="special">></phrase>
+<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special"><</phrase><phrase role="identifier">iostream</phrase><phrase role="special">></phrase>
<phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase>
<phrase role="special">{</phrase>
Modified: branches/proto/v4/tools/quickbook/test/code-block-2.gold
==============================================================================
--- branches/proto/v4/tools/quickbook/test/code-block-2.gold (original)
+++ branches/proto/v4/tools/quickbook/test/code-block-2.gold 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -12,8 +12,7 @@
</para>
<para>
-<programlisting>
-<phrase role="preprocessor">#include</phrase> <phrase role="special"><</phrase><phrase role="identifier">iostream</phrase><phrase role="special">></phrase>
+<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special"><</phrase><phrase role="identifier">iostream</phrase><phrase role="special">></phrase>
<phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase>
<phrase role="special">{</phrase>
Modified: branches/proto/v4/tools/quickbook/test/import.gold
==============================================================================
--- branches/proto/v4/tools/quickbook/test/import.gold (original)
+++ branches/proto/v4/tools/quickbook/test/import.gold 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -25,16 +25,12 @@
</para>
<para>
-<programlisting>
-<phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="identifier">foo</phrase><phrase role="special">()</phrase>
+<programlisting><phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="identifier">foo</phrase><phrase role="special">()</phrase>
<phrase role="special">{</phrase>
<phrase role="comment">// return 'em, foo man!
</phrase> <phrase role="keyword">return</phrase> <phrase role="string">"foo"</phrase><phrase role="special">;</phrase>
<phrase role="special">}</phrase>
</programlisting>
</para>
- <para>
- <calloutlist></calloutlist>
- </para>
</para>
</article>
Modified: branches/proto/v4/tools/quickbook/test/quickbook-manual.gold
==============================================================================
--- branches/proto/v4/tools/quickbook/test/quickbook-manual.gold (original)
+++ branches/proto/v4/tools/quickbook/test/quickbook-manual.gold 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -129,8 +129,7 @@
<listitem>
Better (intuitive) paragraph termination. Some markups may terminate a paragraph.
Example:
-<programlisting>
-<phrase role="special">[</phrase><phrase role="identifier">section</phrase> <phrase role="identifier">x</phrase><phrase role="special">]</phrase>
+<programlisting><phrase role="special">[</phrase><phrase role="identifier">section</phrase> <phrase role="identifier">x</phrase><phrase role="special">]</phrase>
<phrase role="identifier">blah</phrase><phrase role="special">...</phrase>
<phrase role="special">[</phrase><phrase role="identifier">endsect</phrase><phrase role="special">]</phrase></programlisting>
</listitem>
@@ -647,8 +646,7 @@
</para>
<para>
-<programlisting>
-<phrase role="preprocessor">#include</phrase> <phrase role="special"><</phrase><phrase role="identifier">iostream</phrase><phrase role="special">></phrase>
+<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special"><</phrase><phrase role="identifier">iostream</phrase><phrase role="special">></phrase>
<phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase>
<phrase role="special">{</phrase>
@@ -740,105 +738,103 @@
<!--quickbook-escape-postfix--></programlisting>
<warning>
<para>
- <para>
- <code><phrase role="special">[</phrase><phrase role="identifier">br</phrase><phrase
- role="special">]</phrase></code> is now deprecated. <link linkend="quickbook.syntax.block.blurbs">Blurbs</link>,
- <link linkend="quickbook.syntax.block.admonitions">Admonitions</link>
- and table cells (see <link linkend="quickbook.syntax.block.tables">Tables</link>)
- may now contain paragraphs.
- </para>
- </warning>
- </section>
- <section id="quickbook.syntax.phrase.anchors">
- <title><link linkend="quickbook.syntax.phrase.anchors">Anchors</link></title>
-
+ <code><phrase role="special">[</phrase><phrase role="identifier">br</phrase><phrase
+ role="special">]</phrase></code> is now deprecated. <link linkend="quickbook.syntax.block.blurbs">Blurbs</link>,
+ <link linkend="quickbook.syntax.block.admonitions">Admonitions</link>
+ and table cells (see <link linkend="quickbook.syntax.block.tables">Tables</link>)
+ may now contain paragraphs.
+ </para>
+ </warning>
+ </section>
+ <section id="quickbook.syntax.phrase.anchors">
+ <title><link linkend="quickbook.syntax.phrase.anchors">Anchors</link></title>
+
<programlisting><!--quickbook-escape-prefix-->[#named_anchor]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- A named anchor is a hook that can be referenced by a link elsewhere in
- the document. You can then reference an anchor with <literal>[link named_anchor
+ <para>
+ A named anchor is a hook that can be referenced by a link elsewhere in
+ the document. You can then reference an anchor with <literal>[link named_anchor
Some link text]</literal>.
- See <link linkend="quickbook.syntax.phrase.anchor_links">Anchor links</link>,
- <link linkend="quickbook.syntax.block.section">Section</link> and <link
- linkend="quickbook.syntax.block.headings">Heading</link>.
- </para>
- </section>
- <section id="quickbook.syntax.phrase.links">
- <title><link linkend="quickbook.syntax.phrase.links">Links</link></title>
-
+ See <link linkend="quickbook.syntax.phrase.anchor_links">Anchor links</link>,
+ <link linkend="quickbook.syntax.block.section">Section</link> and <link
+ linkend="quickbook.syntax.block.headings">Heading</link>.
+ </para>
+ </section>
+ <section id="quickbook.syntax.phrase.links">
+ <title><link linkend="quickbook.syntax.phrase.links">Links</link></title>
+
<programlisting><!--quickbook-escape-prefix-->[@http://www.boost.org this is [*boost's] website....]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- will generate:
- </para>
- <para>
- <ulink url="http://www.boost.org">this is <emphasis role="bold">boost's</emphasis>
- website....</ulink>
- </para>
- <para>
- URL links where the link text is the link itself is common. Example:
- </para>
-
+ <para>
+ will generate:
+ </para>
+ <para>
+ <ulink url="http://www.boost.org">this is <emphasis role="bold">boost's</emphasis>
+ website....</ulink>
+ </para>
+ <para>
+ URL links where the link text is the link itself is common. Example:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->see http://spirit.sourceforge.net/
<!--quickbook-escape-postfix--></programlisting>
- <para>
- so, when the text is absent in a link markup, the URL is assumed. Example:
- </para>
-
+ <para>
+ so, when the text is absent in a link markup, the URL is assumed. Example:
+ </para>
+
<programlisting>see <!--quickbook-escape-prefix-->[@http://spirit.sourceforge.net/]<!--quickbook-escape-postfix-->
</programlisting>
- <para>
- will generate:
- </para>
- <para>
- see <ulink url="http://spirit.sourceforge.net/">http://spirit.sourceforge.net/>
- </para>
- </section>
- <section id="quickbook.syntax.phrase.anchor_links">
- <title><link linkend="quickbook.syntax.phrase.anchor_links">Anchor links</link></title>
- <para>
- You can link within a document using:
- </para>
-
+ <para>
+ will generate:
+ </para>
+ <para>
+ see <ulink url="http://spirit.sourceforge.net/">http://spirit.sourceforge.net/>
+ </para>
+ </section>
+ <section id="quickbook.syntax.phrase.anchor_links">
+ <title><link linkend="quickbook.syntax.phrase.anchor_links">Anchor links</link></title>
+ <para>
+ You can link within a document using:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[link section_id.normalized_header_text The link text]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- See sections <link linkend="quickbook.syntax.block.section">Section</link>
- and <link linkend="quickbook.syntax.block.headings">Heading</link> for
- more info.
- </para>
- </section>
- <section id="quickbook.syntax.phrase.refentry_links">
- <title><link linkend="quickbook.syntax.phrase.refentry_links">refentry
- links</link></title>
- <para>
- In addition, you can link internally to an XML refentry like:
- </para>
-
+ <para>
+ See sections <link linkend="quickbook.syntax.block.section">Section</link>
+ and <link linkend="quickbook.syntax.block.headings">Heading</link> for
+ more info.
+ </para>
+ </section>
+ <section id="quickbook.syntax.phrase.refentry_links">
+ <title><link linkend="quickbook.syntax.phrase.refentry_links">refentry links</link></title>
+ <para>
+ In addition, you can link internally to an XML refentry like:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[link xml.refentry The link text]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- This gets converted into <literal><link linkend="xml.refentry">The
- link text</link></literal>.
- </para>
- <para>
- Like URLs, the link text is optional. If this is not present, the link
- text will automatically be the refentry. Example:
- </para>
-
+ <para>
+ This gets converted into <literal><link linkend="xml.refentry">The
+ link text</link></literal>.
+ </para>
+ <para>
+ Like URLs, the link text is optional. If this is not present, the link
+ text will automatically be the refentry. Example:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[link xml.refentry]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- This gets converted into <literal><link linkend="xml.refentry">xml.refentry</link></literal>.
- </para>
- </section>
- <section id="quickbook.syntax.phrase.code_links">
- <title><link linkend="quickbook.syntax.phrase.code_links"> Code Links</link></title>
- <para>
- If you want to link to a function, class, member, enum, concept or header
- in the reference section, you can use:
- </para>
-
+ <para>
+ This gets converted into <literal><link linkend="xml.refentry">xml.refentry</link></literal>.
+ </para>
+ </section>
+ <section id="quickbook.syntax.phrase.code_links">
+ <title><link linkend="quickbook.syntax.phrase.code_links"> Code Links</link></title>
+ <para>
+ If you want to link to a function, class, member, enum, concept or header
+ in the reference section, you can use:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[funcref fully::qualified::function_name The link text]
[classref fully::qualified::class_name The link text]
[memberref fully::qualified::member_name The link text]
@@ -847,135 +843,132 @@
[conceptref ConceptName The link text]
[headerref path/to/header.hpp The link text]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- Again, the link text is optional. If this is not present, the link text
- will automatically be the function, class, member, enum, macro, concept
- or header. Example:
- </para>
-
+ <para>
+ Again, the link text is optional. If this is not present, the link text
+ will automatically be the function, class, member, enum, macro, concept
+ or header. Example:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[classref boost::bar::baz]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- would have "boost::bar::baz" as the link text.
- </para>
- </section>
- <section id="quickbook.syntax.phrase.escape">
- <title><link linkend="quickbook.syntax.phrase.escape">Escape</link></title>
- <para>
- The escape mark-up is used when we don't want to do any processing.
- </para>
-
+ <para>
+ would have "boost::bar::baz" as the link text.
+ </para>
+ </section>
+ <section id="quickbook.syntax.phrase.escape">
+ <title><link linkend="quickbook.syntax.phrase.escape">Escape</link></title>
+ <para>
+ The escape mark-up is used when we don't want to do any processing.
+ </para>
+
<programlisting>'''
escape (no processing/formatting)
'''
</programlisting>
- <para>
- Escaping allows us to pass XML markup to <ulink url="http://www.boost.org/doc/html/boostbook.html">BoostBook</ulink>
- or <ulink url="http://www.docbook.org/">DocBook</ulink>. For example:
- </para>
-
+ <para>
+ Escaping allows us to pass XML markup to <ulink url="http://www.boost.org/doc/html/boostbook.html">BoostBook</ulink>
+ or <ulink url="http://www.docbook.org/">DocBook</ulink>. For example:
+ </para>
+
<programlisting>'''
<emphasis role="bold">This is direct XML markup</emphasis>
'''
</programlisting>
+ <para>
+ <emphasis role="bold">This is direct XML markup</emphasis>
+ </para>
+ <important>
<para>
- <emphasis role="bold">This is direct XML markup</emphasis>
- </para>
- <important>
- <para>
- Be careful when using the escape. The text must conform to <ulink url="http://www.boost.org/doc/html/boostbook.html">BoostBook</ulink>/<ulink
- url="http://www.docbook.org/">DocBook</ulink> syntax.
- </para>
- </important>
- </section>
- <section id="quickbook.syntax.phrase.single_char_escape">
- <title><link linkend="quickbook.syntax.phrase.single_char_escape">Single
- char escape</link></title>
- <para>
- The backslash may be used to escape a single punctuation character. The
- punctuation immediately after the backslash is passed without any processing.
- This is useful when we need to escape QuickBook punctuations such as
- <code><phrase role="special">[</phrase></code> and <code><phrase role="special">]</phrase></code>.
- For example, how do you escape the triple quote? Simple: <literal>\'\'\'</literal>
+ Be careful when using the escape. The text must conform to <ulink url="http://www.boost.org/doc/html/boostbook.html">BoostBook</ulink>/<ulink
+ url="http://www.docbook.org/">DocBook</ulink> syntax.
</para>
+ </important>
+ </section>
+ <section id="quickbook.syntax.phrase.single_char_escape">
+ <title><link linkend="quickbook.syntax.phrase.single_char_escape">Single
+ char escape</link></title>
+ <para>
+ The backslash may be used to escape a single punctuation character. The
+ punctuation immediately after the backslash is passed without any processing.
+ This is useful when we need to escape QuickBook punctuations such as <code><phrase
+ role="special">[</phrase></code> and <code><phrase role="special">]</phrase></code>.
+ For example, how do you escape the triple quote? Simple: <literal>\'\'\'</literal>
+ </para>
+ <para>
+ <code><phrase role="special">\</phrase><phrase role="identifier">n</phrase></code>
+ has a special meaning. It is used to generate line breaks.
+ </para>
+ <warning>
<para>
<code><phrase role="special">\</phrase><phrase role="identifier">n</phrase></code>
- has a special meaning. It is used to generate line breaks.
+ and <code><phrase role="special">[</phrase><phrase role="identifier">br</phrase><phrase
+ role="special">]</phrase></code> are now deprecated. <link linkend="quickbook.syntax.block.blurbs">Blurbs</link>,
+ <link linkend="quickbook.syntax.block.admonitions">Admonitions</link>
+ and table cells (see <link linkend="quickbook.syntax.block.tables">Tables</link>)
+ may now contain paragraphs.
</para>
- <warning>
- <para>
- <para>
- <code><phrase role="special">\</phrase><phrase role="identifier">n</phrase></code>
- and <code><phrase role="special">[</phrase><phrase role="identifier">br</phrase><phrase
- role="special">]</phrase></code> are now deprecated. <link linkend="quickbook.syntax.block.blurbs">Blurbs</link>,
- <link linkend="quickbook.syntax.block.admonitions">Admonitions</link>
- and table cells (see <link linkend="quickbook.syntax.block.tables">Tables</link>)
- may now contain paragraphs.
- </para>
- </warning>
- <para>
- The escaped space: <code><phrase role="special">\</phrase> </code>
- also has a special meaning. The escaped space is removed from the output.
- </para>
- </section>
- <section id="quickbook.syntax.phrase.images">
- <title><link linkend="quickbook.syntax.phrase.images">Images</link></title>
-
+ </warning>
+ <para>
+ The escaped space: <code><phrase role="special">\</phrase> </code> also
+ has a special meaning. The escaped space is removed from the output.
+ </para>
+ </section>
+ <section id="quickbook.syntax.phrase.images">
+ <title><link linkend="quickbook.syntax.phrase.images">Images</link></title>
+
<programlisting><!--quickbook-escape-prefix-->[$image.jpg]
<!--quickbook-escape-postfix--></programlisting>
- </section>
- <section id="quickbook.syntax.phrase.footnotes">
- <title><link linkend="quickbook.syntax.phrase.footnotes">Footnotes</link></title>
- <para>
- As of version 1.3, QuickBook supports footnotes. Just put the text
- of the footnote in a <code><phrase role="special">[</phrase><phrase
- role="identifier">footnote</phrase><phrase role="special">]</phrase></code>
- block, and the text will be put at the bottom of the current page.
- For example, this:
- </para>
-
+ </section>
+ <section id="quickbook.syntax.phrase.footnotes">
+ <title><link linkend="quickbook.syntax.phrase.footnotes">Footnotes</link></title>
+ <para>
+ As of version 1.3, QuickBook supports footnotes. Just put the text of the
+ footnote in a <code><phrase role="special">[</phrase><phrase role="identifier">footnote</phrase><phrase
+ role="special">]</phrase></code> block, and the text will be put at the
+ bottom of the current page. For example, this:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[footnote A sample footnote]
<!--quickbook-escape-postfix--></programlisting>
+ <para>
+ will generate this
+ <footnote>
<para>
- will generate this
- <footnote>
- <para>
- A sample footnote
- </para>
- </footnote>
- .
+ A sample footnote
</para>
- <section id="quickbook.syntax.phrase.footnotes.macro_expansion">
- <title><link linkend="quickbook.syntax.phrase.footnotes.macro_expansion">Macro
- Expansion</link></title>
+ </footnote>
+ .
+ </para>
+ <section id="quickbook.syntax.phrase.footnotes.macro_expansion">
+ <title><link linkend="quickbook.syntax.phrase.footnotes.macro_expansion">Macro
+ Expansion</link></title>
<programlisting><!--quickbook-escape-prefix-->__a_macro_identifier__
<!--quickbook-escape-postfix--></programlisting>
- <para>
- See <link linkend="quickbook.syntax.block.macros">Macros</link> for
- details.
- </para>
- </section>
- <section id="quickbook.syntax.phrase.footnotes.template_expansion">
- <title><link linkend="quickbook.syntax.phrase.footnotes.template_expansion">Template
- Expansion</link></title>
+ <para>
+ See <link linkend="quickbook.syntax.block.macros">Macros</link> for details.
+ </para>
+ </section>
+ <section id="quickbook.syntax.phrase.footnotes.template_expansion">
+ <title><link linkend="quickbook.syntax.phrase.footnotes.template_expansion">Template
+ Expansion</link></title>
<programlisting><!--quickbook-escape-prefix-->[a_template_identifier]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- See <link linkend="quickbook.syntax.block.templates">Templates</link>
- for details.
- </para>
- </section>
- </section>
+ <para>
+ See <link linkend="quickbook.syntax.block.templates">Templates</link>
+ for details.
+ </para>
</section>
- <section id="quickbook.syntax.block">
- <title><link linkend="quickbook.syntax.block"> Block Level Elements</link></title>
- <section id="quickbook.syntax.block.document">
- <title><link linkend="quickbook.syntax.block.document">Document</link></title>
- <para>
- Every document must begin with a Document Info section, which should
- look like this:
- </para>
-
+ </section>
+ </section>
+ <section id="quickbook.syntax.block">
+ <title><link linkend="quickbook.syntax.block"> Block Level Elements</link></title>
+ <section id="quickbook.syntax.block.document">
+ <title><link linkend="quickbook.syntax.block.document">Document</link></title>
+ <para>
+ Every document must begin with a Document Info section, which should look
+ like this:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[document-type The Document Title
[quickbook 1.3]
[version 1.0]
@@ -989,146 +982,145 @@
[source-mode source-type]
]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- Where document-type is one of:
- </para>
- <itemizedlist>
- <listitem>
- book
- </listitem>
- <listitem>
- article
- </listitem>
- <listitem>
- library
- </listitem>
- <listitem>
- chapter
- </listitem>
- <listitem>
- part
- </listitem>
- <listitem>
- appendix
- </listitem>
- <listitem>
- preface
- </listitem>
- <listitem>
- qandadiv
- </listitem>
- <listitem>
- qandaset
- </listitem>
- <listitem>
- reference
- </listitem>
- <listitem>
- set
- </listitem>
- </itemizedlist>
- <para>
- quickbook 1.3 declares the version of quickbook the document is written
- for. In its absence, version 1.1 is assumed.
- </para>
- <para>
- <literal>version</literal>, <literal>id</literal>, <literal>dirname</literal>,
- <literal>copyright</literal>, <literal>purpose</literal>, <literal>category</literal>,
- <literal>authors</literal>, <literal>license</literal>, <literal>last-revision</literal>
- and <literal>source-mode</literal> are optional information.
- </para>
- <para>
- <literal>source-type</literal> is a lowercase string setting the initial
- <link linkend="quickbook.syntax.phrase.source_mode">Source Mode</link>.
- If the <literal>source-mode</literal> field is omitted, a default value
- of <literal>c++</literal> will be used.
- </para>
- </section>
- <section id="quickbook.syntax.block.section">
- <title><link linkend="quickbook.syntax.block.section">Section</link></title>
- <para>
- Starting a new section is accomplished with:
- </para>
-
+ <para>
+ Where document-type is one of:
+ </para>
+ <itemizedlist>
+ <listitem>
+ book
+ </listitem>
+ <listitem>
+ article
+ </listitem>
+ <listitem>
+ library
+ </listitem>
+ <listitem>
+ chapter
+ </listitem>
+ <listitem>
+ part
+ </listitem>
+ <listitem>
+ appendix
+ </listitem>
+ <listitem>
+ preface
+ </listitem>
+ <listitem>
+ qandadiv
+ </listitem>
+ <listitem>
+ qandaset
+ </listitem>
+ <listitem>
+ reference
+ </listitem>
+ <listitem>
+ set
+ </listitem>
+ </itemizedlist>
+ <para>
+ quickbook 1.3 declares the version of quickbook the document is written
+ for. In its absence, version 1.1 is assumed.
+ </para>
+ <para>
+ <literal>version</literal>, <literal>id</literal>, <literal>dirname</literal>,
+ <literal>copyright</literal>, <literal>purpose</literal>, <literal>category</literal>,
+ <literal>authors</literal>, <literal>license</literal>, <literal>last-revision</literal>
+ and <literal>source-mode</literal> are optional information.
+ </para>
+ <para>
+ <literal>source-type</literal> is a lowercase string setting the initial
+ <link linkend="quickbook.syntax.phrase.source_mode">Source Mode</link>.
+ If the <literal>source-mode</literal> field is omitted, a default value
+ of <literal>c++</literal> will be used.
+ </para>
+ </section>
+ <section id="quickbook.syntax.block.section">
+ <title><link linkend="quickbook.syntax.block.section">Section</link></title>
+ <para>
+ Starting a new section is accomplished with:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[section:id The Section Title]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- where <emphasis>id</emphasis> is optional. id will be the filename
- of the generated section. If it is not present, "The Section Title"
- will be normalized and become the id. Valid characters are <literal>a-Z</literal>,
- <literal>A-Z</literal>, <literal>0-9</literal> and <literal>_</literal>.
- All non-valid characters are converted to underscore and all upper-case
- are converted to lower case. Thus: "The Section Title" will
- be normalized to "the_section_title".
- </para>
- <para>
- End a section with:
- </para>
-
+ <para>
+ where <emphasis>id</emphasis> is optional. id will be the filename of the
+ generated section. If it is not present, "The Section Title"
+ will be normalized and become the id. Valid characters are <literal>a-Z</literal>,
+ <literal>A-Z</literal>, <literal>0-9</literal> and <literal>_</literal>.
+ All non-valid characters are converted to underscore and all upper-case
+ are converted to lower case. Thus: "The Section Title" will be
+ normalized to "the_section_title".
+ </para>
+ <para>
+ End a section with:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[endsect]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- Sections can nest, and that results in a hierarchy in the table of
- contents.
- </para>
- </section>
- <section id="quickbook.syntax.block.xinclude">
- <title><link linkend="quickbook.syntax.block.xinclude">xinclude</link></title>
- <para>
- You can include another XML file with:
- </para>
-
+ <para>
+ Sections can nest, and that results in a hierarchy in the table of contents.
+ </para>
+ </section>
+ <section id="quickbook.syntax.block.xinclude">
+ <title><link linkend="quickbook.syntax.block.xinclude">xinclude</link></title>
+ <para>
+ You can include another XML file with:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[xinclude file.xml]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- This is useful when file.xml has been generated by Doxygen and contains
- your reference section.
- </para>
- </section>
- <section id="quickbook.syntax.block.paragraphs">
- <title><link linkend="quickbook.syntax.block.paragraphs">Paragraphs</link></title>
- <para>
- Paragraphs start left-flushed and are terminated by two or more newlines.
- No markup is needed for paragraphs. QuickBook automatically detects
- paragraphs from the context. Block markups [section, endsect, h1, h2,
- h3, h4, h5, h6, blurb, (block-quote) ':', pre, def, table and include
- ] may also terminate a paragraph.
- </para>
- </section>
- <section id="quickbook.syntax.block.lists">
- <title><link linkend="quickbook.syntax.block.lists">Lists</link></title>
- <section id="quickbook.syntax.block.lists.ordered_lists">
- <title><link linkend="quickbook.syntax.block.lists.ordered_lists">Ordered
- lists</link></title>
+ <para>
+ This is useful when file.xml has been generated by Doxygen and contains
+ your reference section.
+ </para>
+ </section>
+ <section id="quickbook.syntax.block.paragraphs">
+ <title><link linkend="quickbook.syntax.block.paragraphs">Paragraphs</link></title>
+ <para>
+ Paragraphs start left-flushed and are terminated by two or more newlines.
+ No markup is needed for paragraphs. QuickBook automatically detects paragraphs
+ from the context. Block markups [section, endsect, h1, h2, h3, h4, h5,
+ h6, blurb, (block-quote) ':', pre, def, table and include ] may also terminate
+ a paragraph.
+ </para>
+ </section>
+ <section id="quickbook.syntax.block.lists">
+ <title><link linkend="quickbook.syntax.block.lists">Lists</link></title>
+ <section id="quickbook.syntax.block.lists.ordered_lists">
+ <title><link linkend="quickbook.syntax.block.lists.ordered_lists">Ordered
+ lists</link></title>
<programlisting># One
# Two
# Three
</programlisting>
- <para>
- will generate:
- </para>
- <orderedlist>
- <listitem>
- One
- </listitem>
- <listitem>
- Two
- </listitem>
- <listitem>
- Three
- </listitem>
- </orderedlist>
- </section>
- <section id="quickbook.syntax.block.lists.list_hierarchies">
- <title><link linkend="quickbook.syntax.block.lists.list_hierarchies">List
- Hierarchies</link></title>
- <para>
- List hierarchies are supported. Example:
- </para>
-
-<programlisting># One
-# Two
-# Three
+ <para>
+ will generate:
+ </para>
+ <orderedlist>
+ <listitem>
+ One
+ </listitem>
+ <listitem>
+ Two
+ </listitem>
+ <listitem>
+ Three
+ </listitem>
+ </orderedlist>
+ </section>
+ <section id="quickbook.syntax.block.lists.list_hierarchies">
+ <title><link linkend="quickbook.syntax.block.lists.list_hierarchies">List
+ Hierarchies</link></title>
+ <para>
+ List hierarchies are supported. Example:
+ </para>
+
+<programlisting># One
+# Two
+# Three
# Three.a
# Three.b
# Three.c
@@ -1138,58 +1130,58 @@
# Four.a.ii
# Five
</programlisting>
- <para>
- will generate:
- </para>
+ <para>
+ will generate:
+ </para>
+ <orderedlist>
+ <listitem>
+ One
+ </listitem>
+ <listitem>
+ Two
+ </listitem>
+ <listitem>
+ Three
<orderedlist>
<listitem>
- One
+ Three.a
</listitem>
<listitem>
- Two
+ Three.b
</listitem>
<listitem>
- Three
- <orderedlist>
- <listitem>
- Three.a
- </listitem>
- <listitem>
- Three.b
- </listitem>
- <listitem>
- Three.c
- </listitem>
- </orderedlist>
+ Three.c
</listitem>
+ </orderedlist>
+ </listitem>
+ <listitem>
+ Fourth
+ <orderedlist>
<listitem>
- Fourth
+ Four.a
<orderedlist>
<listitem>
- Four.a
- <orderedlist>
- <listitem>
- Four.a.i
- </listitem>
- <listitem>
- Four.a.ii
- </listitem>
- </orderedlist>
+ Four.a.i
+ </listitem>
+ <listitem>
+ Four.a.ii
</listitem>
</orderedlist>
</listitem>
- <listitem>
- Five
- </listitem>
</orderedlist>
- </section>
- <section id="quickbook.syntax.block.lists.long_list_lines">
- <title><link linkend="quickbook.syntax.block.lists.long_list_lines">Long
- List Lines</link></title>
- <para>
- Long lines will be wrapped appropriately. Example:
- </para>
-
+ </listitem>
+ <listitem>
+ Five
+ </listitem>
+ </orderedlist>
+ </section>
+ <section id="quickbook.syntax.block.lists.long_list_lines">
+ <title><link linkend="quickbook.syntax.block.lists.long_list_lines">Long
+ List Lines</link></title>
+ <para>
+ Long lines will be wrapped appropriately. Example:
+ </para>
+
<programlisting># A short item.
# A very long item. A very long item. A very long item.
A very long item. A very long item. A very long item.
@@ -1198,51 +1190,49 @@
A very long item. A very long item. A very long item.
# A short item.
</programlisting>
- <orderedlist>
- <listitem>
- A short item.
- </listitem>
- <listitem>
- A very long item. A very long item. A very long item. A very long
- item. A very long item. A very long item. A very long item. A very
- long item. A very long item. A very long item. A very long item.
- A very long item. A very long item. A very long item. A very long
- item.
- </listitem>
- <listitem>
- A short item.
- </listitem>
- </orderedlist>
- </section>
- <section id="quickbook.syntax.block.lists.unordered_lists">
- <title><link linkend="quickbook.syntax.block.lists.unordered_lists">Unordered
- lists</link></title>
+ <orderedlist>
+ <listitem>
+ A short item.
+ </listitem>
+ <listitem>
+ A very long item. A very long item. A very long item. A very long item.
+ A very long item. A very long item. A very long item. A very long item.
+ A very long item. A very long item. A very long item. A very long item.
+ A very long item. A very long item. A very long item.
+ </listitem>
+ <listitem>
+ A short item.
+ </listitem>
+ </orderedlist>
+ </section>
+ <section id="quickbook.syntax.block.lists.unordered_lists">
+ <title><link linkend="quickbook.syntax.block.lists.unordered_lists">Unordered
+ lists</link></title>
<programlisting><!--quickbook-escape-prefix-->* First
* Second
* Third
<!--quickbook-escape-postfix--></programlisting>
- <para>
- will generate:
- </para>
- <itemizedlist>
- <listitem>
- First
- </listitem>
- <listitem>
- Second
- </listitem>
- <listitem>
- Third
- </listitem>
- </itemizedlist>
- </section>
- <section id="quickbook.syntax.block.lists.mixed_lists">
- <title><link linkend="quickbook.syntax.block.lists.mixed_lists">Mixed
- lists</link></title>
- <para>
- Mixed lists (ordered and unordered) are supported. Example:
- </para>
-
+ <para>
+ will generate:
+ </para>
+ <itemizedlist>
+ <listitem>
+ First
+ </listitem>
+ <listitem>
+ Second
+ </listitem>
+ <listitem>
+ Third
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section id="quickbook.syntax.block.lists.mixed_lists">
+ <title><link linkend="quickbook.syntax.block.lists.mixed_lists">Mixed lists</link></title>
+ <para>
+ Mixed lists (ordered and unordered) are supported. Example:
+ </para>
+
<programlisting><!--quickbook-escape-prefix--># One
# Two
# Three
@@ -1251,38 +1241,38 @@
* Three.c
# Four
<!--quickbook-escape-postfix--></programlisting>
- <para>
- will generate:
- </para>
- <orderedlist>
- <listitem>
- One
- </listitem>
+ <para>
+ will generate:
+ </para>
+ <orderedlist>
+ <listitem>
+ One
+ </listitem>
+ <listitem>
+ Two
+ </listitem>
+ <listitem>
+ Three
+ <itemizedlist>
<listitem>
- Two
+ Three.a
</listitem>
<listitem>
- Three
- <itemizedlist>
- <listitem>
- Three.a
- </listitem>
- <listitem>
- Three.b
- </listitem>
- <listitem>
- Three.c
- </listitem>
- </itemizedlist>
+ Three.b
</listitem>
<listitem>
- Four
+ Three.c
</listitem>
- </orderedlist>
- <para>
- And...
- </para>
-
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ Four
+ </listitem>
+ </orderedlist>
+ <para>
+ And...
+ </para>
+
<programlisting><!--quickbook-escape-prefix--># 1
* 1.a
# 1.a.1
@@ -1296,71 +1286,70 @@
* 2.b.2.a
* 2.b.2.b
<!--quickbook-escape-postfix--></programlisting>
- <para>
- will generate:
- </para>
- <orderedlist>
+ <para>
+ will generate:
+ </para>
+ <orderedlist>
+ <listitem>
+ 1
+ <itemizedlist>
<listitem>
- 1
- <itemizedlist>
+ 1.a
+ <orderedlist>
<listitem>
- 1.a
- <orderedlist>
- <listitem>
- 1.a.1
- </listitem>
- <listitem>
- 1.a.2
- </listitem>
- </orderedlist>
+ 1.a.1
</listitem>
<listitem>
- 1.b
+ 1.a.2
</listitem>
- </itemizedlist>
+ </orderedlist>
+ </listitem>
+ <listitem>
+ 1.b
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ 2
+ <itemizedlist>
+ <listitem>
+ 2.a
</listitem>
<listitem>
- 2
- <itemizedlist>
+ 2.b
+ <orderedlist>
<listitem>
- 2.a
+ 2.b.1
</listitem>
<listitem>
- 2.b
- <orderedlist>
+ 2.b.2
+ <itemizedlist>
<listitem>
- 2.b.1
+ 2.b.2.a
</listitem>
<listitem>
- 2.b.2
- <itemizedlist>
- <listitem>
- 2.b.2.a
- </listitem>
- <listitem>
- 2.b.2.b
- </listitem>
- </itemizedlist>
+ 2.b.2.b
</listitem>
- </orderedlist>
+ </itemizedlist>
</listitem>
- </itemizedlist>
+ </orderedlist>
</listitem>
- </orderedlist>
- </section>
- </section>
- <section id="quickbook.syntax.block.code">
- <title><link linkend="quickbook.syntax.block.code">Code</link></title>
- <para>
- Preformatted code starts with a space or a tab. The code will be syntax
- highlighted according to the current <link linkend="quickbook.syntax.phrase.source_mode">Source
- Mode</link>:
- </para>
- <para>
- </para>
-
-<programlisting>
-<phrase role="preprocessor">#include</phrase> <phrase role="special"><</phrase><phrase role="identifier">iostream</phrase><phrase role="special">></phrase>
+ </itemizedlist>
+ </listitem>
+ </orderedlist>
+ </section>
+ </section>
+ <section id="quickbook.syntax.block.code">
+ <title><link linkend="quickbook.syntax.block.code">Code</link></title>
+ <para>
+ Preformatted code starts with a space or a tab. The code will be syntax
+ highlighted according to the current <link linkend="quickbook.syntax.phrase.source_mode">Source
+ Mode</link>:
+ </para>
+ <para>
+ </para>
+
+<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special"><</phrase><phrase role="identifier">iostream</phrase><phrase role="special">></phrase>
<phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase>
<phrase role="special">{</phrase>
@@ -1369,73 +1358,70 @@
<phrase role="keyword">return</phrase> <phrase role="number">0</phrase><phrase role="special">;</phrase>
<phrase role="special">}</phrase>
</programlisting>
- <para>
- </para>
-
-<programlisting>
-<phrase role="keyword">import</phrase> <phrase role="identifier">cgi</phrase>
+ <para>
+ </para>
+
+<programlisting><phrase role="keyword">import</phrase> <phrase role="identifier">cgi</phrase>
<phrase role="keyword">def</phrase> <phrase role="identifier">cookForHtml</phrase><phrase role="special">(</phrase><phrase role="identifier">text</phrase><phrase role="special">):</phrase>
<phrase role="string">'''"Cooks" the input text for HTML.'''</phrase>
<phrase role="keyword">return</phrase> <phrase role="identifier">cgi</phrase><phrase role="special">.</phrase><phrase role="identifier">escape</phrase><phrase role="special">(</phrase><phrase role="identifier">text</phrase><phrase role="special">)</phrase>
</programlisting>
- <para>
- </para>
- <para>
- Macros that are already defined are expanded in source code. Example:
- </para>
-
+ <para>
+ </para>
+ <para>
+ Macros that are already defined are expanded in source code. Example:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[def __array__ [@http://www.boost.org/doc/html/array/reference.html array]]
[def __boost__ [@http://www.boost.org/libs/libraries.htm boost]]
using __boost__::__array__;
<!--quickbook-escape-postfix--></programlisting>
- <para>
- Generates:
- </para>
-
-<programlisting>
-<phrase role="keyword">using</phrase> <ulink url="http://www.boost.org/libs/libraries.htm">boost</ulink><phrase role="special">::</phrase><ulink url="http://www.boost.org/doc/html/array/reference.html">array</ulink><phrase role="special">;</phrase>
+ <para>
+ Generates:
+ </para>
+
+<programlisting><phrase role="keyword">using</phrase> <ulink url="http://www.boost.org/libs/libraries.htm">boost</ulink><phrase role="special">::</phrase><ulink url="http://www.boost.org/doc/html/array/reference.html">array</ulink><phrase role="special">;</phrase>
</programlisting>
- </section>
- <section id="quickbook.syntax.block.escape_back">
- <title><link linkend="quickbook.syntax.block.escape_back"> Escaping Back
- To QuickBook</link></title>
- <para>
- Inside code, code blocks and inline code, QuickBook does not allow
- any markup to avoid conflicts with the target syntax (e.g. c++). In
- case you need to switch back to QuickBook markup inside code, you can
- do so using a language specific <emphasis>escape-back</emphasis> delimiter.
- In C++ and Python, the delimiter is the double tick (back-quote): "``"
- and "``". Example:
- </para>
-
+ </section>
+ <section id="quickbook.syntax.block.escape_back">
+ <title><link linkend="quickbook.syntax.block.escape_back"> Escaping Back
+ To QuickBook</link></title>
+ <para>
+ Inside code, code blocks and inline code, QuickBook does not allow any
+ markup to avoid conflicts with the target syntax (e.g. c++). In case you
+ need to switch back to QuickBook markup inside code, you can do so using
+ a language specific <emphasis>escape-back</emphasis> delimiter. In C++
+ and Python, the delimiter is the double tick (back-quote): "``"
+ and "``". Example:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->void ``[@http://en.wikipedia.org/wiki/Foo#Foo.2C_Bar_and_Baz foo]``()
{
}
<!--quickbook-escape-postfix--></programlisting>
- <para>
- Will generate:
- </para>
-
-<programlisting>
-<phrase role="keyword">void</phrase> <ulink url="http://en.wikipedia.org/wiki/Foo#Foo.2C_Bar_and_Baz">foo</ulink><phrase role="special">()</phrase>
+ <para>
+ Will generate:
+ </para>
+
+<programlisting><phrase role="keyword">void</phrase> <ulink url="http://en.wikipedia.org/wiki/Foo#Foo.2C_Bar_and_Baz">foo</ulink><phrase role="special">()</phrase>
<phrase role="special">{</phrase>
<phrase role="special">}</phrase>
</programlisting>
- <para>
- When escaping from code to QuickBook, only phrase level markups are
- allowed. Block level markups like lists, tables etc. are not allowed.
- </para>
- </section>
- <section id="quickbook.syntax.block.preformatted">
- <title><link linkend="quickbook.syntax.block.preformatted">Preformatted</link></title>
- <para>
- Sometimes, you don't want some preformatted text to be parsed as C++.
- In such cases, use the <literal>[pre ... ]</literal> markup block.
- </para>
-
+ <para>
+ When escaping from code to QuickBook, only phrase level markups are allowed.
+ Block level markups like lists, tables etc. are not allowed.
+ </para>
+ </section>
+ <section id="quickbook.syntax.block.preformatted">
+ <title><link linkend="quickbook.syntax.block.preformatted">Preformatted</link></title>
+ <para>
+ Sometimes, you don't want some preformatted text to be parsed as C++. In
+ such cases, use the <literal>[pre ... ]</literal> markup block.
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[pre
Some *preformatted* text Some *preformatted* text
@@ -1446,12 +1432,12 @@
]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- Spaces, tabs and newlines are rendered as-is. Unlike all quickbook
- block level markup, pre (and Code) are the only ones that allow multiple
- newlines. The markup above will generate:
- </para>
-
+ <para>
+ Spaces, tabs and newlines are rendered as-is. Unlike all quickbook block
+ level markup, pre (and Code) are the only ones that allow multiple newlines.
+ The markup above will generate:
+ </para>
+
<programlisting>Some <emphasis role="bold">preformatted</emphasis> text Some <emphasis role="bold">preformatted</emphasis> text
Some <emphasis role="bold">preformatted</emphasis> text Some <emphasis role="bold">preformatted</emphasis> text
@@ -1459,71 +1445,70 @@
Some <emphasis role="bold">preformatted</emphasis> text Some <emphasis role="bold">preformatted</emphasis> text
</programlisting>
- <para>
- Notice that unlike Code, phrase markup such as font style is still
- permitted inside <literal>pre</literal> blocks.
- </para>
- </section>
- <section id="quickbook.syntax.block.blockquote">
- <title><link linkend="quickbook.syntax.block.blockquote">Blockquote</link></title>
-
+ <para>
+ Notice that unlike Code, phrase markup such as font style is still permitted
+ inside <literal>pre</literal> blocks.
+ </para>
+ </section>
+ <section id="quickbook.syntax.block.blockquote">
+ <title><link linkend="quickbook.syntax.block.blockquote">Blockquote</link></title>
+
<programlisting><!--quickbook-escape-prefix-->[:sometext...]<!--quickbook-escape-postfix-->
</programlisting>
- <blockquote>
- <para>
- <para>
- Indents the paragraph. This applies to one paragraph only.
- </para>
- </para>
- </blockquote>
- </section>
- <section id="quickbook.syntax.block.admonitions">
- <title><link linkend="quickbook.syntax.block.admonitions">Admonitions</link></title>
-
+ <blockquote>
+ <para>
+ <para>
+ Indents the paragraph. This applies to one paragraph only.
+ </para>
+ </para>
+ </blockquote>
+ </section>
+ <section id="quickbook.syntax.block.admonitions">
+ <title><link linkend="quickbook.syntax.block.admonitions">Admonitions</link></title>
+
<programlisting><!--quickbook-escape-prefix-->[note This is a note]
[tip This is a tip]
[important This is important]
[caution This is a caution]
[warning This is a warning]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- generates <ulink url="http://www.docbook.org/">DocBook</ulink> admonitions:
- </para>
- <note>
- <para>
- This is a note
- </para>
- </note>
- <tip>
- <para>
- This is a tip
- </para>
- </tip>
- <important>
- <para>
- This is important
- </para>
- </important>
- <caution>
- <para>
- This is a caution
- </para>
- </caution>
- <warning>
- <para>
- <para>
- This is a warning
- </para>
- </warning>
- <para>
- These are the only admonitions supported by <ulink url="http://www.docbook.org/">DocBook</ulink>.
- So, for example <literal>[information This is some information]</literal>
- is unlikely to produce the desired effect.
- </para>
- </section>
- <section id="quickbook.syntax.block.headings">
- <title><link linkend="quickbook.syntax.block.headings">Headings</link></title>
-
+ <para>
+ generates <ulink url="http://www.docbook.org/">DocBook</ulink> admonitions:
+ </para>
+ <note>
+ <para>
+ This is a note
+ </para>
+ </note>
+ <tip>
+ <para>
+ This is a tip
+ </para>
+ </tip>
+ <important>
+ <para>
+ This is important
+ </para>
+ </important>
+ <caution>
+ <para>
+ This is a caution
+ </para>
+ </caution>
+ <warning>
+ <para>
+ This is a warning
+ </para>
+ </warning>
+ <para>
+ These are the only admonitions supported by <ulink url="http://www.docbook.org/">DocBook</ulink>.
+ So, for example <literal>[information This is some information]</literal>
+ is unlikely to produce the desired effect.
+ </para>
+ </section>
+ <section id="quickbook.syntax.block.headings">
+ <title><link linkend="quickbook.syntax.block.headings">Headings</link></title>
+
<programlisting><!--quickbook-escape-prefix-->[h1 Heading 1]
[h2 Heading 2]
[h3 Heading 3]
@@ -1531,577 +1516,564 @@
[h5 Heading 5]
[h6 Heading 6]
<!--quickbook-escape-postfix--></programlisting>
- <anchor id="quickbook.syntax.block.headings.heading_1"/>
- <bridgehead renderas="sect1">
- <link linkend="quickbook.syntax.block.headings.heading_1">Heading
- 1</link>
- </bridgehead>
- <anchor id="quickbook.syntax.block.headings.heading_2"/>
- <bridgehead renderas="sect2">
- <link linkend="quickbook.syntax.block.headings.heading_2">Heading
- 2</link>
- </bridgehead>
- <anchor id="quickbook.syntax.block.headings.heading_3"/>
- <bridgehead renderas="sect3">
- <link linkend="quickbook.syntax.block.headings.heading_3">Heading
- 3</link>
- </bridgehead>
- <anchor id="quickbook.syntax.block.headings.heading_4"/>
- <bridgehead renderas="sect4">
- <link linkend="quickbook.syntax.block.headings.heading_4">Heading
- 4</link>
- </bridgehead>
- <anchor id="quickbook.syntax.block.headings.heading_5"/>
- <bridgehead renderas="sect5">
- <link linkend="quickbook.syntax.block.headings.heading_5">Heading
- 5</link>
- </bridgehead>
- <anchor id="quickbook.syntax.block.headings.heading_6"/>
- <bridgehead renderas="sect6">
- <link linkend="quickbook.syntax.block.headings.heading_6">Heading
- 6</link>
- </bridgehead>
- <para>
- Headings 1-3 [h1 h2 and h3] will automatically have anchors with
- normalized names with <literal>name="section_id.normalized_header_text"</literal>
- (i.e. valid characters are <literal>a-z</literal>, <literal>A-Z</literal>,
- <literal>0-9</literal> and <literal>_</literal>. All non-valid characters
- are converted to underscore and all upper-case are converted to lower-case.
- For example: Heading 1 in section Section 2 will be normalized to
- <literal>section_2.heading_1</literal>). You can use:
- </para>
-
+ <anchor id="quickbook.syntax.block.headings.heading_1"/>
+ <bridgehead renderas="sect1">
+ <link linkend="quickbook.syntax.block.headings.heading_1">Heading 1</link>
+ </bridgehead>
+ <anchor id="quickbook.syntax.block.headings.heading_2"/>
+ <bridgehead renderas="sect2">
+ <link linkend="quickbook.syntax.block.headings.heading_2">Heading 2</link>
+ </bridgehead>
+ <anchor id="quickbook.syntax.block.headings.heading_3"/>
+ <bridgehead renderas="sect3">
+ <link linkend="quickbook.syntax.block.headings.heading_3">Heading 3</link>
+ </bridgehead>
+ <anchor id="quickbook.syntax.block.headings.heading_4"/>
+ <bridgehead renderas="sect4">
+ <link linkend="quickbook.syntax.block.headings.heading_4">Heading 4</link>
+ </bridgehead>
+ <anchor id="quickbook.syntax.block.headings.heading_5"/>
+ <bridgehead renderas="sect5">
+ <link linkend="quickbook.syntax.block.headings.heading_5">Heading 5</link>
+ </bridgehead>
+ <anchor id="quickbook.syntax.block.headings.heading_6"/>
+ <bridgehead renderas="sect6">
+ <link linkend="quickbook.syntax.block.headings.heading_6">Heading 6</link>
+ </bridgehead>
+ <para>
+ Headings 1-3 [h1 h2 and h3] will automatically have anchors with normalized
+ names with <literal>name="section_id.normalized_header_text"</literal>
+ (i.e. valid characters are <literal>a-z</literal>, <literal>A-Z</literal>,
+ <literal>0-9</literal> and <literal>_</literal>. All non-valid characters
+ are converted to underscore and all upper-case are converted to lower-case.
+ For example: Heading 1 in section Section 2 will be normalized to <literal>section_2.heading_1</literal>).
+ You can use:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[link section_id.normalized_header_text The link text]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- to link to them. See <link linkend="quickbook.syntax.phrase.anchor_links">Anchor
- links</link> and <link linkend="quickbook.syntax.block.section">Section</link>
- for more info.
- </para>
- </section>
- <section id="quickbook.syntax.block.generic_heading">
- <title><link linkend="quickbook.syntax.block.generic_heading">Generic
- Heading</link></title>
- <para>
- In cases when you don't want to care about the heading level (1 to
- 6), you can use the <emphasis>Generic Heading</emphasis>:
- </para>
-
+ <para>
+ to link to them. See <link linkend="quickbook.syntax.phrase.anchor_links">Anchor
+ links</link> and <link linkend="quickbook.syntax.block.section">Section</link>
+ for more info.
+ </para>
+ </section>
+ <section id="quickbook.syntax.block.generic_heading">
+ <title><link linkend="quickbook.syntax.block.generic_heading">Generic Heading</link></title>
+ <para>
+ In cases when you don't want to care about the heading level (1 to 6),
+ you can use the <emphasis>Generic Heading</emphasis>:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[heading Heading]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- The <emphasis>Generic Heading</emphasis> assumes the level, plus
- one, of the innermost section where it is placed. For example, if
- it is placed in the outermost section, then, it assumes <emphasis>h2</emphasis>.
- </para>
- <para>
- Headings are often used as an alternative to sections. It is used
- particularly if you do not want to start a new section. In many cases,
- however, headings in a particular section is just flat. Example:
- </para>
-
+ <para>
+ The <emphasis>Generic Heading</emphasis> assumes the level, plus one, of
+ the innermost section where it is placed. For example, if it is placed
+ in the outermost section, then, it assumes <emphasis>h2</emphasis>.
+ </para>
+ <para>
+ Headings are often used as an alternative to sections. It is used particularly
+ if you do not want to start a new section. In many cases, however, headings
+ in a particular section is just flat. Example:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[section A]
[h2 X]
[h2 Y]
[h2 Z]
[endsect]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- Here we use h2 assuming that section A is the outermost level. If
- it is placed in an inner level, you'll have to use h3, h4, etc. depending
- on where the section is. In general, it is the section level plus
- one. It is rather tedious, however, to scan the section level everytime.
- If you rewrite the example above as shown below, this will be automatic:
- </para>
-
+ <para>
+ Here we use h2 assuming that section A is the outermost level. If it is
+ placed in an inner level, you'll have to use h3, h4, etc. depending on
+ where the section is. In general, it is the section level plus one. It
+ is rather tedious, however, to scan the section level everytime. If you
+ rewrite the example above as shown below, this will be automatic:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[section A]
[heading X]
[heading Y]
[heading Z]
[endsect]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- They work well regardless where you place them. You can rearrange
- sections at will without any extra work to ensure correct heading
- levels. In fact, with <emphasis>section</emphasis> and <emphasis>heading</emphasis>,
- you have all you need. <emphasis>h1</emphasis>..<emphasis>h6</emphasis>
- becomes redundant. <emphasis>h1</emphasis>..<emphasis>h6</emphasis>
- might be deprecated in the future.
- </para>
- </section>
- <section id="quickbook.syntax.block.macros">
- <title><link linkend="quickbook.syntax.block.macros">Macros</link></title>
-
+ <para>
+ They work well regardless where you place them. You can rearrange sections
+ at will without any extra work to ensure correct heading levels. In fact,
+ with <emphasis>section</emphasis> and <emphasis>heading</emphasis>, you
+ have all you need. <emphasis>h1</emphasis>..<emphasis>h6</emphasis> becomes
+ redundant. <emphasis>h1</emphasis>..<emphasis>h6</emphasis> might be deprecated
+ in the future.
+ </para>
+ </section>
+ <section id="quickbook.syntax.block.macros">
+ <title><link linkend="quickbook.syntax.block.macros">Macros</link></title>
+
<programlisting><!--quickbook-escape-prefix-->[def macro_identifier some text]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- When a macro is defined, the identifier replaces the text anywhere
- in the file, in paragraphs, in markups, etc. macro_identifier is
- a string of non- white space characters except ']'. A macro may not
- follow an alphabetic character or the underscore. The replacement
- text can be any phrase (even marked up). Example:
- </para>
-
-<programlisting><!--quickbook-escape-prefix-->[def sf_logo [$http://sourceforge.net/sflogo.php?group_id=28447&type=1]]
+ <para>
+ When a macro is defined, the identifier replaces the text anywhere in the
+ file, in paragraphs, in markups, etc. macro_identifier is a string of non-
+ white space characters except ']'. A macro may not follow an alphabetic
+ character or the underscore. The replacement text can be any phrase (even
+ marked up). Example:
+ </para>
+
+<programlisting><!--quickbook-escape-prefix-->[def sf_logo [$http://sourceforge.net/sflogo.php?group_id=28447&type=1]]
sf_logo
<!--quickbook-escape-postfix--></programlisting>
+ <para>
+ Now everywhere the sf_logo is placed, the picture will be inlined.
+ </para>
+ <para>
+ <inlinemediaobject><imageobject><imagedata fileref="http://sourceforge.net/sflogo.php?group_id=28447&type=1"></imagedata></imageobject>
+ <textobject>
+ <phrase>sflogo</phrase>
+ </textobject>
+ </inlinemediaobject>
+ </para>
+ <tip>
+ <para>
+ It's a good idea to use macro identifiers that are distinguishable. For
+ instance, in this document, macro identifiers have two leading and trailing
+ underscores (e.g. <literal>__spirit__</literal>). The reason is to avoid unwanted
+ macro replacement.
+ </para>
+ </tip>
+ <para>
+ Links (URLS) and images are good candidates for macros. <emphasis role="bold">1</emphasis>)
+ They tend to change a lot. It is a good idea to place all links and images
+ in one place near the top to make it easy to make changes. <emphasis role="bold">2</emphasis>)
+ The syntax is not pretty. It's easier to read and write, e.g. <literal>__spirit__</literal>
+ than <literal>[@http://spirit.sourceforge.net Spirit]</literal>.
+ </para>
+ <para>
+ Some more examples:
+ </para>
+
+<programlisting><!--quickbook-escape-prefix-->[def :-) [$theme/smiley.png]]
+[def __spirit__ [@http://spirit.sourceforge.net Spirit]]
+<!--quickbook-escape-postfix--></programlisting>
+ <para>
+ (See <link linkend="quickbook.syntax.phrase.images">Images</link> and
+ <link linkend="quickbook.syntax.phrase.links">Links</link>)
+ </para>
+ <para>
+ Invoking these macros:
+ </para>
+
+<programlisting><!--quickbook-escape-prefix-->Hi __spirit__ :-)
+<!--quickbook-escape-postfix--></programlisting>
+ <para>
+ will generate this:
+ </para>
+ <para>
+ Hi <ulink url="http://spirit.sourceforge.net">Spirit</ulink> <inlinemediaobject><imageobject><imagedata
+ fileref="images/smiley.png"></imagedata></imageobject>
+ <textobject>
+ <phrase>smiley</phrase>
+ </textobject>
+ </inlinemediaobject>
+ </para>
+ </section>
+ <section id="quickbook.syntax.block.predefined_macros">
+ <title><link linkend="quickbook.syntax.block.predefined_macros">Predefined
+ Macros</link></title>
+ <para>
+ Quickbook has some predefined macros that you can already use.
+ </para>
+ <table frame="all"> <title>Predefined Macros</title>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>
<para>
- Now everywhere the sf_logo is placed, the picture will be inlined.
+ Macro
</para>
+ </entry><entry>
<para>
- <inlinemediaobject><imageobject><imagedata fileref="http://sourceforge.net/sflogo.php?group_id=28447&type=1"></imagedata></imageobject>
- <textobject>
- <phrase>sflogo</phrase>
- </textobject>
- </inlinemediaobject>
- </para>
- <tip>
- <para>
- It's a good idea to use macro identifiers that are distinguishable.
- For instance, in this document, macro identifiers have two leading
- and trailing underscores (e.g. <literal>__spirit__</literal>). The reason
- is to avoid unwanted macro replacement.
- </para>
- </tip>
- <para>
- Links (URLS) and images are good candidates for macros. <emphasis
- role="bold">1</emphasis>) They tend to change a lot. It is a good
- idea to place all links and images in one place near the top to make
- it easy to make changes. <emphasis role="bold">2</emphasis>) The
- syntax is not pretty. It's easier to read and write, e.g. <literal>__spirit__</literal>
- than <literal>[@http://spirit.sourceforge.net Spirit]</literal>.
+ Meaning
</para>
+ </entry><entry>
<para>
- Some more examples:
+ Example
</para>
-
-<programlisting><!--quickbook-escape-prefix-->[def :-) [$theme/smiley.png]]
-[def __spirit__ [@http://spirit.sourceforge.net Spirit]]
-<!--quickbook-escape-postfix--></programlisting>
+ </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>
<para>
- (See <link linkend="quickbook.syntax.phrase.images">Images</link>
- and <link linkend="quickbook.syntax.phrase.links">Links</link>)
+ __DATE__
</para>
+ </entry><entry>
<para>
- Invoking these macros:
+ Today's date
</para>
-
-<programlisting><!--quickbook-escape-prefix-->Hi __spirit__ :-)
-<!--quickbook-escape-postfix--></programlisting>
+ </entry><entry>
+ <para>
+ 2000-Dec-20
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ __TIME__
+ </para>
+ </entry><entry>
+ <para>
+ The current time
+ </para>
+ </entry><entry>
+ <para>
+ 12:00:00 PM
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
<para>
- will generate this:
+ __FILENAME__
</para>
+ </entry><entry>
<para>
- Hi <ulink url="http://spirit.sourceforge.net">Spirit</ulink> <inlinemediaobject><imageobject><imagedata
- fileref="images/smiley.png"></imagedata></imageobject>
- <textobject>
- <phrase>smiley</phrase>
- </textobject>
- </inlinemediaobject>
- </para>
- </section>
- <section id="quickbook.syntax.block.predefined_macros">
- <title><link linkend="quickbook.syntax.block.predefined_macros">Predefined
- Macros</link></title>
- <para>
- Quickbook has some predefined macros that you can already use.
- </para>
- <table frame="all"> <title>Predefined Macros</title>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>
- <para>
- Macro
- </para>
- </entry><entry>
- <para>
- Meaning
- </para>
- </entry><entry>
- <para>
- Example
- </para>
- </entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>
- <para>
- __DATE__
- </para>
- </entry><entry>
- <para>
- Today's date
- </para>
- </entry><entry>
- <para>
- 2000-Dec-20
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- __TIME__
- </para>
- </entry><entry>
- <para>
- The current time
- </para>
- </entry><entry>
- <para>
- 12:00:00 PM
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- __FILENAME__
- </para>
- </entry><entry>
- <para>
- Quickbook source filename
- </para>
- </entry><entry>
- <para>
- NO_FILENAME_MACRO_GENERATED_IN_DEBUG_MODE
- </para>
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </section>
- <section id="quickbook.syntax.block.templates">
- <title><link linkend="quickbook.syntax.block.templates">Templates</link></title>
- <para>
- Templates provide a more versatile text substitution mechanism. Templates
- come in handy when you need to create parameterizable, multi-line,
- boilerplate text that you specify once and expand many times. Templates
- accept one or more arguments. These arguments act like place-holders
- for text replacement. Unlike simple macros, which are limited to
- phrase level markup, templates can contain block level markup (e.g.
- paragraphs, code blocks and tables).
+ Quickbook source filename
</para>
+ </entry><entry>
<para>
- Example template:
+ NO_FILENAME_MACRO_GENERATED_IN_DEBUG_MODE
</para>
-
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+ <section id="quickbook.syntax.block.templates">
+ <title><link linkend="quickbook.syntax.block.templates">Templates</link></title>
+ <para>
+ Templates provide a more versatile text substitution mechanism. Templates
+ come in handy when you need to create parameterizable, multi-line, boilerplate
+ text that you specify once and expand many times. Templates accept one
+ or more arguments. These arguments act like place-holders for text replacement.
+ Unlike simple macros, which are limited to phrase level markup, templates
+ can contain block level markup (e.g. paragraphs, code blocks and tables).
+ </para>
+ <para>
+ Example template:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[template person[name age what]
Hi, my name is [name]. I am [age] years old. I am a [what].
]
<!--quickbook-escape-postfix--></programlisting>
- <anchor id="quickbook.syntax.block.templates.template_identifier"/>
- <bridgehead renderas="sect5">
- <link linkend="quickbook.syntax.block.templates.template_identifier">Template
- Identifier</link>
- </bridgehead>
- <para>
- Template identifiers can either consist of:
- </para>
- <itemizedlist>
- <listitem>
- An initial alphabetic character or the underscore, followed by
- zero or more alphanumeric characters or the underscore. This is
- similar to your typical C/C++ identifier.
- </listitem>
- <listitem>
- A single character punctuation (a non-alphanumeric printable character)
- </listitem>
- </itemizedlist>
- <anchor id="quickbook.syntax.block.templates.formal_template_arguments"/>
- <bridgehead renderas="sect5">
- <link linkend="quickbook.syntax.block.templates.formal_template_arguments">Formal
- Template Arguments</link>
- </bridgehead>
- <para>
- Template formal arguments are identifiers consisting of an initial
- alphabetic character or the underscore, followed by zero or more
- alphanumeric characters or the underscore. This is similar to your
- typical C/C++ identifier.
- </para>
- <para>
- A template formal argument temporarily hides a template of the same
- name at the point where the <link linkend="quickbook.syntax.block.templates.template_expansion">template
- is expanded</link>. Note that the body of the <literal>person</literal>
- template above refers to <literal>name</literal> <literal>age</literal>
- and <literal>what</literal> as <literal>[name]</literal> <literal>[age]</literal>
- and <literal>[what]</literal>. <literal>name</literal> <literal>age</literal>
- and <literal>what</literal> are actually templates that exist in
- the duration of the template call.
- </para>
- <anchor id="quickbook.syntax.block.templates.template_body"/>
- <bridgehead renderas="sect5">
- <link linkend="quickbook.syntax.block.templates.template_body">Template
- Body</link>
- </bridgehead>
- <para>
- The template body can be just about any QuickBook block or phrase.
- There are actually two forms. Templates may be phrase or block level.
- Phrase templates are of the form:
- </para>
-
+ <anchor id="quickbook.syntax.block.templates.template_identifier"/>
+ <bridgehead renderas="sect5">
+ <link linkend="quickbook.syntax.block.templates.template_identifier">Template
+ Identifier</link>
+ </bridgehead>
+ <para>
+ Template identifiers can either consist of:
+ </para>
+ <itemizedlist>
+ <listitem>
+ An initial alphabetic character or the underscore, followed by zero or
+ more alphanumeric characters or the underscore. This is similar to your
+ typical C/C++ identifier.
+ </listitem>
+ <listitem>
+ A single character punctuation (a non-alphanumeric printable character)
+ </listitem>
+ </itemizedlist>
+ <anchor id="quickbook.syntax.block.templates.formal_template_arguments"/>
+ <bridgehead renderas="sect5">
+ <link linkend="quickbook.syntax.block.templates.formal_template_arguments">Formal
+ Template Arguments</link>
+ </bridgehead>
+ <para>
+ Template formal arguments are identifiers consisting of an initial alphabetic
+ character or the underscore, followed by zero or more alphanumeric characters
+ or the underscore. This is similar to your typical C/C++ identifier.
+ </para>
+ <para>
+ A template formal argument temporarily hides a template of the same name
+ at the point where the <link linkend="quickbook.syntax.block.templates.template_expansion">template
+ is expanded</link>. Note that the body of the <literal>person</literal>
+ template above refers to <literal>name</literal> <literal>age</literal>
+ and <literal>what</literal> as <literal>[name]</literal> <literal>[age]</literal>
+ and <literal>[what]</literal>. <literal>name</literal> <literal>age</literal>
+ and <literal>what</literal> are actually templates that exist in the duration
+ of the template call.
+ </para>
+ <anchor id="quickbook.syntax.block.templates.template_body"/>
+ <bridgehead renderas="sect5">
+ <link linkend="quickbook.syntax.block.templates.template_body">Template
+ Body</link>
+ </bridgehead>
+ <para>
+ The template body can be just about any QuickBook block or phrase. There
+ are actually two forms. Templates may be phrase or block level. Phrase
+ templates are of the form:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[template sample[arg1 arg2...argN] replacement text... ]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- Block templates are of the form:
- </para>
-
+ <para>
+ Block templates are of the form:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[template sample[arg1 arg2...argN]
replacement text...
]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- The basic rule is as follows: if a newline immediately follows the
- argument list, then it is a block template, otherwise, it is a phrase
- template. Phrase templates are typically expanded as part of phrases.
- Like macros, block level elements are not allowed in phrase templates.
- </para>
- <anchor id="quickbook.syntax.block.templates.template_expansion"/>
- <bridgehead renderas="sect5">
- <link linkend="quickbook.syntax.block.templates.template_expansion">Template
- Expansion</link>
- </bridgehead>
- <para>
- You expand a template this way:
- </para>
-
+ <para>
+ The basic rule is as follows: if a newline immediately follows the argument
+ list, then it is a block template, otherwise, it is a phrase template.
+ Phrase templates are typically expanded as part of phrases. Like macros,
+ block level elements are not allowed in phrase templates.
+ </para>
+ <anchor id="quickbook.syntax.block.templates.template_expansion"/>
+ <bridgehead renderas="sect5">
+ <link linkend="quickbook.syntax.block.templates.template_expansion">Template
+ Expansion</link>
+ </bridgehead>
+ <para>
+ You expand a template this way:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[template_identifier arg1..arg2..arg3]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- At template expansion, you supply the actual arguments. The template
- will be expanded with your supplied arguments. Example:
- </para>
-
+ <para>
+ At template expansion, you supply the actual arguments. The template will
+ be expanded with your supplied arguments. Example:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[person James Bond..39..Spy]
[person Santa Clause..87..Big Red Fatso]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- Which will expand to:
- </para>
- <para>
- <para>
- Hi, my name is James Bond. I am 39 years old. I am a Spy.
- </para>
- <para>
- Hi, my name is Santa Clause. I am 87 years old. I am a Big Red
- Fatso.
- </para>
- </para>
- <caution>
- <para>
- A word of caution: Templates are recursive. A template can call
- another template or even itself, directly or indirectly. There
- are no control structures in QuickBook (yet) so this will always
- mean infinite recursion. QuickBook can detect this situation and
- report an error if recursion exceeds a certain limit.
- </para>
- </caution>
- <para>
- Each actual argument can be a word, a text fragment or just about
- any <link linkend="quickbook.syntax.phrase">QuickBook phrase</link>.
- Arguments are separated by the double dot <literal>".."</literal>
- and terminated by the close parenthesis.
- </para>
- <anchor id="quickbook.syntax.block.templates.nullary_templates"/>
- <bridgehead renderas="sect5">
- <link linkend="quickbook.syntax.block.templates.nullary_templates">Nullary
- Templates</link>
- </bridgehead>
- <para>
- Nullary templates look and act like simple macros. Example:
- </para>
-
+ <para>
+ Which will expand to:
+ </para>
+ <para>
+ <para>
+ Hi, my name is James Bond. I am 39 years old. I am a Spy.
+ </para>
+ <para>
+ Hi, my name is Santa Clause. I am 87 years old. I am a Big Red Fatso.
+ </para>
+ </para>
+ <caution>
+ <para>
+ A word of caution: Templates are recursive. A template can call another
+ template or even itself, directly or indirectly. There are no control
+ structures in QuickBook (yet) so this will always mean infinite recursion.
+ QuickBook can detect this situation and report an error if recursion
+ exceeds a certain limit.
+ </para>
+ </caution>
+ <para>
+ Each actual argument can be a word, a text fragment or just about any
+ <link linkend="quickbook.syntax.phrase">QuickBook phrase</link>. Arguments
+ are separated by the double dot <literal>".."</literal> and terminated
+ by the close parenthesis.
+ </para>
+ <anchor id="quickbook.syntax.block.templates.nullary_templates"/>
+ <bridgehead renderas="sect5">
+ <link linkend="quickbook.syntax.block.templates.nullary_templates">Nullary
+ Templates</link>
+ </bridgehead>
+ <para>
+ Nullary templates look and act like simple macros. Example:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[template alpha[]'''&#945;''']
[template beta[]'''&#946;''']
<!--quickbook-escape-postfix--></programlisting>
- <para>
- Expanding:
- </para>
-
+ <para>
+ Expanding:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->Some squigles...[*[alpha][beta]]<!--quickbook-escape-postfix--></programlisting>
- <para>
- We have:
- </para>
- <para>
- Some squiggles...<emphasis role="bold">αβ</emphasis>
- </para>
- <para>
- The difference with macros are
- </para>
- <itemizedlist>
- <listitem>
- The explicit <link linkend="quickbook.syntax.block.templates.template_expansion">template
- expansion syntax</link>. This is an advantage because, now, we
- don't have to use obscure naming conventions like double underscores
- (e.g. __alpha__) to avoid unwanted macro replacement.
- </listitem>
- <listitem>
- The template is expanded at the point where it is invoked. A macro
- is expanded immediately at its point of declaration. This is subtle
- and can cause a slight difference in behavior especially if you
- refer to other macros and templates in the body.
- </listitem>
- </itemizedlist>
- <para>
- The empty brackets after the template identifier (<literal>alpha[]</literal>)
- indicates no arguments. If the template body does not look like a
- template argument list, we can elide the empty brackets. Example:
- </para>
-
+ <para>
+ We have:
+ </para>
+ <para>
+ Some squiggles...<emphasis role="bold">αβ</emphasis>
+ </para>
+ <para>
+ The difference with macros are
+ </para>
+ <itemizedlist>
+ <listitem>
+ The explicit <link linkend="quickbook.syntax.block.templates.template_expansion">template
+ expansion syntax</link>. This is an advantage because, now, we don't
+ have to use obscure naming conventions like double underscores (e.g.
+ __alpha__) to avoid unwanted macro replacement.
+ </listitem>
+ <listitem>
+ The template is expanded at the point where it is invoked. A macro is
+ expanded immediately at its point of declaration. This is subtle and
+ can cause a slight difference in behavior especially if you refer to
+ other macros and templates in the body.
+ </listitem>
+ </itemizedlist>
+ <para>
+ The empty brackets after the template identifier (<literal>alpha[]</literal>)
+ indicates no arguments. If the template body does not look like a template
+ argument list, we can elide the empty brackets. Example:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[template aristotle_quote Aristotle: [*['Education is the best provision
for the journey to old age.]]]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- Expanding:
- </para>
-
+ <para>
+ Expanding:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->Here's a quote from [aristotle_quote].
<!--quickbook-escape-postfix--></programlisting>
- <para>
- We have:
- </para>
- <para>
- Here's a quote from Aristotle: <emphasis role="bold"><emphasis>Education
- is the best provision for the journey to old age.</emphasis></emphasis>.
- </para>
- <para>
- The disadvantage is that you can't avoid the space between the template
- identifier, <code><phrase role="identifier">aristotle_quote</phrase></code>,
- and the template body "Aristotle...". This space will be
- part of the template body. If that space is unwanted, use empty brackets
- or use the space escape: "<code><phrase role="special">\</phrase>
- </code>". Example:
- </para>
-
+ <para>
+ We have:
+ </para>
+ <para>
+ Here's a quote from Aristotle: <emphasis role="bold"><emphasis>Education
+ is the best provision for the journey to old age.</emphasis></emphasis>.
+ </para>
+ <para>
+ The disadvantage is that you can't avoid the space between the template
+ identifier, <code><phrase role="identifier">aristotle_quote</phrase></code>,
+ and the template body "Aristotle...". This space will be part
+ of the template body. If that space is unwanted, use empty brackets or
+ use the space escape: "<code><phrase role="special">\</phrase> </code>".
+ Example:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[template tag\ _tag]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- Then expanding:
- </para>
-
+ <para>
+ Then expanding:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->`struct` x[tag];
<!--quickbook-escape-postfix--></programlisting>
- <para>
- We have:
- </para>
- <para>
- <code><phrase role="keyword">struct</phrase></code> x_tag;
- </para>
- <para>
- You have a couple of ways to do it. I personally prefer the explicit
- empty brackets, though.
- </para>
- <anchor id="quickbook.syntax.block.templates.simple_arguments"/>
- <bridgehead renderas="sect5">
- <link linkend="quickbook.syntax.block.templates.simple_arguments">Simple
- Arguments</link>
- </bridgehead>
- <para>
- As mentioned, arguments are separated by the double dot <literal>".."</literal>.
- If there are less arguments passed than expected, QuickBook attempts
- to break the last argument into two or more arguments following this
- logic:
- </para>
- <itemizedlist>
- <listitem>
- Break the last argument into two, at the first space found (<literal>'',
- '\n', \t' or '\r'</literal>).
- </listitem>
- <listitem>
- Repeat until there are enough arguments or if there are no more
- spaces found (in which case, an error is reported).
- </listitem>
- </itemizedlist>
- <para>
- For example:
- </para>
-
+ <para>
+ We have:
+ </para>
+ <para>
+ <code><phrase role="keyword">struct</phrase></code> x_tag;
+ </para>
+ <para>
+ You have a couple of ways to do it. I personally prefer the explicit empty
+ brackets, though.
+ </para>
+ <anchor id="quickbook.syntax.block.templates.simple_arguments"/>
+ <bridgehead renderas="sect5">
+ <link linkend="quickbook.syntax.block.templates.simple_arguments">Simple
+ Arguments</link>
+ </bridgehead>
+ <para>
+ As mentioned, arguments are separated by the double dot <literal>".."</literal>.
+ If there are less arguments passed than expected, QuickBook attempts to
+ break the last argument into two or more arguments following this logic:
+ </para>
+ <itemizedlist>
+ <listitem>
+ Break the last argument into two, at the first space found (<literal>'',
+ '\n', \t' or '\r'</literal>).
+ </listitem>
+ <listitem>
+ Repeat until there are enough arguments or if there are no more spaces
+ found (in which case, an error is reported).
+ </listitem>
+ </itemizedlist>
+ <para>
+ For example:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[template simple[a b c d] [a][b][c][d]]
[simple w x y z]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- will produce:
- </para>
- <para>
- wxyz
- </para>
- <para>
- "w x y z" is initially treated as a single argument because
- we didn't supply any <literal>".."</literal> separators.
- However, since <literal>simple</literal> expects 4 arguments, "w
- x y z" is broken down iteratively (applying the logic above)
- until we have "w", "x", "y" and "z".
- </para>
- <para>
- QuickBook only tries to get the arguments it needs. For example:
- </para>
-
+ <para>
+ will produce:
+ </para>
+ <para>
+ wxyz
+ </para>
+ <para>
+ "w x y z" is initially treated as a single argument because we
+ didn't supply any <literal>".."</literal> separators. However,
+ since <literal>simple</literal> expects 4 arguments, "w x y z"
+ is broken down iteratively (applying the logic above) until we have "w",
+ "x", "y" and "z".
+ </para>
+ <para>
+ QuickBook only tries to get the arguments it needs. For example:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[simple w x y z trail]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- will produce:
- </para>
- <para>
- wxyz trail
- </para>
- <para>
- The arguments being: "w", "x", "y"
- and "z trail".
- </para>
- <para>
- It should be obvious now that for simple arguments with no spaces,
- we can get by without separating the arguments with <literal>".."</literal>
- separators. It is possible to combine <literal>".."</literal>
- separators with the argument passing simplification presented above.
- Example:
- </para>
-
-<programlisting><!--quickbook-escape-prefix-->[simple what do you think ..m a n?]
-<!--quickbook-escape-postfix--></programlisting>
- <para>
- will produce:
- </para>
- <para>
- what do you think man?
- </para>
- <anchor id="quickbook.syntax.block.templates.punctuation_templates"/>
- <bridgehead renderas="sect5">
- <link linkend="quickbook.syntax.block.templates.punctuation_templates">Punctuation
- Templates</link>
- </bridgehead>
- <para>
- With templates, one of our objectives is to allow us to rewrite QuickBook
- in QuickBook (as a qbk library). For that to happen, we need to accommodate
- single character punctuation templates which are fairly common in
- QuickBook. You might have noticed that single character punctuations
- are allowed as <link linkend="quickbook.syntax.block.templates.template_identifier">template
- identifiers</link>. Example:
- </para>
-
+ <para>
+ will produce:
+ </para>
+ <para>
+ wxyz trail
+ </para>
+ <para>
+ The arguments being: "w", "x", "y" and "z
+ trail".
+ </para>
+ <para>
+ It should be obvious now that for simple arguments with no spaces, we can
+ get by without separating the arguments with <literal>".."</literal>
+ separators. It is possible to combine <literal>".."</literal>
+ separators with the argument passing simplification presented above. Example:
+ </para>
+
+<programlisting><!--quickbook-escape-prefix-->[simple what do you think ..m a n?]
+<!--quickbook-escape-postfix--></programlisting>
+ <para>
+ will produce:
+ </para>
+ <para>
+ what do you think man?
+ </para>
+ <anchor id="quickbook.syntax.block.templates.punctuation_templates"/>
+ <bridgehead renderas="sect5">
+ <link linkend="quickbook.syntax.block.templates.punctuation_templates">Punctuation
+ Templates</link>
+ </bridgehead>
+ <para>
+ With templates, one of our objectives is to allow us to rewrite QuickBook
+ in QuickBook (as a qbk library). For that to happen, we need to accommodate
+ single character punctuation templates which are fairly common in QuickBook.
+ You might have noticed that single character punctuations are allowed as
+ <link linkend="quickbook.syntax.block.templates.template_identifier">template
+ identifiers</link>. Example:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[template ![bar] <!--quickbook-escape-postfix--><hey><!--quickbook-escape-prefix-->[bar]<!--quickbook-escape-postfix--></hey><!--quickbook-escape-prefix-->]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- Now, expanding this:
- </para>
-
+ <para>
+ Now, expanding this:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[!baz]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- We will have:
- </para>
-
+ <para>
+ We will have:
+ </para>
+
<programlisting><hey>baz</hey>
</programlisting>
- </section>
- <section id="quickbook.syntax.block.blurbs">
- <title><link linkend="quickbook.syntax.block.blurbs">Blurbs</link></title>
-
+ </section>
+ <section id="quickbook.syntax.block.blurbs">
+ <title><link linkend="quickbook.syntax.block.blurbs">Blurbs</link></title>
+
<programlisting><!--quickbook-escape-prefix-->[blurb :-) [*An eye catching advertisement or note...]
__spirit__ is an object-oriented recursive-descent parser generator framework
@@ -2110,35 +2082,35 @@
completely in C++.
]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- will generate this:
- </para>
- <sidebar role="blurb">
- <para>
- <inlinemediaobject><imageobject><imagedata fileref="images/smiley.png"></imagedata></imageobject>
- <textobject>
- <phrase>smiley</phrase>
- </textobject>
- </inlinemediaobject> <emphasis role="bold">An eye catching advertisement
- or note...</emphasis>
- </para>
- <para>
- <ulink url="http://spirit.sourceforge.net">Spirit</ulink> is an object-oriented
- recursive-descent parser generator framework implemented using template
- meta-programming techniques. Expression templates allow us to approximate
- the syntax of Extended Backus-Normal Form (EBNF) completely in C++.
- </para>
- </sidebar>
- <note>
- <para>
- Prefer <link linkend="quickbook.syntax.block.admonitions">admonitions</link>
- wherever appropriate.
- </para>
- </note>
- </section>
- <section id="quickbook.syntax.block.tables">
- <title><link linkend="quickbook.syntax.block.tables">Tables</link></title>
-
+ <para>
+ will generate this:
+ </para>
+ <sidebar role="blurb">
+ <para>
+ <inlinemediaobject><imageobject><imagedata fileref="images/smiley.png"></imagedata></imageobject>
+ <textobject>
+ <phrase>smiley</phrase>
+ </textobject>
+ </inlinemediaobject> <emphasis role="bold">An eye catching advertisement
+ or note...</emphasis>
+ </para>
+ <para>
+ <ulink url="http://spirit.sourceforge.net">Spirit</ulink> is an object-oriented
+ recursive-descent parser generator framework implemented using template
+ meta-programming techniques. Expression templates allow us to approximate
+ the syntax of Extended Backus-Normal Form (EBNF) completely in C++.
+ </para>
+ </sidebar>
+ <note>
+ <para>
+ Prefer <link linkend="quickbook.syntax.block.admonitions">admonitions</link>
+ wherever appropriate.
+ </para>
+ </note>
+ </section>
+ <section id="quickbook.syntax.block.tables">
+ <title><link linkend="quickbook.syntax.block.tables">Tables</link></title>
+
<programlisting><!--quickbook-escape-prefix-->[table A Simple Table
[[Heading 1] [Heading 2] [Heading 3]]
[[R0-C0] [R0-C1] [R0-C2]]
@@ -2146,85 +2118,85 @@
[[R2-C0] [R2-C1] [R2-C2]]
]
<!--quickbook-escape-postfix--></programlisting>
+ <para>
+ will generate:
+ </para>
+ <table frame="all"> <title>A Simple Table</title>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>
+ <para>
+ Heading 1
+ </para>
+ </entry><entry>
+ <para>
+ Heading 2
+ </para>
+ </entry><entry>
+ <para>
+ Heading 3
+ </para>
+ </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>
+ <para>
+ R0-C0
+ </para>
+ </entry><entry>
+ <para>
+ R0-C1
+ </para>
+ </entry><entry>
+ <para>
+ R0-C2
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
<para>
- will generate:
+ R2-C0
</para>
- <table frame="all"> <title>A Simple Table</title>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>
- <para>
- Heading 1
- </para>
- </entry><entry>
- <para>
- Heading 2
- </para>
- </entry><entry>
- <para>
- Heading 3
- </para>
- </entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>
- <para>
- R0-C0
- </para>
- </entry><entry>
- <para>
- R0-C1
- </para>
- </entry><entry>
- <para>
- R0-C2
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- R2-C0
- </para>
- </entry><entry>
- <para>
- R2-C1
- </para>
- </entry><entry>
- <para>
- R2-C2
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- R3-C0
- </para>
- </entry><entry>
- <para>
- R3-C1
- </para>
- </entry><entry>
- <para>
- R3-C2
- </para>
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <para>
- The table title is optional. The first row of the table is automatically
- treated as the table header; that is, it is wrapped in <literal><thead>...</thead></literal>
- XML tags. Note that unlike the original QuickDoc, the columns are
- nested in [ cells... ]. The syntax is free-format and allows big
- cells to be formatted nicely. Example:
+ </entry><entry>
+ <para>
+ R2-C1
+ </para>
+ </entry><entry>
+ <para>
+ R2-C2
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ R3-C0
+ </para>
+ </entry><entry>
+ <para>
+ R3-C1
+ </para>
+ </entry><entry>
+ <para>
+ R3-C2
</para>
-
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <para>
+ The table title is optional. The first row of the table is automatically
+ treated as the table header; that is, it is wrapped in <literal><thead>...</thead></literal>
+ XML tags. Note that unlike the original QuickDoc, the columns are nested
+ in [ cells... ]. The syntax is free-format and allows big cells to be formatted
+ nicely. Example:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[table Table with fat cells
[[Heading 1] [Heading 2]]
[
@@ -2246,63 +2218,63 @@
]
]
<!--quickbook-escape-postfix--></programlisting>
+ <para>
+ and thus:
+ </para>
+ <table frame="all"> <title>Table with fat cells</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>
+ <para>
+ Heading 1
+ </para>
+ </entry><entry>
+ <para>
+ Heading 2
+ </para>
+ </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>
+ <para>
+ Row 0, Col 0: a small cell
+ </para>
+ </entry><entry>
+ <para>
+ Row 0, Col 1: a big fat cell with paragraphs
+ </para>
+ <para>
+ Boost provides free peer-reviewed portable C++ source libraries.
+ </para>
+ <para>
+ We emphasize libraries that work well with the C++ Standard Library.
+ Boost libraries are intended to be widely useful, and usable across
+ a broad spectrum of applications. The Boost license encourages both
+ commercial and non-commercial use.
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
<para>
- and thus:
+ Row 1, Col 0: a small cell
</para>
- <table frame="all"> <title>Table with fat cells</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>
- <para>
- Heading 1
- </para>
- </entry><entry>
- <para>
- Heading 2
- </para>
- </entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>
- <para>
- Row 0, Col 0: a small cell
- </para>
- </entry><entry>
- <para>
- Row 0, Col 1: a big fat cell with paragraphs
- </para>
- <para>
- Boost provides free peer-reviewed portable C++ source libraries.
- </para>
- <para>
- We emphasize libraries that work well with the C++ Standard
- Library. Boost libraries are intended to be widely useful,
- and usable across a broad spectrum of applications. The Boost
- license encourages both commercial and non-commercial use.
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- Row 1, Col 0: a small cell
- </para>
- </entry><entry>
- <para>
- Row 1, Col 1: a small cell
- </para>
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
+ </entry><entry>
<para>
- Here's how to have preformatted blocks of code in a table cell:
+ Row 1, Col 1: a small cell
</para>
-
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <para>
+ Here's how to have preformatted blocks of code in a table cell:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[table Table with code
[[Comment] [Code]]
[
@@ -2319,32 +2291,31 @@
]
]
<!--quickbook-escape-postfix--></programlisting>
- <table frame="all"> <title>Table with code</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>
- <para>
- Comment
- </para>
- </entry><entry>
- <para>
- Code
- </para>
- </entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>
- <para>
- My first program
- </para>
- </entry><entry>
- <para>
-
-<programlisting>
-<phrase role="preprocessor">#include</phrase> <phrase role="special"><</phrase><phrase role="identifier">iostream</phrase><phrase role="special">></phrase>
+ <table frame="all"> <title>Table with code</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>
+ <para>
+ Comment
+ </para>
+ </entry><entry>
+ <para>
+ Code
+ </para>
+ </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>
+ <para>
+ My first program
+ </para>
+ </entry><entry>
+ <para>
+
+<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special"><</phrase><phrase role="identifier">iostream</phrase><phrase role="special">></phrase>
<phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase>
<phrase role="special">{</phrase>
@@ -2352,381 +2323,361 @@
<phrase role="keyword">return</phrase> <phrase role="number">0</phrase><phrase role="special">;</phrase>
<phrase role="special">}</phrase>
</programlisting>
- </para>
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </section>
- <section id="quickbook.syntax.block.variable_lists">
- <title><link linkend="quickbook.syntax.block.variable_lists">Variable
- Lists</link></title>
+ </para>
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+ <section id="quickbook.syntax.block.variable_lists">
+ <title><link linkend="quickbook.syntax.block.variable_lists">Variable Lists</link></title>
+
<programlisting><!--quickbook-escape-prefix-->[variablelist A Variable List
[[term 1] [The definition of term 1]]
[[term 2] [The definition of term 2]]
[[term 3] [The definition of term 3]]
]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- will generate:
- </para>
- <variablelist>
- <title>A Variable List</title> <varlistentry><term>term 1</term>
- <listitem>
- <para>
- The definition of term 1
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>term 2</term>
- <listitem>
- <para>
- The definition of term 2
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>term 3</term>
- <listitem>
- <para>
- The definition of term 3
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- <para>
- The rules for variable lists are the same as for tables, except that
- only 2 "columns" are allowed. The first column contains
- the terms, and the second column contains the definitions. Those
- familiar with HTML will recognize this as a "definition list".
- </para>
- </section>
- <section id="quickbook.syntax.block.include">
- <title><link linkend="quickbook.syntax.block.include">Include</link></title>
- <para>
- You can include one QuickBook file from another. The syntax is simply:
- </para>
-
+ <para>
+ will generate:
+ </para>
+ <variablelist>
+ <title>A Variable List</title> <varlistentry><term>term 1</term>
+ <listitem>
+ <para>
+ The definition of term 1
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>term 2</term>
+ <listitem>
+ <para>
+ The definition of term 2
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>term 3</term>
+ <listitem>
+ <para>
+ The definition of term 3
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <para>
+ The rules for variable lists are the same as for tables, except that only
+ 2 "columns" are allowed. The first column contains the terms,
+ and the second column contains the definitions. Those familiar with HTML
+ will recognize this as a "definition list".
+ </para>
+ </section>
+ <section id="quickbook.syntax.block.include">
+ <title><link linkend="quickbook.syntax.block.include">Include</link></title>
+ <para>
+ You can include one QuickBook file from another. The syntax is simply:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[include someother.qbk]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- The included file will be processed as if it had been cut and pasted
- into the current document, with the following exceptions:
- </para>
- <itemizedlist>
- <listitem>
- The __FILENAME__ predefined macro will reflect the name of the file currently
- being processed.
- </listitem>
- <listitem>
- Any macros defined in the included file are scoped to that file.
- </listitem>
- </itemizedlist>
- <para>
- The <literal>[include]</literal> directive lets you specify a document
- id to use for the included file. When this id is not explicitly specified,
- the id defaults to the filename ("someother", in the example
- above). You can specify the id like this:
- </para>
-
+ <para>
+ The included file will be processed as if it had been cut and pasted into
+ the current document, with the following exceptions:
+ </para>
+ <itemizedlist>
+ <listitem>
+ The __FILENAME__ predefined macro will reflect the name of the file currently being
+ processed.
+ </listitem>
+ <listitem>
+ Any macros defined in the included file are scoped to that file.
+ </listitem>
+ </itemizedlist>
+ <para>
+ The <literal>[include]</literal> directive lets you specify a document
+ id to use for the included file. When this id is not explicitly specified,
+ the id defaults to the filename ("someother", in the example
+ above). You can specify the id like this:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[include:someid someother.qbk]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- All auto-generated anchors will use the document id as a unique prefix.
- So for instance, if there is a top section in someother.qbk named
- "Intro", the named anchor for that section will be "someid.intro",
- and you can link to it with <literal>[link someid.intro The Intro]</literal>.
- </para>
- </section>
- <section id="quickbook.syntax.block.import">
- <title><link linkend="quickbook.syntax.block.import">Import</link></title>
- <para>
- When documenting code, you'd surely need to present code from actual
- source files. While it is possible to copy some code and paste them
- in your QuickBook file, doing so is error prone and the extracted
- code in the documentation tends to get out of sync with the actual
- code as the code evolves. The problem, as always, is that once documentation
- is written, the tendency is for the docs to languish in the archives
- without maintenance.
- </para>
- <para>
- QuickBook's import facility provides a nice solution.
- </para>
- <anchor id="quickbook.syntax.block.import.example"/>
- <bridgehead renderas="sect5">
- <link linkend="quickbook.syntax.block.import.example">Example</link>
- </bridgehead>
- <para>
- You can effortlessly import code snippets from source code into your
- QuickBook. The following illustrates how this is done:
- </para>
-
+ <para>
+ All auto-generated anchors will use the document id as a unique prefix.
+ So for instance, if there is a top section in someother.qbk named "Intro",
+ the named anchor for that section will be "someid.intro", and
+ you can link to it with <literal>[link someid.intro The Intro]</literal>.
+ </para>
+ </section>
+ <section id="quickbook.syntax.block.import">
+ <title><link linkend="quickbook.syntax.block.import">Import</link></title>
+ <para>
+ When documenting code, you'd surely need to present code from actual source
+ files. While it is possible to copy some code and paste them in your QuickBook
+ file, doing so is error prone and the extracted code in the documentation
+ tends to get out of sync with the actual code as the code evolves. The
+ problem, as always, is that once documentation is written, the tendency
+ is for the docs to languish in the archives without maintenance.
+ </para>
+ <para>
+ QuickBook's import facility provides a nice solution.
+ </para>
+ <anchor id="quickbook.syntax.block.import.example"/>
+ <bridgehead renderas="sect5">
+ <link linkend="quickbook.syntax.block.import.example">Example</link>
+ </bridgehead>
+ <para>
+ You can effortlessly import code snippets from source code into your QuickBook.
+ The following illustrates how this is done:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[import ../test/stub.cpp]
[foo]
[bar]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- The first line:
- </para>
-
+ <para>
+ The first line:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[import ../test/stub.cpp]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- collects specially marked-up code snippets from <ulink url="../../test/stub.cpp">stub.cpp</ulink>
- and places them in your QuickBook file as virtual templates. Each
- of the specially marked-up code snippets has a name (e.g. <code><phrase
- role="identifier">foo</phrase></code> and <code><phrase role="identifier">bar</phrase></code>
- in the example above). This shall be the template identifier for
- that particular code snippet. The second and third line above does
- the actual template expansion:
- </para>
-
+ <para>
+ collects specially marked-up code snippets from <ulink url="../../test/stub.cpp">stub.cpp</ulink>
+ and places them in your QuickBook file as virtual templates. Each of the
+ specially marked-up code snippets has a name (e.g. <code><phrase role="identifier">foo</phrase></code>
+ and <code><phrase role="identifier">bar</phrase></code> in the example
+ above). This shall be the template identifier for that particular code
+ snippet. The second and third line above does the actual template expansion:
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->[foo]
[bar]
<!--quickbook-escape-postfix--></programlisting>
- <para>
- And the result is:
- </para>
- <para>
- <para>
- This is the <emphasis role="bold"><emphasis>foo</emphasis></emphasis>
- function.
- </para>
- <para>
- This description can have paragraphs...
- </para>
- <itemizedlist>
- <listitem>
- lists
- </listitem>
- <listitem>
- etc.
- </listitem>
- </itemizedlist>
- <para>
- And any quickbook block markup.
- </para>
- <para>
-
-<programlisting>
-<phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="identifier">foo</phrase><phrase role="special">()</phrase>
-<phrase role="special">{</phrase>
- <phrase role="comment">// return 'em, foo man!
-</phrase> <phrase role="keyword">return</phrase> <phrase role="string">"foo"</phrase><phrase role="special">;</phrase>
-<phrase role="special">}</phrase>
-</programlisting>
- </para>
- <para>
- <calloutlist></calloutlist>
- </para>
- <para>
- This is the <emphasis role="bold"><emphasis>bar</emphasis></emphasis>
- function
- </para>
- <para>
-
-<programlisting>
-<phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="identifier">bar</phrase><phrase role="special">()</phrase>
-<phrase role="special">{</phrase>
- <phrase role="comment">// return 'em, bar man!
-</phrase> <phrase role="keyword">return</phrase> <phrase role="string">"bar"</phrase><phrase role="special">;</phrase>
+ <para>
+ And the result is:
+ </para>
+ <para>
+ <para>
+ This is the <emphasis role="bold"><emphasis>foo</emphasis></emphasis>
+ function.
+ </para>
+ <para>
+ This description can have paragraphs...
+ </para>
+ <itemizedlist>
+ <listitem>
+ lists
+ </listitem>
+ <listitem>
+ etc.
+ </listitem>
+ </itemizedlist>
+ <para>
+ And any quickbook block markup.
+ </para>
+ <para>
+
+<programlisting><phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="identifier">foo</phrase><phrase role="special">()</phrase>
+<phrase role="special">{</phrase>
+ <phrase role="comment">// return 'em, foo man!
+</phrase> <phrase role="keyword">return</phrase> <phrase role="string">"foo"</phrase><phrase role="special">;</phrase>
+<phrase role="special">}</phrase>
+</programlisting>
+ </para>
+ <para>
+ This is the <emphasis role="bold"><emphasis>bar</emphasis></emphasis>
+ function
+ </para>
+ <para>
+
+<programlisting><phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="identifier">bar</phrase><phrase role="special">()</phrase>
+<phrase role="special">{</phrase>
+ <phrase role="comment">// return 'em, bar man!
+</phrase> <phrase role="keyword">return</phrase> <phrase role="string">"bar"</phrase><phrase role="special">;</phrase>
<phrase role="special">}</phrase></programlisting>
- </para>
- <para>
- Some trailing text here <calloutlist></calloutlist>
- </para>
- </para>
- <anchor id="quickbook.syntax.block.import.code_snippet_markup"/>
- <bridgehead renderas="sect5">
- <link linkend="quickbook.syntax.block.import.code_snippet_markup">Code
- Snippet Markup</link>
- </bridgehead>
- <para>
- Note how the code snippets in <ulink url="../../test/stub.cpp">stub.cpp</ulink>
- get marked up. We use distinguishable comments following the form:
- </para>
-
-<programlisting>
-<phrase role="comment">//[id
+ </para>
+ <para>
+ Some trailing text here
+ </para>
+ </para>
+ <anchor id="quickbook.syntax.block.import.code_snippet_markup"/>
+ <bridgehead renderas="sect5">
+ <link linkend="quickbook.syntax.block.import.code_snippet_markup">Code
+ Snippet Markup</link>
+ </bridgehead>
+ <para>
+ Note how the code snippets in <ulink url="../../test/stub.cpp">stub.cpp</ulink>
+ get marked up. We use distinguishable comments following the form:
+ </para>
+
+<programlisting><phrase role="comment">//[id
</phrase><phrase role="identifier">some</phrase> <phrase role="identifier">code</phrase> <phrase role="identifier">here</phrase>
<phrase role="comment">//]
</phrase></programlisting>
- <para>
- The first comment line above initiates a named code-snippet. This
- prefix will not be visible in quickbook. The entire code-snippet
- in between <code><phrase role="comment">//[id</phrase></code> and
- <code><phrase role="comment">//]</phrase></code> will be inserted
- as a template in quickbook with name <emphasis><emphasis>id</emphasis></emphasis>.
- The comment <code><phrase role="comment">//]</phrase></code> ends
- a code-snippet This too will not be visible in quickbook.
- </para>
- <anchor id="quickbook.syntax.block.import.special_comments"/>
- <bridgehead renderas="sect5">
- <link linkend="quickbook.syntax.block.import.special_comments">Special
- Comments</link>
- </bridgehead>
- <para>
- Special comments of the form:
- </para>
-
-<programlisting>
-<phrase role="comment">//` some [*quickbook] markup here
+ <para>
+ The first comment line above initiates a named code-snippet. This prefix
+ will not be visible in quickbook. The entire code-snippet in between <code><phrase
+ role="comment">//[id</phrase></code> and <code><phrase role="comment">//]</phrase></code>
+ will be inserted as a template in quickbook with name <emphasis><emphasis>id</emphasis></emphasis>.
+ The comment <code><phrase role="comment">//]</phrase></code> ends a code-snippet
+ This too will not be visible in quickbook.
+ </para>
+ <anchor id="quickbook.syntax.block.import.special_comments"/>
+ <bridgehead renderas="sect5">
+ <link linkend="quickbook.syntax.block.import.special_comments">Special
+ Comments</link>
+ </bridgehead>
+ <para>
+ Special comments of the form:
+ </para>
+
+<programlisting><phrase role="comment">//` some [*quickbook] markup here
</phrase></programlisting>
- <para>
- and:
- </para>
-
-<programlisting>
-<phrase role="comment">/*` some [*quickbook] markup here */</phrase>
+ <para>
+ and:
+ </para>
+
+<programlisting><phrase role="comment">/*` some [*quickbook] markup here */</phrase>
</programlisting>
- <para>
- will be parsed by QuickBook. This can contain quickbook <emphasis>blocks</emphasis>
- (e.g. sections, paragraphs, tables, etc). In the first case, the
- initial slash-slash, tick and white-space shall be ignored. In the
- second, the initial slash-star-tick and the final star-slash shall
- be ignored.
- </para>
- <anchor id="quickbook.syntax.block.import.callouts"/>
- <bridgehead renderas="sect5">
- <link linkend="quickbook.syntax.block.import.callouts">Callouts</link>
- </bridgehead>
- <para>
- Special comments of the form:
- </para>
-
-<programlisting>
-<phrase role="comment">/*< some [*quickbook] markup here >*/</phrase>
+ <para>
+ will be parsed by QuickBook. This can contain quickbook <emphasis>blocks</emphasis>
+ (e.g. sections, paragraphs, tables, etc). In the first case, the initial
+ slash-slash, tick and white-space shall be ignored. In the second, the
+ initial slash-star-tick and the final star-slash shall be ignored.
+ </para>
+ <anchor id="quickbook.syntax.block.import.callouts"/>
+ <bridgehead renderas="sect5">
+ <link linkend="quickbook.syntax.block.import.callouts">Callouts</link>
+ </bridgehead>
+ <para>
+ Special comments of the form:
+ </para>
+
+<programlisting><phrase role="comment">/*< some [*quickbook] markup here >*/</phrase>
</programlisting>
- <para>
- will be regarded as callouts. These will be collected, numbered and
- rendered as a "callout bug" (a small icon with a number).
- After the whole snippet is parsed, the callout list is generated.
- See <ulink url="http://www.docbook.org/tdg/en/html/callout.html">Callouts</ulink>
- for details. Example:
- </para>
- <para>
- <para>
-
-<programlisting>
-<phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="identifier">foo_bar</phrase><phrase role="special">()</phrase> <!--quickbook-escape-prefix--><phrase role="callout_bug"><co id="quickbook0co" linkends="quickbook0" /></phrase><!--quickbook-escape-postfix-->
+ <para>
+ will be regarded as callouts. These will be collected, numbered and rendered
+ as a "callout bug" (a small icon with a number). After the whole
+ snippet is parsed, the callout list is generated. See <ulink url="http://www.docbook.org/tdg/en/html/callout.html">Callouts</ulink>
+ for details. Example:
+ </para>
+ <para>
+ <para>
+
+<programlisting><phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="identifier">foo_bar</phrase><phrase role="special">()</phrase> <!--quickbook-escape-prefix--><phrase role="callout_bug"><co id="quickbook0co" linkends="quickbook0" /></phrase><!--quickbook-escape-postfix-->
<phrase role="special">{</phrase>
<phrase role="keyword">return</phrase> <phrase role="string">"foo-bar"</phrase><phrase role="special">;</phrase> <!--quickbook-escape-prefix--><phrase role="callout_bug"><co id="quickbook1co" linkends="quickbook1" /></phrase><!--quickbook-escape-postfix-->
<phrase role="special">}</phrase>
</programlisting>
- </para>
- <para>
- <calloutlist><callout arearefs="quickbook0co" id="quickbook0"><para> The <emphasis>Mythical</emphasis> FooBar. See <ulink url="http://en.wikipedia.org/wiki/Foobar">Foobar
- for details</ulink> </para></callout><callout arearefs="quickbook1co" id="quickbook1"><para> return 'em, foo-bar man! </para></callout></calloutlist>
- </para>
- </para>
- <para>
- Checkout <ulink url="../../test/stub.cpp">stub.cpp</ulink> to see
- the actual code.
- </para>
- </section>
- </section>
- </section>
- <section id="quickbook.install">
- <title><link linkend="quickbook.install"> Installation and configuration</link></title>
+ </para>
<para>
- This section provides some guidelines on how to install and configure
- BoostBook and Quickbook under several operating systems.
+ <calloutlist><callout arearefs="quickbook0co" id="quickbook0"><para> The <emphasis>Mythical</emphasis> FooBar. See <ulink url="http://en.wikipedia.org/wiki/Foobar">Foobar
+ for details</ulink> </para></callout><callout arearefs="quickbook1co" id="quickbook1"><para> return 'em, foo-bar man! </para></callout></calloutlist>
</para>
+ </para>
+ <para>
+ Checkout <ulink url="../../test/stub.cpp">stub.cpp</ulink> to see the actual
+ code.
+ </para>
+ </section>
+ </section>
+ </section>
+ <section id="quickbook.install">
+ <title><link linkend="quickbook.install"> Installation and configuration</link></title>
+ <para>
+ This section provides some guidelines on how to install and configure BoostBook
+ and Quickbook under several operating systems.
+ </para>
+ <para>
+ Before continuing, it is very important that you keep this in mind: if you
+ try to build some documents and the process breaks due to misconfiguration,
+ be absolutely sure to delete any <code><phrase role="identifier">bin</phrase></code>
+ and <code><phrase role="identifier">bin</phrase><phrase role="special">.</phrase><phrase
+ role="identifier">v2</phrase></code> directories generated by the build before
+ trying again. Otherwise your configuration fixes will not take any effect.
+ </para>
+ <section id="quickbook.install.windows">
+ <title><link linkend="quickbook.install.windows"> Windows 2000, XP, 2003, Vista</link></title>
+ <para>
+ </para>
+ <blockquote>
+ <para>
<para>
- Before continuing, it is very important that you keep this in mind: if
- you try to build some documents and the process breaks due to misconfiguration,
- be absolutely sure to delete any <code><phrase role="identifier">bin</phrase></code>
- and <code><phrase role="identifier">bin</phrase><phrase role="special">.</phrase><phrase
- role="identifier">v2</phrase></code> directories generated by the build
- before trying again. Otherwise your configuration fixes will not take
- any effect.
- </para>
- <section id="quickbook.install.windows">
- <title><link linkend="quickbook.install.windows"> Windows 2000, XP, 2003,
- Vista</link></title>
- <para>
- </para>
- <blockquote>
- <para>
- <para>
- <emphasis>Section contributed by Julio M. Merino Vidal</emphasis>
- </para>
- </para>
- </blockquote>
- <para>
- The following instructions apply to any Windows system based on Windows
- 2000, including Windows XP, Windows 2003 Server and Windows Vista.
- The paths shown below are taken from a Windows Vista machine; you will
- need to adjust them to match your system in case you are running an
- older version.
- </para>
- <orderedlist>
- <listitem>
- First of all you need to have a copy of <code><phrase role="identifier">xsltproc</phrase></code>
- for Windows. There are many ways to get this tool, but to keep things
- simple, use the <ulink url="http://www.zlatkovic.com/pub/libxml/">binary
- packages</ulink> made by Igor Zlatkovic. At the very least, you need
- to download the following packages: <code><phrase role="identifier">iconv</phrase></code>,
- <code><phrase role="identifier">zlib</phrase></code>, <code><phrase
- role="identifier">libxml2</phrase></code> and <code><phrase role="identifier">libxslt</phrase></code>.
- </listitem>
- <listitem>
- Unpack all these packages in the same directory so that you get unique
- <code><phrase role="identifier">bin</phrase></code>, <code><phrase
- role="identifier">include</phrase></code> and <code><phrase role="identifier">lib</phrase></code>
- directories within the hierarchy. These instructions use <code><phrase
- role="identifier">C</phrase><phrase role="special">:\</phrase><phrase
- role="identifier">Users</phrase><phrase role="special">\</phrase><phrase
- role="identifier">example</phrase><phrase role="special">\</phrase><phrase
- role="identifier">Documents</phrase><phrase role="special">\</phrase><phrase
- role="identifier">boost</phrase><phrase role="special">\</phrase><phrase
- role="identifier">xml</phrase></code> as the root for all files.
- </listitem>
- <listitem>
- From the command line, go to the <code><phrase role="identifier">bin</phrase></code>
- directory and launch <code><phrase role="identifier">xsltproc</phrase><phrase
- role="special">.</phrase><phrase role="identifier">exe</phrase></code>
- to ensure it works. You should get usage information on screen.
- </listitem>
- <listitem>
- Download <ulink url="http://www.docbook.org/xml/4.2/docbook-xml-4.2.zip">Docbook
- XML 4.2</ulink> and unpack it in the same directory used above. That
- is: <code><phrase role="identifier">C</phrase><phrase role="special">:\</phrase><phrase
- role="identifier">Users</phrase><phrase role="special">\</phrase><phrase
- role="identifier">example</phrase><phrase role="special">\</phrase><phrase
- role="identifier">Documents</phrase><phrase role="special">\</phrase><phrase
- role="identifier">boost</phrase><phrase role="special">\</phrase><phrase
- role="identifier">xml</phrase><phrase role="special">\</phrase><phrase
- role="identifier">docbook</phrase><phrase role="special">-</phrase><phrase
- role="identifier">xml</phrase></code>.
- </listitem>
- <listitem>
- Download the latest <ulink url="http://sourceforge.net/project/showfiles.php?group_id=21935&package_id=16608">Docbook
- XSL</ulink> version and unpack it, again in the same directory used
- before. To make things easier, rename the directory created during
- the extraction to <code><phrase role="identifier">docbook</phrase><phrase
- role="special">-</phrase><phrase role="identifier">xsl</phrase></code>
- (bypassing the version name): <code><phrase role="identifier">C</phrase><phrase
- role="special">:\</phrase><phrase role="identifier">Users</phrase><phrase
- role="special">\</phrase><phrase role="identifier">example</phrase><phrase
- role="special">\</phrase><phrase role="identifier">Documents</phrase><phrase
- role="special">\</phrase><phrase role="identifier">boost</phrase><phrase
- role="special">\</phrase><phrase role="identifier">xml</phrase><phrase
- role="special">\</phrase><phrase role="identifier">docbook</phrase><phrase
- role="special">-</phrase><phrase role="identifier">xsl</phrase></code>.
- </listitem>
- <listitem>
- Add the following to your <code><phrase role="identifier">user</phrase><phrase
- role="special">-</phrase><phrase role="identifier">config</phrase><phrase
- role="special">.</phrase><phrase role="identifier">jam</phrase></code>
- file, which should live in your home directory (<code><phrase role="special">%</phrase><phrase
- role="identifier">HOMEDRIVE</phrase><phrase role="special">%%</phrase><phrase
- role="identifier">HOMEPATH</phrase><phrase role="special">%</phrase></code>).
- You must already have it somewhere or otherwise you could not be
- building Boost (i.e. missing tools configuration).
- </listitem>
- </orderedlist>
-
-<programlisting>
-<phrase role="identifier">using</phrase> <phrase role="identifier">xsltproc</phrase>
+ <emphasis>Section contributed by Julio M. Merino Vidal</emphasis>
+ </para>
+ </para>
+ </blockquote>
+ <para>
+ The following instructions apply to any Windows system based on Windows 2000,
+ including Windows XP, Windows 2003 Server and Windows Vista. The paths shown
+ below are taken from a Windows Vista machine; you will need to adjust them
+ to match your system in case you are running an older version.
+ </para>
+ <orderedlist>
+ <listitem>
+ First of all you need to have a copy of <code><phrase role="identifier">xsltproc</phrase></code>
+ for Windows. There are many ways to get this tool, but to keep things simple,
+ use the <ulink url="http://www.zlatkovic.com/pub/libxml/">binary packages</ulink>
+ made by Igor Zlatkovic. At the very least, you need to download the following
+ packages: <code><phrase role="identifier">iconv</phrase></code>, <code><phrase
+ role="identifier">zlib</phrase></code>, <code><phrase role="identifier">libxml2</phrase></code>
+ and <code><phrase role="identifier">libxslt</phrase></code>.
+ </listitem>
+ <listitem>
+ Unpack all these packages in the same directory so that you get unique
+ <code><phrase role="identifier">bin</phrase></code>, <code><phrase role="identifier">include</phrase></code>
+ and <code><phrase role="identifier">lib</phrase></code> directories within
+ the hierarchy. These instructions use <code><phrase role="identifier">C</phrase><phrase
+ role="special">:\</phrase><phrase role="identifier">Users</phrase><phrase
+ role="special">\</phrase><phrase role="identifier">example</phrase><phrase
+ role="special">\</phrase><phrase role="identifier">Documents</phrase><phrase
+ role="special">\</phrase><phrase role="identifier">boost</phrase><phrase
+ role="special">\</phrase><phrase role="identifier">xml</phrase></code>
+ as the root for all files.
+ </listitem>
+ <listitem>
+ From the command line, go to the <code><phrase role="identifier">bin</phrase></code>
+ directory and launch <code><phrase role="identifier">xsltproc</phrase><phrase
+ role="special">.</phrase><phrase role="identifier">exe</phrase></code>
+ to ensure it works. You should get usage information on screen.
+ </listitem>
+ <listitem>
+ Download <ulink url="http://www.docbook.org/xml/4.2/docbook-xml-4.2.zip">Docbook
+ XML 4.2</ulink> and unpack it in the same directory used above. That is:
+ <code><phrase role="identifier">C</phrase><phrase role="special">:\</phrase><phrase
+ role="identifier">Users</phrase><phrase role="special">\</phrase><phrase
+ role="identifier">example</phrase><phrase role="special">\</phrase><phrase
+ role="identifier">Documents</phrase><phrase role="special">\</phrase><phrase
+ role="identifier">boost</phrase><phrase role="special">\</phrase><phrase
+ role="identifier">xml</phrase><phrase role="special">\</phrase><phrase
+ role="identifier">docbook</phrase><phrase role="special">-</phrase><phrase
+ role="identifier">xml</phrase></code>.
+ </listitem>
+ <listitem>
+ Download the latest <ulink url="http://sourceforge.net/project/showfiles.php?group_id=21935&package_id=16608">Docbook
+ XSL</ulink> version and unpack it, again in the same directory used before.
+ To make things easier, rename the directory created during the extraction
+ to <code><phrase role="identifier">docbook</phrase><phrase role="special">-</phrase><phrase
+ role="identifier">xsl</phrase></code> (bypassing the version name): <code><phrase
+ role="identifier">C</phrase><phrase role="special">:\</phrase><phrase role="identifier">Users</phrase><phrase
+ role="special">\</phrase><phrase role="identifier">example</phrase><phrase
+ role="special">\</phrase><phrase role="identifier">Documents</phrase><phrase
+ role="special">\</phrase><phrase role="identifier">boost</phrase><phrase
+ role="special">\</phrase><phrase role="identifier">xml</phrase><phrase
+ role="special">\</phrase><phrase role="identifier">docbook</phrase><phrase
+ role="special">-</phrase><phrase role="identifier">xsl</phrase></code>.
+ </listitem>
+ <listitem>
+ Add the following to your <code><phrase role="identifier">user</phrase><phrase
+ role="special">-</phrase><phrase role="identifier">config</phrase><phrase
+ role="special">.</phrase><phrase role="identifier">jam</phrase></code>
+ file, which should live in your home directory (<code><phrase role="special">%</phrase><phrase
+ role="identifier">HOMEDRIVE</phrase><phrase role="special">%%</phrase><phrase
+ role="identifier">HOMEPATH</phrase><phrase role="special">%</phrase></code>).
+ You must already have it somewhere or otherwise you could not be building
+ Boost (i.e. missing tools configuration).
+ </listitem>
+ </orderedlist>
+
+<programlisting><phrase role="identifier">using</phrase> <phrase role="identifier">xsltproc</phrase>
<phrase role="special">:</phrase> <phrase role="string">"C:/Users/example/Documents/boost/xml/bin/xsltproc.exe"</phrase>
<phrase role="special">;</phrase>
@@ -2735,90 +2686,84 @@
<phrase role="special">:</phrase> <phrase role="string">"C:/Users/example/Documents/boost/xml/docbook-xml"</phrase>
<phrase role="special">;</phrase>
</programlisting>
- <para>
- The above steps are enough to get a functional BoostBook setup. Quickbook
- will be automatically built when needed. If you want to avoid these
- rebuilds:
- </para>
- <orderedlist>
- <listitem>
- Go to Quickbook's source directory (<code><phrase role="identifier">BOOST_ROOT</phrase><phrase
- role="special">\</phrase><phrase role="identifier">tools</phrase><phrase
- role="special">\</phrase><phrase role="identifier">quickbook</phrase></code>).
- </listitem>
- <listitem>
- Build the utility by issuing <code><phrase role="identifier">bjam</phrase>
- <phrase role="special">--</phrase><phrase role="identifier">v2</phrase></code>.
- </listitem>
- <listitem>
- Copy the resulting <code><phrase role="identifier">quickbook</phrase><phrase
- role="special">.</phrase><phrase role="identifier">exe</phrase></code>
- binary (located under the <code><phrase role="identifier">BOOST_ROOT</phrase><phrase
- role="special">\</phrase><phrase role="identifier">bin</phrase><phrase
- role="special">.</phrase><phrase role="identifier">v2</phrase></code>
- hierarchy) to a safe place. Following our previous example, you can
- install it into: <code><phrase role="identifier">C</phrase><phrase
- role="special">:\</phrase><phrase role="identifier">Users</phrase><phrase
- role="special">\</phrase><phrase role="identifier">example</phrase><phrase
- role="special">\</phrase><phrase role="identifier">Documents</phrase><phrase
- role="special">\</phrase><phrase role="identifier">boost</phrase><phrase
- role="special">\</phrase><phrase role="identifier">xml</phrase><phrase
- role="special">\</phrase><phrase role="identifier">bin</phrase></code>.
- </listitem>
- <listitem>
- Add the following to your <code><phrase role="identifier">user</phrase><phrase
- role="special">-</phrase><phrase role="identifier">config</phrase><phrase
- role="special">.</phrase><phrase role="identifier">jam</phrase></code>
- file:
- </listitem>
- </orderedlist>
-
-<programlisting>
-<phrase role="identifier">using</phrase> <phrase role="identifier">quickbook</phrase>
+ <para>
+ The above steps are enough to get a functional BoostBook setup. Quickbook
+ will be automatically built when needed. If you want to avoid these rebuilds:
+ </para>
+ <orderedlist>
+ <listitem>
+ Go to Quickbook's source directory (<code><phrase role="identifier">BOOST_ROOT</phrase><phrase
+ role="special">\</phrase><phrase role="identifier">tools</phrase><phrase
+ role="special">\</phrase><phrase role="identifier">quickbook</phrase></code>).
+ </listitem>
+ <listitem>
+ Build the utility by issuing <code><phrase role="identifier">bjam</phrase>
+ <phrase role="special">--</phrase><phrase role="identifier">v2</phrase></code>.
+ </listitem>
+ <listitem>
+ Copy the resulting <code><phrase role="identifier">quickbook</phrase><phrase
+ role="special">.</phrase><phrase role="identifier">exe</phrase></code>
+ binary (located under the <code><phrase role="identifier">BOOST_ROOT</phrase><phrase
+ role="special">\</phrase><phrase role="identifier">bin</phrase><phrase
+ role="special">.</phrase><phrase role="identifier">v2</phrase></code> hierarchy)
+ to a safe place. Following our previous example, you can install it into:
+ <code><phrase role="identifier">C</phrase><phrase role="special">:\</phrase><phrase
+ role="identifier">Users</phrase><phrase role="special">\</phrase><phrase
+ role="identifier">example</phrase><phrase role="special">\</phrase><phrase
+ role="identifier">Documents</phrase><phrase role="special">\</phrase><phrase
+ role="identifier">boost</phrase><phrase role="special">\</phrase><phrase
+ role="identifier">xml</phrase><phrase role="special">\</phrase><phrase
+ role="identifier">bin</phrase></code>.
+ </listitem>
+ <listitem>
+ Add the following to your <code><phrase role="identifier">user</phrase><phrase
+ role="special">-</phrase><phrase role="identifier">config</phrase><phrase
+ role="special">.</phrase><phrase role="identifier">jam</phrase></code>
+ file:
+ </listitem>
+ </orderedlist>
+
+<programlisting><phrase role="identifier">using</phrase> <phrase role="identifier">quickbook</phrase>
<phrase role="special">:</phrase> <phrase role="string">"C:/Users/example/Documents/boost/xml/bin/quickbook.exe"</phrase>
<phrase role="special">;</phrase>
</programlisting>
- </section>
- <section id="quickbook.install.linux">
- <title><link linkend="quickbook.install.linux"> Debian, Ubuntu</link></title>
- <para>
- The following instructions apply to Debian and its derivatives. They
- are based on a Ubuntu Edgy install but should work on other Debian
- based systems.
- </para>
- <para>
- First install the <code><phrase role="identifier">bjam</phrase></code>,
- <code><phrase role="identifier">xsltproc</phrase></code>, <code><phrase
- role="identifier">docbook</phrase><phrase role="special">-</phrase><phrase
- role="identifier">xsl</phrase></code> and <code><phrase role="identifier">docbook</phrase><phrase
- role="special">-</phrase><phrase role="identifier">xml</phrase></code>
- packages. For example, using <code><phrase role="identifier">apt</phrase><phrase
- role="special">-</phrase><phrase role="identifier">get</phrase></code>:
- </para>
-
-<programlisting>
-<phrase role="identifier">sudo</phrase> <phrase role="identifier">apt</phrase><phrase role="special">-</phrase><phrase role="identifier">get</phrase> <phrase role="identifier">install</phrase> <phrase role="identifier">xsltprc</phrase> <phrase role="identifier">docbook</phrase><phrase role="special">-</phrase><phrase role="identifier">xsl</phrase> <phrase role="identifier">docbook</phrase><phrase role="special">-</phrase><phrase role="identifier">xml</phrase>
+ </section>
+ <section id="quickbook.install.linux">
+ <title><link linkend="quickbook.install.linux"> Debian, Ubuntu</link></title>
+ <para>
+ The following instructions apply to Debian and its derivatives. They are
+ based on a Ubuntu Edgy install but should work on other Debian based systems.
+ </para>
+ <para>
+ First install the <code><phrase role="identifier">bjam</phrase></code>,
+ <code><phrase role="identifier">xsltproc</phrase></code>, <code><phrase role="identifier">docbook</phrase><phrase
+ role="special">-</phrase><phrase role="identifier">xsl</phrase></code> and
+ <code><phrase role="identifier">docbook</phrase><phrase role="special">-</phrase><phrase
+ role="identifier">xml</phrase></code> packages. For example, using <code><phrase
+ role="identifier">apt</phrase><phrase role="special">-</phrase><phrase role="identifier">get</phrase></code>:
+ </para>
+
+<programlisting><phrase role="identifier">sudo</phrase> <phrase role="identifier">apt</phrase><phrase role="special">-</phrase><phrase role="identifier">get</phrase> <phrase role="identifier">install</phrase> <phrase role="identifier">xsltprc</phrase> <phrase role="identifier">docbook</phrase><phrase role="special">-</phrase><phrase role="identifier">xsl</phrase> <phrase role="identifier">docbook</phrase><phrase role="special">-</phrase><phrase role="identifier">xml</phrase>
</programlisting>
- <para>
- If you're planning on building boost's documentation, you'll also need
- to install the <code><phrase role="identifier">doxygen</phrase></code>
- package as well.
- </para>
- <para>
- Next, we need to configure Boost Build to compile BoostBook files.
- Add the following to your <code><phrase role="identifier">user</phrase><phrase
- role="special">-</phrase><phrase role="identifier">config</phrase><phrase
- role="special">.</phrase><phrase role="identifier">jam</phrase></code>
- file, which should be in your home directory. If you don't have one,
- create a file containing this text. For more information on setting
- up <code><phrase role="identifier">user</phrase><phrase role="special">-</phrase><phrase
- role="identifier">config</phrase><phrase role="special">.</phrase><phrase
- role="identifier">jam</phrase></code>, see the <ulink url="http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html">Boost
- Build documentation</ulink>.
- </para>
-
-<programlisting>
-<phrase role="identifier">using</phrase> <phrase role="identifier">xsltproc</phrase> <phrase role="special">;</phrase>
+ <para>
+ If you're planning on building boost's documentation, you'll also need to
+ install the <code><phrase role="identifier">doxygen</phrase></code> package
+ as well.
+ </para>
+ <para>
+ Next, we need to configure Boost Build to compile BoostBook files. Add the
+ following to your <code><phrase role="identifier">user</phrase><phrase role="special">-</phrase><phrase
+ role="identifier">config</phrase><phrase role="special">.</phrase><phrase
+ role="identifier">jam</phrase></code> file, which should be in your home
+ directory. If you don't have one, create a file containing this text. For
+ more information on setting up <code><phrase role="identifier">user</phrase><phrase
+ role="special">-</phrase><phrase role="identifier">config</phrase><phrase
+ role="special">.</phrase><phrase role="identifier">jam</phrase></code>, see
+ the <ulink url="http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html">Boost
+ Build documentation</ulink>.
+ </para>
+
+<programlisting><phrase role="identifier">using</phrase> <phrase role="identifier">xsltproc</phrase> <phrase role="special">;</phrase>
<phrase role="identifier">using</phrase> <phrase role="identifier">boostbook</phrase>
<phrase role="special">:</phrase> <phrase role="special">/</phrase><phrase role="identifier">usr</phrase><phrase role="special">/</phrase><phrase role="identifier">share</phrase><phrase role="special">/</phrase><phrase role="identifier">xml</phrase><phrase role="special">/</phrase><phrase role="identifier">docbook</phrase><phrase role="special">/</phrase><phrase role="identifier">stylesheet</phrase><phrase role="special">/</phrase><phrase role="identifier">nwalsh</phrase>
@@ -2828,91 +2773,89 @@
<phrase role="comment"># Remove this line if you're not using doxygen
</phrase><phrase role="identifier">using</phrase> <phrase role="identifier">doxygen</phrase> <phrase role="special">;</phrase>
</programlisting>
- <para>
- The above steps are enough to get a functional BoostBook setup. Quickbook
- will be automatically built when needed. If you want to avoid these
- rebuilds:
- </para>
- <orderedlist>
- <listitem>
- Go to Quickbook's source directory (<code><phrase role="identifier">BOOST_ROOT</phrase><phrase
- role="special">/</phrase><phrase role="identifier">tools</phrase><phrase
- role="special">/</phrase><phrase role="identifier">quickbook</phrase></code>).
- </listitem>
- <listitem>
- Build the utility by issuing <code><phrase role="identifier">bjam</phrase>
- <phrase role="special">--</phrase><phrase role="identifier">v2</phrase></code>.
- </listitem>
- <listitem>
- Copy the resulting <code><phrase role="identifier">quickbook</phrase></code>
- binary (located under the <code><phrase role="identifier">BOOST_ROOT</phrase><phrase
- role="special">/</phrase><phrase role="identifier">bin</phrase><phrase
- role="special">.</phrase><phrase role="identifier">v2</phrase></code>
- hierarchy) to a safe place. The traditional location is <code><phrase
- role="special">/</phrase><phrase role="identifier">usr</phrase><phrase
- role="special">/</phrase><phrase role="identifier">local</phrase><phrase
- role="special">/</phrase><phrase role="identifier">bin</phrase></code>.
- </listitem>
- <listitem>
- Add the following to your <code><phrase role="identifier">user</phrase><phrase
- role="special">-</phrase><phrase role="identifier">config</phrase><phrase
- role="special">.</phrase><phrase role="identifier">jam</phrase></code>
- file, using the full path of the quickbook executable:
- </listitem>
- </orderedlist>
-
-<programlisting>
-<phrase role="identifier">using</phrase> <phrase role="identifier">quickbook</phrase>
+ <para>
+ The above steps are enough to get a functional BoostBook setup. Quickbook
+ will be automatically built when needed. If you want to avoid these rebuilds:
+ </para>
+ <orderedlist>
+ <listitem>
+ Go to Quickbook's source directory (<code><phrase role="identifier">BOOST_ROOT</phrase><phrase
+ role="special">/</phrase><phrase role="identifier">tools</phrase><phrase
+ role="special">/</phrase><phrase role="identifier">quickbook</phrase></code>).
+ </listitem>
+ <listitem>
+ Build the utility by issuing <code><phrase role="identifier">bjam</phrase>
+ <phrase role="special">--</phrase><phrase role="identifier">v2</phrase></code>.
+ </listitem>
+ <listitem>
+ Copy the resulting <code><phrase role="identifier">quickbook</phrase></code>
+ binary (located under the <code><phrase role="identifier">BOOST_ROOT</phrase><phrase
+ role="special">/</phrase><phrase role="identifier">bin</phrase><phrase
+ role="special">.</phrase><phrase role="identifier">v2</phrase></code> hierarchy)
+ to a safe place. The traditional location is <code><phrase role="special">/</phrase><phrase
+ role="identifier">usr</phrase><phrase role="special">/</phrase><phrase
+ role="identifier">local</phrase><phrase role="special">/</phrase><phrase
+ role="identifier">bin</phrase></code>.
+ </listitem>
+ <listitem>
+ Add the following to your <code><phrase role="identifier">user</phrase><phrase
+ role="special">-</phrase><phrase role="identifier">config</phrase><phrase
+ role="special">.</phrase><phrase role="identifier">jam</phrase></code>
+ file, using the full path of the quickbook executable:
+ </listitem>
+ </orderedlist>
+
+<programlisting><phrase role="identifier">using</phrase> <phrase role="identifier">quickbook</phrase>
<phrase role="special">:</phrase> <phrase role="special">/</phrase><phrase role="identifier">usr</phrase><phrase role="special">/</phrase><phrase role="identifier">local</phrase><phrase role="special">/</phrase><phrase role="identifier">bin</phrase><phrase role="special">/</phrase><phrase role="identifier">quickbook</phrase>
<phrase role="special">;</phrase>
</programlisting>
- </section>
- </section>
- <section id="quickbook.editors">
- <title><link linkend="quickbook.editors"> Editor Support</link></title>
+ </section>
+ </section>
+ <section id="quickbook.editors">
+ <title><link linkend="quickbook.editors"> Editor Support</link></title>
+ <para>
+ Editing quickbook files is usually done with text editors both simple and powerful.
+ The following sections list the settings for some editors which can help make
+ editing quickbook files a bit easier.
+ </para>
+ <sidebar role="blurb">
+ <para>
+ <inlinemediaobject><imageobject><imagedata fileref="images/note.png"></imagedata></imageobject>
+ <textobject>
+ <phrase>note</phrase>
+ </textobject>
+ </inlinemediaobject> You may submit your settings, tips, and suggestions to
+ the authors, or through the <ulink url="https://lists.sourceforge.net/lists/listinfo/boost-">docs
+ Boost Docs mailing list</ulink>.
+ </para>
+ </sidebar>
+ <section id="quickbook.editors.scite">
+ <title><link linkend="quickbook.editors.scite"> Scintilla Text Editor</link></title>
+ <blockquote>
+ <para>
<para>
- Editing quickbook files is usually done with text editors both simple
- and powerful. The following sections list the settings for some editors
- which can help make editing quickbook files a bit easier.
- </para>
- <sidebar role="blurb">
- <para>
- <inlinemediaobject><imageobject><imagedata fileref="images/note.png"></imagedata></imageobject>
- <textobject>
- <phrase>note</phrase>
- </textobject>
- </inlinemediaobject> You may submit your settings, tips, and suggestions
- to the authors, or through the <ulink url="https://lists.sourceforge.net/lists/listinfo/boost-">docs
- Boost Docs mailing list</ulink>.
- </para>
- </sidebar>
- <section id="quickbook.editors.scite">
- <title><link linkend="quickbook.editors.scite"> Scintilla Text Editor</link></title>
- <blockquote>
- <para>
- <para>
- <emphasis>Section contributed by Dean Michael Berris</emphasis>
- </para>
- </para>
- </blockquote>
- <para>
- The Scintilla Text Editor (SciTE) is a free source code editor for
- Win32 and X. It uses the SCIntilla source code editing component.
- </para>
- <sidebar role="blurb">
- <para>
- <inlinemediaobject><imageobject><imagedata fileref="images/tip.png"></imagedata></imageobject>
- <textobject>
- <phrase>tip</phrase>
- </textobject>
- </inlinemediaobject> SciTE can be downloaded from <ulink url="http://www.scintilla.org/SciTE.html">http://www.scintilla.org/SciTE.html>
- </para>
- </sidebar>
- <para>
- You can use the following settings to highlight quickbook tags when
- editing quickbook files.
- </para>
-
+ <emphasis>Section contributed by Dean Michael Berris</emphasis>
+ </para>
+ </para>
+ </blockquote>
+ <para>
+ The Scintilla Text Editor (SciTE) is a free source code editor for Win32
+ and X. It uses the SCIntilla source code editing component.
+ </para>
+ <sidebar role="blurb">
+ <para>
+ <inlinemediaobject><imageobject><imagedata fileref="images/tip.png"></imagedata></imageobject>
+ <textobject>
+ <phrase>tip</phrase>
+ </textobject>
+ </inlinemediaobject> SciTE can be downloaded from <ulink url="http://www.scintilla.org/SciTE.html">http://www.scintilla.org/SciTE.html>
+ </para>
+ </sidebar>
+ <para>
+ You can use the following settings to highlight quickbook tags when editing
+ quickbook files.
+ </para>
+
<programlisting><!--quickbook-escape-prefix-->qbk=*.qbk
lexer.*.qbk=props
use.tabs.$(qbk)=0
@@ -2925,47 +2868,45 @@
comment.box.middle.props=
comment.box.end.props=]
<!--quickbook-escape-postfix--></programlisting>
- <sidebar role="blurb">
- <para>
- <inlinemediaobject><imageobject><imagedata fileref="images/note.png"></imagedata></imageobject>
- <textobject>
- <phrase>note</phrase>
- </textobject>
- </inlinemediaobject> Thanks to Rene Rivera for the above SciTE settings.
- </para>
- </sidebar>
- </section>
- </section>
- <section id="quickbook.faq">
- <title><link linkend="quickbook.faq"> Frequently Asked Questions</link></title>
- <anchor id="quickbook.faq.can_i_use_quickbook_for_non_boost_documentation_"/>
- <bridgehead renderas="sect3">
- <link linkend="quickbook.faq.can_i_use_quickbook_for_non_boost_documentation_">Can
- I use QuickBook for non-Boost documentation?</link>
- </bridgehead>
- <para>
- QuickBook can be used for non-Boost documentation with a little extra
- work.
- </para>
- <blockquote>
- <para>
- <para>
- <emphasis>Faq contributed by Michael Marcin</emphasis>
- </para>
- </para>
- </blockquote>
- <para>
- When building HTML documentation with BoostBook a Boost C++ Libraries
- header is added to the files. When using QuickBook to document projects
- outside of Boost this is not desirable. This behavior can be overridden
- at the BoostBook level by specifying some XSLT options. When using Boost
- Build version 2 (BBv2) this can be achieved by adding parameters to the
- BoostBook target declaration.
- </para>
- <para>
- For example:
- </para>
-
+ <sidebar role="blurb">
+ <para>
+ <inlinemediaobject><imageobject><imagedata fileref="images/note.png"></imagedata></imageobject>
+ <textobject>
+ <phrase>note</phrase>
+ </textobject>
+ </inlinemediaobject> Thanks to Rene Rivera for the above SciTE settings.
+ </para>
+ </sidebar>
+ </section>
+ </section>
+ <section id="quickbook.faq">
+ <title><link linkend="quickbook.faq"> Frequently Asked Questions</link></title>
+ <anchor id="quickbook.faq.can_i_use_quickbook_for_non_boost_documentation_"/>
+ <bridgehead renderas="sect3">
+ <link linkend="quickbook.faq.can_i_use_quickbook_for_non_boost_documentation_">Can
+ I use QuickBook for non-Boost documentation?</link>
+ </bridgehead>
+ <para>
+ QuickBook can be used for non-Boost documentation with a little extra work.
+ </para>
+ <blockquote>
+ <para>
+ <para>
+ <emphasis>Faq contributed by Michael Marcin</emphasis>
+ </para>
+ </para>
+ </blockquote>
+ <para>
+ When building HTML documentation with BoostBook a Boost C++ Libraries header
+ is added to the files. When using QuickBook to document projects outside of
+ Boost this is not desirable. This behavior can be overridden at the BoostBook
+ level by specifying some XSLT options. When using Boost Build version 2 (BBv2)
+ this can be achieved by adding parameters to the BoostBook target declaration.
+ </para>
+ <para>
+ For example:
+ </para>
+
<programlisting>using quickbook ;
xml my_doc : my_doc.qbk ;
@@ -2981,785 +2922,780 @@
<xsl:param>nav.layout=none
;
</programlisting>
- </section>
- <section id="quickbook.ref">
- <title><link linkend="quickbook.ref"> Quick Reference</link></title>
+ </section>
+ <section id="quickbook.ref">
+ <title><link linkend="quickbook.ref"> Quick Reference</link></title>
+ <para>
+ [cpp]
+ </para>
+ <table frame="all"> <title>Syntax Compendium</title>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>
+ <para>
+ To do this...
+ </para>
+ </entry><entry>
+ <para>
+ Use this...
+ </para>
+ </entry><entry>
+ <para>
+ See this...
+ </para>
+ </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>
+ <para>
+ comment
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[/ some comment]</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.comments">Comments</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ <emphasis>italics</emphasis>
+ </para>
+ </entry><entry>
+ <para>
+ <literal>['italics] or /italics/</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.phrase.font_styles">Font Styles</link>
+ and <link linkend="quickbook.syntax.phrase.simple_formatting">Simple
+ formatting</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ <emphasis role="bold">bold</emphasis>
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[*bold] or *bold*</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.phrase.font_styles">Font Styles</link>
+ and <link linkend="quickbook.syntax.phrase.simple_formatting">Simple
+ formatting</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ <emphasis role="underline">underline</emphasis>
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[_underline] or _underline_</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.phrase.font_styles">Font Styles</link>
+ and <link linkend="quickbook.syntax.phrase.simple_formatting">Simple
+ formatting</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ <literal>teletype</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[^teletype] or =teletype=</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.phrase.font_styles">Font Styles</link>
+ and <link linkend="quickbook.syntax.phrase.simple_formatting">Simple
+ formatting</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ <emphasis role="strikethrough">strikethrough</emphasis>
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[-strikethrough]</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.phrase.font_styles">Font Styles</link>
+ and <link linkend="quickbook.syntax.phrase.simple_formatting">Simple
+ formatting</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ <replaceable>
+ replaceable
+ </replaceable>
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[~replaceable]</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.phrase.replaceable">Replaceble</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ source mode
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[c++]</literal> or <literal>[python]</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.phrase.source_mode">Source Mode</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ inline code
+ </para>
+ </entry><entry>
+ <para>
+ <literal>`int main();`</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.phrase.inline_code">Inline code</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ code block
+ </para>
+ </entry><entry>
+ <para>
+ <literal>``int main();``</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.block.code">Code</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ code escape
+ </para>
+ </entry><entry>
+ <para>
+ <literal>``from c++ to QuickBook``</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.block.escape_back">Escaping Back To QuickBook</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ line break
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[br] or \n</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.phrase.line_break">line-break</link>
+ <emphasis role="bold">DEPRECATED</emphasis>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ anchor
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[#anchor]</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.phrase.anchors">Anchors</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ link
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[@http://www.boost.org Boost]</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.phrase.links">Links</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ anchor link
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[link section.anchor Link text]</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.phrase.anchor_links">Anchor links</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ refentry link
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[link xml.refentry Link text]</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.phrase.refentry_links">refentry links</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ function link
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[funcref fully::qualified::function_name Link text]</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.phrase.code_links">function, class, member,
+ enum, macro, concept or header links</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ class link
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[classref fully::qualified::class_name Link text]</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.phrase.code_links">function, class, member,
+ enum, macro, concept or header links</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ member link
+ </para>
+ </entry><entry>
<para>
- [cpp]
+ <literal>[memberref fully::qualified::member_name Link text]</literal>
</para>
- <table frame="all"> <title>Syntax Compendium</title>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>
- <para>
- To do this...
- </para>
- </entry><entry>
- <para>
- Use this...
- </para>
- </entry><entry>
- <para>
- See this...
- </para>
- </entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>
- <para>
- comment
- </para>
- </entry><entry>
- <para>
- <literal>[/ some comment]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.comments">Comments</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- <emphasis>italics</emphasis>
- </para>
- </entry><entry>
- <para>
- <literal>['italics] or /italics/</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.phrase.font_styles">Font Styles</link>
- and <link linkend="quickbook.syntax.phrase.simple_formatting">Simple
- formatting</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- <emphasis role="bold">bold</emphasis>
- </para>
- </entry><entry>
- <para>
- <literal>[*bold] or *bold*</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.phrase.font_styles">Font Styles</link>
- and <link linkend="quickbook.syntax.phrase.simple_formatting">Simple
- formatting</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- <emphasis role="underline">underline</emphasis>
- </para>
- </entry><entry>
- <para>
- <literal>[_underline] or _underline_</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.phrase.font_styles">Font Styles</link>
- and <link linkend="quickbook.syntax.phrase.simple_formatting">Simple
- formatting</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- <literal>teletype</literal>
- </para>
- </entry><entry>
- <para>
- <literal>[^teletype] or =teletype=</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.phrase.font_styles">Font Styles</link>
- and <link linkend="quickbook.syntax.phrase.simple_formatting">Simple
- formatting</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- <emphasis role="strikethrough">strikethrough</emphasis>
- </para>
- </entry><entry>
- <para>
- <literal>[-strikethrough]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.phrase.font_styles">Font Styles</link>
- and <link linkend="quickbook.syntax.phrase.simple_formatting">Simple
- formatting</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- <replaceable>
- replaceable
- </replaceable>
- </para>
- </entry><entry>
- <para>
- <literal>[~replaceable]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.phrase.replaceable">Replaceble</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- source mode
- </para>
- </entry><entry>
- <para>
- <literal>[c++]</literal> or <literal>[python]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.phrase.source_mode">Source Mode</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- inline code
- </para>
- </entry><entry>
- <para>
- <literal>`int main();`</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.phrase.inline_code">Inline code</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- code block
- </para>
- </entry><entry>
- <para>
- <literal>``int main();``</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.block.code">Code</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- code escape
- </para>
- </entry><entry>
- <para>
- <literal>``from c++ to QuickBook``</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.block.escape_back">Escaping Back
- To QuickBook</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- line break
- </para>
- </entry><entry>
- <para>
- <literal>[br] or \n</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.phrase.line_break">line-break</link>
- <emphasis role="bold">DEPRECATED</emphasis>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- anchor
- </para>
- </entry><entry>
- <para>
- <literal>[#anchor]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.phrase.anchors">Anchors</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- link
- </para>
- </entry><entry>
- <para>
- <literal>[@http://www.boost.org Boost]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.phrase.links">Links</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- anchor link
- </para>
- </entry><entry>
- <para>
- <literal>[link section.anchor Link text]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.phrase.anchor_links">Anchor links</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- refentry link
- </para>
- </entry><entry>
- <para>
- <literal>[link xml.refentry Link text]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.phrase.refentry_links">refentry
- links</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- function link
- </para>
- </entry><entry>
- <para>
- <literal>[funcref fully::qualified::function_name Link text]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.phrase.code_links">function, class,
- member, enum, macro, concept or header links</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- class link
- </para>
- </entry><entry>
- <para>
- <literal>[classref fully::qualified::class_name Link text]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.phrase.code_links">function, class,
- member, enum, macro, concept or header links</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- member link
- </para>
- </entry><entry>
- <para>
- <literal>[memberref fully::qualified::member_name Link text]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.phrase.code_links">function, class,
- member, enum, macro, concept or header links</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- enum link
- </para>
- </entry><entry>
- <para>
- <literal>[enumref fully::qualified::enum_name Link text]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.phrase.code_links">function, class,
- member, enum, macro, concept or header links</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- macro link
- </para>
- </entry><entry>
- <para>
- <literal>[macroref MACRO_NAME Link text]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.phrase.code_links">function, class,
- member, enum, macro, concept or header links</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- concept link
- </para>
- </entry><entry>
- <para>
- <literal>[conceptref ConceptName Link text]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.phrase.code_links">function, class,
- member, enum, macro, concept or header links</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- header link
- </para>
- </entry><entry>
- <para>
- <literal>[headerref path/to/header.hpp Link text]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.phrase.code_links">function, class,
- member, enum, macro, concept or header links</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- escape
- </para>
- </entry><entry>
- <para>
- <literal>'''escaped text (no processing/formatting)'''</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.phrase.escape">Escape</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- single char escape
- </para>
- </entry><entry>
- <para>
- <literal>\c</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.phrase.single_char_escape">Single
- char escape</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- images
- </para>
- </entry><entry>
- <para>
- <literal>[$image.jpg]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.phrase.images">Images</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- begin section
- </para>
- </entry><entry>
- <para>
- <literal>[section The Section Title]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.block.section">Section</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- end section
- </para>
- </entry><entry>
- <para>
- <literal>[endsect]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.block.section">Section</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- paragraph
- </para>
- </entry><entry>
- <para>
- No markup. Paragraphs start left-flushed and are terminated by
- two or more newlines.
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.block.paragraphs">Paragraphs</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- ordered list
- </para>
- </entry><entry>
- <para>
-
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.phrase.code_links">function, class, member,
+ enum, macro, concept or header links</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ enum link
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[enumref fully::qualified::enum_name Link text]</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.phrase.code_links">function, class, member,
+ enum, macro, concept or header links</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ macro link
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[macroref MACRO_NAME Link text]</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.phrase.code_links">function, class, member,
+ enum, macro, concept or header links</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ concept link
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[conceptref ConceptName Link text]</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.phrase.code_links">function, class, member,
+ enum, macro, concept or header links</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ header link
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[headerref path/to/header.hpp Link text]</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.phrase.code_links">function, class, member,
+ enum, macro, concept or header links</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ escape
+ </para>
+ </entry><entry>
+ <para>
+ <literal>'''escaped text (no processing/formatting)'''</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.phrase.escape">Escape</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ single char escape
+ </para>
+ </entry><entry>
+ <para>
+ <literal>\c</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.phrase.single_char_escape">Single char
+ escape</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ images
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[$image.jpg]</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.phrase.images">Images</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ begin section
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[section The Section Title]</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.block.section">Section</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ end section
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[endsect]</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.block.section">Section</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ paragraph
+ </para>
+ </entry><entry>
+ <para>
+ No markup. Paragraphs start left-flushed and are terminated by two or
+ more newlines.
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.block.paragraphs">Paragraphs</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ ordered list
+ </para>
+ </entry><entry>
+ <para>
+
<programlisting><!--quickbook-escape-prefix--># one
# two
# three
<!--quickbook-escape-postfix--></programlisting>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.block.lists.ordered_lists">Ordered
- lists</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- unordered list
- </para>
- </entry><entry>
- <para>
-
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.block.lists.ordered_lists">Ordered lists</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ unordered list
+ </para>
+ </entry><entry>
+ <para>
+
<programlisting><!--quickbook-escape-prefix-->* one
* two
* three
<!--quickbook-escape-postfix--></programlisting>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.block.lists.unordered_lists">Unordered
- lists</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- code
- </para>
- </entry><entry>
- <para>
- No markup. Preformatted code starts with a space or a tab.
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.block.code">Code</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- preformatted
- </para>
- </entry><entry>
- <para>
- <literal>[pre preformatted]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.block.preformatted">Preformatted</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- block quote
- </para>
- </entry><entry>
- <para>
- <literal>[:sometext...]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.block.blockquote">Blockquote</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- heading 1
- </para>
- </entry><entry>
- <para>
- <literal>[h1 Heading 1]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.block.headings">Heading</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- heading 2
- </para>
- </entry><entry>
- <para>
- <literal>[h2 Heading 2]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.block.headings">Heading</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- heading 3
- </para>
- </entry><entry>
- <para>
- <literal>[h3 Heading 3]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.block.headings">Heading</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- heading 4
- </para>
- </entry><entry>
- <para>
- <literal>[h4 Heading 4]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.block.headings">Heading</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- heading 5
- </para>
- </entry><entry>
- <para>
- <literal>[h5 Heading 5]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.block.headings">Heading</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- heading 6
- </para>
- </entry><entry>
- <para>
- <literal>[h6 Heading 6]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.block.headings">Heading</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- macro
- </para>
- </entry><entry>
- <para>
- <literal>[def macro_identifier some text]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.block.macros">Macros</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- template
- </para>
- </entry><entry>
- <para>
- <literal>[template[a b] [a] body [b]]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.block.templates">Templates</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- blurb
- </para>
- </entry><entry>
- <para>
- <literal>[blurb advertisement or note...]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.block.blurbs">Blurbs</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- admonition
- </para>
- </entry><entry>
- <para>
- <literal>[warning Warning text...]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.block.admonitions">Admonitions</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- table
- </para>
- </entry><entry>
- <para>
-
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.block.lists.unordered_lists">Unordered
+ lists</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ code
+ </para>
+ </entry><entry>
+ <para>
+ No markup. Preformatted code starts with a space or a tab.
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.block.code">Code</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ preformatted
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[pre preformatted]</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.block.preformatted">Preformatted</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ block quote
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[:sometext...]</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.block.blockquote">Blockquote</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ heading 1
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[h1 Heading 1]</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.block.headings">Heading</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ heading 2
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[h2 Heading 2]</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.block.headings">Heading</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ heading 3
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[h3 Heading 3]</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.block.headings">Heading</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ heading 4
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[h4 Heading 4]</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.block.headings">Heading</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ heading 5
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[h5 Heading 5]</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.block.headings">Heading</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ heading 6
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[h6 Heading 6]</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.block.headings">Heading</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ macro
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[def macro_identifier some text]</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.block.macros">Macros</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ template
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[template[a b] [a] body [b]]</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.block.templates">Templates</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ blurb
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[blurb advertisement or note...]</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.block.blurbs">Blurbs</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ admonition
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[warning Warning text...]</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.block.admonitions">Admonitions</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ table
+ </para>
+ </entry><entry>
+ <para>
+
<programlisting><!--quickbook-escape-prefix-->[table Title
[[a][b][c]]
[[a][b][c]]
]
<!--quickbook-escape-postfix--></programlisting>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.block.tables">Tables</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- variablelist
- </para>
- </entry><entry>
- <para>
-
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.block.tables">Tables</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ variablelist
+ </para>
+ </entry><entry>
+ <para>
+
<programlisting><!--quickbook-escape-prefix-->[variablelist Title
[[a][b]]
[[a][b]]
]
<!--quickbook-escape-postfix--></programlisting>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.block.variable_lists">Variable
- Lists</link>
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- include
- </para>
- </entry><entry>
- <para>
- <literal>[include someother.qbk]</literal>
- </para>
- </entry><entry>
- <para>
- <link linkend="quickbook.syntax.block.include">Include</link>
- </para>
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </section>
- </article>
-
\ No newline at end of file
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.block.variable_lists">Variable Lists</link>
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ include
+ </para>
+ </entry><entry>
+ <para>
+ <literal>[include someother.qbk]</literal>
+ </para>
+ </entry><entry>
+ <para>
+ <link linkend="quickbook.syntax.block.include">Include</link>
+ </para>
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+</article>
Modified: branches/proto/v4/tools/quickbook/test/templates.gold
==============================================================================
--- branches/proto/v4/tools/quickbook/test/templates.gold (original)
+++ branches/proto/v4/tools/quickbook/test/templates.gold 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -47,8 +47,7 @@
</para>
<para>
-<programlisting>
-<phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase>
+<programlisting><phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase>
<phrase role="special">{</phrase>
<phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> "Hello, World" <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase>
<phrase role="special">}</phrase>
Modified: branches/proto/v4/tools/quickbook/test/templates.quickbook
==============================================================================
--- branches/proto/v4/tools/quickbook/test/templates.quickbook (original)
+++ branches/proto/v4/tools/quickbook/test/templates.quickbook 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -93,4 +93,11 @@
[plantation [banana]]
+[/-------------------------------- Bugs! ]
+
+[template join1[a b] [b][a]]
+[template join2[a b] [a][b]]
+[template test[x] [join1 [join2 0 [x]] 0]]
+[test 0]
+
[endsect]
Modified: branches/proto/v4/tools/regression/src/process_jam_log.py
==============================================================================
--- branches/proto/v4/tools/regression/src/process_jam_log.py (original)
+++ branches/proto/v4/tools/regression/src/process_jam_log.py 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -7,6 +7,7 @@
import optparse
import time
import xml.dom.minidom
+import xml.dom.pulldom
from xml.sax.saxutils import unescape, escape
import os.path
@@ -77,10 +78,37 @@
def add_log(self):
if self.input[0]:
- bjam_log = xml.dom.minidom.parse(self.input[0])
+ bjam_xml = self.input[0]
else:
- bjam_log = xml.dom.minidom.parse(self.input[1])
- self.x(bjam_log.documentElement)
+ bjam_xml = self.input[1]
+ events = xml.dom.pulldom.parse(bjam_xml)
+ context = []
+ test_run = self.results.documentElement
+ for (event,node) in events:
+ if event == xml.dom.pulldom.START_ELEMENT:
+ context.append(node)
+ if node.nodeType == xml.dom.Node.ELEMENT_NODE:
+ x_f = self.x_name_(*context)
+ if x_f:
+ events.expandNode(node)
+ # expanding eats the end element, hence walking us out one level
+ context.pop()
+ # call the translator, and add returned items to the result
+ items = (x_f[1])(node)
+ if items:
+ for item in items:
+ if item:
+ test_run.appendChild(self.results.createTextNode("\n"))
+ test_run.appendChild(item)
+ elif event == xml.dom.pulldom.END_ELEMENT:
+ context.pop()
+ #~ Add the log items nwo that we've collected all of them.
+ items = self.log.values()
+ if items:
+ for item in items:
+ if item:
+ test_run.appendChild(self.results.createTextNode("\n"))
+ test_run.appendChild(item)
def gen_output(self):
if self.output:
@@ -93,6 +121,24 @@
def tostring(self):
return self.results.toxml('utf-8')
+ def x_name_(self, *context, **kwargs):
+ node = None
+ names = [ ]
+ for c in context:
+ if c:
+ if not isinstance(c,xml.dom.Node):
+ suffix = '_'+c.replace('-','_').replace('#','_')
+ else:
+ suffix = '_'+c.nodeName.replace('-','_').replace('#','_')
+ node = c
+ names.append('x')
+ names = map(lambda x: x+suffix,names)
+ if node:
+ for name in names:
+ if hasattr(self,name):
+ return (name,getattr(self,name))
+ return None
+
def x(self, *context, **kwargs):
node = None
names = [ ]
@@ -113,26 +159,10 @@
assert False, 'Unknown node type %s'%(name)
return None
- #~ The single top-level build element...
- def x_build( self, node ):
- test_run = self.results.documentElement
- #~ Iterate over the sub-sections in a specific order to build up the
- #~ cross-reference information and the XML output.
- for type in ('timestamp','comment','test','targets','action'):
- items = self.x(node,type)
- #~ Any items generated by the processing are inteserted into the results.
- if items:
- for item in items:
- if item:
- test_run.appendChild(self.results.createTextNode("\n"))
- test_run.appendChild(item)
- return None
-
#~ The timestamp goes to the corresponding attribute in the result.
def x_build_timestamp( self, node ):
test_run = self.results.documentElement
- timestamp = self.get_child(self.get_child(node,tag='timestamp'),tag='#cdata-section').data.strip()
- test_run.setAttribute('timestamp',timestamp)
+ test_run.setAttribute('timestamp',self.get_data(node).strip())
return None
#~ Comment file becomes a comment node.
@@ -150,122 +180,122 @@
#~ Tests are remembered for future reference.
def x_build_test( self, node ):
test_run = self.results.documentElement
- test_node = self.get_child(node,tag='test')
- while test_node:
- test_name = test_node.getAttribute('name')
- self.test[test_name] = {
- 'library' : '/'.join(test_name.split('/')[0:-1]),
- 'test-name' : test_name.split('/')[-1],
- 'test-type' : test_node.getAttribute('type').lower(),
- 'test-program' : self.get_child_data(test_node,tag='source').strip(),
- 'target' : self.get_child_data(test_node,tag='target').strip(),
- 'info' : self.get_child_data(test_node,tag='info',strip=True)
- }
- #~ Add a lookup for the test given the test target.
- self.target_to_test[self.test[test_name]['target']] = test_name
- #~ print "--- %s\n => %s" %(self.test[test_name]['target'],test_name)
- test_node = self.get_sibling(test_node.nextSibling,tag='test')
+ test_node = node
+ test_name = test_node.getAttribute('name')
+ self.test[test_name] = {
+ 'library' : '/'.join(test_name.split('/')[0:-1]),
+ 'test-name' : test_name.split('/')[-1],
+ 'test-type' : test_node.getAttribute('type').lower(),
+ 'test-program' : self.get_child_data(test_node,tag='source',strip=True),
+ 'target' : self.get_child_data(test_node,tag='target',strip=True),
+ 'info' : self.get_child_data(test_node,tag='info',strip=True)
+ }
+ #~ Add a lookup for the test given the test target.
+ self.target_to_test[self.test[test_name]['target']] = test_name
+ #~ print "--- %s\n => %s" %(self.test[test_name]['target'],test_name)
return None
#~ Process the target dependency DAG into an ancestry tree so we can look up
#~ which top-level library and test targets specific build actions correspond to.
- def x_build_targets( self, node ):
+ def x_build_targets_target( self, node ):
test_run = self.results.documentElement
- target_node = self.get_child(self.get_child(node,tag='targets'),tag='target')
- while target_node:
- name = self.get_child_data(target_node,tag='name').strip()
- path = self.get_child_data(target_node,tag='path').strip()
- jam_target = self.get_child_data(target_node,tag='jam-target').strip()
- #~ Map for jam targets to virtual targets.
- self.target[jam_target] = {
- 'name' : name,
- 'path' : path
- }
- #~ Create the ancestry.
- dep_node = self.get_child(self.get_child(target_node,tag='dependencies'),tag='dependency')
- while dep_node:
- child = self.get_data(dep_node).strip()
- child_jam_target = '<p%s>%s' % (path,child.split('//',1)[1])
- self.parent[child_jam_target] = jam_target
- #~ print "--- %s\n ^ %s" %(jam_target,child_jam_target)
- dep_node = self.get_sibling(dep_node.nextSibling,tag='dependency')
- target_node = self.get_sibling(target_node.nextSibling,tag='target')
+ target_node = node
+ name = self.get_child_data(target_node,tag='name',strip=True)
+ path = self.get_child_data(target_node,tag='path',strip=True)
+ jam_target = self.get_child_data(target_node,tag='jam-target',strip=True)
+ #~ print "--- target :: %s" %(name)
+ #~ Map for jam targets to virtual targets.
+ self.target[jam_target] = {
+ 'name' : name,
+ 'path' : path
+ }
+ #~ Create the ancestry.
+ dep_node = self.get_child(self.get_child(target_node,tag='dependencies'),tag='dependency')
+ while dep_node:
+ child = self.get_data(dep_node,strip=True)
+ child_jam_target = '<p%s>%s' % (path,child.split('//',1)[1])
+ self.parent[child_jam_target] = jam_target
+ #~ print "--- %s\n ^ %s" %(jam_target,child_jam_target)
+ dep_node = self.get_sibling(dep_node.nextSibling,tag='dependency')
return None
#~ Given a build action log, process into the corresponding test log and
#~ specific test log sub-part.
def x_build_action( self, node ):
test_run = self.results.documentElement
- action_node = self.get_child(node,tag='action')
- while action_node:
- name = self.get_child(action_node,tag='name')
- if name:
- name = self.get_data(name)
- #~ Based on the action, we decide what sub-section the log
- #~ should go into.
- action_type = None
- if re.match('[^%]+%[^.]+[.](compile)',name):
- action_type = 'compile'
- elif re.match('[^%]+%[^.]+[.](link|archive)',name):
- action_type = 'link'
- elif re.match('[^%]+%testing[.](capture-output)',name):
- action_type = 'run'
- elif re.match('[^%]+%testing[.](expect-failure|expect-success)',name):
- action_type = 'result'
- #~ print "+ [%s] %s %s :: %s" %(action_type,name,'','')
- if action_type:
- #~ Get the corresponding test.
- (target,test) = self.get_test(action_node,type=action_type)
- #~ And the log node, which we will add the results to.
- log = self.get_log(action_node,test)
- #~ print "--- [%s] %s %s :: %s" %(action_type,name,target,test)
- #~ Collect some basic info about the action.
- result_data = "%(info)s\n\n%(command)s\n%(output)s\n" % {
- 'command' : self.get_action_command(action_node,action_type),
- 'output' : self.get_action_output(action_node,action_type),
- 'info' : self.get_action_info(action_node,action_type)
- }
- #~ For the test result status we find the appropriate node
- #~ based on the type of test. Then adjust the result status
- #~ acorrdingly. This makes the result status reflect the
- #~ expectation as the result pages post processing does not
- #~ account for this inversion.
- action_tag = action_type
- if action_type == 'result':
- if re.match(r'^compile',test['test-type']):
- action_tag = 'compile'
- elif re.match(r'^link',test['test-type']):
- action_tag = 'link'
- elif re.match(r'^run',test['test-type']):
- action_tag = 'run'
- #~ The result sub-part we will add this result to.
- result_node = self.get_child(log,tag=action_tag)
- if action_node.getAttribute('status') == '0':
- action_result = 'succeed'
- else:
- action_result = 'fail'
- if not result_node:
- #~ If we don't have one already, create it and add the result.
- result_node = self.new_text(action_tag,result_data,
- result = action_result,
- timestamp = action_node.getAttribute('start'))
- log.appendChild(self.results.createTextNode("\n"))
- log.appendChild(result_node)
+ action_node = node
+ name = self.get_child(action_node,tag='name')
+ if name:
+ name = self.get_data(name)
+ #~ Based on the action, we decide what sub-section the log
+ #~ should go into.
+ action_type = None
+ if re.match('[^%]+%[^.]+[.](compile)',name):
+ action_type = 'compile'
+ elif re.match('[^%]+%[^.]+[.](link|archive)',name):
+ action_type = 'link'
+ elif re.match('[^%]+%testing[.](capture-output)',name):
+ action_type = 'run'
+ elif re.match('[^%]+%testing[.](expect-failure|expect-success)',name):
+ action_type = 'result'
+ #~ print "+ [%s] %s %s :: %s" %(action_type,name,'','')
+ if action_type:
+ #~ Get the corresponding test.
+ (target,test) = self.get_test(action_node,type=action_type)
+ #~ Skip action that have no correspoding test as they are
+ #~ regular build actions and don't need to show up in the
+ #~ regression results.
+ if not test:
+ return None
+ #~ And the log node, which we will add the results to.
+ log = self.get_log(action_node,test)
+ #~ print "--- [%s] %s %s :: %s" %(action_type,name,target,test)
+ #~ Collect some basic info about the action.
+ result_data = "%(info)s\n\n%(command)s\n%(output)s\n" % {
+ 'command' : self.get_action_command(action_node,action_type),
+ 'output' : self.get_action_output(action_node,action_type),
+ 'info' : self.get_action_info(action_node,action_type)
+ }
+ #~ For the test result status we find the appropriate node
+ #~ based on the type of test. Then adjust the result status
+ #~ acorrdingly. This makes the result status reflect the
+ #~ expectation as the result pages post processing does not
+ #~ account for this inversion.
+ action_tag = action_type
+ if action_type == 'result':
+ if re.match(r'^compile',test['test-type']):
+ action_tag = 'compile'
+ elif re.match(r'^link',test['test-type']):
+ action_tag = 'link'
+ elif re.match(r'^run',test['test-type']):
+ action_tag = 'run'
+ #~ The result sub-part we will add this result to.
+ result_node = self.get_child(log,tag=action_tag)
+ if action_node.getAttribute('status') == '0':
+ action_result = 'succeed'
+ else:
+ action_result = 'fail'
+ if not result_node:
+ #~ If we don't have one already, create it and add the result.
+ result_node = self.new_text(action_tag,result_data,
+ result = action_result,
+ timestamp = action_node.getAttribute('start'))
+ log.appendChild(self.results.createTextNode("\n"))
+ log.appendChild(result_node)
+ else:
+ #~ For an existing result node we set the status to fail
+ #~ when any of the individual actions fail, except for result
+ #~ status.
+ if action_type != 'result':
+ result = result_node.getAttribute('result')
+ if action_node.getAttribute('status') != '0':
+ result = 'fail'
else:
- #~ For an existing result node we set the status to fail
- #~ when any of the individual actions fail, except for result
- #~ status.
- if action_type != 'result':
- result = result_node.getAttribute('result')
- if action_node.getAttribute('status') != '0':
- result = 'fail'
- else:
- result = action_result
- result_node.setAttribute('result',result)
- result_node.appendChild(self.results.createTextNode("\n"))
- result_node.appendChild(self.results.createTextNode(result_data))
- action_node = self.get_sibling(action_node.nextSibling,tag='action')
- return self.log.values()
+ result = action_result
+ result_node.setAttribute('result',result)
+ result_node.appendChild(self.results.createTextNode("\n"))
+ result_node.appendChild(self.results.createTextNode(result_data))
+ return None
#~ The command executed for the action. For run actions we omit the command
#~ as it's just noise.
@@ -323,7 +353,11 @@
}
test = self.test[lib]
else:
- test = self.test[self.target_to_test[self.target[target]['name']]]
+ target_name_ = self.target[target]['name']
+ if self.target_to_test.has_key(target_name_):
+ test = self.test[self.target_to_test[target_name_]]
+ else:
+ test = None
return (base,test)
#~ Find, or create, the test-log node to add results to.
@@ -357,10 +391,12 @@
#~ XML utilities...
- def get_sibling( self, sibling, tag = None, id = None, name = None ):
+ def get_sibling( self, sibling, tag = None, id = None, name = None, type = None ):
n = sibling
while n:
found = True
+ if type and found:
+ found = found and type == n.nodeType
if tag and found:
found = found and tag == n.nodeName
if (id or name) and found:
@@ -377,23 +413,30 @@
n = n.nextSibling
return None
- def get_child( self, root, tag = None, id = None, name = None ):
- return self.get_sibling(root.firstChild,tag=tag,id=id,name=name)
+ def get_child( self, root, tag = None, id = None, name = None, type = None ):
+ return self.get_sibling(root.firstChild,tag=tag,id=id,name=name,type=type)
def get_data( self, node, strip = False, default = None ):
data = None
if node:
- if not data:
- data = self.get_child(node,tag='#text')
- if not data:
- data = self.get_child(node,tag='#cdata-section')
- if data:
- if not strip:
- data = data.data
- else:
- data = data.data.strip()
+ data_node = None
+ if not data_node:
+ data_node = self.get_child(node,tag='#text')
+ if not data_node:
+ data_node = self.get_child(node,tag='#cdata-section')
+ data = ""
+ while data_node:
+ data += data_node.data
+ data_node = data_node.nextSibling
+ if data_node:
+ if data_node.nodeName != '#text' \
+ and data_node.nodeName != '#cdata-section':
+ data_node = None
if not data:
data = default
+ else:
+ if strip:
+ data = data.strip()
return data
def get_child_data( self, root, tag = None, id = None, name = None, strip = False, default = None ):
Modified: branches/proto/v4/tools/regression/xsl_reports/build_results.sh
==============================================================================
--- branches/proto/v4/tools/regression/xsl_reports/build_results.sh (original)
+++ branches/proto/v4/tools/regression/xsl_reports/build_results.sh 2008-05-27 20:03:07 EDT (Tue, 27 May 2008)
@@ -1,6 +1,6 @@
#!/bin/sh
-#~ Copyright Redshift Software, Inc. 2007
+#~ Copyright Redshift Software, Inc. 2007-2008
#~ Distributed under the Boost Software License, Version 1.0.
#~ (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
@@ -8,9 +8,9 @@
build_all()
{
- update_tools ${1}
- build_results ${1}
- upload_results ${1}
+ update_tools ${1} ${2}
+ build_results ${1} ${2}
+ upload_results ${1} ${2}
}
update_tools()
@@ -93,8 +93,25 @@
root=`pwd`
boost=${cwd}/boost
case ${1} in
- trunk) tag=trunk ;;
- release) tag=branches/release ;;
+ trunk)
+ tag=trunk
+ reports="dd,ds,i,n"
+ ;;
+
+ release)
+ tag=branches/release
+ reports="dd,ds,i,n"
+ ;;
+
+ release)
+ tag=branches/release
+ reports="dd,ds,i,n"
+ ;;
+
+ release-1_35_0)
+ tag=tags/release/Boost_1_35_0
+ reports="dd,ud,ds,us,ddr,udr,dsr,usr,i,n,e"
+ ;;
esac
report_info
python "${boost}/tools/regression/xsl_reports/boost_wide_report.py" \
@@ -104,20 +121,25 @@
--failures-markup="${boost}/status/explicit-failures-markup.xml" \
--comment="comment.html" \
--user="" \
- --reports="i,dd,ds,n"
+ --reports=${reports}
cd "${cwd}"
}
upload_results()
{
cwd=`pwd`
+ upload_dir=/home/grafik/www.boost.org/testing
+
cd ${1}/all
rm -f ../../${1}.zip*
- zip -r -9 ../../${1} * -x '*.xml'
+ zip -q -r -9 ../../${1} * -x '*.xml'
cd "${cwd}"
- bzip2 -9 ${1}.zip
- scp ${1}.zip.bz2 grafik_at_[hidden]:/home/grafik/www.boost.org/testing/incoming/
- ssh grafik_at_[hidden] bunzip2 /home/grafik/www.boost.org/testing/incoming/${1}.zip.bz2
+ mv ${1}.zip ${1}.zip.uploading
+ rsync -vuzhh --rsh=ssh --stats \
+ ${1}.zip.uploading grafik_at_[hidden]:/${upload_dir}/incoming/
+ ssh grafik_at_[hidden] \
+ cp ${upload_dir}/incoming/${1}.zip.uploading ${upload_dir}/live/${1}.zip
+ mv ${1}.zip.uploading ${1}.zip
}
-build_all ${1}
+build_all ${1} ${2}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk