passenger 5.3.3 → 5.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG +8 -0
- data/build/support/cxx_dependency_map.rb +151 -83
- data/dev/configkit-schemas/index.json +3 -3
- data/src/agent/Core/AdminPanelConnector.h +5 -3
- data/src/agent/Core/ApplicationPool/Common.h +1 -2
- data/src/agent/Core/ApplicationPool/Context.h +1 -2
- data/src/agent/Core/ApplicationPool/Group/InternalUtils.cpp +2 -2
- data/src/agent/Core/ApplicationPool/Pool/InitializationAndShutdown.cpp +2 -2
- data/src/agent/Core/Config.h +1 -1
- data/src/agent/Core/Controller.h +2 -1
- data/src/agent/Core/Controller/Config.h +6 -5
- data/src/agent/Core/Controller/Hooks.cpp +11 -0
- data/src/agent/Core/Controller/SendRequest.cpp +7 -7
- data/src/agent/Core/CoreMain.cpp +0 -2
- data/src/agent/Core/SpawningKit/Context.h +1 -3
- data/src/agent/Core/SpawningKit/Handshake/BackgroundIOCapturer.h +2 -2
- data/src/agent/Core/SpawningKit/Handshake/Perform.h +2 -2
- data/src/agent/Core/SpawningKit/Handshake/Prepare.h +17 -38
- data/src/agent/Core/SpawningKit/PipeWatcher.h +5 -3
- data/src/agent/Core/SpawningKit/UserSwitchingRules.h +13 -5
- data/src/agent/Shared/ApiServerUtils.h +2 -2
- data/src/agent/SpawnEnvSetupper/SpawnEnvSetupperMain.cpp +33 -18
- data/src/agent/Watchdog/Config.h +1 -1
- data/src/agent/Watchdog/WatchdogMain.cpp +20 -20
- data/src/apache2_module/Config.cpp +7 -6
- data/src/cxx_supportlib/ConfigKit/Store.h +2 -2
- data/src/cxx_supportlib/Constants.h +1 -1
- data/src/cxx_supportlib/Exceptions.h +0 -1
- data/src/cxx_supportlib/FileTools/PathSecurityCheck.cpp +3 -2
- data/src/cxx_supportlib/ResourceLocator.h +3 -21
- data/src/cxx_supportlib/SafeLibev.h +6 -6
- data/src/cxx_supportlib/ServerKit/Channel.h +2 -2
- data/src/cxx_supportlib/ServerKit/FileBufferedChannel.h +3 -3
- data/src/cxx_supportlib/ServerKit/FileBufferedFdSinkChannel.h +2 -2
- data/src/cxx_supportlib/ServerKit/HttpServer.h +27 -15
- data/src/cxx_supportlib/ServerKit/Server.h +2 -2
- data/src/cxx_supportlib/SystemTools/README.md +1 -0
- data/src/cxx_supportlib/SystemTools/UserDatabase.cpp +222 -0
- data/src/cxx_supportlib/SystemTools/UserDatabase.h +151 -0
- data/src/cxx_supportlib/Utils.cpp +1 -113
- data/src/cxx_supportlib/Utils.h +1 -29
- data/src/cxx_supportlib/Utils/MessagePassing.h +3 -3
- data/src/cxx_supportlib/WatchdogLauncher.h +1 -2
- data/src/cxx_supportlib/vendor-modified/boost/algorithm/string/detail/case_conv.hpp +6 -2
- data/src/cxx_supportlib/vendor-modified/boost/algorithm/string/detail/find_iterator.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/algorithm/string/detail/util.hpp +3 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio.hpp +31 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/associated_allocator.hpp +133 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/associated_executor.hpp +151 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/async_result.hpp +149 -22
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_datagram_socket.hpp +140 -49
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_deadline_timer.hpp +145 -35
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_io_object.hpp +75 -41
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_raw_socket.hpp +139 -49
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_seq_packet_socket.hpp +98 -45
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_serial_port.hpp +42 -49
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_signal_set.hpp +45 -38
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_socket.hpp +349 -109
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_socket_acceptor.hpp +959 -108
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_socket_iostream.hpp +198 -54
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_socket_streambuf.hpp +424 -284
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_stream_socket.hpp +116 -47
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_streambuf.hpp +99 -16
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_streambuf_fwd.hpp +4 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_waitable_timer.hpp +235 -49
- data/src/cxx_supportlib/vendor-modified/boost/asio/bind_executor.hpp +613 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/buffer.hpp +1139 -1216
- data/src/cxx_supportlib/vendor-modified/boost/asio/buffered_read_stream.hpp +27 -14
- data/src/cxx_supportlib/vendor-modified/boost/asio/buffered_read_stream_fwd.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/buffered_stream.hpp +26 -6
- data/src/cxx_supportlib/vendor-modified/boost/asio/buffered_stream_fwd.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/buffered_write_stream.hpp +27 -14
- data/src/cxx_supportlib/vendor-modified/boost/asio/buffered_write_stream_fwd.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/buffers_iterator.hpp +61 -21
- data/src/cxx_supportlib/vendor-modified/boost/asio/completion_condition.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/connect.hpp +462 -226
- data/src/cxx_supportlib/vendor-modified/boost/asio/coroutine.hpp +7 -7
- data/src/cxx_supportlib/vendor-modified/boost/asio/datagram_socket_service.hpp +94 -64
- data/src/cxx_supportlib/vendor-modified/boost/asio/deadline_timer.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/deadline_timer_service.hpp +20 -18
- data/src/cxx_supportlib/vendor-modified/boost/asio/defer.hpp +109 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/array.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/array_fwd.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/assert.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/atomic_count.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/base_from_completion_cond.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/bind_handler.hpp +404 -77
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/buffer_resize_guard.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/buffer_sequence_adapter.hpp +212 -51
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/buffered_stream_storage.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/call_stack.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/chrono.hpp +68 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/chrono_time_traits.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/completion_handler.hpp +8 -6
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/concurrency_hint.hpp +94 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/conditionally_enabled_event.hpp +114 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/conditionally_enabled_mutex.hpp +151 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/config.hpp +398 -13
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/consuming_buffers.hpp +287 -165
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/cstddef.hpp +33 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/cstdint.hpp +15 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/date_time_fwd.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/deadline_timer_service.hpp +65 -14
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/dependent_type.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/descriptor_ops.hpp +5 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/descriptor_read_op.hpp +17 -8
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/descriptor_write_op.hpp +17 -8
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/dev_poll_reactor.hpp +27 -15
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/epoll_reactor.hpp +41 -17
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/event.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/eventfd_select_interrupter.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/executor_op.hpp +86 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/fd_set_adapter.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/fenced_block.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/{function.hpp → functional.hpp} +10 -10
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/gcc_arm_fenced_block.hpp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/gcc_hppa_fenced_block.hpp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/gcc_sync_fenced_block.hpp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/gcc_x86_fenced_block.hpp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/global.hpp +54 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/handler_alloc_helpers.hpp +158 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/handler_cont_helpers.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/handler_invoke_helpers.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/handler_tracking.hpp +90 -9
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/handler_type_requirements.hpp +117 -39
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/handler_work.hpp +97 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/hash_map.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/buffer_sequence_adapter.ipp +6 -6
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/descriptor_ops.ipp +24 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/dev_poll_reactor.hpp +17 -4
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/dev_poll_reactor.ipp +34 -18
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/epoll_reactor.hpp +17 -4
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/epoll_reactor.ipp +152 -51
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/eventfd_select_interrupter.ipp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/handler_tracking.ipp +80 -27
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/kqueue_reactor.hpp +19 -6
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/kqueue_reactor.ipp +93 -23
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/null_event.ipp +76 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/pipe_select_interrupter.ipp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/posix_event.ipp +13 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/posix_mutex.ipp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/posix_thread.ipp +11 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/posix_tss_ptr.ipp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/reactive_descriptor_service.ipp +27 -13
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/reactive_serial_port_service.ipp +7 -6
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/reactive_socket_service_base.ipp +43 -10
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/resolver_service_base.ipp +54 -30
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/{task_io_service.ipp → scheduler.ipp} +167 -70
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/select_reactor.hpp +17 -4
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/select_reactor.ipp +46 -26
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/service_registry.hpp +36 -30
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/service_registry.ipp +39 -30
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/signal_set_service.ipp +43 -21
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/socket_ops.ipp +129 -26
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/socket_select_interrupter.ipp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/strand_executor_service.hpp +181 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/strand_executor_service.ipp +136 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/strand_service.hpp +13 -13
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/strand_service.ipp +15 -14
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/throw_error.ipp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/timer_queue_ptime.ipp +12 -5
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/timer_queue_set.ipp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/io_control.hpp +1 -51
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/is_buffer_sequence.hpp +241 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/is_executor.hpp +128 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/keyword_tss_ptr.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/kqueue_reactor.hpp +36 -14
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/local_free_on_block_exit.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/macos_fenced_block.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/memory.hpp +42 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/mutex.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/noncopyable.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/null_event.hpp +17 -5
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/null_fenced_block.hpp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/null_global.hpp +61 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/null_mutex.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/null_reactor.hpp +10 -9
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/null_signal_blocker.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/null_socket_service.hpp +29 -19
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/null_static_mutex.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/null_thread.hpp +7 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/null_tss_ptr.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/object_pool.hpp +26 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/old_win_sdk_compat.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/op_queue.hpp +7 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/operation.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/pipe_select_interrupter.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/pop_options.hpp +5 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/posix_event.hpp +37 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/posix_fd_set_adapter.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/posix_global.hpp +82 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/posix_mutex.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/posix_signal_blocker.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/posix_static_mutex.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/posix_thread.hpp +5 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/posix_tss_ptr.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/push_options.hpp +10 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_descriptor_service.hpp +86 -20
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_null_buffers_op.hpp +9 -7
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_serial_port_service.hpp +10 -8
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_accept_op.hpp +101 -20
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_connect_op.hpp +14 -7
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_recv_op.hpp +20 -8
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_recvfrom_op.hpp +13 -8
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_recvmsg_op.hpp +15 -8
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_send_op.hpp +25 -11
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_sendto_op.hpp +15 -8
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_service.hpp +99 -31
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_service_base.hpp +96 -35
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_wait_op.hpp +92 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactor.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactor_fwd.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactor_op.hpp +7 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactor_op_queue.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/recycling_allocator.hpp +106 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/regex_fwd.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/resolve_endpoint_op.hpp +25 -24
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/resolve_op.hpp +6 -92
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/resolve_query_op.hpp +136 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/resolver_service.hpp +38 -22
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/resolver_service_base.hpp +30 -19
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/{task_io_service.hpp → scheduler.hpp} +57 -45
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/{task_io_service_operation.hpp → scheduler_operation.hpp} +19 -17
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/{task_io_service_thread_info.hpp → scheduler_thread_info.hpp} +10 -10
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/scoped_lock.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/scoped_ptr.hpp +9 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/select_interrupter.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/select_reactor.hpp +37 -18
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/service_registry.hpp +54 -34
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/signal_blocker.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/signal_handler.hpp +9 -5
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/signal_init.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/signal_op.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/signal_set_service.hpp +14 -13
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/socket_holder.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/socket_ops.hpp +9 -6
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/socket_option.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/socket_select_interrupter.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/socket_types.hpp +10 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/solaris_fenced_block.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/static_mutex.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/std_event.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/std_fenced_block.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/std_global.hpp +72 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/std_mutex.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/std_static_mutex.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/std_thread.hpp +7 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/strand_executor_service.hpp +144 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/strand_service.hpp +10 -10
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/string_view.hpp +49 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/thread.hpp +9 -5
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/thread_context.hpp +44 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/thread_group.hpp +91 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/thread_info_base.hpp +45 -15
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/throw_error.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/throw_exception.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/timer_queue.hpp +29 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/timer_queue_base.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/timer_queue_ptime.hpp +11 -5
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/timer_queue_set.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/timer_scheduler.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/timer_scheduler_fwd.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/tss_ptr.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/type_traits.hpp +29 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/variadic_templates.hpp +74 -18
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/wait_handler.hpp +8 -6
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/wait_op.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/winsock_init.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/work_dispatcher.hpp +74 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/wrapped_handler.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/dispatch.hpp +110 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/error.hpp +17 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution_context.hpp +413 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/executor.hpp +343 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/executor_work_guard.hpp +172 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental.hpp +22 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/co_spawn.hpp +228 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detached.hpp +67 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/co_spawn.hpp +878 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/detached.hpp +93 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/redirect_error.hpp +296 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/redirect_error.hpp +69 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/generic/basic_endpoint.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/generic/datagram_protocol.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/generic/detail/endpoint.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/generic/detail/impl/endpoint.ipp +3 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/generic/raw_protocol.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/generic/seq_packet_protocol.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/generic/stream_protocol.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/handler_alloc_hook.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/handler_continuation_hook.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/handler_invoke_hook.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/asio/handler_type.hpp +11 -73
- data/src/cxx_supportlib/vendor-modified/boost/asio/high_resolution_timer.hpp +4 -23
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/buffered_read_stream.hpp +86 -15
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/buffered_write_stream.hpp +92 -19
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/connect.hpp +549 -119
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/defer.hpp +79 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/dispatch.hpp +80 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/error.ipp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/execution_context.hpp +109 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/execution_context.ipp +84 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/executor.hpp +388 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/executor.ipp +40 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/handler_alloc_hook.ipp +7 -32
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/io_context.hpp +347 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/io_context.ipp +176 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/post.hpp +79 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read.hpp +341 -379
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read_at.hpp +173 -343
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read_until.hpp +559 -206
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/serial_port_base.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/serial_port_base.ipp +30 -30
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/spawn.hpp +254 -72
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/src.cpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/src.hpp +12 -4
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/system_context.hpp +36 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/system_context.ipp +75 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/system_executor.hpp +87 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/thread_pool.hpp +129 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/thread_pool.ipp +78 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/use_future.hpp +855 -94
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/write.hpp +358 -449
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/write_at.hpp +165 -418
- data/src/cxx_supportlib/vendor-modified/boost/asio/io_context.hpp +878 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/io_context_strand.hpp +386 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/io_service.hpp +6 -743
- data/src/cxx_supportlib/vendor-modified/boost/asio/io_service_strand.hpp +20 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/address.hpp +79 -19
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/address_v4.hpp +111 -23
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/address_v4_iterator.hpp +164 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/address_v4_range.hpp +136 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/address_v6.hpp +104 -14
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/address_v6_iterator.hpp +185 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/address_v6_range.hpp +131 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/bad_address_cast.hpp +50 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/basic_endpoint.hpp +5 -5
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/basic_resolver.hpp +821 -71
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/basic_resolver_entry.hpp +23 -4
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/basic_resolver_iterator.hpp +31 -99
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/basic_resolver_query.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/basic_resolver_results.hpp +313 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/detail/endpoint.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/detail/impl/endpoint.ipp +5 -10
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/detail/socket_option.hpp +16 -19
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/host_name.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/icmp.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/address.hpp +28 -14
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/address.ipp +55 -47
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/address_v4.hpp +28 -14
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/address_v4.ipp +76 -44
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/address_v6.hpp +28 -14
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/address_v6.ipp +85 -33
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/basic_endpoint.hpp +2 -14
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/host_name.ipp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/network_v4.hpp +56 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/network_v4.ipp +218 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/network_v6.hpp +55 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/network_v6.ipp +187 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/multicast.hpp +8 -8
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/network_v4.hpp +263 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/network_v6.hpp +237 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/resolver_base.hpp +131 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/resolver_query_base.hpp +3 -90
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/resolver_service.hpp +48 -24
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/tcp.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/udp.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/unicast.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/v6_only.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/is_executor.hpp +48 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/is_read_buffered.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/is_write_buffered.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/local/basic_endpoint.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/local/connect_pair.hpp +23 -21
- data/src/cxx_supportlib/vendor-modified/boost/asio/local/datagram_protocol.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/local/detail/endpoint.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/local/detail/impl/endpoint.ipp +3 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/local/stream_protocol.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/packaged_task.hpp +128 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/placeholders.hpp +30 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/posix/basic_descriptor.hpp +138 -46
- data/src/cxx_supportlib/vendor-modified/boost/asio/posix/basic_stream_descriptor.hpp +15 -15
- data/src/cxx_supportlib/vendor-modified/boost/asio/posix/descriptor.hpp +646 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/posix/descriptor_base.hpp +17 -24
- data/src/cxx_supportlib/vendor-modified/boost/asio/posix/stream_descriptor.hpp +326 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/posix/stream_descriptor_service.hpp +63 -44
- data/src/cxx_supportlib/vendor-modified/boost/asio/post.hpp +109 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/raw_socket_service.hpp +94 -64
- data/src/cxx_supportlib/vendor-modified/boost/asio/read.hpp +328 -12
- data/src/cxx_supportlib/vendor-modified/boost/asio/read_at.hpp +13 -6
- data/src/cxx_supportlib/vendor-modified/boost/asio/read_until.hpp +1148 -247
- data/src/cxx_supportlib/vendor-modified/boost/asio/seq_packet_socket_service.hpp +88 -56
- data/src/cxx_supportlib/vendor-modified/boost/asio/serial_port.hpp +736 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/serial_port_base.hpp +11 -11
- data/src/cxx_supportlib/vendor-modified/boost/asio/serial_port_service.hpp +41 -45
- data/src/cxx_supportlib/vendor-modified/boost/asio/signal_set.hpp +422 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/signal_set_service.hpp +32 -24
- data/src/cxx_supportlib/vendor-modified/boost/asio/socket_acceptor_service.hpp +114 -48
- data/src/cxx_supportlib/vendor-modified/boost/asio/socket_base.hpp +85 -46
- data/src/cxx_supportlib/vendor-modified/boost/asio/spawn.hpp +89 -18
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl.hpp +1 -4
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/context.hpp +33 -62
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/context_base.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/buffered_handshake_op.hpp +27 -23
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/engine.hpp +10 -14
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/handshake_op.hpp +2 -8
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/impl/engine.ipp +22 -25
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/impl/openssl_init.ipp +5 -4
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/io.hpp +40 -17
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/openssl_init.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/openssl_types.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/password_callback.hpp +4 -10
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/read_op.hpp +3 -9
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/shutdown_op.hpp +2 -8
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/stream_core.hpp +27 -19
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/verify_callback.hpp +2 -8
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/write_op.hpp +3 -9
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/error.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/impl/context.hpp +8 -12
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/impl/context.ipp +86 -102
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/impl/error.ipp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/impl/rfc2818_verification.ipp +7 -13
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/impl/src.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/rfc2818_verification.hpp +7 -13
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/stream.hpp +90 -85
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/stream_base.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/verify_context.hpp +3 -9
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/verify_mode.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/steady_timer.hpp +4 -23
- data/src/cxx_supportlib/vendor-modified/boost/asio/strand.hpp +209 -175
- data/src/cxx_supportlib/vendor-modified/boost/asio/stream_socket_service.hpp +88 -56
- data/src/cxx_supportlib/vendor-modified/boost/asio/streambuf.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/system_context.hpp +80 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/system_executor.hpp +131 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/system_timer.hpp +4 -19
- data/src/cxx_supportlib/vendor-modified/boost/asio/thread_pool.hpp +234 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/time_traits.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/ts/buffer.hpp +24 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ts/executor.hpp +35 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ts/internet.hpp +40 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ts/io_context.hpp +20 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ts/net.hpp +26 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ts/netfwd.hpp +199 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ts/socket.hpp +27 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ts/timer.hpp +26 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/unyield.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/use_future.hpp +70 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/uses_executor.hpp +73 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/version.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/wait_traits.hpp +17 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/waitable_timer_service.hpp +62 -20
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_handle.hpp +22 -30
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_object_handle.hpp +14 -10
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_random_access_handle.hpp +15 -15
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_stream_handle.hpp +15 -15
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/object_handle.hpp +346 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/object_handle_service.hpp +26 -20
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/overlapped_handle.hpp +333 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/overlapped_ptr.hpp +6 -6
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/random_access_handle.hpp +344 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/random_access_handle_service.hpp +31 -37
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/stream_handle.hpp +328 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/stream_handle_service.hpp +29 -37
- data/src/cxx_supportlib/vendor-modified/boost/asio/write.hpp +321 -12
- data/src/cxx_supportlib/vendor-modified/boost/asio/write_at.hpp +13 -6
- data/src/cxx_supportlib/vendor-modified/boost/asio/yield.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/atomic/atomic.hpp +11 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/capabilities.hpp +50 -1
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/addressof.hpp +58 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/atomic_flag.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/atomic_template.hpp +688 -220
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/bitwise_cast.hpp +25 -21
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/bitwise_fp_cast.hpp +86 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/caps_gcc_arm.hpp +1 -18
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/caps_gcc_atomic.hpp +9 -10
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/caps_gcc_ppc.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/caps_gcc_sync.hpp +7 -8
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/caps_gcc_x86.hpp +1 -36
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/config.hpp +108 -34
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/extra_fp_operations.hpp +28 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/extra_fp_operations_fwd.hpp +35 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/extra_fp_ops_emulated.hpp +107 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/extra_fp_ops_generic.hpp +189 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/extra_operations.hpp +28 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/extra_operations_fwd.hpp +35 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/extra_ops_emulated.hpp +238 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/extra_ops_gcc_arm.hpp +1111 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/extra_ops_gcc_ppc.hpp +840 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/extra_ops_gcc_x86.hpp +1656 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/extra_ops_generic.hpp +402 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/extra_ops_msvc_arm.hpp +106 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/extra_ops_msvc_x86.hpp +1301 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/float_sizes.hpp +142 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/fp_operations.hpp +28 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/fp_operations_fwd.hpp +35 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/fp_ops_emulated.hpp +72 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/fp_ops_generic.hpp +83 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/hwcaps_gcc_arm.hpp +67 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/hwcaps_gcc_ppc.hpp +42 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/hwcaps_gcc_x86.hpp +58 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/int_sizes.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/integral_extend.hpp +105 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/interlocked.hpp +35 -1
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/operations_lockfree.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_cas_based.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_emulated.hpp +8 -9
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_extending_cas_based.hpp +8 -7
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_gcc_alpha.hpp +14 -16
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_gcc_arm.hpp +548 -126
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_gcc_arm_common.hpp +134 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_gcc_atomic.hpp +36 -44
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_gcc_ppc.hpp +524 -96
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_gcc_ppc_common.hpp +70 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_gcc_sparc.hpp +14 -16
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_gcc_sync.hpp +27 -59
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_gcc_x86.hpp +104 -57
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_gcc_x86_dcas.hpp +268 -340
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_linux_arm.hpp +9 -9
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_msvc_arm.hpp +22 -24
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_msvc_x86.hpp +55 -80
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/platform.hpp +88 -46
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/storage_type.hpp +30 -103
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/string_ops.hpp +61 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/type_traits/conditional.hpp +42 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/type_traits/integral_constant.hpp +46 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/type_traits/is_floating_point.hpp +42 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/type_traits/is_function.hpp +42 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/type_traits/is_iec559.hpp +47 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/type_traits/is_integral.hpp +43 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/type_traits/is_signed.hpp +43 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/type_traits/is_trivially_default_constructible.hpp +46 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/type_traits/make_signed.hpp +43 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/type_traits/make_unsigned.hpp +43 -0
- data/src/cxx_supportlib/vendor-modified/boost/bind/bind.hpp +37 -0
- data/src/cxx_supportlib/vendor-modified/boost/bind/bind_cc.hpp +30 -30
- data/src/cxx_supportlib/vendor-modified/boost/bind/bind_mf_cc.hpp +36 -36
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/system.hpp +0 -10
- data/src/cxx_supportlib/vendor-modified/boost/chrono/duration.hpp +28 -30
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/duration_get.hpp +2 -4
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/duration_io.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/time_point_io.hpp +14 -8
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/time_point_units.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io_v1/chrono_io.hpp +2 -4
- data/src/cxx_supportlib/vendor-modified/boost/chrono/process_cpu_clocks.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/chrono/time_point.hpp +0 -1
- data/src/cxx_supportlib/vendor-modified/boost/circular_buffer/base.hpp +9 -9
- data/src/cxx_supportlib/vendor-modified/boost/circular_buffer/details.hpp +7 -6
- data/src/cxx_supportlib/vendor-modified/boost/config.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/config/auto_link.hpp +26 -4
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/borland.hpp +12 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/clang.hpp +30 -2
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/codegear.hpp +13 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/common_edg.hpp +11 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/cray.hpp +32 -2
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/diab.hpp +26 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/digitalmars.hpp +11 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/gcc.hpp +33 -6
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/gcc_xml.hpp +11 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/intel.hpp +8 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/metrowerks.hpp +11 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/mpw.hpp +11 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/nvcc.hpp +28 -2
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/pathscale.hpp +17 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/pgi.hpp +8 -142
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/sunpro_cc.hpp +14 -3
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/vacpp.hpp +16 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/visualc.hpp +37 -9
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/xlcpp.hpp +19 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/xlcpp_zos.hpp +169 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/{posix_features.hpp → detail/posix_features.hpp} +0 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/{select_compiler_config.hpp → detail/select_compiler_config.hpp} +15 -5
- data/src/cxx_supportlib/vendor-modified/boost/config/{select_platform_config.hpp → detail/select_platform_config.hpp} +8 -3
- data/src/cxx_supportlib/vendor-modified/boost/config/{select_stdlib_config.hpp → detail/select_stdlib_config.hpp} +5 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/{suffix.hpp → detail/suffix.hpp} +27 -27
- data/src/cxx_supportlib/vendor-modified/boost/config/header_deprecated.hpp +26 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/helper_macros.hpp +37 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/platform/aix.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/platform/beos.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/platform/bsd.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/platform/cray.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/platform/cygwin.hpp +12 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/platform/haiku.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/platform/hpux.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/platform/irix.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/platform/linux.hpp +4 -3
- data/src/cxx_supportlib/vendor-modified/boost/config/platform/macos.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/platform/qnxnto.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/platform/solaris.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/platform/symbian.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/platform/vxworks.hpp +155 -91
- data/src/cxx_supportlib/vendor-modified/boost/config/platform/zos.hpp +32 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/pragma_message.hpp +31 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/dinkumware.hpp +21 -2
- data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/libcomo.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/libcpp.hpp +20 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/libstdcpp3.hpp +35 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/modena.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/msl.hpp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/roguewave.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/sgi.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/stlport.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/vacpp.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/xlcpp_zos.hpp +60 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/workaround.hpp +279 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/adaptive_pool.hpp +19 -19
- data/src/cxx_supportlib/vendor-modified/boost/container/allocator.hpp +5 -5
- data/src/cxx_supportlib/vendor-modified/boost/container/allocator_traits.hpp +58 -58
- data/src/cxx_supportlib/vendor-modified/boost/container/container_fwd.hpp +7 -28
- data/src/cxx_supportlib/vendor-modified/boost/container/deque.hpp +57 -57
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/adaptive_node_pool.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/adaptive_node_pool_impl.hpp +10 -10
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/addressof.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/advanced_insert_int.hpp +18 -18
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/algorithm.hpp +122 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/alloc_helpers.hpp +8 -8
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/allocator_version_traits.hpp +7 -7
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/construct_in_place.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/container_or_allocator_rebind.hpp +49 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/container_rebind.hpp +258 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/copy_move_algo.hpp +119 -134
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/destroyers.hpp +15 -15
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/dispatch_uses_allocator.hpp +55 -55
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/flat_tree.hpp +714 -282
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/is_container.hpp +55 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/is_contiguous_container.hpp +47 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/is_sorted.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/iterator.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/iterator_to_raw_pointer.hpp +4 -29
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/iterators.hpp +9 -9
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/math_functions.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/min_max.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/mpl.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/multiallocation_chain.hpp +8 -8
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/mutex.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/next_capacity.hpp +37 -35
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/node_alloc_holder.hpp +41 -41
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/node_pool.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/node_pool_impl.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/pair.hpp +69 -16
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/pair_key_mapped_of_value.hpp +55 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/pool_common.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/pool_common_alloc.hpp +7 -7
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/singleton.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/transform_iterator.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/tree.hpp +180 -116
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/type_traits.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/value_functors.hpp +36 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/value_init.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/variadic_templates_tools.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/version_type.hpp +8 -8
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/workaround.hpp +0 -6
- data/src/cxx_supportlib/vendor-modified/boost/container/flat_map.hpp +874 -572
- data/src/cxx_supportlib/vendor-modified/boost/container/flat_set.hpp +497 -248
- data/src/cxx_supportlib/vendor-modified/boost/container/list.hpp +33 -42
- data/src/cxx_supportlib/vendor-modified/boost/container/map.hpp +326 -246
- data/src/cxx_supportlib/vendor-modified/boost/container/node_allocator.hpp +19 -19
- data/src/cxx_supportlib/vendor-modified/boost/container/node_handle.hpp +122 -78
- data/src/cxx_supportlib/vendor-modified/boost/container/options.hpp +165 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/flat_map.hpp +4 -8
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/flat_set.hpp +4 -8
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/map.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/polymorphic_allocator.hpp +6 -6
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/resource_adaptor.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/set.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/container/scoped_allocator.hpp +19 -19
- data/src/cxx_supportlib/vendor-modified/boost/container/set.hpp +285 -110
- data/src/cxx_supportlib/vendor-modified/boost/container/slist.hpp +35 -53
- data/src/cxx_supportlib/vendor-modified/boost/container/small_vector.hpp +18 -19
- data/src/cxx_supportlib/vendor-modified/boost/container/stable_vector.hpp +25 -25
- data/src/cxx_supportlib/vendor-modified/boost/container/static_vector.hpp +24 -9
- data/src/cxx_supportlib/vendor-modified/boost/container/string.hpp +194 -142
- data/src/cxx_supportlib/vendor-modified/boost/container/throw_exception.hpp +15 -5
- data/src/cxx_supportlib/vendor-modified/boost/container/uses_allocator.hpp +5 -5
- data/src/cxx_supportlib/vendor-modified/boost/container/vector.hpp +395 -421
- data/src/cxx_supportlib/vendor-modified/boost/{functional/hash → container_hash}/detail/float_functions.hpp +0 -0
- data/src/cxx_supportlib/vendor-modified/boost/{functional/hash → container_hash}/detail/hash_float.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/{functional/hash → container_hash}/detail/limits.hpp +0 -0
- data/src/cxx_supportlib/vendor-modified/boost/{functional/hash → container_hash}/extensions.hpp +112 -16
- data/src/cxx_supportlib/vendor-modified/boost/{functional/hash → container_hash}/hash.hpp +195 -7
- data/src/cxx_supportlib/vendor-modified/boost/{functional/hash → container_hash}/hash_fwd.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/core/addressof.hpp +53 -44
- data/src/cxx_supportlib/vendor-modified/boost/core/lightweight_test.hpp +80 -2
- data/src/cxx_supportlib/vendor-modified/boost/core/no_exceptions_support.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/core/pointer_traits.hpp +233 -0
- data/src/cxx_supportlib/vendor-modified/boost/core/ref.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/cstdint.hpp +26 -16
- data/src/cxx_supportlib/vendor-modified/boost/date_time/adjust_functors.hpp +20 -34
- data/src/cxx_supportlib/vendor-modified/boost/date_time/c_local_time_adjustor.hpp +8 -5
- data/src/cxx_supportlib/vendor-modified/boost/date_time/date_duration.hpp +4 -0
- data/src/cxx_supportlib/vendor-modified/boost/date_time/date_formatting.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/date_time/date_formatting_locales.hpp +7 -6
- data/src/cxx_supportlib/vendor-modified/boost/date_time/dst_rules.hpp +6 -6
- data/src/cxx_supportlib/vendor-modified/boost/date_time/filetime_functions.hpp +8 -94
- data/src/cxx_supportlib/vendor-modified/boost/date_time/format_date_parser.hpp +1 -8
- data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_day.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_facet.hpp +6 -4
- data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_month.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_weekday.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_year.hpp +6 -6
- data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/gregorian_io.hpp +52 -52
- data/src/cxx_supportlib/vendor-modified/boost/date_time/int_adapter.hpp +14 -27
- data/src/cxx_supportlib/vendor-modified/boost/date_time/local_time/custom_time_zone.hpp +0 -1
- data/src/cxx_supportlib/vendor-modified/boost/date_time/locale_config.hpp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/date_time/microsec_time_clock.hpp +36 -5
- data/src/cxx_supportlib/vendor-modified/boost/date_time/period_formatter.hpp +10 -9
- data/src/cxx_supportlib/vendor-modified/boost/date_time/posix_time/conversion.hpp +10 -12
- data/src/cxx_supportlib/vendor-modified/boost/date_time/posix_time/posix_time_duration.hpp +18 -10
- data/src/cxx_supportlib/vendor-modified/boost/date_time/posix_time/posix_time_io.hpp +12 -12
- data/src/cxx_supportlib/vendor-modified/boost/date_time/posix_time/time_serialize.hpp +65 -20
- data/src/cxx_supportlib/vendor-modified/boost/date_time/special_values_parser.hpp +32 -23
- data/src/cxx_supportlib/vendor-modified/boost/date_time/string_parse_tree.hpp +6 -5
- data/src/cxx_supportlib/vendor-modified/boost/date_time/time_duration.hpp +10 -7
- data/src/cxx_supportlib/vendor-modified/boost/date_time/time_facet.hpp +8 -3
- data/src/cxx_supportlib/vendor-modified/boost/date_time/time_parsing.hpp +20 -0
- data/src/cxx_supportlib/vendor-modified/boost/date_time/time_resolution_traits.hpp +31 -8
- data/src/cxx_supportlib/vendor-modified/boost/date_time/time_system_split.hpp +10 -4
- data/src/cxx_supportlib/vendor-modified/boost/date_time/tz_db_base.hpp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/detail/workaround.hpp +2 -264
- data/src/cxx_supportlib/vendor-modified/boost/enable_shared_from_this.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/exception/detail/error_info_impl.hpp +38 -21
- data/src/cxx_supportlib/vendor-modified/boost/exception/detail/exception_ptr.hpp +10 -9
- data/src/cxx_supportlib/vendor-modified/boost/exception/detail/is_output_streamable.hpp +3 -2
- data/src/cxx_supportlib/vendor-modified/boost/exception/detail/object_hex_dump.hpp +7 -6
- data/src/cxx_supportlib/vendor-modified/boost/exception/detail/type_info.hpp +7 -6
- data/src/cxx_supportlib/vendor-modified/boost/exception/diagnostic_information.hpp +10 -7
- data/src/cxx_supportlib/vendor-modified/boost/exception/get_error_info.hpp +8 -6
- data/src/cxx_supportlib/vendor-modified/boost/exception/info.hpp +13 -47
- data/src/cxx_supportlib/vendor-modified/boost/exception/to_string.hpp +5 -4
- data/src/cxx_supportlib/vendor-modified/boost/exception/to_string_stub.hpp +5 -4
- data/src/cxx_supportlib/vendor-modified/boost/function.hpp +12 -4
- data/src/cxx_supportlib/vendor-modified/boost/function/detail/gen_maybe_include.pl +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/function/detail/maybe_include.hpp +102 -0
- data/src/cxx_supportlib/vendor-modified/boost/function/function_base.hpp +20 -0
- data/src/cxx_supportlib/vendor-modified/boost/function/function_template.hpp +9 -0
- data/src/cxx_supportlib/vendor-modified/boost/functional/hash.hpp +1 -2
- data/src/cxx_supportlib/vendor-modified/boost/functional/hash_fwd.hpp +1 -6
- data/src/cxx_supportlib/vendor-modified/boost/integer/common_factor_rt.hpp +508 -390
- data/src/cxx_supportlib/vendor-modified/boost/integer/integer_mask.hpp +9 -1
- data/src/cxx_supportlib/vendor-modified/boost/integer_fwd.hpp +3 -0
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/bstree.hpp +11 -3
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/circular_list_algorithms.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/config_begin.hpp +7 -20
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/default_header_holder.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/ebo_functor_holder.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/hashtable_node.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/hook_traits.hpp +5 -5
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/iterator.hpp +108 -2
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/mpl.hpp +15 -5
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/node_to_value.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/tree_value_compare.hpp +8 -4
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/hashtable.hpp +147 -64
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/list.hpp +9 -2
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/member_value_traits.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/pointer_plus_bits.hpp +15 -0
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/pointer_traits.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/slist.hpp +9 -2
- data/src/cxx_supportlib/vendor-modified/boost/intrusive_ptr.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/iterator/advance.hpp +84 -0
- data/src/cxx_supportlib/vendor-modified/boost/iterator/iterator_adaptor.hpp +0 -2
- data/src/cxx_supportlib/vendor-modified/boost/iterator/iterator_categories.hpp +3 -2
- data/src/cxx_supportlib/vendor-modified/boost/iterator/iterator_concepts.hpp +8 -10
- data/src/cxx_supportlib/vendor-modified/boost/iterator/iterator_facade.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/iterator/iterator_traits.hpp +7 -6
- data/src/cxx_supportlib/vendor-modified/boost/iterator/reverse_iterator.hpp +7 -4
- data/src/cxx_supportlib/vendor-modified/boost/iterator/transform_iterator.hpp +6 -2
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_lexical_streams.hpp +7 -7
- data/src/cxx_supportlib/vendor-modified/boost/libs/thread/src/pthread/once_atomic.cpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/libs/thread/src/pthread/thread.cpp +36 -92
- data/src/cxx_supportlib/vendor-modified/boost/make_shared.hpp +1 -2
- data/src/cxx_supportlib/vendor-modified/boost/math/special_functions/detail/fp_traits.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/math/special_functions/math_fwd.hpp +57 -3
- data/src/cxx_supportlib/vendor-modified/boost/math/special_functions/sign.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/math/tools/config.hpp +12 -1
- data/src/cxx_supportlib/vendor-modified/boost/memory_order.hpp +40 -9
- data/src/cxx_supportlib/vendor-modified/boost/move/adl_move_swap.hpp +6 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/algo/adaptive_merge.hpp +253 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/algo/adaptive_sort.hpp +563 -4
- data/src/cxx_supportlib/vendor-modified/boost/move/algo/detail/adaptive_sort_merge.hpp +324 -1071
- data/src/cxx_supportlib/vendor-modified/boost/move/algo/detail/basic_op.hpp +10 -10
- data/src/cxx_supportlib/vendor-modified/boost/move/algo/detail/heap_sort.hpp +111 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/algo/detail/insertion_sort.hpp +12 -11
- data/src/cxx_supportlib/vendor-modified/boost/move/algo/detail/is_sorted.hpp +55 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/algo/detail/merge.hpp +59 -143
- data/src/cxx_supportlib/vendor-modified/boost/move/algo/detail/merge_sort.hpp +6 -6
- data/src/cxx_supportlib/vendor-modified/boost/move/algo/detail/pdqsort.hpp +334 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/algo/detail/set_difference.hpp +207 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/algo/move.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/move/algo/predicate.hpp +86 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/algo/unique.hpp +55 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/core.hpp +1 -9
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/destruct_n.hpp +3 -4
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/fwd_macros.hpp +25 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/iterator_to_raw_pointer.hpp +59 -0
- data/src/cxx_supportlib/vendor-modified/boost/{intrusive → move}/detail/pointer_element.hpp +12 -12
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/to_raw_pointer.hpp +45 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/type_traits.hpp +19 -5
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/unique_ptr_meta_utils.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/mpl/assert.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/mpl/get_tag.hpp +26 -0
- data/src/cxx_supportlib/vendor-modified/boost/next_prior.hpp +85 -55
- data/src/cxx_supportlib/vendor-modified/boost/numeric/conversion/cast.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/numeric/conversion/conversion_traits.hpp +0 -7
- data/src/cxx_supportlib/vendor-modified/boost/numeric/conversion/detail/converter.hpp +4 -13
- data/src/cxx_supportlib/vendor-modified/boost/operators.hpp +26 -7
- data/src/cxx_supportlib/vendor-modified/boost/optional/detail/experimental_traits.hpp +98 -0
- data/src/cxx_supportlib/vendor-modified/boost/optional/detail/old_optional_implementation.hpp +10 -10
- data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_aligned_storage.hpp +17 -21
- data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_config.hpp +25 -6
- data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_reference_spec.hpp +15 -15
- data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_relops.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_trivially_copyable_base.hpp +499 -0
- data/src/cxx_supportlib/vendor-modified/boost/optional/optional.hpp +126 -21
- data/src/cxx_supportlib/vendor-modified/boost/parameter/aux_/arg_list.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/pointer_cast.hpp +10 -9
- data/src/cxx_supportlib/vendor-modified/boost/pointer_to_other.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/predef/architecture/arm.h +6 -1
- data/src/cxx_supportlib/vendor-modified/boost/predef/architecture/parisc.h +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/predef/compiler/intel.h +8 -1
- data/src/cxx_supportlib/vendor-modified/boost/predef/hardware/simd/arm.h +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/predef/library/c.h +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/predef/library/c/cloudabi.h +53 -0
- data/src/cxx_supportlib/vendor-modified/boost/predef/make.h +4 -0
- data/src/cxx_supportlib/vendor-modified/boost/predef/os/android.h +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/predef/os/bsd/free.h +10 -3
- data/src/cxx_supportlib/vendor-modified/boost/predef/os/bsd/open.h +80 -0
- data/src/cxx_supportlib/vendor-modified/boost/predef/other/workaround.h +87 -0
- data/src/cxx_supportlib/vendor-modified/boost/predef/platform.h +9 -2
- data/src/cxx_supportlib/vendor-modified/boost/predef/platform/cloudabi.h +43 -0
- data/src/cxx_supportlib/vendor-modified/boost/predef/platform/ios.h +58 -0
- data/src/cxx_supportlib/vendor-modified/boost/predef/platform/mingw.h +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/predef/platform/mingw32.h +63 -0
- data/src/cxx_supportlib/vendor-modified/boost/predef/platform/mingw64.h +63 -0
- data/src/cxx_supportlib/vendor-modified/boost/predef/platform/windows_desktop.h +9 -3
- data/src/cxx_supportlib/vendor-modified/boost/predef/platform/windows_phone.h +7 -2
- data/src/cxx_supportlib/vendor-modified/boost/predef/platform/windows_runtime.h +13 -5
- data/src/cxx_supportlib/vendor-modified/boost/predef/platform/windows_server.h +47 -0
- data/src/cxx_supportlib/vendor-modified/boost/predef/platform/windows_store.h +11 -4
- data/src/cxx_supportlib/vendor-modified/boost/predef/platform/windows_system.h +47 -0
- data/src/cxx_supportlib/vendor-modified/boost/predef/platform/windows_uwp.h +60 -0
- data/src/cxx_supportlib/vendor-modified/boost/predef/version.h +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/preprocessor/config/config.hpp +11 -9
- data/src/cxx_supportlib/vendor-modified/boost/random/binomial_distribution.hpp +27 -27
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/vector_io.hpp +3 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/discrete_distribution.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/random/hyperexponential_distribution.hpp +0 -11
- data/src/cxx_supportlib/vendor-modified/boost/random/independent_bits.hpp +12 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/linear_congruential.hpp +5 -1
- data/src/cxx_supportlib/vendor-modified/boost/random/poisson_distribution.hpp +17 -17
- data/src/cxx_supportlib/vendor-modified/boost/random/seed_seq.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/random/uniform_on_sphere.hpp +6 -2
- data/src/cxx_supportlib/vendor-modified/boost/range/concepts.hpp +6 -4
- data/src/cxx_supportlib/vendor-modified/boost/range/iterator_range_core.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/regex/config.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/regex/pending/object_cache.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/basic_regex_creator.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/basic_regex_parser.hpp +56 -11
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/instances.hpp +10 -10
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/perl_matcher.hpp +7 -2
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/perl_matcher_common.hpp +6 -1
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/perl_matcher_non_recursive.hpp +37 -13
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/perl_matcher_recursive.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_traits_defaults.hpp +9 -6
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_workaround.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/scoped_array.hpp +1 -2
- data/src/cxx_supportlib/vendor-modified/boost/scoped_ptr.hpp +1 -2
- data/src/cxx_supportlib/vendor-modified/boost/shared_array.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/shared_ptr.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/allocate_shared_array.hpp +333 -656
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/bad_weak_ptr.hpp +4 -2
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/atomic_count_gcc.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/local_counted_base.hpp +148 -0
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/local_sp_deleter.hpp +91 -0
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/operator_bool.hpp +6 -6
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/shared_count.hpp +15 -3
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_aix.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_clang.hpp +3 -2
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_cw_x86.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp +7 -0
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_nt.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_pt.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_solaris.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_spin.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp +3 -2
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_sync.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_impl.hpp +29 -0
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_noexcept.hpp +21 -3
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/yield_k.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/enable_shared_from_this.hpp +6 -6
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/intrusive_ptr.hpp +26 -26
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/intrusive_ref_counter.hpp +17 -16
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/make_shared.hpp +1 -2
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/make_shared_object.hpp +19 -19
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/scoped_array.hpp +11 -12
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/scoped_ptr.hpp +15 -16
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/shared_array.hpp +22 -22
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/shared_ptr.hpp +135 -90
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/weak_ptr.hpp +23 -23
- data/src/cxx_supportlib/vendor-modified/boost/system/detail/error_code.ipp +140 -111
- data/src/cxx_supportlib/vendor-modified/boost/system/error_code.hpp +297 -49
- data/src/cxx_supportlib/vendor-modified/boost/system/system_error.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/thread/concurrent_queues/detail/sync_deque_base.hpp +30 -30
- data/src/cxx_supportlib/vendor-modified/boost/thread/concurrent_queues/detail/sync_queue_base.hpp +30 -30
- data/src/cxx_supportlib/vendor-modified/boost/thread/concurrent_queues/sync_bounded_queue.hpp +4 -2
- data/src/cxx_supportlib/vendor-modified/boost/thread/concurrent_queues/sync_deque.hpp +5 -7
- data/src/cxx_supportlib/vendor-modified/boost/thread/concurrent_queues/sync_priority_queue.hpp +19 -19
- data/src/cxx_supportlib/vendor-modified/boost/thread/concurrent_queues/sync_queue.hpp +5 -15
- data/src/cxx_supportlib/vendor-modified/boost/thread/concurrent_queues/sync_timed_queue.hpp +118 -183
- data/src/cxx_supportlib/vendor-modified/boost/{detail → thread/detail}/atomic_redef_macros.hpp +0 -0
- data/src/cxx_supportlib/vendor-modified/boost/{detail → thread/detail}/atomic_undef_macros.hpp +0 -0
- data/src/cxx_supportlib/vendor-modified/boost/thread/detail/config.hpp +62 -11
- data/src/cxx_supportlib/vendor-modified/boost/thread/detail/log.hpp +15 -0
- data/src/cxx_supportlib/vendor-modified/boost/thread/detail/move.hpp +0 -2
- data/src/cxx_supportlib/vendor-modified/boost/thread/detail/platform.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/thread/detail/platform_time.hpp +478 -0
- data/src/cxx_supportlib/vendor-modified/boost/thread/detail/thread.hpp +51 -85
- data/src/cxx_supportlib/vendor-modified/boost/thread/executors/basic_thread_pool.hpp +11 -3
- data/src/cxx_supportlib/vendor-modified/boost/thread/executors/detail/priority_executor_base.hpp +10 -4
- data/src/cxx_supportlib/vendor-modified/boost/thread/executors/scheduled_thread_pool.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/thread/executors/scheduler.hpp +10 -0
- data/src/cxx_supportlib/vendor-modified/boost/thread/executors/scheduling_adaptor.hpp +15 -4
- data/src/cxx_supportlib/vendor-modified/boost/thread/executors/serial_executor.hpp +9 -0
- data/src/cxx_supportlib/vendor-modified/boost/thread/future.hpp +320 -92
- data/src/cxx_supportlib/vendor-modified/boost/thread/once.hpp +10 -0
- data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/condition_variable.hpp +187 -112
- data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/condition_variable_fwd.hpp +137 -164
- data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/mutex.hpp +67 -37
- data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/pthread_helpers.hpp +42 -0
- data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/pthread_mutex_scoped_lock.hpp +15 -9
- data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/recursive_mutex.hpp +65 -33
- data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/shared_mutex.hpp +84 -158
- data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/thread_data.hpp +143 -35
- data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/thread_heap_alloc.hpp +32 -2
- data/src/cxx_supportlib/vendor-modified/boost/thread/shared_mutex.hpp +8 -1
- data/src/cxx_supportlib/vendor-modified/boost/thread/thread_only.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/thread/v2/shared_mutex.hpp +579 -589
- data/src/cxx_supportlib/vendor-modified/boost/token_functions.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/token_iterator.hpp +5 -2
- data/src/cxx_supportlib/vendor-modified/boost/tuple/detail/tuple_basic.hpp +7 -9
- data/src/cxx_supportlib/vendor-modified/boost/tuple/tuple.hpp +8 -8
- data/src/cxx_supportlib/vendor-modified/boost/type_index.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_index/stl_type_index.hpp +6 -2
- data/src/cxx_supportlib/vendor-modified/boost/type_index/type_index_facade.hpp +5 -8
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/add_const.hpp +6 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/add_cv.hpp +6 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/add_lvalue_reference.hpp +6 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/add_pointer.hpp +6 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/add_reference.hpp +7 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/add_rvalue_reference.hpp +6 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/add_volatile.hpp +6 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/common_type.hpp +7 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/conditional.hpp +8 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/copy_cv.hpp +6 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/decay.hpp +6 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/config.hpp +12 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/detector.hpp +37 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/has_binary_operator.hpp +71 -14
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/has_postfix_operator.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/has_prefix_operator.hpp +4 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/is_function_ptr_helper.hpp +370 -102
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/is_likely_lambda.hpp +94 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/is_mem_fun_pointer_impl.hpp +1177 -572
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/is_mem_fun_pointer_tester.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/detected.hpp +24 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/detected_or.hpp +25 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/floating_point_promotion.hpp +8 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_equal_to.hpp +3 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_greater.hpp +3 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_greater_equal.hpp +3 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_less.hpp +3 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_less_equal.hpp +3 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_minus.hpp +93 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_minus_assign.hpp +95 -2
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_not_equal_to.hpp +3 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_nothrow_destructor.hpp +11 -2
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_plus_assign.hpp +90 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/integral_constant.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/integral_promotion.hpp +6 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/intrinsics.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_assignable.hpp +10 -2
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_complete.hpp +90 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_complex.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_constructible.hpp +12 -2
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_convertible.hpp +20 -2
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_default_constructible.hpp +16 -2
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_destructible.hpp +10 -2
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_detected.hpp +29 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_detected_convertible.hpp +29 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_detected_exact.hpp +29 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_list_constructible.hpp +48 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_nothrow_move_assignable.hpp +14 -3
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_nothrow_move_constructible.hpp +14 -4
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_nothrow_swappable.hpp +67 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/make_signed.hpp +6 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/make_unsigned.hpp +6 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/nonesuch.hpp +35 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/promote.hpp +6 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/remove_all_extents.hpp +6 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/remove_bounds.hpp +7 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/remove_const.hpp +6 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/remove_cv.hpp +5 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/remove_cv_ref.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/remove_extent.hpp +6 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/remove_pointer.hpp +7 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/remove_reference.hpp +5 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/remove_volatile.hpp +5 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/type_identity.hpp +9 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/type_with_alignment.hpp +2 -3
- data/src/cxx_supportlib/vendor-modified/boost/typeof/decltype.hpp +34 -0
- data/src/cxx_supportlib/vendor-modified/boost/typeof/msvc/typeof_impl.hpp +5 -85
- data/src/cxx_supportlib/vendor-modified/boost/typeof/register_fundamental.hpp +1 -2
- data/src/cxx_supportlib/vendor-modified/boost/typeof/std/functional.hpp +6 -0
- data/src/cxx_supportlib/vendor-modified/boost/typeof/std/memory.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/typeof/typeof.hpp +24 -14
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/fwd.hpp +18 -12
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/implementation.hpp +4018 -4052
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/map.hpp +57 -97
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/set.hpp +56 -95
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_map.hpp +2150 -1777
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_map_fwd.hpp +41 -38
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_set.hpp +1630 -1420
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_set_fwd.hpp +40 -37
- data/src/cxx_supportlib/vendor-modified/boost/utility.hpp +6 -3
- data/src/cxx_supportlib/vendor-modified/boost/utility/detail/minstd_rand.hpp +55 -0
- data/src/cxx_supportlib/vendor-modified/boost/utility/detail/result_of_iterate.hpp +14 -17
- data/src/cxx_supportlib/vendor-modified/boost/utility/result_of.hpp +44 -20
- data/src/cxx_supportlib/vendor-modified/boost/utility/string_view.hpp +30 -30
- data/src/cxx_supportlib/vendor-modified/boost/version.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/weak_ptr.hpp +1 -1
- data/src/ruby_supportlib/phusion_passenger.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/common_library.rb +3 -0
- data/src/ruby_supportlib/phusion_passenger/platform_info/compiler.rb +8 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/cxx_portability.rb +7 -1
- data/src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb +2 -2
- data/src/ruby_supportlib/phusion_passenger/utils/tee_input.rb +4 -4
- metadata +201 -47
- data/src/cxx_supportlib/ConfigKit/VariantMapUtils.h +0 -96
- data/src/cxx_supportlib/MessageClient.h +0 -309
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/addressof.hpp +0 -40
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/task_io_service.hpp +0 -80
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/shared_ptr.hpp +0 -40
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/weak_ptr.hpp +0 -40
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/win_iocp_serial_port_service.hpp +0 -230
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/io_service.hpp +0 -156
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/io_service.ipp +0 -157
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/basic_context.hpp +0 -42
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/context_service.hpp +0 -42
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/old/basic_context.hpp +0 -436
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/old/context_service.hpp +0 -176
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/old/detail/openssl_context_service.hpp +0 -396
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/old/detail/openssl_operation.hpp +0 -526
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/old/detail/openssl_stream_service.hpp +0 -573
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/old/stream.hpp +0 -503
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/old/stream_service.hpp +0 -186
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/stream_service.hpp +0 -42
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/to_raw_pointer.hpp +0 -33
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/to_raw_pointer.hpp +0 -47
- data/src/cxx_supportlib/vendor-modified/boost/iterator.hpp +0 -20
- data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/shared_mutex_assert.hpp +0 -724
- data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/timespec.hpp +0 -149
- data/src/cxx_supportlib/vendor-modified/boost/thread/v2/thread.hpp +0 -155
- data/src/cxx_supportlib/vendor-modified/boost/utility/empty_deleter.hpp +0 -43
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// buffer.hpp
|
|
3
3
|
// ~~~~~~~~~~
|
|
4
4
|
//
|
|
5
|
-
// Copyright (c) 2003-
|
|
5
|
+
// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com)
|
|
6
6
|
//
|
|
7
7
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
8
8
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
@@ -18,17 +18,23 @@
|
|
|
18
18
|
#include <boost/asio/detail/config.hpp>
|
|
19
19
|
#include <cstddef>
|
|
20
20
|
#include <cstring>
|
|
21
|
+
#include <limits>
|
|
22
|
+
#include <stdexcept>
|
|
21
23
|
#include <string>
|
|
22
24
|
#include <vector>
|
|
23
25
|
#include <boost/asio/detail/array_fwd.hpp>
|
|
26
|
+
#include <boost/asio/detail/is_buffer_sequence.hpp>
|
|
27
|
+
#include <boost/asio/detail/string_view.hpp>
|
|
28
|
+
#include <boost/asio/detail/throw_exception.hpp>
|
|
29
|
+
#include <boost/asio/detail/type_traits.hpp>
|
|
24
30
|
|
|
25
|
-
#if defined(BOOST_ASIO_MSVC)
|
|
31
|
+
#if defined(BOOST_ASIO_MSVC) && (BOOST_ASIO_MSVC >= 1700)
|
|
26
32
|
# if defined(_HAS_ITERATOR_DEBUGGING) && (_HAS_ITERATOR_DEBUGGING != 0)
|
|
27
33
|
# if !defined(BOOST_ASIO_DISABLE_BUFFER_DEBUGGING)
|
|
28
34
|
# define BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
|
|
29
35
|
# endif // !defined(BOOST_ASIO_DISABLE_BUFFER_DEBUGGING)
|
|
30
36
|
# endif // defined(_HAS_ITERATOR_DEBUGGING)
|
|
31
|
-
#endif // defined(BOOST_ASIO_MSVC)
|
|
37
|
+
#endif // defined(BOOST_ASIO_MSVC) && (BOOST_ASIO_MSVC >= 1700)
|
|
32
38
|
|
|
33
39
|
#if defined(__GNUC__)
|
|
34
40
|
# if defined(_GLIBCXX_DEBUG)
|
|
@@ -39,7 +45,7 @@
|
|
|
39
45
|
#endif // defined(__GNUC__)
|
|
40
46
|
|
|
41
47
|
#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
|
|
42
|
-
# include <boost/asio/detail/
|
|
48
|
+
# include <boost/asio/detail/functional.hpp>
|
|
43
49
|
#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
|
|
44
50
|
|
|
45
51
|
#if defined(BOOST_ASIO_HAS_BOOST_WORKAROUND)
|
|
@@ -63,13 +69,6 @@ namespace asio {
|
|
|
63
69
|
class mutable_buffer;
|
|
64
70
|
class const_buffer;
|
|
65
71
|
|
|
66
|
-
namespace detail {
|
|
67
|
-
void* buffer_cast_helper(const mutable_buffer&);
|
|
68
|
-
const void* buffer_cast_helper(const const_buffer&);
|
|
69
|
-
std::size_t buffer_size_helper(const mutable_buffer&);
|
|
70
|
-
std::size_t buffer_size_helper(const const_buffer&);
|
|
71
|
-
} // namespace detail
|
|
72
|
-
|
|
73
72
|
/// Holds a buffer that can be modified.
|
|
74
73
|
/**
|
|
75
74
|
* The mutable_buffer class provides a safe representation of a buffer that can
|
|
@@ -78,29 +77,29 @@ std::size_t buffer_size_helper(const const_buffer&);
|
|
|
78
77
|
*
|
|
79
78
|
* @par Accessing Buffer Contents
|
|
80
79
|
*
|
|
81
|
-
* The contents of a buffer may be accessed using the @
|
|
82
|
-
*
|
|
80
|
+
* The contents of a buffer may be accessed using the @c data() and @c size()
|
|
81
|
+
* member functions:
|
|
83
82
|
*
|
|
84
83
|
* @code boost::asio::mutable_buffer b1 = ...;
|
|
85
|
-
* std::size_t s1 =
|
|
86
|
-
* unsigned char* p1 =
|
|
84
|
+
* std::size_t s1 = b1.size();
|
|
85
|
+
* unsigned char* p1 = static_cast<unsigned char*>(b1.data());
|
|
87
86
|
* @endcode
|
|
88
87
|
*
|
|
89
|
-
* The
|
|
90
|
-
*
|
|
88
|
+
* The @c data() member function permits violations of type safety, so uses of
|
|
89
|
+
* it in application code should be carefully considered.
|
|
91
90
|
*/
|
|
92
91
|
class mutable_buffer
|
|
93
92
|
{
|
|
94
93
|
public:
|
|
95
94
|
/// Construct an empty buffer.
|
|
96
|
-
mutable_buffer()
|
|
95
|
+
mutable_buffer() BOOST_ASIO_NOEXCEPT
|
|
97
96
|
: data_(0),
|
|
98
97
|
size_(0)
|
|
99
98
|
{
|
|
100
99
|
}
|
|
101
100
|
|
|
102
101
|
/// Construct a buffer to represent a given memory range.
|
|
103
|
-
mutable_buffer(void* data, std::size_t size)
|
|
102
|
+
mutable_buffer(void* data, std::size_t size) BOOST_ASIO_NOEXCEPT
|
|
104
103
|
: data_(data),
|
|
105
104
|
size_(size)
|
|
106
105
|
{
|
|
@@ -121,12 +120,32 @@ public:
|
|
|
121
120
|
}
|
|
122
121
|
#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
|
|
123
122
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
123
|
+
/// Get a pointer to the beginning of the memory range.
|
|
124
|
+
void* data() const BOOST_ASIO_NOEXCEPT
|
|
125
|
+
{
|
|
126
|
+
#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
|
|
127
|
+
if (size_ && debug_check_)
|
|
128
|
+
debug_check_();
|
|
129
|
+
#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
|
|
130
|
+
return data_;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/// Get the size of the memory range.
|
|
134
|
+
std::size_t size() const BOOST_ASIO_NOEXCEPT
|
|
135
|
+
{
|
|
136
|
+
return size_;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/// Move the start of the buffer by the specified number of bytes.
|
|
140
|
+
mutable_buffer& operator+=(std::size_t n) BOOST_ASIO_NOEXCEPT
|
|
141
|
+
{
|
|
142
|
+
std::size_t offset = n < size_ ? n : size_;
|
|
143
|
+
data_ = static_cast<char*>(data_) + offset;
|
|
144
|
+
size_ -= offset;
|
|
145
|
+
return *this;
|
|
146
|
+
}
|
|
129
147
|
|
|
148
|
+
private:
|
|
130
149
|
void* data_;
|
|
131
150
|
std::size_t size_;
|
|
132
151
|
|
|
@@ -135,26 +154,10 @@ private:
|
|
|
135
154
|
#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
|
|
136
155
|
};
|
|
137
156
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
inline void* buffer_cast_helper(const mutable_buffer& b)
|
|
141
|
-
{
|
|
142
|
-
#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
|
|
143
|
-
if (b.size_ && b.debug_check_)
|
|
144
|
-
b.debug_check_();
|
|
145
|
-
#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
|
|
146
|
-
return b.data_;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
inline std::size_t buffer_size_helper(const mutable_buffer& b)
|
|
150
|
-
{
|
|
151
|
-
return b.size_;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
} // namespace detail
|
|
157
|
+
#if !defined(BOOST_ASIO_NO_DEPRECATED)
|
|
155
158
|
|
|
156
|
-
/// Adapts a single modifiable buffer so that
|
|
157
|
-
/// MutableBufferSequence concept.
|
|
159
|
+
/// (Deprecated: Use mutable_buffer.) Adapts a single modifiable buffer so that
|
|
160
|
+
/// it meets the requirements of the MutableBufferSequence concept.
|
|
158
161
|
class mutable_buffers_1
|
|
159
162
|
: public mutable_buffer
|
|
160
163
|
{
|
|
@@ -166,30 +169,40 @@ public:
|
|
|
166
169
|
typedef const mutable_buffer* const_iterator;
|
|
167
170
|
|
|
168
171
|
/// Construct to represent a given memory range.
|
|
169
|
-
mutable_buffers_1(void* data, std::size_t size)
|
|
172
|
+
mutable_buffers_1(void* data, std::size_t size) BOOST_ASIO_NOEXCEPT
|
|
170
173
|
: mutable_buffer(data, size)
|
|
171
174
|
{
|
|
172
175
|
}
|
|
173
176
|
|
|
177
|
+
#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
|
|
178
|
+
mutable_buffers_1(void* data, std::size_t size,
|
|
179
|
+
boost::asio::detail::function<void()> debug_check)
|
|
180
|
+
: mutable_buffer(data, size, debug_check)
|
|
181
|
+
{
|
|
182
|
+
}
|
|
183
|
+
#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
|
|
184
|
+
|
|
174
185
|
/// Construct to represent a single modifiable buffer.
|
|
175
|
-
explicit mutable_buffers_1(const mutable_buffer& b)
|
|
186
|
+
explicit mutable_buffers_1(const mutable_buffer& b) BOOST_ASIO_NOEXCEPT
|
|
176
187
|
: mutable_buffer(b)
|
|
177
188
|
{
|
|
178
189
|
}
|
|
179
190
|
|
|
180
191
|
/// Get a random-access iterator to the first element.
|
|
181
|
-
const_iterator begin() const
|
|
192
|
+
const_iterator begin() const BOOST_ASIO_NOEXCEPT
|
|
182
193
|
{
|
|
183
194
|
return this;
|
|
184
195
|
}
|
|
185
196
|
|
|
186
197
|
/// Get a random-access iterator for one past the last element.
|
|
187
|
-
const_iterator end() const
|
|
198
|
+
const_iterator end() const BOOST_ASIO_NOEXCEPT
|
|
188
199
|
{
|
|
189
200
|
return begin() + 1;
|
|
190
201
|
}
|
|
191
202
|
};
|
|
192
203
|
|
|
204
|
+
#endif // !defined(BOOST_ASIO_NO_DEPRECATED)
|
|
205
|
+
|
|
193
206
|
/// Holds a buffer that cannot be modified.
|
|
194
207
|
/**
|
|
195
208
|
* The const_buffer class provides a safe representation of a buffer that cannot
|
|
@@ -198,38 +211,38 @@ public:
|
|
|
198
211
|
*
|
|
199
212
|
* @par Accessing Buffer Contents
|
|
200
213
|
*
|
|
201
|
-
* The contents of a buffer may be accessed using the @
|
|
202
|
-
*
|
|
214
|
+
* The contents of a buffer may be accessed using the @c data() and @c size()
|
|
215
|
+
* member functions:
|
|
203
216
|
*
|
|
204
217
|
* @code boost::asio::const_buffer b1 = ...;
|
|
205
|
-
* std::size_t s1 =
|
|
206
|
-
* const unsigned char* p1 =
|
|
218
|
+
* std::size_t s1 = b1.size();
|
|
219
|
+
* const unsigned char* p1 = static_cast<const unsigned char*>(b1.data());
|
|
207
220
|
* @endcode
|
|
208
221
|
*
|
|
209
|
-
* The
|
|
210
|
-
*
|
|
222
|
+
* The @c data() member function permits violations of type safety, so uses of
|
|
223
|
+
* it in application code should be carefully considered.
|
|
211
224
|
*/
|
|
212
225
|
class const_buffer
|
|
213
226
|
{
|
|
214
227
|
public:
|
|
215
228
|
/// Construct an empty buffer.
|
|
216
|
-
const_buffer()
|
|
229
|
+
const_buffer() BOOST_ASIO_NOEXCEPT
|
|
217
230
|
: data_(0),
|
|
218
231
|
size_(0)
|
|
219
232
|
{
|
|
220
233
|
}
|
|
221
234
|
|
|
222
235
|
/// Construct a buffer to represent a given memory range.
|
|
223
|
-
const_buffer(const void* data, std::size_t size)
|
|
236
|
+
const_buffer(const void* data, std::size_t size) BOOST_ASIO_NOEXCEPT
|
|
224
237
|
: data_(data),
|
|
225
238
|
size_(size)
|
|
226
239
|
{
|
|
227
240
|
}
|
|
228
241
|
|
|
229
242
|
/// Construct a non-modifiable buffer from a modifiable one.
|
|
230
|
-
const_buffer(const mutable_buffer& b)
|
|
231
|
-
: data_(
|
|
232
|
-
size_(
|
|
243
|
+
const_buffer(const mutable_buffer& b) BOOST_ASIO_NOEXCEPT
|
|
244
|
+
: data_(b.data()),
|
|
245
|
+
size_(b.size())
|
|
233
246
|
#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
|
|
234
247
|
, debug_check_(b.get_debug_check())
|
|
235
248
|
#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
|
|
@@ -251,12 +264,32 @@ public:
|
|
|
251
264
|
}
|
|
252
265
|
#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
|
|
253
266
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
267
|
+
/// Get a pointer to the beginning of the memory range.
|
|
268
|
+
const void* data() const BOOST_ASIO_NOEXCEPT
|
|
269
|
+
{
|
|
270
|
+
#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
|
|
271
|
+
if (size_ && debug_check_)
|
|
272
|
+
debug_check_();
|
|
273
|
+
#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
|
|
274
|
+
return data_;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/// Get the size of the memory range.
|
|
278
|
+
std::size_t size() const BOOST_ASIO_NOEXCEPT
|
|
279
|
+
{
|
|
280
|
+
return size_;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/// Move the start of the buffer by the specified number of bytes.
|
|
284
|
+
const_buffer& operator+=(std::size_t n) BOOST_ASIO_NOEXCEPT
|
|
285
|
+
{
|
|
286
|
+
std::size_t offset = n < size_ ? n : size_;
|
|
287
|
+
data_ = static_cast<const char*>(data_) + offset;
|
|
288
|
+
size_ -= offset;
|
|
289
|
+
return *this;
|
|
290
|
+
}
|
|
259
291
|
|
|
292
|
+
private:
|
|
260
293
|
const void* data_;
|
|
261
294
|
std::size_t size_;
|
|
262
295
|
|
|
@@ -265,26 +298,10 @@ private:
|
|
|
265
298
|
#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
|
|
266
299
|
};
|
|
267
300
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
inline const void* buffer_cast_helper(const const_buffer& b)
|
|
271
|
-
{
|
|
272
|
-
#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
|
|
273
|
-
if (b.size_ && b.debug_check_)
|
|
274
|
-
b.debug_check_();
|
|
275
|
-
#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
|
|
276
|
-
return b.data_;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
inline std::size_t buffer_size_helper(const const_buffer& b)
|
|
280
|
-
{
|
|
281
|
-
return b.size_;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
} // namespace detail
|
|
301
|
+
#if !defined(BOOST_ASIO_NO_DEPRECATED)
|
|
285
302
|
|
|
286
|
-
/// Adapts a single non-modifiable buffer so
|
|
287
|
-
/// the ConstBufferSequence concept.
|
|
303
|
+
/// (Deprecated: Use const_buffer.) Adapts a single non-modifiable buffer so
|
|
304
|
+
/// that it meets the requirements of the ConstBufferSequence concept.
|
|
288
305
|
class const_buffers_1
|
|
289
306
|
: public const_buffer
|
|
290
307
|
{
|
|
@@ -296,32 +313,78 @@ public:
|
|
|
296
313
|
typedef const const_buffer* const_iterator;
|
|
297
314
|
|
|
298
315
|
/// Construct to represent a given memory range.
|
|
299
|
-
const_buffers_1(const void* data, std::size_t size)
|
|
316
|
+
const_buffers_1(const void* data, std::size_t size) BOOST_ASIO_NOEXCEPT
|
|
300
317
|
: const_buffer(data, size)
|
|
301
318
|
{
|
|
302
319
|
}
|
|
303
320
|
|
|
321
|
+
#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
|
|
322
|
+
const_buffers_1(const void* data, std::size_t size,
|
|
323
|
+
boost::asio::detail::function<void()> debug_check)
|
|
324
|
+
: const_buffer(data, size, debug_check)
|
|
325
|
+
{
|
|
326
|
+
}
|
|
327
|
+
#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
|
|
328
|
+
|
|
304
329
|
/// Construct to represent a single non-modifiable buffer.
|
|
305
|
-
explicit const_buffers_1(const const_buffer& b)
|
|
330
|
+
explicit const_buffers_1(const const_buffer& b) BOOST_ASIO_NOEXCEPT
|
|
306
331
|
: const_buffer(b)
|
|
307
332
|
{
|
|
308
333
|
}
|
|
309
334
|
|
|
310
335
|
/// Get a random-access iterator to the first element.
|
|
311
|
-
const_iterator begin() const
|
|
336
|
+
const_iterator begin() const BOOST_ASIO_NOEXCEPT
|
|
312
337
|
{
|
|
313
338
|
return this;
|
|
314
339
|
}
|
|
315
340
|
|
|
316
341
|
/// Get a random-access iterator for one past the last element.
|
|
317
|
-
const_iterator end() const
|
|
342
|
+
const_iterator end() const BOOST_ASIO_NOEXCEPT
|
|
318
343
|
{
|
|
319
344
|
return begin() + 1;
|
|
320
345
|
}
|
|
321
346
|
};
|
|
322
347
|
|
|
323
|
-
|
|
324
|
-
|
|
348
|
+
#endif // !defined(BOOST_ASIO_NO_DEPRECATED)
|
|
349
|
+
|
|
350
|
+
/// Trait to determine whether a type satisfies the MutableBufferSequence
|
|
351
|
+
/// requirements.
|
|
352
|
+
template <typename T>
|
|
353
|
+
struct is_mutable_buffer_sequence
|
|
354
|
+
#if defined(GENERATING_DOCUMENTATION)
|
|
355
|
+
: integral_constant<bool, automatically_determined>
|
|
356
|
+
#else // defined(GENERATING_DOCUMENTATION)
|
|
357
|
+
: boost::asio::detail::is_buffer_sequence<T, mutable_buffer>
|
|
358
|
+
#endif // defined(GENERATING_DOCUMENTATION)
|
|
359
|
+
{
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
/// Trait to determine whether a type satisfies the ConstBufferSequence
|
|
363
|
+
/// requirements.
|
|
364
|
+
template <typename T>
|
|
365
|
+
struct is_const_buffer_sequence
|
|
366
|
+
#if defined(GENERATING_DOCUMENTATION)
|
|
367
|
+
: integral_constant<bool, automatically_determined>
|
|
368
|
+
#else // defined(GENERATING_DOCUMENTATION)
|
|
369
|
+
: boost::asio::detail::is_buffer_sequence<T, const_buffer>
|
|
370
|
+
#endif // defined(GENERATING_DOCUMENTATION)
|
|
371
|
+
{
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
/// Trait to determine whether a type satisfies the DynamicBuffer requirements.
|
|
375
|
+
template <typename T>
|
|
376
|
+
struct is_dynamic_buffer
|
|
377
|
+
#if defined(GENERATING_DOCUMENTATION)
|
|
378
|
+
: integral_constant<bool, automatically_determined>
|
|
379
|
+
#else // defined(GENERATING_DOCUMENTATION)
|
|
380
|
+
: boost::asio::detail::is_dynamic_buffer<T>
|
|
381
|
+
#endif // defined(GENERATING_DOCUMENTATION)
|
|
382
|
+
{
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
/// (Deprecated: Use the socket/descriptor wait() and async_wait() member
|
|
386
|
+
/// functions.) An implementation of both the ConstBufferSequence and
|
|
387
|
+
/// MutableBufferSequence concepts to represent a null buffer sequence.
|
|
325
388
|
class null_buffers
|
|
326
389
|
{
|
|
327
390
|
public:
|
|
@@ -332,13 +395,13 @@ public:
|
|
|
332
395
|
typedef const mutable_buffer* const_iterator;
|
|
333
396
|
|
|
334
397
|
/// Get a random-access iterator to the first element.
|
|
335
|
-
const_iterator begin() const
|
|
398
|
+
const_iterator begin() const BOOST_ASIO_NOEXCEPT
|
|
336
399
|
{
|
|
337
400
|
return &buf_;
|
|
338
401
|
}
|
|
339
402
|
|
|
340
403
|
/// Get a random-access iterator for one past the last element.
|
|
341
|
-
const_iterator end() const
|
|
404
|
+
const_iterator end() const BOOST_ASIO_NOEXCEPT
|
|
342
405
|
{
|
|
343
406
|
return &buf_;
|
|
344
407
|
}
|
|
@@ -347,61 +410,189 @@ private:
|
|
|
347
410
|
mutable_buffer buf_;
|
|
348
411
|
};
|
|
349
412
|
|
|
350
|
-
/** @defgroup
|
|
413
|
+
/** @defgroup buffer_sequence_begin boost::asio::buffer_sequence_begin
|
|
351
414
|
*
|
|
352
|
-
* @brief The boost::asio::
|
|
353
|
-
*
|
|
415
|
+
* @brief The boost::asio::buffer_sequence_begin function returns an iterator
|
|
416
|
+
* pointing to the first element in a buffer sequence.
|
|
354
417
|
*/
|
|
355
418
|
/*@{*/
|
|
356
419
|
|
|
357
|
-
/// Get the
|
|
358
|
-
inline
|
|
420
|
+
/// Get an iterator to the first element in a buffer sequence.
|
|
421
|
+
inline const mutable_buffer* buffer_sequence_begin(const mutable_buffer& b)
|
|
359
422
|
{
|
|
360
|
-
return
|
|
423
|
+
return &b;
|
|
361
424
|
}
|
|
362
425
|
|
|
363
|
-
/// Get the
|
|
364
|
-
inline
|
|
426
|
+
/// Get an iterator to the first element in a buffer sequence.
|
|
427
|
+
inline const const_buffer* buffer_sequence_begin(const const_buffer& b)
|
|
365
428
|
{
|
|
366
|
-
return
|
|
429
|
+
return &b;
|
|
367
430
|
}
|
|
368
431
|
|
|
369
|
-
|
|
370
|
-
|
|
432
|
+
#if defined(BOOST_ASIO_HAS_DECLTYPE) || defined(GENERATING_DOCUMENTATION)
|
|
433
|
+
|
|
434
|
+
/// Get an iterator to the first element in a buffer sequence.
|
|
435
|
+
template <typename C>
|
|
436
|
+
inline auto buffer_sequence_begin(C& c) -> decltype(c.begin())
|
|
371
437
|
{
|
|
372
|
-
return
|
|
438
|
+
return c.begin();
|
|
373
439
|
}
|
|
374
440
|
|
|
375
|
-
/// Get the
|
|
376
|
-
|
|
441
|
+
/// Get an iterator to the first element in a buffer sequence.
|
|
442
|
+
template <typename C>
|
|
443
|
+
inline auto buffer_sequence_begin(const C& c) -> decltype(c.begin())
|
|
377
444
|
{
|
|
378
|
-
return
|
|
445
|
+
return c.begin();
|
|
379
446
|
}
|
|
380
447
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
448
|
+
#else // defined(BOOST_ASIO_HAS_DECLTYPE) || defined(GENERATING_DOCUMENTATION)
|
|
449
|
+
|
|
450
|
+
template <typename C>
|
|
451
|
+
inline typename C::iterator buffer_sequence_begin(C& c)
|
|
452
|
+
{
|
|
453
|
+
return c.begin();
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
template <typename C>
|
|
457
|
+
inline typename C::const_iterator buffer_sequence_begin(const C& c)
|
|
458
|
+
{
|
|
459
|
+
return c.begin();
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
#endif // defined(BOOST_ASIO_HAS_DECLTYPE) || defined(GENERATING_DOCUMENTATION)
|
|
463
|
+
|
|
464
|
+
/*@}*/
|
|
465
|
+
|
|
466
|
+
/** @defgroup buffer_sequence_end boost::asio::buffer_sequence_end
|
|
467
|
+
*
|
|
468
|
+
* @brief The boost::asio::buffer_sequence_end function returns an iterator
|
|
469
|
+
* pointing to one past the end element in a buffer sequence.
|
|
385
470
|
*/
|
|
471
|
+
/*@{*/
|
|
472
|
+
|
|
473
|
+
/// Get an iterator to one past the end element in a buffer sequence.
|
|
474
|
+
inline const mutable_buffer* buffer_sequence_end(const mutable_buffer& b)
|
|
475
|
+
{
|
|
476
|
+
return &b + 1;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
/// Get an iterator to one past the end element in a buffer sequence.
|
|
480
|
+
inline const const_buffer* buffer_sequence_end(const const_buffer& b)
|
|
481
|
+
{
|
|
482
|
+
return &b + 1;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
#if defined(BOOST_ASIO_HAS_DECLTYPE) || defined(GENERATING_DOCUMENTATION)
|
|
486
|
+
|
|
487
|
+
/// Get an iterator to one past the end element in a buffer sequence.
|
|
488
|
+
template <typename C>
|
|
489
|
+
inline auto buffer_sequence_end(C& c) -> decltype(c.end())
|
|
490
|
+
{
|
|
491
|
+
return c.end();
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
/// Get an iterator to one past the end element in a buffer sequence.
|
|
495
|
+
template <typename C>
|
|
496
|
+
inline auto buffer_sequence_end(const C& c) -> decltype(c.end())
|
|
497
|
+
{
|
|
498
|
+
return c.end();
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
#else // defined(BOOST_ASIO_HAS_DECLTYPE) || defined(GENERATING_DOCUMENTATION)
|
|
502
|
+
|
|
503
|
+
template <typename C>
|
|
504
|
+
inline typename C::iterator buffer_sequence_end(C& c)
|
|
505
|
+
{
|
|
506
|
+
return c.end();
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
template <typename C>
|
|
510
|
+
inline typename C::const_iterator buffer_sequence_end(const C& c)
|
|
511
|
+
{
|
|
512
|
+
return c.end();
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
#endif // defined(BOOST_ASIO_HAS_DECLTYPE) || defined(GENERATING_DOCUMENTATION)
|
|
516
|
+
|
|
517
|
+
/*@}*/
|
|
518
|
+
|
|
519
|
+
namespace detail {
|
|
520
|
+
|
|
521
|
+
// Tag types used to select appropriately optimised overloads.
|
|
522
|
+
struct one_buffer {};
|
|
523
|
+
struct multiple_buffers {};
|
|
524
|
+
|
|
525
|
+
// Helper trait to detect single buffers.
|
|
386
526
|
template <typename BufferSequence>
|
|
387
|
-
|
|
527
|
+
struct buffer_sequence_cardinality :
|
|
528
|
+
conditional<
|
|
529
|
+
is_same<BufferSequence, mutable_buffer>::value
|
|
530
|
+
#if !defined(BOOST_ASIO_NO_DEPRECATED)
|
|
531
|
+
|| is_same<BufferSequence, mutable_buffers_1>::value
|
|
532
|
+
|| is_same<BufferSequence, const_buffers_1>::value
|
|
533
|
+
#endif // !defined(BOOST_ASIO_NO_DEPRECATED)
|
|
534
|
+
|| is_same<BufferSequence, const_buffer>::value,
|
|
535
|
+
one_buffer, multiple_buffers>::type {};
|
|
536
|
+
|
|
537
|
+
template <typename Iterator>
|
|
538
|
+
inline std::size_t buffer_size(one_buffer,
|
|
539
|
+
Iterator begin, Iterator) BOOST_ASIO_NOEXCEPT
|
|
540
|
+
{
|
|
541
|
+
return const_buffer(*begin).size();
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
template <typename Iterator>
|
|
545
|
+
inline std::size_t buffer_size(multiple_buffers,
|
|
546
|
+
Iterator begin, Iterator end) BOOST_ASIO_NOEXCEPT
|
|
388
547
|
{
|
|
389
548
|
std::size_t total_buffer_size = 0;
|
|
390
549
|
|
|
391
|
-
|
|
392
|
-
typename BufferSequence::const_iterator end = b.end();
|
|
550
|
+
Iterator iter = begin;
|
|
393
551
|
for (; iter != end; ++iter)
|
|
394
|
-
|
|
552
|
+
{
|
|
553
|
+
const_buffer b(*iter);
|
|
554
|
+
total_buffer_size += b.size();
|
|
555
|
+
}
|
|
395
556
|
|
|
396
557
|
return total_buffer_size;
|
|
397
558
|
}
|
|
398
559
|
|
|
399
|
-
|
|
560
|
+
} // namespace detail
|
|
561
|
+
|
|
562
|
+
/// Get the total number of bytes in a buffer sequence.
|
|
563
|
+
/**
|
|
564
|
+
* The @c buffer_size function determines the total size of all buffers in the
|
|
565
|
+
* buffer sequence, as if computed as follows:
|
|
566
|
+
*
|
|
567
|
+
* @code size_t total_size = 0;
|
|
568
|
+
* auto i = boost::asio::buffer_sequence_begin(buffers);
|
|
569
|
+
* auto end = boost::asio::buffer_sequence_end(buffers);
|
|
570
|
+
* for (; i != end; ++i)
|
|
571
|
+
* {
|
|
572
|
+
* const_buffer b(*i);
|
|
573
|
+
* total_size += b.size();
|
|
574
|
+
* }
|
|
575
|
+
* return total_size; @endcode
|
|
576
|
+
*
|
|
577
|
+
* The @c BufferSequence template parameter may meet either of the @c
|
|
578
|
+
* ConstBufferSequence or @c MutableBufferSequence type requirements.
|
|
579
|
+
*/
|
|
580
|
+
template <typename BufferSequence>
|
|
581
|
+
inline std::size_t buffer_size(const BufferSequence& b) BOOST_ASIO_NOEXCEPT
|
|
582
|
+
{
|
|
583
|
+
return detail::buffer_size(
|
|
584
|
+
detail::buffer_sequence_cardinality<BufferSequence>(),
|
|
585
|
+
boost::asio::buffer_sequence_begin(b),
|
|
586
|
+
boost::asio::buffer_sequence_end(b));
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
#if !defined(BOOST_ASIO_NO_DEPRECATED)
|
|
400
590
|
|
|
401
591
|
/** @defgroup buffer_cast boost::asio::buffer_cast
|
|
402
592
|
*
|
|
403
|
-
* @brief
|
|
404
|
-
*
|
|
593
|
+
* @brief (Deprecated: Use the @c data() member function.) The
|
|
594
|
+
* boost::asio::buffer_cast function is used to obtain a pointer to the
|
|
595
|
+
* underlying memory region associated with a buffer.
|
|
405
596
|
*
|
|
406
597
|
* @par Examples:
|
|
407
598
|
*
|
|
@@ -422,30 +613,32 @@ inline std::size_t buffer_size(const BufferSequence& b)
|
|
|
422
613
|
|
|
423
614
|
/// Cast a non-modifiable buffer to a specified pointer to POD type.
|
|
424
615
|
template <typename PointerToPodType>
|
|
425
|
-
inline PointerToPodType buffer_cast(const mutable_buffer& b)
|
|
616
|
+
inline PointerToPodType buffer_cast(const mutable_buffer& b) BOOST_ASIO_NOEXCEPT
|
|
426
617
|
{
|
|
427
|
-
return static_cast<PointerToPodType>(
|
|
618
|
+
return static_cast<PointerToPodType>(b.data());
|
|
428
619
|
}
|
|
429
620
|
|
|
430
621
|
/// Cast a non-modifiable buffer to a specified pointer to POD type.
|
|
431
622
|
template <typename PointerToPodType>
|
|
432
|
-
inline PointerToPodType buffer_cast(const const_buffer& b)
|
|
623
|
+
inline PointerToPodType buffer_cast(const const_buffer& b) BOOST_ASIO_NOEXCEPT
|
|
433
624
|
{
|
|
434
|
-
return static_cast<PointerToPodType>(
|
|
625
|
+
return static_cast<PointerToPodType>(b.data());
|
|
435
626
|
}
|
|
436
627
|
|
|
437
628
|
/*@}*/
|
|
438
629
|
|
|
630
|
+
#endif // !defined(BOOST_ASIO_NO_DEPRECATED)
|
|
631
|
+
|
|
439
632
|
/// Create a new modifiable buffer that is offset from the start of another.
|
|
440
633
|
/**
|
|
441
634
|
* @relates mutable_buffer
|
|
442
635
|
*/
|
|
443
|
-
inline mutable_buffer operator+(const mutable_buffer& b,
|
|
636
|
+
inline mutable_buffer operator+(const mutable_buffer& b,
|
|
637
|
+
std::size_t n) BOOST_ASIO_NOEXCEPT
|
|
444
638
|
{
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
std::size_t new_size = buffer_size(b) - start;
|
|
639
|
+
std::size_t offset = n < b.size() ? n : b.size();
|
|
640
|
+
char* new_data = static_cast<char*>(b.data()) + offset;
|
|
641
|
+
std::size_t new_size = b.size() - offset;
|
|
449
642
|
return mutable_buffer(new_data, new_size
|
|
450
643
|
#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
|
|
451
644
|
, b.get_debug_check()
|
|
@@ -457,29 +650,22 @@ inline mutable_buffer operator+(const mutable_buffer& b, std::size_t start)
|
|
|
457
650
|
/**
|
|
458
651
|
* @relates mutable_buffer
|
|
459
652
|
*/
|
|
460
|
-
inline mutable_buffer operator+(std::size_t
|
|
653
|
+
inline mutable_buffer operator+(std::size_t n,
|
|
654
|
+
const mutable_buffer& b) BOOST_ASIO_NOEXCEPT
|
|
461
655
|
{
|
|
462
|
-
|
|
463
|
-
return mutable_buffer();
|
|
464
|
-
char* new_data = buffer_cast<char*>(b) + start;
|
|
465
|
-
std::size_t new_size = buffer_size(b) - start;
|
|
466
|
-
return mutable_buffer(new_data, new_size
|
|
467
|
-
#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
|
|
468
|
-
, b.get_debug_check()
|
|
469
|
-
#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
|
|
470
|
-
);
|
|
656
|
+
return b + n;
|
|
471
657
|
}
|
|
472
658
|
|
|
473
659
|
/// Create a new non-modifiable buffer that is offset from the start of another.
|
|
474
660
|
/**
|
|
475
661
|
* @relates const_buffer
|
|
476
662
|
*/
|
|
477
|
-
inline const_buffer operator+(const const_buffer& b,
|
|
663
|
+
inline const_buffer operator+(const const_buffer& b,
|
|
664
|
+
std::size_t n) BOOST_ASIO_NOEXCEPT
|
|
478
665
|
{
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
std::size_t new_size = buffer_size(b) - start;
|
|
666
|
+
std::size_t offset = n < b.size() ? n : b.size();
|
|
667
|
+
const char* new_data = static_cast<const char*>(b.data()) + offset;
|
|
668
|
+
std::size_t new_size = b.size() - offset;
|
|
483
669
|
return const_buffer(new_data, new_size
|
|
484
670
|
#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
|
|
485
671
|
, b.get_debug_check()
|
|
@@ -491,17 +677,10 @@ inline const_buffer operator+(const const_buffer& b, std::size_t start)
|
|
|
491
677
|
/**
|
|
492
678
|
* @relates const_buffer
|
|
493
679
|
*/
|
|
494
|
-
inline const_buffer operator+(std::size_t
|
|
680
|
+
inline const_buffer operator+(std::size_t n,
|
|
681
|
+
const const_buffer& b) BOOST_ASIO_NOEXCEPT
|
|
495
682
|
{
|
|
496
|
-
|
|
497
|
-
return const_buffer();
|
|
498
|
-
const char* new_data = buffer_cast<const char*>(b) + start;
|
|
499
|
-
std::size_t new_size = buffer_size(b) - start;
|
|
500
|
-
return const_buffer(new_data, new_size
|
|
501
|
-
#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
|
|
502
|
-
, b.get_debug_check()
|
|
503
|
-
#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
|
|
504
|
-
);
|
|
683
|
+
return b + n;
|
|
505
684
|
}
|
|
506
685
|
|
|
507
686
|
#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
|
|
@@ -528,7 +707,7 @@ public:
|
|
|
528
707
|
|
|
529
708
|
void operator()()
|
|
530
709
|
{
|
|
531
|
-
*iter_;
|
|
710
|
+
(void)*iter_;
|
|
532
711
|
}
|
|
533
712
|
|
|
534
713
|
private:
|
|
@@ -586,32 +765,33 @@ private:
|
|
|
586
765
|
*
|
|
587
766
|
* @par Accessing Buffer Contents
|
|
588
767
|
*
|
|
589
|
-
* The contents of a buffer may be accessed using the @
|
|
590
|
-
*
|
|
768
|
+
* The contents of a buffer may be accessed using the @c data() and @c size()
|
|
769
|
+
* member functions:
|
|
591
770
|
*
|
|
592
771
|
* @code boost::asio::mutable_buffer b1 = ...;
|
|
593
|
-
* std::size_t s1 =
|
|
594
|
-
* unsigned char* p1 =
|
|
772
|
+
* std::size_t s1 = b1.size();
|
|
773
|
+
* unsigned char* p1 = static_cast<unsigned char*>(b1.data());
|
|
595
774
|
*
|
|
596
775
|
* boost::asio::const_buffer b2 = ...;
|
|
597
|
-
* std::size_t s2 =
|
|
598
|
-
* const void* p2 =
|
|
776
|
+
* std::size_t s2 = b2.size();
|
|
777
|
+
* const void* p2 = b2.data(); @endcode
|
|
599
778
|
*
|
|
600
|
-
* The
|
|
779
|
+
* The @c data() member function permits violations of type safety, so
|
|
601
780
|
* uses of it in application code should be carefully considered.
|
|
602
781
|
*
|
|
603
|
-
* For convenience,
|
|
604
|
-
* sequences (that is, types meeting the
|
|
605
|
-
* MutableBufferSequence type requirements). In this
|
|
606
|
-
* the total size of all buffers in the sequence.
|
|
782
|
+
* For convenience, a @ref buffer_size function is provided that works with
|
|
783
|
+
* both buffers and buffer sequences (that is, types meeting the
|
|
784
|
+
* ConstBufferSequence or MutableBufferSequence type requirements). In this
|
|
785
|
+
* case, the function returns the total size of all buffers in the sequence.
|
|
607
786
|
*
|
|
608
787
|
* @par Buffer Copying
|
|
609
788
|
*
|
|
610
789
|
* The @ref buffer_copy function may be used to copy raw bytes between
|
|
611
790
|
* individual buffers and buffer sequences.
|
|
612
|
-
|
|
613
|
-
* In particular, when used with the @ref buffer_size, the @ref
|
|
614
|
-
* function can be used to linearise a sequence of buffers. For
|
|
791
|
+
*
|
|
792
|
+
* In particular, when used with the @ref buffer_size function, the @ref
|
|
793
|
+
* buffer_copy function can be used to linearise a sequence of buffers. For
|
|
794
|
+
* example:
|
|
615
795
|
*
|
|
616
796
|
* @code vector<const_buffer> buffers = ...;
|
|
617
797
|
*
|
|
@@ -700,29 +880,38 @@ private:
|
|
|
700
880
|
*/
|
|
701
881
|
/*@{*/
|
|
702
882
|
|
|
883
|
+
#if defined(BOOST_ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION)
|
|
884
|
+
# define BOOST_ASIO_MUTABLE_BUFFER mutable_buffer
|
|
885
|
+
# define BOOST_ASIO_CONST_BUFFER const_buffer
|
|
886
|
+
#else // defined(BOOST_ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION)
|
|
887
|
+
# define BOOST_ASIO_MUTABLE_BUFFER mutable_buffers_1
|
|
888
|
+
# define BOOST_ASIO_CONST_BUFFER const_buffers_1
|
|
889
|
+
#endif // defined(BOOST_ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION)
|
|
890
|
+
|
|
703
891
|
/// Create a new modifiable buffer from an existing buffer.
|
|
704
892
|
/**
|
|
705
|
-
* @returns <tt>
|
|
893
|
+
* @returns <tt>mutable_buffer(b)</tt>.
|
|
706
894
|
*/
|
|
707
|
-
inline
|
|
895
|
+
inline BOOST_ASIO_MUTABLE_BUFFER buffer(
|
|
896
|
+
const mutable_buffer& b) BOOST_ASIO_NOEXCEPT
|
|
708
897
|
{
|
|
709
|
-
return
|
|
898
|
+
return BOOST_ASIO_MUTABLE_BUFFER(b);
|
|
710
899
|
}
|
|
711
900
|
|
|
712
901
|
/// Create a new modifiable buffer from an existing buffer.
|
|
713
902
|
/**
|
|
714
|
-
* @returns A
|
|
715
|
-
* @code
|
|
716
|
-
*
|
|
717
|
-
* min(
|
|
903
|
+
* @returns A mutable_buffer value equivalent to:
|
|
904
|
+
* @code mutable_buffer(
|
|
905
|
+
* b.data(),
|
|
906
|
+
* min(b.size(), max_size_in_bytes)); @endcode
|
|
718
907
|
*/
|
|
719
|
-
inline
|
|
720
|
-
std::size_t max_size_in_bytes)
|
|
908
|
+
inline BOOST_ASIO_MUTABLE_BUFFER buffer(const mutable_buffer& b,
|
|
909
|
+
std::size_t max_size_in_bytes) BOOST_ASIO_NOEXCEPT
|
|
721
910
|
{
|
|
722
|
-
return
|
|
723
|
-
mutable_buffer(
|
|
724
|
-
|
|
725
|
-
?
|
|
911
|
+
return BOOST_ASIO_MUTABLE_BUFFER(
|
|
912
|
+
mutable_buffer(b.data(),
|
|
913
|
+
b.size() < max_size_in_bytes
|
|
914
|
+
? b.size() : max_size_in_bytes
|
|
726
915
|
#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
|
|
727
916
|
, b.get_debug_check()
|
|
728
917
|
#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
|
|
@@ -731,110 +920,110 @@ inline mutable_buffers_1 buffer(const mutable_buffer& b,
|
|
|
731
920
|
|
|
732
921
|
/// Create a new non-modifiable buffer from an existing buffer.
|
|
733
922
|
/**
|
|
734
|
-
* @returns <tt>
|
|
923
|
+
* @returns <tt>const_buffer(b)</tt>.
|
|
735
924
|
*/
|
|
736
|
-
inline
|
|
925
|
+
inline BOOST_ASIO_CONST_BUFFER buffer(
|
|
926
|
+
const const_buffer& b) BOOST_ASIO_NOEXCEPT
|
|
737
927
|
{
|
|
738
|
-
return
|
|
928
|
+
return BOOST_ASIO_CONST_BUFFER(b);
|
|
739
929
|
}
|
|
740
930
|
|
|
741
931
|
/// Create a new non-modifiable buffer from an existing buffer.
|
|
742
932
|
/**
|
|
743
|
-
* @returns A
|
|
744
|
-
* @code
|
|
745
|
-
*
|
|
746
|
-
* min(
|
|
933
|
+
* @returns A const_buffer value equivalent to:
|
|
934
|
+
* @code const_buffer(
|
|
935
|
+
* b.data(),
|
|
936
|
+
* min(b.size(), max_size_in_bytes)); @endcode
|
|
747
937
|
*/
|
|
748
|
-
inline
|
|
749
|
-
std::size_t max_size_in_bytes)
|
|
938
|
+
inline BOOST_ASIO_CONST_BUFFER buffer(const const_buffer& b,
|
|
939
|
+
std::size_t max_size_in_bytes) BOOST_ASIO_NOEXCEPT
|
|
750
940
|
{
|
|
751
|
-
return
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
? buffer_size(b) : max_size_in_bytes
|
|
941
|
+
return BOOST_ASIO_CONST_BUFFER(b.data(),
|
|
942
|
+
b.size() < max_size_in_bytes
|
|
943
|
+
? b.size() : max_size_in_bytes
|
|
755
944
|
#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
|
|
756
|
-
|
|
945
|
+
, b.get_debug_check()
|
|
757
946
|
#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
|
|
758
|
-
|
|
947
|
+
);
|
|
759
948
|
}
|
|
760
949
|
|
|
761
950
|
/// Create a new modifiable buffer that represents the given memory range.
|
|
762
951
|
/**
|
|
763
|
-
* @returns <tt>
|
|
952
|
+
* @returns <tt>mutable_buffer(data, size_in_bytes)</tt>.
|
|
764
953
|
*/
|
|
765
|
-
inline
|
|
954
|
+
inline BOOST_ASIO_MUTABLE_BUFFER buffer(void* data,
|
|
955
|
+
std::size_t size_in_bytes) BOOST_ASIO_NOEXCEPT
|
|
766
956
|
{
|
|
767
|
-
return
|
|
957
|
+
return BOOST_ASIO_MUTABLE_BUFFER(data, size_in_bytes);
|
|
768
958
|
}
|
|
769
959
|
|
|
770
960
|
/// Create a new non-modifiable buffer that represents the given memory range.
|
|
771
961
|
/**
|
|
772
|
-
* @returns <tt>
|
|
962
|
+
* @returns <tt>const_buffer(data, size_in_bytes)</tt>.
|
|
773
963
|
*/
|
|
774
|
-
inline
|
|
775
|
-
std::size_t size_in_bytes)
|
|
964
|
+
inline BOOST_ASIO_CONST_BUFFER buffer(const void* data,
|
|
965
|
+
std::size_t size_in_bytes) BOOST_ASIO_NOEXCEPT
|
|
776
966
|
{
|
|
777
|
-
return
|
|
967
|
+
return BOOST_ASIO_CONST_BUFFER(data, size_in_bytes);
|
|
778
968
|
}
|
|
779
969
|
|
|
780
970
|
/// Create a new modifiable buffer that represents the given POD array.
|
|
781
971
|
/**
|
|
782
|
-
* @returns A
|
|
783
|
-
* @code
|
|
972
|
+
* @returns A mutable_buffer value equivalent to:
|
|
973
|
+
* @code mutable_buffer(
|
|
784
974
|
* static_cast<void*>(data),
|
|
785
975
|
* N * sizeof(PodType)); @endcode
|
|
786
976
|
*/
|
|
787
977
|
template <typename PodType, std::size_t N>
|
|
788
|
-
inline
|
|
978
|
+
inline BOOST_ASIO_MUTABLE_BUFFER buffer(PodType (&data)[N]) BOOST_ASIO_NOEXCEPT
|
|
789
979
|
{
|
|
790
|
-
return
|
|
980
|
+
return BOOST_ASIO_MUTABLE_BUFFER(data, N * sizeof(PodType));
|
|
791
981
|
}
|
|
792
982
|
|
|
793
983
|
/// Create a new modifiable buffer that represents the given POD array.
|
|
794
984
|
/**
|
|
795
|
-
* @returns A
|
|
796
|
-
* @code
|
|
985
|
+
* @returns A mutable_buffer value equivalent to:
|
|
986
|
+
* @code mutable_buffer(
|
|
797
987
|
* static_cast<void*>(data),
|
|
798
988
|
* min(N * sizeof(PodType), max_size_in_bytes)); @endcode
|
|
799
989
|
*/
|
|
800
990
|
template <typename PodType, std::size_t N>
|
|
801
|
-
inline
|
|
802
|
-
std::size_t max_size_in_bytes)
|
|
991
|
+
inline BOOST_ASIO_MUTABLE_BUFFER buffer(PodType (&data)[N],
|
|
992
|
+
std::size_t max_size_in_bytes) BOOST_ASIO_NOEXCEPT
|
|
803
993
|
{
|
|
804
|
-
return
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
? N * sizeof(PodType) : max_size_in_bytes));
|
|
994
|
+
return BOOST_ASIO_MUTABLE_BUFFER(data,
|
|
995
|
+
N * sizeof(PodType) < max_size_in_bytes
|
|
996
|
+
? N * sizeof(PodType) : max_size_in_bytes);
|
|
808
997
|
}
|
|
809
998
|
|
|
810
999
|
/// Create a new non-modifiable buffer that represents the given POD array.
|
|
811
1000
|
/**
|
|
812
|
-
* @returns A
|
|
813
|
-
* @code
|
|
1001
|
+
* @returns A const_buffer value equivalent to:
|
|
1002
|
+
* @code const_buffer(
|
|
814
1003
|
* static_cast<const void*>(data),
|
|
815
1004
|
* N * sizeof(PodType)); @endcode
|
|
816
1005
|
*/
|
|
817
1006
|
template <typename PodType, std::size_t N>
|
|
818
|
-
inline
|
|
1007
|
+
inline BOOST_ASIO_CONST_BUFFER buffer(
|
|
1008
|
+
const PodType (&data)[N]) BOOST_ASIO_NOEXCEPT
|
|
819
1009
|
{
|
|
820
|
-
return
|
|
1010
|
+
return BOOST_ASIO_CONST_BUFFER(data, N * sizeof(PodType));
|
|
821
1011
|
}
|
|
822
1012
|
|
|
823
1013
|
/// Create a new non-modifiable buffer that represents the given POD array.
|
|
824
1014
|
/**
|
|
825
|
-
* @returns A
|
|
826
|
-
* @code
|
|
1015
|
+
* @returns A const_buffer value equivalent to:
|
|
1016
|
+
* @code const_buffer(
|
|
827
1017
|
* static_cast<const void*>(data),
|
|
828
1018
|
* min(N * sizeof(PodType), max_size_in_bytes)); @endcode
|
|
829
1019
|
*/
|
|
830
1020
|
template <typename PodType, std::size_t N>
|
|
831
|
-
inline
|
|
832
|
-
std::size_t max_size_in_bytes)
|
|
1021
|
+
inline BOOST_ASIO_CONST_BUFFER buffer(const PodType (&data)[N],
|
|
1022
|
+
std::size_t max_size_in_bytes) BOOST_ASIO_NOEXCEPT
|
|
833
1023
|
{
|
|
834
|
-
return
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
? N * sizeof(PodType) : max_size_in_bytes));
|
|
1024
|
+
return BOOST_ASIO_CONST_BUFFER(data,
|
|
1025
|
+
N * sizeof(PodType) < max_size_in_bytes
|
|
1026
|
+
? N * sizeof(PodType) : max_size_in_bytes);
|
|
838
1027
|
}
|
|
839
1028
|
|
|
840
1029
|
#if defined(BOOST_ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND)
|
|
@@ -860,14 +1049,14 @@ template <>
|
|
|
860
1049
|
struct buffer_types_base<false>
|
|
861
1050
|
{
|
|
862
1051
|
typedef mutable_buffer buffer_type;
|
|
863
|
-
typedef
|
|
1052
|
+
typedef BOOST_ASIO_MUTABLE_BUFFER container_type;
|
|
864
1053
|
};
|
|
865
1054
|
|
|
866
1055
|
template <>
|
|
867
1056
|
struct buffer_types_base<true>
|
|
868
1057
|
{
|
|
869
1058
|
typedef const_buffer buffer_type;
|
|
870
|
-
typedef
|
|
1059
|
+
typedef BOOST_ASIO_CONST_BUFFER container_type;
|
|
871
1060
|
};
|
|
872
1061
|
|
|
873
1062
|
template <typename PodType>
|
|
@@ -880,7 +1069,7 @@ struct buffer_types
|
|
|
880
1069
|
|
|
881
1070
|
template <typename PodType, std::size_t N>
|
|
882
1071
|
inline typename detail::buffer_types<PodType>::container_type
|
|
883
|
-
buffer(boost::array<PodType, N>& data)
|
|
1072
|
+
buffer(boost::array<PodType, N>& data) BOOST_ASIO_NOEXCEPT
|
|
884
1073
|
{
|
|
885
1074
|
typedef typename boost::asio::detail::buffer_types<PodType>::buffer_type
|
|
886
1075
|
buffer_type;
|
|
@@ -892,7 +1081,8 @@ buffer(boost::array<PodType, N>& data)
|
|
|
892
1081
|
|
|
893
1082
|
template <typename PodType, std::size_t N>
|
|
894
1083
|
inline typename detail::buffer_types<PodType>::container_type
|
|
895
|
-
buffer(boost::array<PodType, N>& data,
|
|
1084
|
+
buffer(boost::array<PodType, N>& data,
|
|
1085
|
+
std::size_t max_size_in_bytes) BOOST_ASIO_NOEXCEPT
|
|
896
1086
|
{
|
|
897
1087
|
typedef typename boost::asio::detail::buffer_types<PodType>::buffer_type
|
|
898
1088
|
buffer_type;
|
|
@@ -908,200 +1098,195 @@ buffer(boost::array<PodType, N>& data, std::size_t max_size_in_bytes)
|
|
|
908
1098
|
|
|
909
1099
|
/// Create a new modifiable buffer that represents the given POD array.
|
|
910
1100
|
/**
|
|
911
|
-
* @returns A
|
|
912
|
-
* @code
|
|
1101
|
+
* @returns A mutable_buffer value equivalent to:
|
|
1102
|
+
* @code mutable_buffer(
|
|
913
1103
|
* data.data(),
|
|
914
1104
|
* data.size() * sizeof(PodType)); @endcode
|
|
915
1105
|
*/
|
|
916
1106
|
template <typename PodType, std::size_t N>
|
|
917
|
-
inline
|
|
1107
|
+
inline BOOST_ASIO_MUTABLE_BUFFER buffer(
|
|
1108
|
+
boost::array<PodType, N>& data) BOOST_ASIO_NOEXCEPT
|
|
918
1109
|
{
|
|
919
|
-
return
|
|
920
|
-
|
|
1110
|
+
return BOOST_ASIO_MUTABLE_BUFFER(
|
|
1111
|
+
data.c_array(), data.size() * sizeof(PodType));
|
|
921
1112
|
}
|
|
922
1113
|
|
|
923
1114
|
/// Create a new modifiable buffer that represents the given POD array.
|
|
924
1115
|
/**
|
|
925
|
-
* @returns A
|
|
926
|
-
* @code
|
|
1116
|
+
* @returns A mutable_buffer value equivalent to:
|
|
1117
|
+
* @code mutable_buffer(
|
|
927
1118
|
* data.data(),
|
|
928
1119
|
* min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode
|
|
929
1120
|
*/
|
|
930
1121
|
template <typename PodType, std::size_t N>
|
|
931
|
-
inline
|
|
932
|
-
std::size_t max_size_in_bytes)
|
|
1122
|
+
inline BOOST_ASIO_MUTABLE_BUFFER buffer(boost::array<PodType, N>& data,
|
|
1123
|
+
std::size_t max_size_in_bytes) BOOST_ASIO_NOEXCEPT
|
|
933
1124
|
{
|
|
934
|
-
return
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
? data.size() * sizeof(PodType) : max_size_in_bytes));
|
|
1125
|
+
return BOOST_ASIO_MUTABLE_BUFFER(data.c_array(),
|
|
1126
|
+
data.size() * sizeof(PodType) < max_size_in_bytes
|
|
1127
|
+
? data.size() * sizeof(PodType) : max_size_in_bytes);
|
|
938
1128
|
}
|
|
939
1129
|
|
|
940
1130
|
/// Create a new non-modifiable buffer that represents the given POD array.
|
|
941
1131
|
/**
|
|
942
|
-
* @returns A
|
|
943
|
-
* @code
|
|
1132
|
+
* @returns A const_buffer value equivalent to:
|
|
1133
|
+
* @code const_buffer(
|
|
944
1134
|
* data.data(),
|
|
945
1135
|
* data.size() * sizeof(PodType)); @endcode
|
|
946
1136
|
*/
|
|
947
1137
|
template <typename PodType, std::size_t N>
|
|
948
|
-
inline
|
|
1138
|
+
inline BOOST_ASIO_CONST_BUFFER buffer(
|
|
1139
|
+
boost::array<const PodType, N>& data) BOOST_ASIO_NOEXCEPT
|
|
949
1140
|
{
|
|
950
|
-
return
|
|
951
|
-
const_buffer(data.data(), data.size() * sizeof(PodType)));
|
|
1141
|
+
return BOOST_ASIO_CONST_BUFFER(data.data(), data.size() * sizeof(PodType));
|
|
952
1142
|
}
|
|
953
1143
|
|
|
954
1144
|
/// Create a new non-modifiable buffer that represents the given POD array.
|
|
955
1145
|
/**
|
|
956
|
-
* @returns A
|
|
957
|
-
* @code
|
|
1146
|
+
* @returns A const_buffer value equivalent to:
|
|
1147
|
+
* @code const_buffer(
|
|
958
1148
|
* data.data(),
|
|
959
1149
|
* min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode
|
|
960
1150
|
*/
|
|
961
1151
|
template <typename PodType, std::size_t N>
|
|
962
|
-
inline
|
|
963
|
-
std::size_t max_size_in_bytes)
|
|
1152
|
+
inline BOOST_ASIO_CONST_BUFFER buffer(boost::array<const PodType, N>& data,
|
|
1153
|
+
std::size_t max_size_in_bytes) BOOST_ASIO_NOEXCEPT
|
|
964
1154
|
{
|
|
965
|
-
return
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
? data.size() * sizeof(PodType) : max_size_in_bytes));
|
|
1155
|
+
return BOOST_ASIO_CONST_BUFFER(data.data(),
|
|
1156
|
+
data.size() * sizeof(PodType) < max_size_in_bytes
|
|
1157
|
+
? data.size() * sizeof(PodType) : max_size_in_bytes);
|
|
969
1158
|
}
|
|
970
1159
|
|
|
971
1160
|
#endif // defined(BOOST_ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND)
|
|
972
1161
|
|
|
973
1162
|
/// Create a new non-modifiable buffer that represents the given POD array.
|
|
974
1163
|
/**
|
|
975
|
-
* @returns A
|
|
976
|
-
* @code
|
|
1164
|
+
* @returns A const_buffer value equivalent to:
|
|
1165
|
+
* @code const_buffer(
|
|
977
1166
|
* data.data(),
|
|
978
1167
|
* data.size() * sizeof(PodType)); @endcode
|
|
979
1168
|
*/
|
|
980
1169
|
template <typename PodType, std::size_t N>
|
|
981
|
-
inline
|
|
1170
|
+
inline BOOST_ASIO_CONST_BUFFER buffer(
|
|
1171
|
+
const boost::array<PodType, N>& data) BOOST_ASIO_NOEXCEPT
|
|
982
1172
|
{
|
|
983
|
-
return
|
|
984
|
-
const_buffer(data.data(), data.size() * sizeof(PodType)));
|
|
1173
|
+
return BOOST_ASIO_CONST_BUFFER(data.data(), data.size() * sizeof(PodType));
|
|
985
1174
|
}
|
|
986
1175
|
|
|
987
1176
|
/// Create a new non-modifiable buffer that represents the given POD array.
|
|
988
1177
|
/**
|
|
989
|
-
* @returns A
|
|
990
|
-
* @code
|
|
1178
|
+
* @returns A const_buffer value equivalent to:
|
|
1179
|
+
* @code const_buffer(
|
|
991
1180
|
* data.data(),
|
|
992
1181
|
* min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode
|
|
993
1182
|
*/
|
|
994
1183
|
template <typename PodType, std::size_t N>
|
|
995
|
-
inline
|
|
996
|
-
std::size_t max_size_in_bytes)
|
|
1184
|
+
inline BOOST_ASIO_CONST_BUFFER buffer(const boost::array<PodType, N>& data,
|
|
1185
|
+
std::size_t max_size_in_bytes) BOOST_ASIO_NOEXCEPT
|
|
997
1186
|
{
|
|
998
|
-
return
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
? data.size() * sizeof(PodType) : max_size_in_bytes));
|
|
1187
|
+
return BOOST_ASIO_CONST_BUFFER(data.data(),
|
|
1188
|
+
data.size() * sizeof(PodType) < max_size_in_bytes
|
|
1189
|
+
? data.size() * sizeof(PodType) : max_size_in_bytes);
|
|
1002
1190
|
}
|
|
1003
1191
|
|
|
1004
1192
|
#if defined(BOOST_ASIO_HAS_STD_ARRAY) || defined(GENERATING_DOCUMENTATION)
|
|
1005
1193
|
|
|
1006
1194
|
/// Create a new modifiable buffer that represents the given POD array.
|
|
1007
1195
|
/**
|
|
1008
|
-
* @returns A
|
|
1009
|
-
* @code
|
|
1196
|
+
* @returns A mutable_buffer value equivalent to:
|
|
1197
|
+
* @code mutable_buffer(
|
|
1010
1198
|
* data.data(),
|
|
1011
1199
|
* data.size() * sizeof(PodType)); @endcode
|
|
1012
1200
|
*/
|
|
1013
1201
|
template <typename PodType, std::size_t N>
|
|
1014
|
-
inline
|
|
1202
|
+
inline BOOST_ASIO_MUTABLE_BUFFER buffer(
|
|
1203
|
+
std::array<PodType, N>& data) BOOST_ASIO_NOEXCEPT
|
|
1015
1204
|
{
|
|
1016
|
-
return
|
|
1017
|
-
mutable_buffer(data.data(), data.size() * sizeof(PodType)));
|
|
1205
|
+
return BOOST_ASIO_MUTABLE_BUFFER(data.data(), data.size() * sizeof(PodType));
|
|
1018
1206
|
}
|
|
1019
1207
|
|
|
1020
1208
|
/// Create a new modifiable buffer that represents the given POD array.
|
|
1021
1209
|
/**
|
|
1022
|
-
* @returns A
|
|
1023
|
-
* @code
|
|
1210
|
+
* @returns A mutable_buffer value equivalent to:
|
|
1211
|
+
* @code mutable_buffer(
|
|
1024
1212
|
* data.data(),
|
|
1025
1213
|
* min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode
|
|
1026
1214
|
*/
|
|
1027
1215
|
template <typename PodType, std::size_t N>
|
|
1028
|
-
inline
|
|
1029
|
-
std::size_t max_size_in_bytes)
|
|
1216
|
+
inline BOOST_ASIO_MUTABLE_BUFFER buffer(std::array<PodType, N>& data,
|
|
1217
|
+
std::size_t max_size_in_bytes) BOOST_ASIO_NOEXCEPT
|
|
1030
1218
|
{
|
|
1031
|
-
return
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
? data.size() * sizeof(PodType) : max_size_in_bytes));
|
|
1219
|
+
return BOOST_ASIO_MUTABLE_BUFFER(data.data(),
|
|
1220
|
+
data.size() * sizeof(PodType) < max_size_in_bytes
|
|
1221
|
+
? data.size() * sizeof(PodType) : max_size_in_bytes);
|
|
1035
1222
|
}
|
|
1036
1223
|
|
|
1037
1224
|
/// Create a new non-modifiable buffer that represents the given POD array.
|
|
1038
1225
|
/**
|
|
1039
|
-
* @returns A
|
|
1040
|
-
* @code
|
|
1226
|
+
* @returns A const_buffer value equivalent to:
|
|
1227
|
+
* @code const_buffer(
|
|
1041
1228
|
* data.data(),
|
|
1042
1229
|
* data.size() * sizeof(PodType)); @endcode
|
|
1043
1230
|
*/
|
|
1044
1231
|
template <typename PodType, std::size_t N>
|
|
1045
|
-
inline
|
|
1232
|
+
inline BOOST_ASIO_CONST_BUFFER buffer(
|
|
1233
|
+
std::array<const PodType, N>& data) BOOST_ASIO_NOEXCEPT
|
|
1046
1234
|
{
|
|
1047
|
-
return
|
|
1048
|
-
const_buffer(data.data(), data.size() * sizeof(PodType)));
|
|
1235
|
+
return BOOST_ASIO_CONST_BUFFER(data.data(), data.size() * sizeof(PodType));
|
|
1049
1236
|
}
|
|
1050
1237
|
|
|
1051
1238
|
/// Create a new non-modifiable buffer that represents the given POD array.
|
|
1052
1239
|
/**
|
|
1053
|
-
* @returns A
|
|
1054
|
-
* @code
|
|
1240
|
+
* @returns A const_buffer value equivalent to:
|
|
1241
|
+
* @code const_buffer(
|
|
1055
1242
|
* data.data(),
|
|
1056
1243
|
* min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode
|
|
1057
1244
|
*/
|
|
1058
1245
|
template <typename PodType, std::size_t N>
|
|
1059
|
-
inline
|
|
1060
|
-
std::size_t max_size_in_bytes)
|
|
1246
|
+
inline BOOST_ASIO_CONST_BUFFER buffer(std::array<const PodType, N>& data,
|
|
1247
|
+
std::size_t max_size_in_bytes) BOOST_ASIO_NOEXCEPT
|
|
1061
1248
|
{
|
|
1062
|
-
return
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
? data.size() * sizeof(PodType) : max_size_in_bytes));
|
|
1249
|
+
return BOOST_ASIO_CONST_BUFFER(data.data(),
|
|
1250
|
+
data.size() * sizeof(PodType) < max_size_in_bytes
|
|
1251
|
+
? data.size() * sizeof(PodType) : max_size_in_bytes);
|
|
1066
1252
|
}
|
|
1067
1253
|
|
|
1068
1254
|
/// Create a new non-modifiable buffer that represents the given POD array.
|
|
1069
1255
|
/**
|
|
1070
|
-
* @returns A
|
|
1071
|
-
* @code
|
|
1256
|
+
* @returns A const_buffer value equivalent to:
|
|
1257
|
+
* @code const_buffer(
|
|
1072
1258
|
* data.data(),
|
|
1073
1259
|
* data.size() * sizeof(PodType)); @endcode
|
|
1074
1260
|
*/
|
|
1075
1261
|
template <typename PodType, std::size_t N>
|
|
1076
|
-
inline
|
|
1262
|
+
inline BOOST_ASIO_CONST_BUFFER buffer(
|
|
1263
|
+
const std::array<PodType, N>& data) BOOST_ASIO_NOEXCEPT
|
|
1077
1264
|
{
|
|
1078
|
-
return
|
|
1079
|
-
const_buffer(data.data(), data.size() * sizeof(PodType)));
|
|
1265
|
+
return BOOST_ASIO_CONST_BUFFER(data.data(), data.size() * sizeof(PodType));
|
|
1080
1266
|
}
|
|
1081
1267
|
|
|
1082
1268
|
/// Create a new non-modifiable buffer that represents the given POD array.
|
|
1083
1269
|
/**
|
|
1084
|
-
* @returns A
|
|
1085
|
-
* @code
|
|
1270
|
+
* @returns A const_buffer value equivalent to:
|
|
1271
|
+
* @code const_buffer(
|
|
1086
1272
|
* data.data(),
|
|
1087
1273
|
* min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode
|
|
1088
1274
|
*/
|
|
1089
1275
|
template <typename PodType, std::size_t N>
|
|
1090
|
-
inline
|
|
1091
|
-
std::size_t max_size_in_bytes)
|
|
1276
|
+
inline BOOST_ASIO_CONST_BUFFER buffer(const std::array<PodType, N>& data,
|
|
1277
|
+
std::size_t max_size_in_bytes) BOOST_ASIO_NOEXCEPT
|
|
1092
1278
|
{
|
|
1093
|
-
return
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
? data.size() * sizeof(PodType) : max_size_in_bytes));
|
|
1279
|
+
return BOOST_ASIO_CONST_BUFFER(data.data(),
|
|
1280
|
+
data.size() * sizeof(PodType) < max_size_in_bytes
|
|
1281
|
+
? data.size() * sizeof(PodType) : max_size_in_bytes);
|
|
1097
1282
|
}
|
|
1098
1283
|
|
|
1099
1284
|
#endif // defined(BOOST_ASIO_HAS_STD_ARRAY) || defined(GENERATING_DOCUMENTATION)
|
|
1100
1285
|
|
|
1101
1286
|
/// Create a new modifiable buffer that represents the given POD vector.
|
|
1102
1287
|
/**
|
|
1103
|
-
* @returns A
|
|
1104
|
-
* @code
|
|
1288
|
+
* @returns A mutable_buffer value equivalent to:
|
|
1289
|
+
* @code mutable_buffer(
|
|
1105
1290
|
* data.size() ? &data[0] : 0,
|
|
1106
1291
|
* data.size() * sizeof(PodType)); @endcode
|
|
1107
1292
|
*
|
|
@@ -1109,22 +1294,23 @@ inline const_buffers_1 buffer(const std::array<PodType, N>& data,
|
|
|
1109
1294
|
* invalidate iterators.
|
|
1110
1295
|
*/
|
|
1111
1296
|
template <typename PodType, typename Allocator>
|
|
1112
|
-
inline
|
|
1297
|
+
inline BOOST_ASIO_MUTABLE_BUFFER buffer(
|
|
1298
|
+
std::vector<PodType, Allocator>& data) BOOST_ASIO_NOEXCEPT
|
|
1113
1299
|
{
|
|
1114
|
-
return
|
|
1115
|
-
|
|
1300
|
+
return BOOST_ASIO_MUTABLE_BUFFER(
|
|
1301
|
+
data.size() ? &data[0] : 0, data.size() * sizeof(PodType)
|
|
1116
1302
|
#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1303
|
+
, detail::buffer_debug_check<
|
|
1304
|
+
typename std::vector<PodType, Allocator>::iterator
|
|
1305
|
+
>(data.begin())
|
|
1120
1306
|
#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
|
|
1121
|
-
|
|
1307
|
+
);
|
|
1122
1308
|
}
|
|
1123
1309
|
|
|
1124
1310
|
/// Create a new modifiable buffer that represents the given POD vector.
|
|
1125
1311
|
/**
|
|
1126
|
-
* @returns A
|
|
1127
|
-
* @code
|
|
1312
|
+
* @returns A mutable_buffer value equivalent to:
|
|
1313
|
+
* @code mutable_buffer(
|
|
1128
1314
|
* data.size() ? &data[0] : 0,
|
|
1129
1315
|
* min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode
|
|
1130
1316
|
*
|
|
@@ -1132,25 +1318,24 @@ inline mutable_buffers_1 buffer(std::vector<PodType, Allocator>& data)
|
|
|
1132
1318
|
* invalidate iterators.
|
|
1133
1319
|
*/
|
|
1134
1320
|
template <typename PodType, typename Allocator>
|
|
1135
|
-
inline
|
|
1136
|
-
std::size_t max_size_in_bytes)
|
|
1321
|
+
inline BOOST_ASIO_MUTABLE_BUFFER buffer(std::vector<PodType, Allocator>& data,
|
|
1322
|
+
std::size_t max_size_in_bytes) BOOST_ASIO_NOEXCEPT
|
|
1137
1323
|
{
|
|
1138
|
-
return
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
? data.size() * sizeof(PodType) : max_size_in_bytes
|
|
1324
|
+
return BOOST_ASIO_MUTABLE_BUFFER(data.size() ? &data[0] : 0,
|
|
1325
|
+
data.size() * sizeof(PodType) < max_size_in_bytes
|
|
1326
|
+
? data.size() * sizeof(PodType) : max_size_in_bytes
|
|
1142
1327
|
#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1328
|
+
, detail::buffer_debug_check<
|
|
1329
|
+
typename std::vector<PodType, Allocator>::iterator
|
|
1330
|
+
>(data.begin())
|
|
1146
1331
|
#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
|
|
1147
|
-
|
|
1332
|
+
);
|
|
1148
1333
|
}
|
|
1149
1334
|
|
|
1150
1335
|
/// Create a new non-modifiable buffer that represents the given POD vector.
|
|
1151
1336
|
/**
|
|
1152
|
-
* @returns A
|
|
1153
|
-
* @code
|
|
1337
|
+
* @returns A const_buffer value equivalent to:
|
|
1338
|
+
* @code const_buffer(
|
|
1154
1339
|
* data.size() ? &data[0] : 0,
|
|
1155
1340
|
* data.size() * sizeof(PodType)); @endcode
|
|
1156
1341
|
*
|
|
@@ -1158,23 +1343,23 @@ inline mutable_buffers_1 buffer(std::vector<PodType, Allocator>& data,
|
|
|
1158
1343
|
* invalidate iterators.
|
|
1159
1344
|
*/
|
|
1160
1345
|
template <typename PodType, typename Allocator>
|
|
1161
|
-
inline
|
|
1162
|
-
const std::vector<PodType, Allocator>& data)
|
|
1346
|
+
inline BOOST_ASIO_CONST_BUFFER buffer(
|
|
1347
|
+
const std::vector<PodType, Allocator>& data) BOOST_ASIO_NOEXCEPT
|
|
1163
1348
|
{
|
|
1164
|
-
return
|
|
1165
|
-
|
|
1349
|
+
return BOOST_ASIO_CONST_BUFFER(
|
|
1350
|
+
data.size() ? &data[0] : 0, data.size() * sizeof(PodType)
|
|
1166
1351
|
#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1352
|
+
, detail::buffer_debug_check<
|
|
1353
|
+
typename std::vector<PodType, Allocator>::const_iterator
|
|
1354
|
+
>(data.begin())
|
|
1170
1355
|
#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
|
|
1171
|
-
|
|
1356
|
+
);
|
|
1172
1357
|
}
|
|
1173
1358
|
|
|
1174
1359
|
/// Create a new non-modifiable buffer that represents the given POD vector.
|
|
1175
1360
|
/**
|
|
1176
|
-
* @returns A
|
|
1177
|
-
* @code
|
|
1361
|
+
* @returns A const_buffer value equivalent to:
|
|
1362
|
+
* @code const_buffer(
|
|
1178
1363
|
* data.size() ? &data[0] : 0,
|
|
1179
1364
|
* min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode
|
|
1180
1365
|
*
|
|
@@ -1182,963 +1367,730 @@ inline const_buffers_1 buffer(
|
|
|
1182
1367
|
* invalidate iterators.
|
|
1183
1368
|
*/
|
|
1184
1369
|
template <typename PodType, typename Allocator>
|
|
1185
|
-
inline
|
|
1186
|
-
const std::vector<PodType, Allocator>& data,
|
|
1370
|
+
inline BOOST_ASIO_CONST_BUFFER buffer(
|
|
1371
|
+
const std::vector<PodType, Allocator>& data,
|
|
1372
|
+
std::size_t max_size_in_bytes) BOOST_ASIO_NOEXCEPT
|
|
1187
1373
|
{
|
|
1188
|
-
return
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
? data.size() * sizeof(PodType) : max_size_in_bytes
|
|
1374
|
+
return BOOST_ASIO_CONST_BUFFER(data.size() ? &data[0] : 0,
|
|
1375
|
+
data.size() * sizeof(PodType) < max_size_in_bytes
|
|
1376
|
+
? data.size() * sizeof(PodType) : max_size_in_bytes
|
|
1192
1377
|
#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1378
|
+
, detail::buffer_debug_check<
|
|
1379
|
+
typename std::vector<PodType, Allocator>::const_iterator
|
|
1380
|
+
>(data.begin())
|
|
1196
1381
|
#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
|
|
1197
|
-
|
|
1382
|
+
);
|
|
1198
1383
|
}
|
|
1199
1384
|
|
|
1200
|
-
/// Create a new
|
|
1385
|
+
/// Create a new modifiable buffer that represents the given string.
|
|
1201
1386
|
/**
|
|
1202
|
-
* @returns <tt>
|
|
1387
|
+
* @returns <tt>mutable_buffer(data.size() ? &data[0] : 0,
|
|
1388
|
+
* data.size() * sizeof(Elem))</tt>.
|
|
1203
1389
|
*
|
|
1204
1390
|
* @note The buffer is invalidated by any non-const operation called on the
|
|
1205
1391
|
* given string object.
|
|
1206
1392
|
*/
|
|
1207
1393
|
template <typename Elem, typename Traits, typename Allocator>
|
|
1208
|
-
inline
|
|
1209
|
-
|
|
1394
|
+
inline BOOST_ASIO_MUTABLE_BUFFER buffer(
|
|
1395
|
+
std::basic_string<Elem, Traits, Allocator>& data) BOOST_ASIO_NOEXCEPT
|
|
1210
1396
|
{
|
|
1211
|
-
return
|
|
1397
|
+
return BOOST_ASIO_MUTABLE_BUFFER(data.size() ? &data[0] : 0,
|
|
1398
|
+
data.size() * sizeof(Elem)
|
|
1212
1399
|
#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1400
|
+
, detail::buffer_debug_check<
|
|
1401
|
+
typename std::basic_string<Elem, Traits, Allocator>::iterator
|
|
1402
|
+
>(data.begin())
|
|
1216
1403
|
#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
|
|
1217
|
-
|
|
1404
|
+
);
|
|
1218
1405
|
}
|
|
1219
1406
|
|
|
1220
1407
|
/// Create a new non-modifiable buffer that represents the given string.
|
|
1221
1408
|
/**
|
|
1222
|
-
* @returns A
|
|
1223
|
-
* @code
|
|
1224
|
-
* data.
|
|
1409
|
+
* @returns A mutable_buffer value equivalent to:
|
|
1410
|
+
* @code mutable_buffer(
|
|
1411
|
+
* data.size() ? &data[0] : 0,
|
|
1225
1412
|
* min(data.size() * sizeof(Elem), max_size_in_bytes)); @endcode
|
|
1226
1413
|
*
|
|
1227
1414
|
* @note The buffer is invalidated by any non-const operation called on the
|
|
1228
1415
|
* given string object.
|
|
1229
1416
|
*/
|
|
1230
1417
|
template <typename Elem, typename Traits, typename Allocator>
|
|
1231
|
-
inline
|
|
1232
|
-
|
|
1233
|
-
std::size_t max_size_in_bytes)
|
|
1418
|
+
inline BOOST_ASIO_MUTABLE_BUFFER buffer(
|
|
1419
|
+
std::basic_string<Elem, Traits, Allocator>& data,
|
|
1420
|
+
std::size_t max_size_in_bytes) BOOST_ASIO_NOEXCEPT
|
|
1234
1421
|
{
|
|
1235
|
-
return
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
? data.size() * sizeof(Elem) : max_size_in_bytes
|
|
1422
|
+
return BOOST_ASIO_MUTABLE_BUFFER(data.size() ? &data[0] : 0,
|
|
1423
|
+
data.size() * sizeof(Elem) < max_size_in_bytes
|
|
1424
|
+
? data.size() * sizeof(Elem) : max_size_in_bytes
|
|
1239
1425
|
#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1426
|
+
, detail::buffer_debug_check<
|
|
1427
|
+
typename std::basic_string<Elem, Traits, Allocator>::iterator
|
|
1428
|
+
>(data.begin())
|
|
1243
1429
|
#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
|
|
1244
|
-
|
|
1430
|
+
);
|
|
1245
1431
|
}
|
|
1246
1432
|
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
*
|
|
1251
|
-
* @brief The boost::asio::buffer_copy function is used to copy bytes from a
|
|
1252
|
-
* source buffer (or buffer sequence) to a target buffer (or buffer sequence).
|
|
1253
|
-
*
|
|
1254
|
-
* The @c buffer_copy function is available in two forms:
|
|
1255
|
-
*
|
|
1256
|
-
* @li A 2-argument form: @c buffer_copy(target, source)
|
|
1257
|
-
*
|
|
1258
|
-
* @li A 3-argument form: @c buffer_copy(target, source, max_bytes_to_copy)
|
|
1259
|
-
|
|
1260
|
-
* Both forms return the number of bytes actually copied. The number of bytes
|
|
1261
|
-
* copied is the lesser of:
|
|
1262
|
-
*
|
|
1263
|
-
* @li @c buffer_size(target)
|
|
1264
|
-
*
|
|
1265
|
-
* @li @c buffer_size(source)
|
|
1266
|
-
*
|
|
1267
|
-
* @li @c If specified, @c max_bytes_to_copy.
|
|
1268
|
-
*
|
|
1269
|
-
* This prevents buffer overflow, regardless of the buffer sizes used in the
|
|
1270
|
-
* copy operation.
|
|
1433
|
+
/// Create a new non-modifiable buffer that represents the given string.
|
|
1434
|
+
/**
|
|
1435
|
+
* @returns <tt>const_buffer(data.data(), data.size() * sizeof(Elem))</tt>.
|
|
1271
1436
|
*
|
|
1272
|
-
*
|
|
1273
|
-
*
|
|
1437
|
+
* @note The buffer is invalidated by any non-const operation called on the
|
|
1438
|
+
* given string object.
|
|
1274
1439
|
*/
|
|
1275
|
-
|
|
1440
|
+
template <typename Elem, typename Traits, typename Allocator>
|
|
1441
|
+
inline BOOST_ASIO_CONST_BUFFER buffer(
|
|
1442
|
+
const std::basic_string<Elem, Traits, Allocator>& data) BOOST_ASIO_NOEXCEPT
|
|
1443
|
+
{
|
|
1444
|
+
return BOOST_ASIO_CONST_BUFFER(data.data(), data.size() * sizeof(Elem)
|
|
1445
|
+
#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
|
|
1446
|
+
, detail::buffer_debug_check<
|
|
1447
|
+
typename std::basic_string<Elem, Traits, Allocator>::const_iterator
|
|
1448
|
+
>(data.begin())
|
|
1449
|
+
#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
|
|
1450
|
+
);
|
|
1451
|
+
}
|
|
1276
1452
|
|
|
1277
|
-
///
|
|
1453
|
+
/// Create a new non-modifiable buffer that represents the given string.
|
|
1278
1454
|
/**
|
|
1279
|
-
* @
|
|
1280
|
-
*
|
|
1281
|
-
*
|
|
1282
|
-
*
|
|
1283
|
-
* which the bytes will be copied.
|
|
1284
|
-
*
|
|
1285
|
-
* @returns The number of bytes copied.
|
|
1286
|
-
*
|
|
1287
|
-
* @note The number of bytes copied is the lesser of:
|
|
1288
|
-
*
|
|
1289
|
-
* @li @c buffer_size(target)
|
|
1290
|
-
*
|
|
1291
|
-
* @li @c buffer_size(source)
|
|
1455
|
+
* @returns A const_buffer value equivalent to:
|
|
1456
|
+
* @code const_buffer(
|
|
1457
|
+
* data.data(),
|
|
1458
|
+
* min(data.size() * sizeof(Elem), max_size_in_bytes)); @endcode
|
|
1292
1459
|
*
|
|
1293
|
-
*
|
|
1294
|
-
*
|
|
1460
|
+
* @note The buffer is invalidated by any non-const operation called on the
|
|
1461
|
+
* given string object.
|
|
1295
1462
|
*/
|
|
1296
|
-
|
|
1297
|
-
|
|
1463
|
+
template <typename Elem, typename Traits, typename Allocator>
|
|
1464
|
+
inline BOOST_ASIO_CONST_BUFFER buffer(
|
|
1465
|
+
const std::basic_string<Elem, Traits, Allocator>& data,
|
|
1466
|
+
std::size_t max_size_in_bytes) BOOST_ASIO_NOEXCEPT
|
|
1298
1467
|
{
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1468
|
+
return BOOST_ASIO_CONST_BUFFER(data.data(),
|
|
1469
|
+
data.size() * sizeof(Elem) < max_size_in_bytes
|
|
1470
|
+
? data.size() * sizeof(Elem) : max_size_in_bytes
|
|
1471
|
+
#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
|
|
1472
|
+
, detail::buffer_debug_check<
|
|
1473
|
+
typename std::basic_string<Elem, Traits, Allocator>::const_iterator
|
|
1474
|
+
>(data.begin())
|
|
1475
|
+
#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
|
|
1476
|
+
);
|
|
1305
1477
|
}
|
|
1306
1478
|
|
|
1307
|
-
|
|
1479
|
+
#if defined(BOOST_ASIO_HAS_STRING_VIEW) \
|
|
1480
|
+
|| defined(GENERATING_DOCUMENTATION)
|
|
1481
|
+
|
|
1482
|
+
/// Create a new modifiable buffer that represents the given string_view.
|
|
1308
1483
|
/**
|
|
1309
|
-
* @
|
|
1310
|
-
*
|
|
1311
|
-
*
|
|
1312
|
-
* @param source A non-modifiable buffer representing the memory region from
|
|
1313
|
-
* which the bytes will be copied.
|
|
1314
|
-
*
|
|
1315
|
-
* @returns The number of bytes copied.
|
|
1316
|
-
*
|
|
1317
|
-
* @note The number of bytes copied is the lesser of:
|
|
1318
|
-
*
|
|
1319
|
-
* @li @c buffer_size(target)
|
|
1320
|
-
*
|
|
1321
|
-
* @li @c buffer_size(source)
|
|
1322
|
-
*
|
|
1323
|
-
* This function is implemented in terms of @c memcpy, and consequently it
|
|
1324
|
-
* cannot be used to copy between overlapping memory regions.
|
|
1484
|
+
* @returns <tt>mutable_buffer(data.size() ? &data[0] : 0,
|
|
1485
|
+
* data.size() * sizeof(Elem))</tt>.
|
|
1325
1486
|
*/
|
|
1326
|
-
|
|
1327
|
-
|
|
1487
|
+
template <typename Elem, typename Traits>
|
|
1488
|
+
inline BOOST_ASIO_CONST_BUFFER buffer(
|
|
1489
|
+
basic_string_view<Elem, Traits> data) BOOST_ASIO_NOEXCEPT
|
|
1328
1490
|
{
|
|
1329
|
-
return
|
|
1491
|
+
return BOOST_ASIO_CONST_BUFFER(data.size() ? &data[0] : 0,
|
|
1492
|
+
data.size() * sizeof(Elem)
|
|
1493
|
+
#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
|
|
1494
|
+
, detail::buffer_debug_check<
|
|
1495
|
+
typename basic_string_view<Elem, Traits>::iterator
|
|
1496
|
+
>(data.begin())
|
|
1497
|
+
#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
|
|
1498
|
+
);
|
|
1330
1499
|
}
|
|
1331
1500
|
|
|
1332
|
-
///
|
|
1501
|
+
/// Create a new non-modifiable buffer that represents the given string.
|
|
1333
1502
|
/**
|
|
1334
|
-
* @
|
|
1335
|
-
*
|
|
1336
|
-
*
|
|
1337
|
-
*
|
|
1338
|
-
* the bytes will be copied. The contents of the source buffer will not be
|
|
1339
|
-
* modified.
|
|
1340
|
-
*
|
|
1341
|
-
* @returns The number of bytes copied.
|
|
1342
|
-
*
|
|
1343
|
-
* @note The number of bytes copied is the lesser of:
|
|
1344
|
-
*
|
|
1345
|
-
* @li @c buffer_size(target)
|
|
1346
|
-
*
|
|
1347
|
-
* @li @c buffer_size(source)
|
|
1348
|
-
*
|
|
1349
|
-
* This function is implemented in terms of @c memcpy, and consequently it
|
|
1350
|
-
* cannot be used to copy between overlapping memory regions.
|
|
1503
|
+
* @returns A mutable_buffer value equivalent to:
|
|
1504
|
+
* @code mutable_buffer(
|
|
1505
|
+
* data.size() ? &data[0] : 0,
|
|
1506
|
+
* min(data.size() * sizeof(Elem), max_size_in_bytes)); @endcode
|
|
1351
1507
|
*/
|
|
1352
|
-
|
|
1353
|
-
|
|
1508
|
+
template <typename Elem, typename Traits>
|
|
1509
|
+
inline BOOST_ASIO_CONST_BUFFER buffer(
|
|
1510
|
+
basic_string_view<Elem, Traits> data,
|
|
1511
|
+
std::size_t max_size_in_bytes) BOOST_ASIO_NOEXCEPT
|
|
1354
1512
|
{
|
|
1355
|
-
return
|
|
1513
|
+
return BOOST_ASIO_CONST_BUFFER(data.size() ? &data[0] : 0,
|
|
1514
|
+
data.size() * sizeof(Elem) < max_size_in_bytes
|
|
1515
|
+
? data.size() * sizeof(Elem) : max_size_in_bytes
|
|
1516
|
+
#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
|
|
1517
|
+
, detail::buffer_debug_check<
|
|
1518
|
+
typename basic_string_view<Elem, Traits>::iterator
|
|
1519
|
+
>(data.begin())
|
|
1520
|
+
#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
|
|
1521
|
+
);
|
|
1356
1522
|
}
|
|
1357
1523
|
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
*
|
|
1363
|
-
* @param source A modifiable buffer representing the memory region from which
|
|
1364
|
-
* the bytes will be copied. The contents of the source buffer will not be
|
|
1365
|
-
* modified.
|
|
1366
|
-
*
|
|
1367
|
-
* @returns The number of bytes copied.
|
|
1368
|
-
*
|
|
1369
|
-
* @note The number of bytes copied is the lesser of:
|
|
1370
|
-
*
|
|
1371
|
-
* @li @c buffer_size(target)
|
|
1372
|
-
*
|
|
1373
|
-
* @li @c buffer_size(source)
|
|
1374
|
-
*
|
|
1375
|
-
* This function is implemented in terms of @c memcpy, and consequently it
|
|
1376
|
-
* cannot be used to copy between overlapping memory regions.
|
|
1377
|
-
*/
|
|
1378
|
-
inline std::size_t buffer_copy(const mutable_buffer& target,
|
|
1379
|
-
const mutable_buffers_1& source)
|
|
1380
|
-
{
|
|
1381
|
-
return buffer_copy(target, const_buffer(source));
|
|
1382
|
-
}
|
|
1524
|
+
#endif // defined(BOOST_ASIO_HAS_STRING_VIEW)
|
|
1525
|
+
// || defined(GENERATING_DOCUMENTATION)
|
|
1526
|
+
|
|
1527
|
+
/*@}*/
|
|
1383
1528
|
|
|
1384
|
-
///
|
|
1529
|
+
/// Adapt a basic_string to the DynamicBuffer requirements.
|
|
1385
1530
|
/**
|
|
1386
|
-
*
|
|
1387
|
-
* the bytes will be copied.
|
|
1388
|
-
*
|
|
1389
|
-
* @param source A non-modifiable buffer sequence representing the memory
|
|
1390
|
-
* regions from which the bytes will be copied.
|
|
1391
|
-
*
|
|
1392
|
-
* @returns The number of bytes copied.
|
|
1393
|
-
*
|
|
1394
|
-
* @note The number of bytes copied is the lesser of:
|
|
1395
|
-
*
|
|
1396
|
-
* @li @c buffer_size(target)
|
|
1397
|
-
*
|
|
1398
|
-
* @li @c buffer_size(source)
|
|
1399
|
-
*
|
|
1400
|
-
* This function is implemented in terms of @c memcpy, and consequently it
|
|
1401
|
-
* cannot be used to copy between overlapping memory regions.
|
|
1531
|
+
* Requires that <tt>sizeof(Elem) == 1</tt>.
|
|
1402
1532
|
*/
|
|
1403
|
-
template <typename
|
|
1404
|
-
|
|
1405
|
-
const ConstBufferSequence& source)
|
|
1533
|
+
template <typename Elem, typename Traits, typename Allocator>
|
|
1534
|
+
class dynamic_string_buffer
|
|
1406
1535
|
{
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1536
|
+
public:
|
|
1537
|
+
/// The type used to represent the input sequence as a list of buffers.
|
|
1538
|
+
typedef BOOST_ASIO_CONST_BUFFER const_buffers_type;
|
|
1539
|
+
|
|
1540
|
+
/// The type used to represent the output sequence as a list of buffers.
|
|
1541
|
+
typedef BOOST_ASIO_MUTABLE_BUFFER mutable_buffers_type;
|
|
1542
|
+
|
|
1543
|
+
/// Construct a dynamic buffer from a string.
|
|
1544
|
+
/**
|
|
1545
|
+
* @param s The string to be used as backing storage for the dynamic buffer.
|
|
1546
|
+
* Any existing data in the string is treated as the dynamic buffer's input
|
|
1547
|
+
* sequence. The object stores a reference to the string and the user is
|
|
1548
|
+
* responsible for ensuring that the string object remains valid until the
|
|
1549
|
+
* dynamic_string_buffer object is destroyed.
|
|
1550
|
+
*
|
|
1551
|
+
* @param maximum_size Specifies a maximum size for the buffer, in bytes.
|
|
1552
|
+
*/
|
|
1553
|
+
explicit dynamic_string_buffer(std::basic_string<Elem, Traits, Allocator>& s,
|
|
1554
|
+
std::size_t maximum_size =
|
|
1555
|
+
(std::numeric_limits<std::size_t>::max)()) BOOST_ASIO_NOEXCEPT
|
|
1556
|
+
: string_(s),
|
|
1557
|
+
size_(string_.size()),
|
|
1558
|
+
max_size_(maximum_size)
|
|
1414
1559
|
{
|
|
1415
|
-
const_buffer source_buffer(*source_iter);
|
|
1416
|
-
std::size_t bytes_copied = buffer_copy(target_buffer, source_buffer);
|
|
1417
|
-
total_bytes_copied += bytes_copied;
|
|
1418
|
-
target_buffer = target_buffer + bytes_copied;
|
|
1419
1560
|
}
|
|
1420
1561
|
|
|
1421
|
-
|
|
1422
|
-
|
|
1562
|
+
#if defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
|
|
1563
|
+
/// Move construct a dynamic buffer.
|
|
1564
|
+
dynamic_string_buffer(dynamic_string_buffer&& other) BOOST_ASIO_NOEXCEPT
|
|
1565
|
+
: string_(other.string_),
|
|
1566
|
+
size_(other.size_),
|
|
1567
|
+
max_size_(other.max_size_)
|
|
1568
|
+
{
|
|
1569
|
+
}
|
|
1570
|
+
#endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
|
|
1423
1571
|
|
|
1424
|
-
///
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
* @param source A non-modifiable buffer representing the memory region from
|
|
1430
|
-
* which the bytes will be copied.
|
|
1431
|
-
*
|
|
1432
|
-
* @returns The number of bytes copied.
|
|
1433
|
-
*
|
|
1434
|
-
* @note The number of bytes copied is the lesser of:
|
|
1435
|
-
*
|
|
1436
|
-
* @li @c buffer_size(target)
|
|
1437
|
-
*
|
|
1438
|
-
* @li @c buffer_size(source)
|
|
1439
|
-
*
|
|
1440
|
-
* This function is implemented in terms of @c memcpy, and consequently it
|
|
1441
|
-
* cannot be used to copy between overlapping memory regions.
|
|
1442
|
-
*/
|
|
1443
|
-
inline std::size_t buffer_copy(const mutable_buffers_1& target,
|
|
1444
|
-
const const_buffer& source)
|
|
1445
|
-
{
|
|
1446
|
-
return buffer_copy(static_cast<const mutable_buffer&>(target), source);
|
|
1447
|
-
}
|
|
1572
|
+
/// Get the size of the input sequence.
|
|
1573
|
+
std::size_t size() const BOOST_ASIO_NOEXCEPT
|
|
1574
|
+
{
|
|
1575
|
+
return size_;
|
|
1576
|
+
}
|
|
1448
1577
|
|
|
1449
|
-
///
|
|
1450
|
-
/**
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
*
|
|
1459
|
-
* @note The number of bytes copied is the lesser of:
|
|
1460
|
-
*
|
|
1461
|
-
* @li @c buffer_size(target)
|
|
1462
|
-
*
|
|
1463
|
-
* @li @c buffer_size(source)
|
|
1464
|
-
*
|
|
1465
|
-
* This function is implemented in terms of @c memcpy, and consequently it
|
|
1466
|
-
* cannot be used to copy between overlapping memory regions.
|
|
1467
|
-
*/
|
|
1468
|
-
inline std::size_t buffer_copy(const mutable_buffers_1& target,
|
|
1469
|
-
const const_buffers_1& source)
|
|
1470
|
-
{
|
|
1471
|
-
return buffer_copy(static_cast<const mutable_buffer&>(target),
|
|
1472
|
-
static_cast<const const_buffer&>(source));
|
|
1473
|
-
}
|
|
1578
|
+
/// Get the maximum size of the dynamic buffer.
|
|
1579
|
+
/**
|
|
1580
|
+
* @returns The allowed maximum of the sum of the sizes of the input sequence
|
|
1581
|
+
* and output sequence.
|
|
1582
|
+
*/
|
|
1583
|
+
std::size_t max_size() const BOOST_ASIO_NOEXCEPT
|
|
1584
|
+
{
|
|
1585
|
+
return max_size_;
|
|
1586
|
+
}
|
|
1474
1587
|
|
|
1475
|
-
///
|
|
1476
|
-
/**
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
* @returns The number of bytes copied.
|
|
1485
|
-
*
|
|
1486
|
-
* @note The number of bytes copied is the lesser of:
|
|
1487
|
-
*
|
|
1488
|
-
* @li @c buffer_size(target)
|
|
1489
|
-
*
|
|
1490
|
-
* @li @c buffer_size(source)
|
|
1491
|
-
*
|
|
1492
|
-
* This function is implemented in terms of @c memcpy, and consequently it
|
|
1493
|
-
* cannot be used to copy between overlapping memory regions.
|
|
1494
|
-
*/
|
|
1495
|
-
inline std::size_t buffer_copy(const mutable_buffers_1& target,
|
|
1496
|
-
const mutable_buffer& source)
|
|
1497
|
-
{
|
|
1498
|
-
return buffer_copy(static_cast<const mutable_buffer&>(target),
|
|
1499
|
-
const_buffer(source));
|
|
1500
|
-
}
|
|
1588
|
+
/// Get the current capacity of the dynamic buffer.
|
|
1589
|
+
/**
|
|
1590
|
+
* @returns The current total capacity of the buffer, i.e. for both the input
|
|
1591
|
+
* sequence and output sequence.
|
|
1592
|
+
*/
|
|
1593
|
+
std::size_t capacity() const BOOST_ASIO_NOEXCEPT
|
|
1594
|
+
{
|
|
1595
|
+
return string_.capacity();
|
|
1596
|
+
}
|
|
1501
1597
|
|
|
1502
|
-
///
|
|
1503
|
-
/**
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
*
|
|
1517
|
-
* @li @c buffer_size(source)
|
|
1518
|
-
*
|
|
1519
|
-
* This function is implemented in terms of @c memcpy, and consequently it
|
|
1520
|
-
* cannot be used to copy between overlapping memory regions.
|
|
1521
|
-
*/
|
|
1522
|
-
inline std::size_t buffer_copy(const mutable_buffers_1& target,
|
|
1523
|
-
const mutable_buffers_1& source)
|
|
1524
|
-
{
|
|
1525
|
-
return buffer_copy(static_cast<const mutable_buffer&>(target),
|
|
1526
|
-
const_buffer(source));
|
|
1527
|
-
}
|
|
1598
|
+
/// Get a list of buffers that represents the input sequence.
|
|
1599
|
+
/**
|
|
1600
|
+
* @returns An object of type @c const_buffers_type that satisfies
|
|
1601
|
+
* ConstBufferSequence requirements, representing the basic_string memory in
|
|
1602
|
+
* input sequence.
|
|
1603
|
+
*
|
|
1604
|
+
* @note The returned object is invalidated by any @c dynamic_string_buffer
|
|
1605
|
+
* or @c basic_string member function that modifies the input sequence or
|
|
1606
|
+
* output sequence.
|
|
1607
|
+
*/
|
|
1608
|
+
const_buffers_type data() const BOOST_ASIO_NOEXCEPT
|
|
1609
|
+
{
|
|
1610
|
+
return const_buffers_type(boost::asio::buffer(string_, size_));
|
|
1611
|
+
}
|
|
1528
1612
|
|
|
1529
|
-
///
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
return buffer_copy(static_cast<const mutable_buffer&>(target), source);
|
|
1553
|
-
}
|
|
1613
|
+
/// Get a list of buffers that represents the output sequence, with the given
|
|
1614
|
+
/// size.
|
|
1615
|
+
/**
|
|
1616
|
+
* Ensures that the output sequence can accommodate @c n bytes, resizing the
|
|
1617
|
+
* basic_string object as necessary.
|
|
1618
|
+
*
|
|
1619
|
+
* @returns An object of type @c mutable_buffers_type that satisfies
|
|
1620
|
+
* MutableBufferSequence requirements, representing basic_string memory
|
|
1621
|
+
* at the start of the output sequence of size @c n.
|
|
1622
|
+
*
|
|
1623
|
+
* @throws std::length_error If <tt>size() + n > max_size()</tt>.
|
|
1624
|
+
*
|
|
1625
|
+
* @note The returned object is invalidated by any @c dynamic_string_buffer
|
|
1626
|
+
* or @c basic_string member function that modifies the input sequence or
|
|
1627
|
+
* output sequence.
|
|
1628
|
+
*/
|
|
1629
|
+
mutable_buffers_type prepare(std::size_t n)
|
|
1630
|
+
{
|
|
1631
|
+
if (size () > max_size() || max_size() - size() < n)
|
|
1632
|
+
{
|
|
1633
|
+
std::length_error ex("dynamic_string_buffer too long");
|
|
1634
|
+
boost::asio::detail::throw_exception(ex);
|
|
1635
|
+
}
|
|
1554
1636
|
|
|
1555
|
-
|
|
1556
|
-
/**
|
|
1557
|
-
* @param target A modifiable buffer sequence representing the memory regions to
|
|
1558
|
-
* which the bytes will be copied.
|
|
1559
|
-
*
|
|
1560
|
-
* @param source A non-modifiable buffer representing the memory region from
|
|
1561
|
-
* which the bytes will be copied.
|
|
1562
|
-
*
|
|
1563
|
-
* @returns The number of bytes copied.
|
|
1564
|
-
*
|
|
1565
|
-
* @note The number of bytes copied is the lesser of:
|
|
1566
|
-
*
|
|
1567
|
-
* @li @c buffer_size(target)
|
|
1568
|
-
*
|
|
1569
|
-
* @li @c buffer_size(source)
|
|
1570
|
-
*
|
|
1571
|
-
* This function is implemented in terms of @c memcpy, and consequently it
|
|
1572
|
-
* cannot be used to copy between overlapping memory regions.
|
|
1573
|
-
*/
|
|
1574
|
-
template <typename MutableBufferSequence>
|
|
1575
|
-
std::size_t buffer_copy(const MutableBufferSequence& target,
|
|
1576
|
-
const const_buffer& source)
|
|
1577
|
-
{
|
|
1578
|
-
std::size_t total_bytes_copied = 0;
|
|
1637
|
+
string_.resize(size_ + n);
|
|
1579
1638
|
|
|
1580
|
-
|
|
1581
|
-
|
|
1639
|
+
return boost::asio::buffer(boost::asio::buffer(string_) + size_, n);
|
|
1640
|
+
}
|
|
1582
1641
|
|
|
1583
|
-
|
|
1584
|
-
|
|
1642
|
+
/// Move bytes from the output sequence to the input sequence.
|
|
1643
|
+
/**
|
|
1644
|
+
* @param n The number of bytes to append from the start of the output
|
|
1645
|
+
* sequence to the end of the input sequence. The remainder of the output
|
|
1646
|
+
* sequence is discarded.
|
|
1647
|
+
*
|
|
1648
|
+
* Requires a preceding call <tt>prepare(x)</tt> where <tt>x >= n</tt>, and
|
|
1649
|
+
* no intervening operations that modify the input or output sequence.
|
|
1650
|
+
*
|
|
1651
|
+
* @note If @c n is greater than the size of the output sequence, the entire
|
|
1652
|
+
* output sequence is moved to the input sequence and no error is issued.
|
|
1653
|
+
*/
|
|
1654
|
+
void commit(std::size_t n)
|
|
1585
1655
|
{
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
total_bytes_copied += bytes_copied;
|
|
1589
|
-
source_buffer = source_buffer + bytes_copied;
|
|
1656
|
+
size_ += (std::min)(n, string_.size() - size_);
|
|
1657
|
+
string_.resize(size_);
|
|
1590
1658
|
}
|
|
1591
1659
|
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
* @note The number of bytes copied is the lesser of:
|
|
1606
|
-
*
|
|
1607
|
-
* @li @c buffer_size(target)
|
|
1608
|
-
*
|
|
1609
|
-
* @li @c buffer_size(source)
|
|
1610
|
-
*
|
|
1611
|
-
* This function is implemented in terms of @c memcpy, and consequently it
|
|
1612
|
-
* cannot be used to copy between overlapping memory regions.
|
|
1613
|
-
*/
|
|
1614
|
-
template <typename MutableBufferSequence>
|
|
1615
|
-
inline std::size_t buffer_copy(const MutableBufferSequence& target,
|
|
1616
|
-
const const_buffers_1& source)
|
|
1617
|
-
{
|
|
1618
|
-
return buffer_copy(target, static_cast<const const_buffer&>(source));
|
|
1619
|
-
}
|
|
1620
|
-
|
|
1621
|
-
/// Copies bytes from a source buffer to a target buffer sequence.
|
|
1622
|
-
/**
|
|
1623
|
-
* @param target A modifiable buffer sequence representing the memory regions to
|
|
1624
|
-
* which the bytes will be copied.
|
|
1625
|
-
*
|
|
1626
|
-
* @param source A modifiable buffer representing the memory region from which
|
|
1627
|
-
* the bytes will be copied. The contents of the source buffer will not be
|
|
1628
|
-
* modified.
|
|
1629
|
-
*
|
|
1630
|
-
* @returns The number of bytes copied.
|
|
1631
|
-
*
|
|
1632
|
-
* @note The number of bytes copied is the lesser of:
|
|
1633
|
-
*
|
|
1634
|
-
* @li @c buffer_size(target)
|
|
1635
|
-
*
|
|
1636
|
-
* @li @c buffer_size(source)
|
|
1637
|
-
*
|
|
1638
|
-
* This function is implemented in terms of @c memcpy, and consequently it
|
|
1639
|
-
* cannot be used to copy between overlapping memory regions.
|
|
1640
|
-
*/
|
|
1641
|
-
template <typename MutableBufferSequence>
|
|
1642
|
-
inline std::size_t buffer_copy(const MutableBufferSequence& target,
|
|
1643
|
-
const mutable_buffer& source)
|
|
1644
|
-
{
|
|
1645
|
-
return buffer_copy(target, const_buffer(source));
|
|
1646
|
-
}
|
|
1660
|
+
/// Remove characters from the input sequence.
|
|
1661
|
+
/**
|
|
1662
|
+
* Removes @c n characters from the beginning of the input sequence.
|
|
1663
|
+
*
|
|
1664
|
+
* @note If @c n is greater than the size of the input sequence, the entire
|
|
1665
|
+
* input sequence is consumed and no error is issued.
|
|
1666
|
+
*/
|
|
1667
|
+
void consume(std::size_t n)
|
|
1668
|
+
{
|
|
1669
|
+
std::size_t consume_length = (std::min)(n, size_);
|
|
1670
|
+
string_.erase(0, consume_length);
|
|
1671
|
+
size_ -= consume_length;
|
|
1672
|
+
}
|
|
1647
1673
|
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
* @param source A modifiable buffer representing the memory region from which
|
|
1654
|
-
* the bytes will be copied. The contents of the source buffer will not be
|
|
1655
|
-
* modified.
|
|
1656
|
-
*
|
|
1657
|
-
* @returns The number of bytes copied.
|
|
1658
|
-
*
|
|
1659
|
-
* @note The number of bytes copied is the lesser of:
|
|
1660
|
-
*
|
|
1661
|
-
* @li @c buffer_size(target)
|
|
1662
|
-
*
|
|
1663
|
-
* @li @c buffer_size(source)
|
|
1664
|
-
*
|
|
1665
|
-
* This function is implemented in terms of @c memcpy, and consequently it
|
|
1666
|
-
* cannot be used to copy between overlapping memory regions.
|
|
1667
|
-
*/
|
|
1668
|
-
template <typename MutableBufferSequence>
|
|
1669
|
-
inline std::size_t buffer_copy(const MutableBufferSequence& target,
|
|
1670
|
-
const mutable_buffers_1& source)
|
|
1671
|
-
{
|
|
1672
|
-
return buffer_copy(target, const_buffer(source));
|
|
1673
|
-
}
|
|
1674
|
+
private:
|
|
1675
|
+
std::basic_string<Elem, Traits, Allocator>& string_;
|
|
1676
|
+
std::size_t size_;
|
|
1677
|
+
const std::size_t max_size_;
|
|
1678
|
+
};
|
|
1674
1679
|
|
|
1675
|
-
///
|
|
1680
|
+
/// Adapt a vector to the DynamicBuffer requirements.
|
|
1676
1681
|
/**
|
|
1677
|
-
*
|
|
1678
|
-
* which the bytes will be copied.
|
|
1679
|
-
*
|
|
1680
|
-
* @param source A non-modifiable buffer sequence representing the memory
|
|
1681
|
-
* regions from which the bytes will be copied.
|
|
1682
|
-
*
|
|
1683
|
-
* @returns The number of bytes copied.
|
|
1684
|
-
*
|
|
1685
|
-
* @note The number of bytes copied is the lesser of:
|
|
1686
|
-
*
|
|
1687
|
-
* @li @c buffer_size(target)
|
|
1688
|
-
*
|
|
1689
|
-
* @li @c buffer_size(source)
|
|
1690
|
-
*
|
|
1691
|
-
* This function is implemented in terms of @c memcpy, and consequently it
|
|
1692
|
-
* cannot be used to copy between overlapping memory regions.
|
|
1682
|
+
* Requires that <tt>sizeof(Elem) == 1</tt>.
|
|
1693
1683
|
*/
|
|
1694
|
-
template <typename
|
|
1695
|
-
|
|
1696
|
-
const ConstBufferSequence& source)
|
|
1684
|
+
template <typename Elem, typename Allocator>
|
|
1685
|
+
class dynamic_vector_buffer
|
|
1697
1686
|
{
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1687
|
+
public:
|
|
1688
|
+
/// The type used to represent the input sequence as a list of buffers.
|
|
1689
|
+
typedef BOOST_ASIO_CONST_BUFFER const_buffers_type;
|
|
1690
|
+
|
|
1691
|
+
/// The type used to represent the output sequence as a list of buffers.
|
|
1692
|
+
typedef BOOST_ASIO_MUTABLE_BUFFER mutable_buffers_type;
|
|
1693
|
+
|
|
1694
|
+
/// Construct a dynamic buffer from a string.
|
|
1695
|
+
/**
|
|
1696
|
+
* @param v The vector to be used as backing storage for the dynamic buffer.
|
|
1697
|
+
* Any existing data in the vector is treated as the dynamic buffer's input
|
|
1698
|
+
* sequence. The object stores a reference to the vector and the user is
|
|
1699
|
+
* responsible for ensuring that the vector object remains valid until the
|
|
1700
|
+
* dynamic_vector_buffer object is destroyed.
|
|
1701
|
+
*
|
|
1702
|
+
* @param maximum_size Specifies a maximum size for the buffer, in bytes.
|
|
1703
|
+
*/
|
|
1704
|
+
explicit dynamic_vector_buffer(std::vector<Elem, Allocator>& v,
|
|
1705
|
+
std::size_t maximum_size =
|
|
1706
|
+
(std::numeric_limits<std::size_t>::max)()) BOOST_ASIO_NOEXCEPT
|
|
1707
|
+
: vector_(v),
|
|
1708
|
+
size_(vector_.size()),
|
|
1709
|
+
max_size_(maximum_size)
|
|
1710
|
+
{
|
|
1711
|
+
}
|
|
1703
1712
|
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1713
|
+
#if defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
|
|
1714
|
+
/// Move construct a dynamic buffer.
|
|
1715
|
+
dynamic_vector_buffer(dynamic_vector_buffer&& other) BOOST_ASIO_NOEXCEPT
|
|
1716
|
+
: vector_(other.vector_),
|
|
1717
|
+
size_(other.size_),
|
|
1718
|
+
max_size_(other.max_size_)
|
|
1719
|
+
{
|
|
1720
|
+
}
|
|
1721
|
+
#endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
|
|
1707
1722
|
|
|
1708
|
-
|
|
1723
|
+
/// Get the size of the input sequence.
|
|
1724
|
+
std::size_t size() const BOOST_ASIO_NOEXCEPT
|
|
1709
1725
|
{
|
|
1710
|
-
|
|
1711
|
-
|
|
1726
|
+
return size_;
|
|
1727
|
+
}
|
|
1712
1728
|
|
|
1713
|
-
|
|
1714
|
-
|
|
1729
|
+
/// Get the maximum size of the dynamic buffer.
|
|
1730
|
+
/**
|
|
1731
|
+
* @returns The allowed maximum of the sum of the sizes of the input sequence
|
|
1732
|
+
* and output sequence.
|
|
1733
|
+
*/
|
|
1734
|
+
std::size_t max_size() const BOOST_ASIO_NOEXCEPT
|
|
1735
|
+
{
|
|
1736
|
+
return max_size_;
|
|
1737
|
+
}
|
|
1715
1738
|
|
|
1716
|
-
|
|
1717
|
-
|
|
1739
|
+
/// Get the current capacity of the dynamic buffer.
|
|
1740
|
+
/**
|
|
1741
|
+
* @returns The current total capacity of the buffer, i.e. for both the input
|
|
1742
|
+
* sequence and output sequence.
|
|
1743
|
+
*/
|
|
1744
|
+
std::size_t capacity() const BOOST_ASIO_NOEXCEPT
|
|
1745
|
+
{
|
|
1746
|
+
return vector_.capacity();
|
|
1747
|
+
}
|
|
1718
1748
|
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1749
|
+
/// Get a list of buffers that represents the input sequence.
|
|
1750
|
+
/**
|
|
1751
|
+
* @returns An object of type @c const_buffers_type that satisfies
|
|
1752
|
+
* ConstBufferSequence requirements, representing the basic_string memory in
|
|
1753
|
+
* input sequence.
|
|
1754
|
+
*
|
|
1755
|
+
* @note The returned object is invalidated by any @c dynamic_vector_buffer
|
|
1756
|
+
* or @c basic_string member function that modifies the input sequence or
|
|
1757
|
+
* output sequence.
|
|
1758
|
+
*/
|
|
1759
|
+
const_buffers_type data() const BOOST_ASIO_NOEXCEPT
|
|
1760
|
+
{
|
|
1761
|
+
return const_buffers_type(boost::asio::buffer(vector_, size_));
|
|
1762
|
+
}
|
|
1726
1763
|
|
|
1727
|
-
|
|
1764
|
+
/// Get a list of buffers that represents the output sequence, with the given
|
|
1765
|
+
/// size.
|
|
1766
|
+
/**
|
|
1767
|
+
* Ensures that the output sequence can accommodate @c n bytes, resizing the
|
|
1768
|
+
* basic_string object as necessary.
|
|
1769
|
+
*
|
|
1770
|
+
* @returns An object of type @c mutable_buffers_type that satisfies
|
|
1771
|
+
* MutableBufferSequence requirements, representing basic_string memory
|
|
1772
|
+
* at the start of the output sequence of size @c n.
|
|
1773
|
+
*
|
|
1774
|
+
* @throws std::length_error If <tt>size() + n > max_size()</tt>.
|
|
1775
|
+
*
|
|
1776
|
+
* @note The returned object is invalidated by any @c dynamic_vector_buffer
|
|
1777
|
+
* or @c basic_string member function that modifies the input sequence or
|
|
1778
|
+
* output sequence.
|
|
1779
|
+
*/
|
|
1780
|
+
mutable_buffers_type prepare(std::size_t n)
|
|
1781
|
+
{
|
|
1782
|
+
if (size () > max_size() || max_size() - size() < n)
|
|
1728
1783
|
{
|
|
1729
|
-
|
|
1730
|
-
|
|
1784
|
+
std::length_error ex("dynamic_vector_buffer too long");
|
|
1785
|
+
boost::asio::detail::throw_exception(ex);
|
|
1731
1786
|
}
|
|
1732
|
-
else
|
|
1733
|
-
source_buffer_offset += bytes_copied;
|
|
1734
|
-
}
|
|
1735
1787
|
|
|
1736
|
-
|
|
1737
|
-
}
|
|
1788
|
+
vector_.resize(size_ + n);
|
|
1738
1789
|
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
* @param target A modifiable buffer representing the memory region to which
|
|
1742
|
-
* the bytes will be copied.
|
|
1743
|
-
*
|
|
1744
|
-
* @param source A non-modifiable buffer representing the memory region from
|
|
1745
|
-
* which the bytes will be copied.
|
|
1746
|
-
*
|
|
1747
|
-
* @param max_bytes_to_copy The maximum number of bytes to be copied.
|
|
1748
|
-
*
|
|
1749
|
-
* @returns The number of bytes copied.
|
|
1750
|
-
*
|
|
1751
|
-
* @note The number of bytes copied is the lesser of:
|
|
1752
|
-
*
|
|
1753
|
-
* @li @c buffer_size(target)
|
|
1754
|
-
*
|
|
1755
|
-
* @li @c buffer_size(source)
|
|
1756
|
-
*
|
|
1757
|
-
* @li @c max_bytes_to_copy
|
|
1758
|
-
*
|
|
1759
|
-
* This function is implemented in terms of @c memcpy, and consequently it
|
|
1760
|
-
* cannot be used to copy between overlapping memory regions.
|
|
1761
|
-
*/
|
|
1762
|
-
inline std::size_t buffer_copy(const mutable_buffer& target,
|
|
1763
|
-
const const_buffer& source, std::size_t max_bytes_to_copy)
|
|
1764
|
-
{
|
|
1765
|
-
return buffer_copy(buffer(target, max_bytes_to_copy), source);
|
|
1766
|
-
}
|
|
1767
|
-
|
|
1768
|
-
/// Copies a limited number of bytes from a source buffer to a target buffer.
|
|
1769
|
-
/**
|
|
1770
|
-
* @param target A modifiable buffer representing the memory region to which
|
|
1771
|
-
* the bytes will be copied.
|
|
1772
|
-
*
|
|
1773
|
-
* @param source A non-modifiable buffer representing the memory region from
|
|
1774
|
-
* which the bytes will be copied.
|
|
1775
|
-
*
|
|
1776
|
-
* @param max_bytes_to_copy The maximum number of bytes to be copied.
|
|
1777
|
-
*
|
|
1778
|
-
* @returns The number of bytes copied.
|
|
1779
|
-
*
|
|
1780
|
-
* @note The number of bytes copied is the lesser of:
|
|
1781
|
-
*
|
|
1782
|
-
* @li @c buffer_size(target)
|
|
1783
|
-
*
|
|
1784
|
-
* @li @c buffer_size(source)
|
|
1785
|
-
*
|
|
1786
|
-
* @li @c max_bytes_to_copy
|
|
1787
|
-
*
|
|
1788
|
-
* This function is implemented in terms of @c memcpy, and consequently it
|
|
1789
|
-
* cannot be used to copy between overlapping memory regions.
|
|
1790
|
-
*/
|
|
1791
|
-
inline std::size_t buffer_copy(const mutable_buffer& target,
|
|
1792
|
-
const const_buffers_1& source, std::size_t max_bytes_to_copy)
|
|
1793
|
-
{
|
|
1794
|
-
return buffer_copy(buffer(target, max_bytes_to_copy), source);
|
|
1795
|
-
}
|
|
1796
|
-
|
|
1797
|
-
/// Copies a limited number of bytes from a source buffer to a target buffer.
|
|
1798
|
-
/**
|
|
1799
|
-
* @param target A modifiable buffer representing the memory region to which
|
|
1800
|
-
* the bytes will be copied.
|
|
1801
|
-
*
|
|
1802
|
-
* @param source A modifiable buffer representing the memory region from which
|
|
1803
|
-
* the bytes will be copied. The contents of the source buffer will not be
|
|
1804
|
-
* modified.
|
|
1805
|
-
*
|
|
1806
|
-
* @param max_bytes_to_copy The maximum number of bytes to be copied.
|
|
1807
|
-
*
|
|
1808
|
-
* @returns The number of bytes copied.
|
|
1809
|
-
*
|
|
1810
|
-
* @note The number of bytes copied is the lesser of:
|
|
1811
|
-
*
|
|
1812
|
-
* @li @c buffer_size(target)
|
|
1813
|
-
*
|
|
1814
|
-
* @li @c buffer_size(source)
|
|
1815
|
-
*
|
|
1816
|
-
* @li @c max_bytes_to_copy
|
|
1817
|
-
*
|
|
1818
|
-
* This function is implemented in terms of @c memcpy, and consequently it
|
|
1819
|
-
* cannot be used to copy between overlapping memory regions.
|
|
1820
|
-
*/
|
|
1821
|
-
inline std::size_t buffer_copy(const mutable_buffer& target,
|
|
1822
|
-
const mutable_buffer& source, std::size_t max_bytes_to_copy)
|
|
1823
|
-
{
|
|
1824
|
-
return buffer_copy(buffer(target, max_bytes_to_copy), source);
|
|
1825
|
-
}
|
|
1790
|
+
return boost::asio::buffer(boost::asio::buffer(vector_) + size_, n);
|
|
1791
|
+
}
|
|
1826
1792
|
|
|
1827
|
-
///
|
|
1828
|
-
/**
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
* @li @c buffer_size(source)
|
|
1845
|
-
*
|
|
1846
|
-
* @li @c max_bytes_to_copy
|
|
1847
|
-
*
|
|
1848
|
-
* This function is implemented in terms of @c memcpy, and consequently it
|
|
1849
|
-
* cannot be used to copy between overlapping memory regions.
|
|
1850
|
-
*/
|
|
1851
|
-
inline std::size_t buffer_copy(const mutable_buffer& target,
|
|
1852
|
-
const mutable_buffers_1& source, std::size_t max_bytes_to_copy)
|
|
1853
|
-
{
|
|
1854
|
-
return buffer_copy(buffer(target, max_bytes_to_copy), source);
|
|
1855
|
-
}
|
|
1793
|
+
/// Move bytes from the output sequence to the input sequence.
|
|
1794
|
+
/**
|
|
1795
|
+
* @param n The number of bytes to append from the start of the output
|
|
1796
|
+
* sequence to the end of the input sequence. The remainder of the output
|
|
1797
|
+
* sequence is discarded.
|
|
1798
|
+
*
|
|
1799
|
+
* Requires a preceding call <tt>prepare(x)</tt> where <tt>x >= n</tt>, and
|
|
1800
|
+
* no intervening operations that modify the input or output sequence.
|
|
1801
|
+
*
|
|
1802
|
+
* @note If @c n is greater than the size of the output sequence, the entire
|
|
1803
|
+
* output sequence is moved to the input sequence and no error is issued.
|
|
1804
|
+
*/
|
|
1805
|
+
void commit(std::size_t n)
|
|
1806
|
+
{
|
|
1807
|
+
size_ += (std::min)(n, vector_.size() - size_);
|
|
1808
|
+
vector_.resize(size_);
|
|
1809
|
+
}
|
|
1856
1810
|
|
|
1857
|
-
///
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
* @note The number of bytes copied is the lesser of:
|
|
1871
|
-
*
|
|
1872
|
-
* @li @c buffer_size(target)
|
|
1873
|
-
*
|
|
1874
|
-
* @li @c buffer_size(source)
|
|
1875
|
-
*
|
|
1876
|
-
* @li @c max_bytes_to_copy
|
|
1877
|
-
*
|
|
1878
|
-
* This function is implemented in terms of @c memcpy, and consequently it
|
|
1879
|
-
* cannot be used to copy between overlapping memory regions.
|
|
1880
|
-
*/
|
|
1881
|
-
template <typename ConstBufferSequence>
|
|
1882
|
-
inline std::size_t buffer_copy(const mutable_buffer& target,
|
|
1883
|
-
const ConstBufferSequence& source, std::size_t max_bytes_to_copy)
|
|
1884
|
-
{
|
|
1885
|
-
return buffer_copy(buffer(target, max_bytes_to_copy), source);
|
|
1886
|
-
}
|
|
1811
|
+
/// Remove characters from the input sequence.
|
|
1812
|
+
/**
|
|
1813
|
+
* Removes @c n characters from the beginning of the input sequence.
|
|
1814
|
+
*
|
|
1815
|
+
* @note If @c n is greater than the size of the input sequence, the entire
|
|
1816
|
+
* input sequence is consumed and no error is issued.
|
|
1817
|
+
*/
|
|
1818
|
+
void consume(std::size_t n)
|
|
1819
|
+
{
|
|
1820
|
+
std::size_t consume_length = (std::min)(n, size_);
|
|
1821
|
+
vector_.erase(vector_.begin(), vector_.begin() + consume_length);
|
|
1822
|
+
size_ -= consume_length;
|
|
1823
|
+
}
|
|
1887
1824
|
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
* @param source A non-modifiable buffer representing the memory region from
|
|
1894
|
-
* which the bytes will be copied.
|
|
1895
|
-
*
|
|
1896
|
-
* @param max_bytes_to_copy The maximum number of bytes to be copied.
|
|
1897
|
-
*
|
|
1898
|
-
* @returns The number of bytes copied.
|
|
1899
|
-
*
|
|
1900
|
-
* @note The number of bytes copied is the lesser of:
|
|
1901
|
-
*
|
|
1902
|
-
* @li @c buffer_size(target)
|
|
1903
|
-
*
|
|
1904
|
-
* @li @c buffer_size(source)
|
|
1905
|
-
*
|
|
1906
|
-
* @li @c max_bytes_to_copy
|
|
1907
|
-
*
|
|
1908
|
-
* This function is implemented in terms of @c memcpy, and consequently it
|
|
1909
|
-
* cannot be used to copy between overlapping memory regions.
|
|
1910
|
-
*/
|
|
1911
|
-
inline std::size_t buffer_copy(const mutable_buffers_1& target,
|
|
1912
|
-
const const_buffer& source, std::size_t max_bytes_to_copy)
|
|
1913
|
-
{
|
|
1914
|
-
return buffer_copy(buffer(target, max_bytes_to_copy), source);
|
|
1915
|
-
}
|
|
1825
|
+
private:
|
|
1826
|
+
std::vector<Elem, Allocator>& vector_;
|
|
1827
|
+
std::size_t size_;
|
|
1828
|
+
const std::size_t max_size_;
|
|
1829
|
+
};
|
|
1916
1830
|
|
|
1917
|
-
|
|
1918
|
-
/**
|
|
1919
|
-
* @param target A modifiable buffer representing the memory region to which
|
|
1920
|
-
* the bytes will be copied.
|
|
1921
|
-
*
|
|
1922
|
-
* @param source A non-modifiable buffer representing the memory region from
|
|
1923
|
-
* which the bytes will be copied.
|
|
1924
|
-
*
|
|
1925
|
-
* @param max_bytes_to_copy The maximum number of bytes to be copied.
|
|
1926
|
-
*
|
|
1927
|
-
* @returns The number of bytes copied.
|
|
1831
|
+
/** @defgroup dynamic_buffer boost::asio::dynamic_buffer
|
|
1928
1832
|
*
|
|
1929
|
-
* @
|
|
1930
|
-
*
|
|
1931
|
-
* @li @c buffer_size(target)
|
|
1932
|
-
*
|
|
1933
|
-
* @li @c buffer_size(source)
|
|
1934
|
-
*
|
|
1935
|
-
* @li @c max_bytes_to_copy
|
|
1936
|
-
*
|
|
1937
|
-
* This function is implemented in terms of @c memcpy, and consequently it
|
|
1938
|
-
* cannot be used to copy between overlapping memory regions.
|
|
1833
|
+
* @brief The boost::asio::dynamic_buffer function is used to create a
|
|
1834
|
+
* dynamically resized buffer from a @c std::basic_string or @c std::vector.
|
|
1939
1835
|
*/
|
|
1940
|
-
|
|
1941
|
-
const const_buffers_1& source, std::size_t max_bytes_to_copy)
|
|
1942
|
-
{
|
|
1943
|
-
return buffer_copy(buffer(target, max_bytes_to_copy), source);
|
|
1944
|
-
}
|
|
1836
|
+
/*@{*/
|
|
1945
1837
|
|
|
1946
|
-
///
|
|
1947
|
-
/**
|
|
1948
|
-
* @
|
|
1949
|
-
* the bytes will be copied.
|
|
1950
|
-
*
|
|
1951
|
-
* @param source A modifiable buffer representing the memory region from which
|
|
1952
|
-
* the bytes will be copied. The contents of the source buffer will not be
|
|
1953
|
-
* modified.
|
|
1954
|
-
*
|
|
1955
|
-
* @param max_bytes_to_copy The maximum number of bytes to be copied.
|
|
1956
|
-
*
|
|
1957
|
-
* @returns The number of bytes copied.
|
|
1958
|
-
*
|
|
1959
|
-
* @note The number of bytes copied is the lesser of:
|
|
1960
|
-
*
|
|
1961
|
-
* @li @c buffer_size(target)
|
|
1962
|
-
*
|
|
1963
|
-
* @li @c buffer_size(source)
|
|
1964
|
-
*
|
|
1965
|
-
* @li @c max_bytes_to_copy
|
|
1966
|
-
*
|
|
1967
|
-
* This function is implemented in terms of @c memcpy, and consequently it
|
|
1968
|
-
* cannot be used to copy between overlapping memory regions.
|
|
1838
|
+
/// Create a new dynamic buffer that represents the given string.
|
|
1839
|
+
/**
|
|
1840
|
+
* @returns <tt>dynamic_string_buffer<Elem, Traits, Allocator>(data)</tt>.
|
|
1969
1841
|
*/
|
|
1970
|
-
|
|
1971
|
-
|
|
1842
|
+
template <typename Elem, typename Traits, typename Allocator>
|
|
1843
|
+
inline dynamic_string_buffer<Elem, Traits, Allocator> dynamic_buffer(
|
|
1844
|
+
std::basic_string<Elem, Traits, Allocator>& data) BOOST_ASIO_NOEXCEPT
|
|
1972
1845
|
{
|
|
1973
|
-
return
|
|
1846
|
+
return dynamic_string_buffer<Elem, Traits, Allocator>(data);
|
|
1974
1847
|
}
|
|
1975
1848
|
|
|
1976
|
-
///
|
|
1849
|
+
/// Create a new dynamic buffer that represents the given string.
|
|
1977
1850
|
/**
|
|
1978
|
-
* @
|
|
1979
|
-
*
|
|
1980
|
-
*
|
|
1981
|
-
* @param source A modifiable buffer representing the memory region from which
|
|
1982
|
-
* the bytes will be copied. The contents of the source buffer will not be
|
|
1983
|
-
* modified.
|
|
1984
|
-
*
|
|
1985
|
-
* @param max_bytes_to_copy The maximum number of bytes to be copied.
|
|
1986
|
-
*
|
|
1987
|
-
* @returns The number of bytes copied.
|
|
1988
|
-
*
|
|
1989
|
-
* @note The number of bytes copied is the lesser of:
|
|
1990
|
-
*
|
|
1991
|
-
* @li @c buffer_size(target)
|
|
1992
|
-
*
|
|
1993
|
-
* @li @c buffer_size(source)
|
|
1994
|
-
*
|
|
1995
|
-
* @li @c max_bytes_to_copy
|
|
1996
|
-
*
|
|
1997
|
-
* This function is implemented in terms of @c memcpy, and consequently it
|
|
1998
|
-
* cannot be used to copy between overlapping memory regions.
|
|
1851
|
+
* @returns <tt>dynamic_string_buffer<Elem, Traits, Allocator>(data,
|
|
1852
|
+
* max_size)</tt>.
|
|
1999
1853
|
*/
|
|
2000
|
-
|
|
2001
|
-
|
|
1854
|
+
template <typename Elem, typename Traits, typename Allocator>
|
|
1855
|
+
inline dynamic_string_buffer<Elem, Traits, Allocator> dynamic_buffer(
|
|
1856
|
+
std::basic_string<Elem, Traits, Allocator>& data,
|
|
1857
|
+
std::size_t max_size) BOOST_ASIO_NOEXCEPT
|
|
2002
1858
|
{
|
|
2003
|
-
return
|
|
1859
|
+
return dynamic_string_buffer<Elem, Traits, Allocator>(data, max_size);
|
|
2004
1860
|
}
|
|
2005
1861
|
|
|
2006
|
-
///
|
|
2007
|
-
/// buffer.
|
|
1862
|
+
/// Create a new dynamic buffer that represents the given vector.
|
|
2008
1863
|
/**
|
|
2009
|
-
* @
|
|
2010
|
-
* the bytes will be copied.
|
|
2011
|
-
*
|
|
2012
|
-
* @param source A non-modifiable buffer sequence representing the memory
|
|
2013
|
-
* regions from which the bytes will be copied.
|
|
2014
|
-
*
|
|
2015
|
-
* @param max_bytes_to_copy The maximum number of bytes to be copied.
|
|
2016
|
-
*
|
|
2017
|
-
* @returns The number of bytes copied.
|
|
2018
|
-
*
|
|
2019
|
-
* @note The number of bytes copied is the lesser of:
|
|
2020
|
-
*
|
|
2021
|
-
* @li @c buffer_size(target)
|
|
2022
|
-
*
|
|
2023
|
-
* @li @c buffer_size(source)
|
|
2024
|
-
*
|
|
2025
|
-
* @li @c max_bytes_to_copy
|
|
2026
|
-
*
|
|
2027
|
-
* This function is implemented in terms of @c memcpy, and consequently it
|
|
2028
|
-
* cannot be used to copy between overlapping memory regions.
|
|
1864
|
+
* @returns <tt>dynamic_vector_buffer<Elem, Allocator>(data)</tt>.
|
|
2029
1865
|
*/
|
|
2030
|
-
template <typename
|
|
2031
|
-
inline
|
|
2032
|
-
|
|
1866
|
+
template <typename Elem, typename Allocator>
|
|
1867
|
+
inline dynamic_vector_buffer<Elem, Allocator> dynamic_buffer(
|
|
1868
|
+
std::vector<Elem, Allocator>& data) BOOST_ASIO_NOEXCEPT
|
|
2033
1869
|
{
|
|
2034
|
-
return
|
|
1870
|
+
return dynamic_vector_buffer<Elem, Allocator>(data);
|
|
2035
1871
|
}
|
|
2036
1872
|
|
|
2037
|
-
///
|
|
2038
|
-
/// sequence.
|
|
1873
|
+
/// Create a new dynamic buffer that represents the given vector.
|
|
2039
1874
|
/**
|
|
2040
|
-
* @
|
|
2041
|
-
* which the bytes will be copied.
|
|
2042
|
-
*
|
|
2043
|
-
* @param source A non-modifiable buffer representing the memory region from
|
|
2044
|
-
* which the bytes will be copied.
|
|
2045
|
-
*
|
|
2046
|
-
* @param max_bytes_to_copy The maximum number of bytes to be copied.
|
|
2047
|
-
*
|
|
2048
|
-
* @returns The number of bytes copied.
|
|
2049
|
-
*
|
|
2050
|
-
* @note The number of bytes copied is the lesser of:
|
|
2051
|
-
*
|
|
2052
|
-
* @li @c buffer_size(target)
|
|
2053
|
-
*
|
|
2054
|
-
* @li @c buffer_size(source)
|
|
2055
|
-
*
|
|
2056
|
-
* @li @c max_bytes_to_copy
|
|
2057
|
-
*
|
|
2058
|
-
* This function is implemented in terms of @c memcpy, and consequently it
|
|
2059
|
-
* cannot be used to copy between overlapping memory regions.
|
|
1875
|
+
* @returns <tt>dynamic_vector_buffer<Elem, Allocator>(data, max_size)</tt>.
|
|
2060
1876
|
*/
|
|
2061
|
-
template <typename
|
|
2062
|
-
inline
|
|
2063
|
-
|
|
1877
|
+
template <typename Elem, typename Allocator>
|
|
1878
|
+
inline dynamic_vector_buffer<Elem, Allocator> dynamic_buffer(
|
|
1879
|
+
std::vector<Elem, Allocator>& data,
|
|
1880
|
+
std::size_t max_size) BOOST_ASIO_NOEXCEPT
|
|
2064
1881
|
{
|
|
2065
|
-
return
|
|
1882
|
+
return dynamic_vector_buffer<Elem, Allocator>(data, max_size);
|
|
2066
1883
|
}
|
|
2067
1884
|
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
/**
|
|
2071
|
-
* @param target A modifiable buffer sequence representing the memory regions to
|
|
2072
|
-
* which the bytes will be copied.
|
|
1885
|
+
/*@}*/
|
|
1886
|
+
|
|
1887
|
+
/** @defgroup buffer_copy boost::asio::buffer_copy
|
|
2073
1888
|
*
|
|
2074
|
-
* @
|
|
2075
|
-
*
|
|
1889
|
+
* @brief The boost::asio::buffer_copy function is used to copy bytes from a
|
|
1890
|
+
* source buffer (or buffer sequence) to a target buffer (or buffer sequence).
|
|
2076
1891
|
*
|
|
2077
|
-
* @
|
|
1892
|
+
* The @c buffer_copy function is available in two forms:
|
|
2078
1893
|
*
|
|
2079
|
-
* @
|
|
1894
|
+
* @li A 2-argument form: @c buffer_copy(target, source)
|
|
2080
1895
|
*
|
|
2081
|
-
* @
|
|
1896
|
+
* @li A 3-argument form: @c buffer_copy(target, source, max_bytes_to_copy)
|
|
1897
|
+
*
|
|
1898
|
+
* Both forms return the number of bytes actually copied. The number of bytes
|
|
1899
|
+
* copied is the lesser of:
|
|
2082
1900
|
*
|
|
2083
1901
|
* @li @c buffer_size(target)
|
|
2084
1902
|
*
|
|
2085
1903
|
* @li @c buffer_size(source)
|
|
2086
1904
|
*
|
|
2087
|
-
* @li @c max_bytes_to_copy
|
|
1905
|
+
* @li @c If specified, @c max_bytes_to_copy.
|
|
2088
1906
|
*
|
|
2089
|
-
* This
|
|
2090
|
-
*
|
|
1907
|
+
* This prevents buffer overflow, regardless of the buffer sizes used in the
|
|
1908
|
+
* copy operation.
|
|
1909
|
+
*
|
|
1910
|
+
* Note that @ref buffer_copy is implemented in terms of @c memcpy, and
|
|
1911
|
+
* consequently it cannot be used to copy between overlapping memory regions.
|
|
2091
1912
|
*/
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
1913
|
+
/*@{*/
|
|
1914
|
+
|
|
1915
|
+
namespace detail {
|
|
1916
|
+
|
|
1917
|
+
inline std::size_t buffer_copy_1(const mutable_buffer& target,
|
|
1918
|
+
const const_buffer& source)
|
|
2095
1919
|
{
|
|
2096
|
-
|
|
1920
|
+
using namespace std; // For memcpy.
|
|
1921
|
+
std::size_t target_size = target.size();
|
|
1922
|
+
std::size_t source_size = source.size();
|
|
1923
|
+
std::size_t n = target_size < source_size ? target_size : source_size;
|
|
1924
|
+
if (n > 0)
|
|
1925
|
+
memcpy(target.data(), source.data(), n);
|
|
1926
|
+
return n;
|
|
2097
1927
|
}
|
|
2098
1928
|
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
*
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
*
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
1929
|
+
template <typename TargetIterator, typename SourceIterator>
|
|
1930
|
+
inline std::size_t buffer_copy(one_buffer, one_buffer,
|
|
1931
|
+
TargetIterator target_begin, TargetIterator,
|
|
1932
|
+
SourceIterator source_begin, SourceIterator) BOOST_ASIO_NOEXCEPT
|
|
1933
|
+
{
|
|
1934
|
+
return (buffer_copy_1)(*target_begin, *source_begin);
|
|
1935
|
+
}
|
|
1936
|
+
|
|
1937
|
+
template <typename TargetIterator, typename SourceIterator>
|
|
1938
|
+
inline std::size_t buffer_copy(one_buffer, one_buffer,
|
|
1939
|
+
TargetIterator target_begin, TargetIterator,
|
|
1940
|
+
SourceIterator source_begin, SourceIterator,
|
|
1941
|
+
std::size_t max_bytes_to_copy) BOOST_ASIO_NOEXCEPT
|
|
1942
|
+
{
|
|
1943
|
+
return (buffer_copy_1)(*target_begin,
|
|
1944
|
+
boost::asio::buffer(*source_begin, max_bytes_to_copy));
|
|
1945
|
+
}
|
|
1946
|
+
|
|
1947
|
+
template <typename TargetIterator, typename SourceIterator>
|
|
1948
|
+
std::size_t buffer_copy(one_buffer, multiple_buffers,
|
|
1949
|
+
TargetIterator target_begin, TargetIterator,
|
|
1950
|
+
SourceIterator source_begin, SourceIterator source_end,
|
|
1951
|
+
std::size_t max_bytes_to_copy
|
|
1952
|
+
= (std::numeric_limits<std::size_t>::max)()) BOOST_ASIO_NOEXCEPT
|
|
1953
|
+
{
|
|
1954
|
+
std::size_t total_bytes_copied = 0;
|
|
1955
|
+
SourceIterator source_iter = source_begin;
|
|
1956
|
+
|
|
1957
|
+
for (mutable_buffer target_buffer(
|
|
1958
|
+
boost::asio::buffer(*target_begin, max_bytes_to_copy));
|
|
1959
|
+
target_buffer.size() && source_iter != source_end; ++source_iter)
|
|
1960
|
+
{
|
|
1961
|
+
const_buffer source_buffer(*source_iter);
|
|
1962
|
+
std::size_t bytes_copied = (buffer_copy_1)(target_buffer, source_buffer);
|
|
1963
|
+
total_bytes_copied += bytes_copied;
|
|
1964
|
+
target_buffer += bytes_copied;
|
|
1965
|
+
}
|
|
1966
|
+
|
|
1967
|
+
return total_bytes_copied;
|
|
1968
|
+
}
|
|
1969
|
+
|
|
1970
|
+
template <typename TargetIterator, typename SourceIterator>
|
|
1971
|
+
std::size_t buffer_copy(multiple_buffers, one_buffer,
|
|
1972
|
+
TargetIterator target_begin, TargetIterator target_end,
|
|
1973
|
+
SourceIterator source_begin, SourceIterator,
|
|
1974
|
+
std::size_t max_bytes_to_copy
|
|
1975
|
+
= (std::numeric_limits<std::size_t>::max)()) BOOST_ASIO_NOEXCEPT
|
|
1976
|
+
{
|
|
1977
|
+
std::size_t total_bytes_copied = 0;
|
|
1978
|
+
TargetIterator target_iter = target_begin;
|
|
1979
|
+
|
|
1980
|
+
for (const_buffer source_buffer(
|
|
1981
|
+
boost::asio::buffer(*source_begin, max_bytes_to_copy));
|
|
1982
|
+
source_buffer.size() && target_iter != target_end; ++target_iter)
|
|
1983
|
+
{
|
|
1984
|
+
mutable_buffer target_buffer(*target_iter);
|
|
1985
|
+
std::size_t bytes_copied = (buffer_copy_1)(target_buffer, source_buffer);
|
|
1986
|
+
total_bytes_copied += bytes_copied;
|
|
1987
|
+
source_buffer += bytes_copied;
|
|
1988
|
+
}
|
|
1989
|
+
|
|
1990
|
+
return total_bytes_copied;
|
|
1991
|
+
}
|
|
1992
|
+
|
|
1993
|
+
template <typename TargetIterator, typename SourceIterator>
|
|
1994
|
+
std::size_t buffer_copy(multiple_buffers, multiple_buffers,
|
|
1995
|
+
TargetIterator target_begin, TargetIterator target_end,
|
|
1996
|
+
SourceIterator source_begin, SourceIterator source_end) BOOST_ASIO_NOEXCEPT
|
|
1997
|
+
{
|
|
1998
|
+
std::size_t total_bytes_copied = 0;
|
|
1999
|
+
|
|
2000
|
+
TargetIterator target_iter = target_begin;
|
|
2001
|
+
std::size_t target_buffer_offset = 0;
|
|
2002
|
+
|
|
2003
|
+
SourceIterator source_iter = source_begin;
|
|
2004
|
+
std::size_t source_buffer_offset = 0;
|
|
2005
|
+
|
|
2006
|
+
while (target_iter != target_end && source_iter != source_end)
|
|
2007
|
+
{
|
|
2008
|
+
mutable_buffer target_buffer =
|
|
2009
|
+
mutable_buffer(*target_iter) + target_buffer_offset;
|
|
2010
|
+
|
|
2011
|
+
const_buffer source_buffer =
|
|
2012
|
+
const_buffer(*source_iter) + source_buffer_offset;
|
|
2013
|
+
|
|
2014
|
+
std::size_t bytes_copied = (buffer_copy_1)(target_buffer, source_buffer);
|
|
2015
|
+
total_bytes_copied += bytes_copied;
|
|
2016
|
+
|
|
2017
|
+
if (bytes_copied == target_buffer.size())
|
|
2018
|
+
{
|
|
2019
|
+
++target_iter;
|
|
2020
|
+
target_buffer_offset = 0;
|
|
2021
|
+
}
|
|
2022
|
+
else
|
|
2023
|
+
target_buffer_offset += bytes_copied;
|
|
2024
|
+
|
|
2025
|
+
if (bytes_copied == source_buffer.size())
|
|
2026
|
+
{
|
|
2027
|
+
++source_iter;
|
|
2028
|
+
source_buffer_offset = 0;
|
|
2029
|
+
}
|
|
2030
|
+
else
|
|
2031
|
+
source_buffer_offset += bytes_copied;
|
|
2032
|
+
}
|
|
2033
|
+
|
|
2034
|
+
return total_bytes_copied;
|
|
2035
|
+
}
|
|
2036
|
+
|
|
2037
|
+
template <typename TargetIterator, typename SourceIterator>
|
|
2038
|
+
std::size_t buffer_copy(multiple_buffers, multiple_buffers,
|
|
2039
|
+
TargetIterator target_begin, TargetIterator target_end,
|
|
2040
|
+
SourceIterator source_begin, SourceIterator source_end,
|
|
2041
|
+
std::size_t max_bytes_to_copy) BOOST_ASIO_NOEXCEPT
|
|
2127
2042
|
{
|
|
2128
|
-
|
|
2043
|
+
std::size_t total_bytes_copied = 0;
|
|
2044
|
+
|
|
2045
|
+
TargetIterator target_iter = target_begin;
|
|
2046
|
+
std::size_t target_buffer_offset = 0;
|
|
2047
|
+
|
|
2048
|
+
SourceIterator source_iter = source_begin;
|
|
2049
|
+
std::size_t source_buffer_offset = 0;
|
|
2050
|
+
|
|
2051
|
+
while (total_bytes_copied != max_bytes_to_copy
|
|
2052
|
+
&& target_iter != target_end && source_iter != source_end)
|
|
2053
|
+
{
|
|
2054
|
+
mutable_buffer target_buffer =
|
|
2055
|
+
mutable_buffer(*target_iter) + target_buffer_offset;
|
|
2056
|
+
|
|
2057
|
+
const_buffer source_buffer =
|
|
2058
|
+
const_buffer(*source_iter) + source_buffer_offset;
|
|
2059
|
+
|
|
2060
|
+
std::size_t bytes_copied = (buffer_copy_1)(
|
|
2061
|
+
target_buffer, boost::asio::buffer(source_buffer,
|
|
2062
|
+
max_bytes_to_copy - total_bytes_copied));
|
|
2063
|
+
total_bytes_copied += bytes_copied;
|
|
2064
|
+
|
|
2065
|
+
if (bytes_copied == target_buffer.size())
|
|
2066
|
+
{
|
|
2067
|
+
++target_iter;
|
|
2068
|
+
target_buffer_offset = 0;
|
|
2069
|
+
}
|
|
2070
|
+
else
|
|
2071
|
+
target_buffer_offset += bytes_copied;
|
|
2072
|
+
|
|
2073
|
+
if (bytes_copied == source_buffer.size())
|
|
2074
|
+
{
|
|
2075
|
+
++source_iter;
|
|
2076
|
+
source_buffer_offset = 0;
|
|
2077
|
+
}
|
|
2078
|
+
else
|
|
2079
|
+
source_buffer_offset += bytes_copied;
|
|
2080
|
+
}
|
|
2081
|
+
|
|
2082
|
+
return total_bytes_copied;
|
|
2129
2083
|
}
|
|
2130
2084
|
|
|
2131
|
-
|
|
2132
|
-
|
|
2085
|
+
} // namespace detail
|
|
2086
|
+
|
|
2087
|
+
/// Copies bytes from a source buffer sequence to a target buffer sequence.
|
|
2133
2088
|
/**
|
|
2134
2089
|
* @param target A modifiable buffer sequence representing the memory regions to
|
|
2135
2090
|
* which the bytes will be copied.
|
|
2136
2091
|
*
|
|
2137
|
-
* @param source A modifiable buffer representing the memory
|
|
2138
|
-
* the bytes will be copied.
|
|
2139
|
-
* modified.
|
|
2140
|
-
*
|
|
2141
|
-
* @param max_bytes_to_copy The maximum number of bytes to be copied.
|
|
2092
|
+
* @param source A non-modifiable buffer sequence representing the memory
|
|
2093
|
+
* regions from which the bytes will be copied.
|
|
2142
2094
|
*
|
|
2143
2095
|
* @returns The number of bytes copied.
|
|
2144
2096
|
*
|
|
@@ -2148,16 +2100,20 @@ inline std::size_t buffer_copy(const MutableBufferSequence& target,
|
|
|
2148
2100
|
*
|
|
2149
2101
|
* @li @c buffer_size(source)
|
|
2150
2102
|
*
|
|
2151
|
-
* @li @c max_bytes_to_copy
|
|
2152
|
-
*
|
|
2153
2103
|
* This function is implemented in terms of @c memcpy, and consequently it
|
|
2154
2104
|
* cannot be used to copy between overlapping memory regions.
|
|
2155
2105
|
*/
|
|
2156
|
-
template <typename MutableBufferSequence>
|
|
2106
|
+
template <typename MutableBufferSequence, typename ConstBufferSequence>
|
|
2157
2107
|
inline std::size_t buffer_copy(const MutableBufferSequence& target,
|
|
2158
|
-
const
|
|
2108
|
+
const ConstBufferSequence& source) BOOST_ASIO_NOEXCEPT
|
|
2159
2109
|
{
|
|
2160
|
-
return buffer_copy(
|
|
2110
|
+
return detail::buffer_copy(
|
|
2111
|
+
detail::buffer_sequence_cardinality<MutableBufferSequence>(),
|
|
2112
|
+
detail::buffer_sequence_cardinality<ConstBufferSequence>(),
|
|
2113
|
+
boost::asio::buffer_sequence_begin(target),
|
|
2114
|
+
boost::asio::buffer_sequence_end(target),
|
|
2115
|
+
boost::asio::buffer_sequence_begin(source),
|
|
2116
|
+
boost::asio::buffer_sequence_end(source));
|
|
2161
2117
|
}
|
|
2162
2118
|
|
|
2163
2119
|
/// Copies a limited number of bytes from a source buffer sequence to a target
|
|
@@ -2185,50 +2141,17 @@ inline std::size_t buffer_copy(const MutableBufferSequence& target,
|
|
|
2185
2141
|
* cannot be used to copy between overlapping memory regions.
|
|
2186
2142
|
*/
|
|
2187
2143
|
template <typename MutableBufferSequence, typename ConstBufferSequence>
|
|
2188
|
-
std::size_t buffer_copy(const MutableBufferSequence& target,
|
|
2189
|
-
const ConstBufferSequence& source,
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
std::size_t source_buffer_offset = 0;
|
|
2200
|
-
|
|
2201
|
-
while (total_bytes_copied != max_bytes_to_copy
|
|
2202
|
-
&& target_iter != target_end && source_iter != source_end)
|
|
2203
|
-
{
|
|
2204
|
-
mutable_buffer target_buffer =
|
|
2205
|
-
mutable_buffer(*target_iter) + target_buffer_offset;
|
|
2206
|
-
|
|
2207
|
-
const_buffer source_buffer =
|
|
2208
|
-
const_buffer(*source_iter) + source_buffer_offset;
|
|
2209
|
-
|
|
2210
|
-
std::size_t bytes_copied = buffer_copy(target_buffer,
|
|
2211
|
-
source_buffer, max_bytes_to_copy - total_bytes_copied);
|
|
2212
|
-
total_bytes_copied += bytes_copied;
|
|
2213
|
-
|
|
2214
|
-
if (bytes_copied == buffer_size(target_buffer))
|
|
2215
|
-
{
|
|
2216
|
-
++target_iter;
|
|
2217
|
-
target_buffer_offset = 0;
|
|
2218
|
-
}
|
|
2219
|
-
else
|
|
2220
|
-
target_buffer_offset += bytes_copied;
|
|
2221
|
-
|
|
2222
|
-
if (bytes_copied == buffer_size(source_buffer))
|
|
2223
|
-
{
|
|
2224
|
-
++source_iter;
|
|
2225
|
-
source_buffer_offset = 0;
|
|
2226
|
-
}
|
|
2227
|
-
else
|
|
2228
|
-
source_buffer_offset += bytes_copied;
|
|
2229
|
-
}
|
|
2230
|
-
|
|
2231
|
-
return total_bytes_copied;
|
|
2144
|
+
inline std::size_t buffer_copy(const MutableBufferSequence& target,
|
|
2145
|
+
const ConstBufferSequence& source,
|
|
2146
|
+
std::size_t max_bytes_to_copy) BOOST_ASIO_NOEXCEPT
|
|
2147
|
+
{
|
|
2148
|
+
return detail::buffer_copy(
|
|
2149
|
+
detail::buffer_sequence_cardinality<MutableBufferSequence>(),
|
|
2150
|
+
detail::buffer_sequence_cardinality<ConstBufferSequence>(),
|
|
2151
|
+
boost::asio::buffer_sequence_begin(target),
|
|
2152
|
+
boost::asio::buffer_sequence_end(target),
|
|
2153
|
+
boost::asio::buffer_sequence_begin(source),
|
|
2154
|
+
boost::asio::buffer_sequence_end(source), max_bytes_to_copy);
|
|
2232
2155
|
}
|
|
2233
2156
|
|
|
2234
2157
|
/*@}*/
|