From 333b1299c28072d59fb07233b4c2125a454780db Mon Sep 17 00:00:00 2001 From: saipubw Date: Tue, 4 Jul 2023 14:09:35 +0800 Subject: [PATCH] refactor project (#347) refact project --- .github/workflows/ubuntu_clang.yml | 2 +- .github/workflows/ubuntu_gcc.yml | 2 +- BUILD.bazel | 88 +- CMakeLists.txt | 16 +- NOTICE | 4 +- README.md | 232 +- cmake/build.cmake | 35 +- cmake/config.cmake | 55 + cmake/dependency.cmake | 8 - cmake/develop.cmake | 16 +- cmake/install.cmake | 69 +- cmake/module.cmake | 42 - cmake/platform.cmake | 15 - cmake/struct_pb.cmake | 4 +- cmake/subdirectory.cmake | 13 + cmake/utils.cmake | 35 +- cmake/yalantinglibsConfig.cmake.in | 39 - conanfile.py | 57 - coverage_gen.sh | 6 +- include/struct_xml/xml_reader.h | 24 - include/struct_xml/xml_writer.h | 14 - include/struct_yaml/yaml_reader.h | 15 - include/struct_yaml/yaml_writer.h | 9 - include/util/concurrentqueue.h | 3747 -------------- .../coro_http/coro_http_client.hpp} | 3 + include/{ => ylt}/coro_io/channel.hpp | 5 +- include/{ => ylt}/coro_io/client_pool.hpp | 28 +- include/{ => ylt}/coro_io/coro_file.hpp | 31 +- include/{ => ylt}/coro_io/coro_io.hpp | 17 +- .../coro_io/detail}/client_queue.hpp | 17 +- include/{ => ylt}/coro_io/io_context_pool.hpp | 5 +- .../{ => ylt}/coro_rpc/coro_rpc_client.hpp | 4 +- .../coro_rpc/coro_rpc_context.hpp} | 4 +- .../{ => ylt}/coro_rpc/coro_rpc_server.hpp | 6 +- .../coro_rpc/impl}/common_service.hpp | 9 +- .../coro_rpc/impl}/context.hpp | 9 +- .../coro_rpc/impl}/coro_connection.hpp | 25 +- .../coro_rpc/impl}/coro_rpc_client.hpp | 52 +- .../coro_rpc/impl}/coro_rpc_server.hpp | 25 +- .../impl}/default_config/coro_rpc_config.hpp | 10 +- .../coro_rpc/impl}/expected.hpp | 6 +- .../impl}/protocol/coro_rpc_protocol.hpp | 18 +- .../impl}/protocol/struct_pack_protocol.hpp | 4 +- .../coro_rpc => ylt/coro_rpc/impl}/router.hpp | 10 +- .../coro_rpc/impl}/rpc_execute.hpp | 4 +- .../{easylog/easylog.h => ylt/easylog.hpp} | 2 +- include/{ => ylt}/easylog/appender.hpp | 2 +- include/{ => ylt}/easylog/record.hpp | 6 +- include/{ => ylt}/struct_json/json_reader.h | 0 include/{ => ylt}/struct_json/json_writer.h | 0 include/{struct_pack => ylt}/struct_pack.hpp | 2 +- .../struct_pack/error_code.hpp | 15 + .../{struct_pack => ylt}/struct_pack/marco.h | 2 +- .../struct_pack/md5_constexpr.hpp | 3 +- .../struct_pack/reflection.hpp | 2 +- .../struct_pack/struct_pack_impl.hpp | 15 +- .../struct_pack/trivial_view.hpp | 2 +- .../struct_pack/tuple.hpp | 2 +- .../struct_pack/varint.hpp | 2 +- include/{struct_pb => ylt}/struct_pb.hpp | 15 + .../struct_pb/struct_pb_impl.hpp | 17 +- include/ylt/struct_xml/xml_reader.h | 39 + include/ylt/struct_xml/xml_writer.h | 29 + include/ylt/struct_yaml/yaml_reader.h | 30 + include/ylt/struct_yaml/yaml_writer.h | 24 + .../asio => include/ylt/thirdparty}/asio.hpp | 0 .../ylt/thirdparty}/asio/any_io_executor.hpp | 0 .../ylt/thirdparty}/asio/append.hpp | 0 .../ylt/thirdparty}/asio/as_tuple.hpp | 0 .../thirdparty}/asio/associated_allocator.hpp | 0 .../asio/associated_cancellation_slot.hpp | 0 .../thirdparty}/asio/associated_executor.hpp | 0 .../ylt/thirdparty}/asio/associator.hpp | 0 .../ylt/thirdparty}/asio/async_result.hpp | 0 .../ylt/thirdparty}/asio/awaitable.hpp | 0 .../asio/basic_datagram_socket.hpp | 0 .../thirdparty}/asio/basic_deadline_timer.hpp | 0 .../ylt/thirdparty}/asio/basic_file.hpp | 0 .../ylt/thirdparty}/asio/basic_io_object.hpp | 0 .../asio/basic_random_access_file.hpp | 0 .../ylt/thirdparty}/asio/basic_raw_socket.hpp | 0 .../thirdparty}/asio/basic_readable_pipe.hpp | 0 .../asio/basic_seq_packet_socket.hpp | 0 .../thirdparty}/asio/basic_serial_port.hpp | 0 .../ylt/thirdparty}/asio/basic_signal_set.hpp | 0 .../ylt/thirdparty}/asio/basic_socket.hpp | 0 .../asio/basic_socket_acceptor.hpp | 0 .../asio/basic_socket_iostream.hpp | 0 .../asio/basic_socket_streambuf.hpp | 0 .../thirdparty}/asio/basic_stream_file.hpp | 0 .../thirdparty}/asio/basic_stream_socket.hpp | 0 .../ylt/thirdparty}/asio/basic_streambuf.hpp | 0 .../thirdparty}/asio/basic_streambuf_fwd.hpp | 0 .../thirdparty}/asio/basic_waitable_timer.hpp | 0 .../thirdparty}/asio/basic_writable_pipe.hpp | 0 .../ylt/thirdparty}/asio/bind_allocator.hpp | 0 .../asio/bind_cancellation_slot.hpp | 0 .../ylt/thirdparty}/asio/bind_executor.hpp | 0 .../ylt/thirdparty}/asio/buffer.hpp | 0 .../thirdparty}/asio/buffer_registration.hpp | 0 .../thirdparty}/asio/buffered_read_stream.hpp | 0 .../asio/buffered_read_stream_fwd.hpp | 0 .../ylt/thirdparty}/asio/buffered_stream.hpp | 0 .../thirdparty}/asio/buffered_stream_fwd.hpp | 0 .../asio/buffered_write_stream.hpp | 0 .../asio/buffered_write_stream_fwd.hpp | 0 .../ylt/thirdparty}/asio/buffers_iterator.hpp | 0 .../thirdparty}/asio/cancellation_signal.hpp | 0 .../thirdparty}/asio/cancellation_state.hpp | 0 .../thirdparty}/asio/cancellation_type.hpp | 0 .../ylt/thirdparty}/asio/co_spawn.hpp | 0 .../thirdparty}/asio/completion_condition.hpp | 0 .../ylt/thirdparty}/asio/compose.hpp | 0 .../ylt/thirdparty}/asio/connect.hpp | 0 .../ylt/thirdparty}/asio/connect_pipe.hpp | 0 .../ylt/thirdparty}/asio/coroutine.hpp | 0 .../ylt/thirdparty}/asio/deadline_timer.hpp | 0 .../ylt/thirdparty}/asio/defer.hpp | 0 .../ylt/thirdparty}/asio/deferred.hpp | 0 .../ylt/thirdparty}/asio/detached.hpp | 0 .../ylt/thirdparty}/asio/detail/array.hpp | 0 .../ylt/thirdparty}/asio/detail/array_fwd.hpp | 0 .../ylt/thirdparty}/asio/detail/assert.hpp | 0 .../thirdparty}/asio/detail/atomic_count.hpp | 0 .../detail/base_from_cancellation_state.hpp | 0 .../asio/detail/base_from_completion_cond.hpp | 0 .../thirdparty}/asio/detail/bind_handler.hpp | 0 .../asio/detail/blocking_executor_op.hpp | 0 .../asio/detail/buffer_resize_guard.hpp | 0 .../asio/detail/buffer_sequence_adapter.hpp | 0 .../asio/detail/buffered_stream_storage.hpp | 0 .../asio/detail/bulk_executor_op.hpp | 0 .../thirdparty}/asio/detail/call_stack.hpp | 0 .../ylt/thirdparty}/asio/detail/chrono.hpp | 0 .../asio/detail/chrono_time_traits.hpp | 0 .../asio/detail/completion_handler.hpp | 0 .../asio/detail/concurrency_hint.hpp | 0 .../detail/conditionally_enabled_event.hpp | 0 .../detail/conditionally_enabled_mutex.hpp | 0 .../ylt/thirdparty}/asio/detail/config.hpp | 0 .../asio/detail/consuming_buffers.hpp | 0 .../ylt/thirdparty}/asio/detail/cstddef.hpp | 0 .../ylt/thirdparty}/asio/detail/cstdint.hpp | 0 .../thirdparty}/asio/detail/date_time_fwd.hpp | 0 .../asio/detail/deadline_timer_service.hpp | 0 .../asio/detail/dependent_type.hpp | 0 .../asio/detail/descriptor_ops.hpp | 0 .../asio/detail/descriptor_read_op.hpp | 0 .../asio/detail/descriptor_write_op.hpp | 0 .../asio/detail/dev_poll_reactor.hpp | 0 .../thirdparty}/asio/detail/epoll_reactor.hpp | 0 .../ylt/thirdparty}/asio/detail/event.hpp | 0 .../detail/eventfd_select_interrupter.hpp | 0 .../ylt/thirdparty}/asio/detail/exception.hpp | 0 .../asio/detail/executor_function.hpp | 0 .../thirdparty}/asio/detail/executor_op.hpp | 0 .../asio/detail/fd_set_adapter.hpp | 0 .../thirdparty}/asio/detail/fenced_block.hpp | 0 .../thirdparty}/asio/detail/functional.hpp | 0 .../ylt/thirdparty}/asio/detail/future.hpp | 0 .../asio/detail/gcc_arm_fenced_block.hpp | 0 .../asio/detail/gcc_hppa_fenced_block.hpp | 0 .../asio/detail/gcc_sync_fenced_block.hpp | 0 .../asio/detail/gcc_x86_fenced_block.hpp | 0 .../ylt/thirdparty}/asio/detail/global.hpp | 0 .../asio/detail/handler_alloc_helpers.hpp | 0 .../asio/detail/handler_cont_helpers.hpp | 0 .../asio/detail/handler_invoke_helpers.hpp | 0 .../asio/detail/handler_tracking.hpp | 0 .../asio/detail/handler_type_requirements.hpp | 0 .../thirdparty}/asio/detail/handler_work.hpp | 0 .../ylt/thirdparty}/asio/detail/hash_map.hpp | 0 .../detail/impl/buffer_sequence_adapter.ipp | 0 .../asio/detail/impl/descriptor_ops.ipp | 0 .../asio/detail/impl/dev_poll_reactor.hpp | 0 .../asio/detail/impl/dev_poll_reactor.ipp | 0 .../asio/detail/impl/epoll_reactor.hpp | 0 .../asio/detail/impl/epoll_reactor.ipp | 0 .../impl/eventfd_select_interrupter.ipp | 0 .../asio/detail/impl/handler_tracking.ipp | 0 .../impl/io_uring_descriptor_service.ipp | 0 .../detail/impl/io_uring_file_service.ipp | 0 .../asio/detail/impl/io_uring_service.hpp | 0 .../asio/detail/impl/io_uring_service.ipp | 0 .../impl/io_uring_socket_service_base.ipp | 0 .../asio/detail/impl/kqueue_reactor.hpp | 0 .../asio/detail/impl/kqueue_reactor.ipp | 0 .../asio/detail/impl/null_event.ipp | 0 .../detail/impl/pipe_select_interrupter.ipp | 0 .../asio/detail/impl/posix_event.ipp | 0 .../asio/detail/impl/posix_mutex.ipp | 0 .../detail/impl/posix_serial_port_service.ipp | 0 .../asio/detail/impl/posix_thread.ipp | 0 .../asio/detail/impl/posix_tss_ptr.ipp | 0 .../impl/reactive_descriptor_service.ipp | 0 .../impl/reactive_socket_service_base.ipp | 0 .../detail/impl/resolver_service_base.ipp | 0 .../asio/detail/impl/scheduler.ipp | 0 .../asio/detail/impl/select_reactor.hpp | 0 .../asio/detail/impl/select_reactor.ipp | 0 .../asio/detail/impl/service_registry.hpp | 0 .../asio/detail/impl/service_registry.ipp | 0 .../asio/detail/impl/signal_set_service.ipp | 0 .../asio/detail/impl/socket_ops.ipp | 0 .../detail/impl/socket_select_interrupter.ipp | 0 .../detail/impl/strand_executor_service.hpp | 0 .../detail/impl/strand_executor_service.ipp | 0 .../asio/detail/impl/strand_service.hpp | 0 .../asio/detail/impl/strand_service.ipp | 0 .../asio/detail/impl/thread_context.ipp | 0 .../asio/detail/impl/throw_error.ipp | 0 .../asio/detail/impl/timer_queue_ptime.ipp | 0 .../asio/detail/impl/timer_queue_set.ipp | 0 .../asio/detail/impl/win_event.ipp | 0 .../detail/impl/win_iocp_file_service.ipp | 0 .../detail/impl/win_iocp_handle_service.ipp | 0 .../asio/detail/impl/win_iocp_io_context.hpp | 0 .../asio/detail/impl/win_iocp_io_context.ipp | 0 .../impl/win_iocp_serial_port_service.ipp | 0 .../impl/win_iocp_socket_service_base.ipp | 0 .../asio/detail/impl/win_mutex.ipp | 0 .../detail/impl/win_object_handle_service.ipp | 0 .../asio/detail/impl/win_static_mutex.ipp | 0 .../asio/detail/impl/win_thread.ipp | 0 .../asio/detail/impl/win_tss_ptr.ipp | 0 .../impl/winrt_ssocket_service_base.ipp | 0 .../detail/impl/winrt_timer_scheduler.hpp | 0 .../detail/impl/winrt_timer_scheduler.ipp | 0 .../asio/detail/impl/winsock_init.ipp | 0 .../thirdparty}/asio/detail/io_control.hpp | 0 .../asio/detail/io_object_impl.hpp | 0 .../detail/io_uring_descriptor_read_at_op.hpp | 0 .../detail/io_uring_descriptor_read_op.hpp | 0 .../detail/io_uring_descriptor_service.hpp | 0 .../io_uring_descriptor_write_at_op.hpp | 0 .../detail/io_uring_descriptor_write_op.hpp | 0 .../asio/detail/io_uring_file_service.hpp | 0 .../asio/detail/io_uring_null_buffers_op.hpp | 0 .../asio/detail/io_uring_operation.hpp | 0 .../asio/detail/io_uring_service.hpp | 0 .../asio/detail/io_uring_socket_accept_op.hpp | 0 .../detail/io_uring_socket_connect_op.hpp | 0 .../asio/detail/io_uring_socket_recv_op.hpp | 0 .../detail/io_uring_socket_recvfrom_op.hpp | 0 .../detail/io_uring_socket_recvmsg_op.hpp | 0 .../asio/detail/io_uring_socket_send_op.hpp | 0 .../asio/detail/io_uring_socket_sendto_op.hpp | 0 .../asio/detail/io_uring_socket_service.hpp | 0 .../detail/io_uring_socket_service_base.hpp | 0 .../asio/detail/io_uring_wait_op.hpp | 0 .../asio/detail/is_buffer_sequence.hpp | 0 .../thirdparty}/asio/detail/is_executor.hpp | 0 .../asio/detail/keyword_tss_ptr.hpp | 0 .../asio/detail/kqueue_reactor.hpp | 0 .../ylt/thirdparty}/asio/detail/limits.hpp | 0 .../asio/detail/local_free_on_block_exit.hpp | 0 .../asio/detail/macos_fenced_block.hpp | 0 .../ylt/thirdparty}/asio/detail/memory.hpp | 0 .../ylt/thirdparty}/asio/detail/mutex.hpp | 0 .../asio/detail/non_const_lvalue.hpp | 0 .../thirdparty}/asio/detail/noncopyable.hpp | 0 .../thirdparty}/asio/detail/null_event.hpp | 0 .../asio/detail/null_fenced_block.hpp | 0 .../thirdparty}/asio/detail/null_global.hpp | 0 .../thirdparty}/asio/detail/null_mutex.hpp | 0 .../thirdparty}/asio/detail/null_reactor.hpp | 0 .../asio/detail/null_signal_blocker.hpp | 0 .../asio/detail/null_socket_service.hpp | 0 .../asio/detail/null_static_mutex.hpp | 0 .../thirdparty}/asio/detail/null_thread.hpp | 0 .../thirdparty}/asio/detail/null_tss_ptr.hpp | 0 .../thirdparty}/asio/detail/object_pool.hpp | 0 .../asio/detail/old_win_sdk_compat.hpp | 0 .../ylt/thirdparty}/asio/detail/op_queue.hpp | 0 .../ylt/thirdparty}/asio/detail/operation.hpp | 0 .../asio/detail/pipe_select_interrupter.hpp | 0 .../thirdparty}/asio/detail/pop_options.hpp | 0 .../thirdparty}/asio/detail/posix_event.hpp | 0 .../asio/detail/posix_fd_set_adapter.hpp | 0 .../thirdparty}/asio/detail/posix_global.hpp | 0 .../thirdparty}/asio/detail/posix_mutex.hpp | 0 .../asio/detail/posix_serial_port_service.hpp | 0 .../asio/detail/posix_signal_blocker.hpp | 0 .../asio/detail/posix_static_mutex.hpp | 0 .../thirdparty}/asio/detail/posix_thread.hpp | 0 .../thirdparty}/asio/detail/posix_tss_ptr.hpp | 0 .../thirdparty}/asio/detail/push_options.hpp | 0 .../detail/reactive_descriptor_service.hpp | 0 .../asio/detail/reactive_null_buffers_op.hpp | 0 .../asio/detail/reactive_socket_accept_op.hpp | 0 .../detail/reactive_socket_connect_op.hpp | 0 .../asio/detail/reactive_socket_recv_op.hpp | 0 .../detail/reactive_socket_recvfrom_op.hpp | 0 .../detail/reactive_socket_recvmsg_op.hpp | 0 .../asio/detail/reactive_socket_send_op.hpp | 0 .../asio/detail/reactive_socket_sendto_op.hpp | 0 .../asio/detail/reactive_socket_service.hpp | 0 .../detail/reactive_socket_service_base.hpp | 0 .../asio/detail/reactive_wait_op.hpp | 0 .../ylt/thirdparty}/asio/detail/reactor.hpp | 0 .../thirdparty}/asio/detail/reactor_op.hpp | 0 .../asio/detail/reactor_op_queue.hpp | 0 .../asio/detail/recycling_allocator.hpp | 0 .../ylt/thirdparty}/asio/detail/regex_fwd.hpp | 0 .../asio/detail/resolve_endpoint_op.hpp | 0 .../thirdparty}/asio/detail/resolve_op.hpp | 0 .../asio/detail/resolve_query_op.hpp | 0 .../asio/detail/resolver_service.hpp | 0 .../asio/detail/resolver_service_base.hpp | 0 .../ylt/thirdparty}/asio/detail/scheduler.hpp | 0 .../asio/detail/scheduler_operation.hpp | 0 .../asio/detail/scheduler_task.hpp | 0 .../asio/detail/scheduler_thread_info.hpp | 0 .../thirdparty}/asio/detail/scoped_lock.hpp | 0 .../thirdparty}/asio/detail/scoped_ptr.hpp | 0 .../asio/detail/select_interrupter.hpp | 0 .../asio/detail/select_reactor.hpp | 0 .../asio/detail/service_registry.hpp | 0 .../asio/detail/signal_blocker.hpp | 0 .../asio/detail/signal_handler.hpp | 0 .../thirdparty}/asio/detail/signal_init.hpp | 0 .../ylt/thirdparty}/asio/detail/signal_op.hpp | 0 .../asio/detail/signal_set_service.hpp | 0 .../thirdparty}/asio/detail/socket_holder.hpp | 0 .../thirdparty}/asio/detail/socket_ops.hpp | 0 .../thirdparty}/asio/detail/socket_option.hpp | 0 .../asio/detail/socket_select_interrupter.hpp | 0 .../thirdparty}/asio/detail/socket_types.hpp | 0 .../asio/detail/solaris_fenced_block.hpp | 0 .../asio/detail/source_location.hpp | 0 .../thirdparty}/asio/detail/static_mutex.hpp | 0 .../ylt/thirdparty}/asio/detail/std_event.hpp | 0 .../asio/detail/std_fenced_block.hpp | 0 .../thirdparty}/asio/detail/std_global.hpp | 0 .../ylt/thirdparty}/asio/detail/std_mutex.hpp | 0 .../asio/detail/std_static_mutex.hpp | 0 .../thirdparty}/asio/detail/std_thread.hpp | 0 .../asio/detail/strand_executor_service.hpp | 0 .../asio/detail/strand_service.hpp | 0 .../thirdparty}/asio/detail/string_view.hpp | 0 .../ylt/thirdparty}/asio/detail/thread.hpp | 0 .../asio/detail/thread_context.hpp | 0 .../thirdparty}/asio/detail/thread_group.hpp | 0 .../asio/detail/thread_info_base.hpp | 0 .../thirdparty}/asio/detail/throw_error.hpp | 0 .../asio/detail/throw_exception.hpp | 0 .../thirdparty}/asio/detail/timer_queue.hpp | 0 .../asio/detail/timer_queue_base.hpp | 0 .../asio/detail/timer_queue_ptime.hpp | 0 .../asio/detail/timer_queue_set.hpp | 0 .../asio/detail/timer_scheduler.hpp | 0 .../asio/detail/timer_scheduler_fwd.hpp | 0 .../ylt/thirdparty}/asio/detail/tss_ptr.hpp | 0 .../thirdparty}/asio/detail/type_traits.hpp | 0 .../ylt/thirdparty}/asio/detail/utility.hpp | 0 .../asio/detail/variadic_templates.hpp | 0 .../thirdparty}/asio/detail/wait_handler.hpp | 0 .../ylt/thirdparty}/asio/detail/wait_op.hpp | 0 .../ylt/thirdparty}/asio/detail/win_event.hpp | 0 .../asio/detail/win_fd_set_adapter.hpp | 0 .../asio/detail/win_fenced_block.hpp | 0 .../thirdparty}/asio/detail/win_global.hpp | 0 .../asio/detail/win_iocp_file_service.hpp | 0 .../asio/detail/win_iocp_handle_read_op.hpp | 0 .../asio/detail/win_iocp_handle_service.hpp | 0 .../asio/detail/win_iocp_handle_write_op.hpp | 0 .../asio/detail/win_iocp_io_context.hpp | 0 .../asio/detail/win_iocp_null_buffers_op.hpp | 0 .../asio/detail/win_iocp_operation.hpp | 0 .../asio/detail/win_iocp_overlapped_op.hpp | 0 .../asio/detail/win_iocp_overlapped_ptr.hpp | 0 .../detail/win_iocp_serial_port_service.hpp | 0 .../asio/detail/win_iocp_socket_accept_op.hpp | 0 .../detail/win_iocp_socket_connect_op.hpp | 0 .../asio/detail/win_iocp_socket_recv_op.hpp | 0 .../detail/win_iocp_socket_recvfrom_op.hpp | 0 .../detail/win_iocp_socket_recvmsg_op.hpp | 0 .../asio/detail/win_iocp_socket_send_op.hpp | 0 .../asio/detail/win_iocp_socket_service.hpp | 0 .../detail/win_iocp_socket_service_base.hpp | 0 .../asio/detail/win_iocp_thread_info.hpp | 0 .../asio/detail/win_iocp_wait_op.hpp | 0 .../ylt/thirdparty}/asio/detail/win_mutex.hpp | 0 .../asio/detail/win_object_handle_service.hpp | 0 .../asio/detail/win_static_mutex.hpp | 0 .../thirdparty}/asio/detail/win_thread.hpp | 0 .../thirdparty}/asio/detail/win_tss_ptr.hpp | 0 .../thirdparty}/asio/detail/winapp_thread.hpp | 0 .../thirdparty}/asio/detail/wince_thread.hpp | 0 .../asio/detail/winrt_async_manager.hpp | 0 .../asio/detail/winrt_async_op.hpp | 0 .../asio/detail/winrt_resolve_op.hpp | 0 .../asio/detail/winrt_resolver_service.hpp | 0 .../asio/detail/winrt_socket_connect_op.hpp | 0 .../asio/detail/winrt_socket_recv_op.hpp | 0 .../asio/detail/winrt_socket_send_op.hpp | 0 .../asio/detail/winrt_ssocket_service.hpp | 0 .../detail/winrt_ssocket_service_base.hpp | 0 .../asio/detail/winrt_timer_scheduler.hpp | 0 .../thirdparty}/asio/detail/winrt_utils.hpp | 0 .../thirdparty}/asio/detail/winsock_init.hpp | 0 .../asio/detail/work_dispatcher.hpp | 0 .../asio/detail/wrapped_handler.hpp | 0 .../ylt/thirdparty}/asio/dispatch.hpp | 0 .../ylt/thirdparty}/asio/error.hpp | 0 .../ylt/thirdparty}/asio/error_code.hpp | 0 .../ylt/thirdparty}/asio/execution.hpp | 0 .../thirdparty}/asio/execution/allocator.hpp | 0 .../asio/execution/any_executor.hpp | 0 .../asio/execution/bad_executor.hpp | 0 .../thirdparty}/asio/execution/blocking.hpp | 0 .../asio/execution/blocking_adaptation.hpp | 0 .../asio/execution/bulk_execute.hpp | 0 .../asio/execution/bulk_guarantee.hpp | 0 .../thirdparty}/asio/execution/connect.hpp | 0 .../thirdparty}/asio/execution/context.hpp | 0 .../thirdparty}/asio/execution/context_as.hpp | 0 .../asio/execution/detail/as_invocable.hpp | 0 .../asio/execution/detail/as_operation.hpp | 0 .../asio/execution/detail/as_receiver.hpp | 0 .../asio/execution/detail/bulk_sender.hpp | 0 .../asio/execution/detail/submit_receiver.hpp | 0 .../asio/execution/detail/void_receiver.hpp | 0 .../thirdparty}/asio/execution/execute.hpp | 0 .../thirdparty}/asio/execution/executor.hpp | 0 .../asio/execution/impl/bad_executor.ipp | 0 .../impl/receiver_invocation_error.ipp | 0 .../asio/execution/invocable_archetype.hpp | 0 .../thirdparty}/asio/execution/mapping.hpp | 0 .../thirdparty}/asio/execution/occupancy.hpp | 0 .../asio/execution/operation_state.hpp | 0 .../asio/execution/outstanding_work.hpp | 0 .../asio/execution/prefer_only.hpp | 0 .../thirdparty}/asio/execution/receiver.hpp | 0 .../execution/receiver_invocation_error.hpp | 0 .../asio/execution/relationship.hpp | 0 .../thirdparty}/asio/execution/schedule.hpp | 0 .../thirdparty}/asio/execution/scheduler.hpp | 0 .../ylt/thirdparty}/asio/execution/sender.hpp | 0 .../thirdparty}/asio/execution/set_done.hpp | 0 .../thirdparty}/asio/execution/set_error.hpp | 0 .../thirdparty}/asio/execution/set_value.hpp | 0 .../ylt/thirdparty}/asio/execution/start.hpp | 0 .../ylt/thirdparty}/asio/execution/submit.hpp | 0 .../thirdparty}/asio/execution_context.hpp | 0 .../ylt/thirdparty}/asio/executor.hpp | 0 .../thirdparty}/asio/executor_work_guard.hpp | 0 .../thirdparty}/asio/experimental/append.hpp | 0 .../asio/experimental/as_single.hpp | 0 .../asio/experimental/as_tuple.hpp | 0 .../asio/experimental/awaitable_operators.hpp | 0 .../asio/experimental/basic_channel.hpp | 0 .../experimental/basic_concurrent_channel.hpp | 0 .../experimental/cancellation_condition.hpp | 0 .../thirdparty}/asio/experimental/channel.hpp | 0 .../asio/experimental/channel_error.hpp | 0 .../asio/experimental/channel_traits.hpp | 0 .../asio/experimental/co_spawn.hpp | 0 .../asio/experimental/concurrent_channel.hpp | 0 .../thirdparty}/asio/experimental/coro.hpp | 0 .../asio/experimental/coro_traits.hpp | 0 .../asio/experimental/deferred.hpp | 0 .../experimental/detail/channel_handler.hpp | 0 .../experimental/detail/channel_message.hpp | 0 .../experimental/detail/channel_operation.hpp | 0 .../experimental/detail/channel_payload.hpp | 0 .../detail/channel_receive_op.hpp | 0 .../detail/channel_send_functions.hpp | 0 .../experimental/detail/channel_send_op.hpp | 0 .../experimental/detail/channel_service.hpp | 0 .../detail/completion_handler_erasure.hpp | 0 .../detail/coro_promise_allocator.hpp | 0 .../experimental/detail/has_signature.hpp | 0 .../detail/impl/channel_service.hpp | 0 .../experimental/detail/partial_promise.hpp | 0 .../asio/experimental/impl/as_single.hpp | 0 .../asio/experimental/impl/channel_error.ipp | 0 .../asio/experimental/impl/coro.hpp | 0 .../asio/experimental/impl/parallel_group.hpp | 0 .../asio/experimental/impl/promise.hpp | 0 .../asio/experimental/impl/use_coro.hpp | 0 .../asio/experimental/parallel_group.hpp | 0 .../thirdparty}/asio/experimental/prepend.hpp | 0 .../thirdparty}/asio/experimental/promise.hpp | 0 .../asio/experimental/use_coro.hpp | 0 .../ylt/thirdparty}/asio/file_base.hpp | 0 .../asio/generic/basic_endpoint.hpp | 0 .../asio/generic/datagram_protocol.hpp | 0 .../asio/generic/detail/endpoint.hpp | 0 .../asio/generic/detail/impl/endpoint.ipp | 0 .../thirdparty}/asio/generic/raw_protocol.hpp | 0 .../asio/generic/seq_packet_protocol.hpp | 0 .../asio/generic/stream_protocol.hpp | 0 .../thirdparty}/asio/handler_alloc_hook.hpp | 0 .../asio/handler_continuation_hook.hpp | 0 .../thirdparty}/asio/handler_invoke_hook.hpp | 0 .../asio/high_resolution_timer.hpp | 0 .../thirdparty}/asio/impl/any_io_executor.ipp | 0 .../ylt/thirdparty}/asio/impl/append.hpp | 0 .../ylt/thirdparty}/asio/impl/as_tuple.hpp | 0 .../ylt/thirdparty}/asio/impl/awaitable.hpp | 0 .../asio/impl/buffered_read_stream.hpp | 0 .../asio/impl/buffered_write_stream.hpp | 0 .../asio/impl/cancellation_signal.ipp | 0 .../ylt/thirdparty}/asio/impl/co_spawn.hpp | 0 .../ylt/thirdparty}/asio/impl/connect.hpp | 0 .../thirdparty}/asio/impl/connect_pipe.hpp | 0 .../thirdparty}/asio/impl/connect_pipe.ipp | 0 .../ylt/thirdparty}/asio/impl/defer.hpp | 0 .../ylt/thirdparty}/asio/impl/deferred.hpp | 0 .../ylt/thirdparty}/asio/impl/detached.hpp | 0 .../ylt/thirdparty}/asio/impl/dispatch.hpp | 0 .../ylt/thirdparty}/asio/impl/error.ipp | 0 .../ylt/thirdparty}/asio/impl/error_code.ipp | 0 .../asio/impl/execution_context.hpp | 0 .../asio/impl/execution_context.ipp | 0 .../ylt/thirdparty}/asio/impl/executor.hpp | 0 .../ylt/thirdparty}/asio/impl/executor.ipp | 0 .../asio/impl/handler_alloc_hook.ipp | 0 .../ylt/thirdparty}/asio/impl/io_context.hpp | 0 .../ylt/thirdparty}/asio/impl/io_context.ipp | 0 .../asio/impl/multiple_exceptions.ipp | 0 .../ylt/thirdparty}/asio/impl/post.hpp | 0 .../ylt/thirdparty}/asio/impl/prepend.hpp | 0 .../ylt/thirdparty}/asio/impl/read.hpp | 0 .../ylt/thirdparty}/asio/impl/read_at.hpp | 0 .../ylt/thirdparty}/asio/impl/read_until.hpp | 0 .../thirdparty}/asio/impl/redirect_error.hpp | 0 .../asio/impl/serial_port_base.hpp | 0 .../asio/impl/serial_port_base.ipp | 0 .../ylt/thirdparty}/asio/impl/spawn.hpp | 0 .../ylt/thirdparty}/asio/impl/src.hpp | 0 .../thirdparty}/asio/impl/system_context.hpp | 0 .../thirdparty}/asio/impl/system_context.ipp | 0 .../thirdparty}/asio/impl/system_executor.hpp | 0 .../ylt/thirdparty}/asio/impl/thread_pool.hpp | 0 .../ylt/thirdparty}/asio/impl/thread_pool.ipp | 0 .../thirdparty}/asio/impl/use_awaitable.hpp | 0 .../ylt/thirdparty}/asio/impl/use_future.hpp | 0 .../ylt/thirdparty}/asio/impl/write.hpp | 0 .../ylt/thirdparty}/asio/impl/write_at.hpp | 0 .../ylt/thirdparty}/asio/io_context.hpp | 0 .../thirdparty}/asio/io_context_strand.hpp | 0 .../ylt/thirdparty}/asio/io_service.hpp | 0 .../thirdparty}/asio/io_service_strand.hpp | 0 .../ylt/thirdparty}/asio/ip/address.hpp | 0 .../ylt/thirdparty}/asio/ip/address_v4.hpp | 0 .../asio/ip/address_v4_iterator.hpp | 0 .../thirdparty}/asio/ip/address_v4_range.hpp | 0 .../ylt/thirdparty}/asio/ip/address_v6.hpp | 0 .../asio/ip/address_v6_iterator.hpp | 0 .../thirdparty}/asio/ip/address_v6_range.hpp | 0 .../thirdparty}/asio/ip/bad_address_cast.hpp | 0 .../thirdparty}/asio/ip/basic_endpoint.hpp | 0 .../thirdparty}/asio/ip/basic_resolver.hpp | 0 .../asio/ip/basic_resolver_entry.hpp | 0 .../asio/ip/basic_resolver_iterator.hpp | 0 .../asio/ip/basic_resolver_query.hpp | 0 .../asio/ip/basic_resolver_results.hpp | 0 .../thirdparty}/asio/ip/detail/endpoint.hpp | 0 .../asio/ip/detail/impl/endpoint.ipp | 0 .../asio/ip/detail/socket_option.hpp | 0 .../ylt/thirdparty}/asio/ip/host_name.hpp | 0 .../ylt/thirdparty}/asio/ip/icmp.hpp | 0 .../ylt/thirdparty}/asio/ip/impl/address.hpp | 0 .../ylt/thirdparty}/asio/ip/impl/address.ipp | 0 .../thirdparty}/asio/ip/impl/address_v4.hpp | 0 .../thirdparty}/asio/ip/impl/address_v4.ipp | 0 .../thirdparty}/asio/ip/impl/address_v6.hpp | 0 .../thirdparty}/asio/ip/impl/address_v6.ipp | 0 .../asio/ip/impl/basic_endpoint.hpp | 0 .../thirdparty}/asio/ip/impl/host_name.ipp | 0 .../thirdparty}/asio/ip/impl/network_v4.hpp | 0 .../thirdparty}/asio/ip/impl/network_v4.ipp | 0 .../thirdparty}/asio/ip/impl/network_v6.hpp | 0 .../thirdparty}/asio/ip/impl/network_v6.ipp | 0 .../ylt/thirdparty}/asio/ip/multicast.hpp | 0 .../ylt/thirdparty}/asio/ip/network_v4.hpp | 0 .../ylt/thirdparty}/asio/ip/network_v6.hpp | 0 .../ylt/thirdparty}/asio/ip/resolver_base.hpp | 0 .../asio/ip/resolver_query_base.hpp | 0 .../ylt/thirdparty}/asio/ip/tcp.hpp | 0 .../ylt/thirdparty}/asio/ip/udp.hpp | 0 .../ylt/thirdparty}/asio/ip/unicast.hpp | 0 .../ylt/thirdparty}/asio/ip/v6_only.hpp | 0 .../asio/is_applicable_property.hpp | 0 .../asio/is_contiguous_iterator.hpp | 0 .../ylt/thirdparty}/asio/is_executor.hpp | 0 .../ylt/thirdparty}/asio/is_read_buffered.hpp | 0 .../thirdparty}/asio/is_write_buffered.hpp | 0 .../thirdparty}/asio/local/basic_endpoint.hpp | 0 .../thirdparty}/asio/local/connect_pair.hpp | 0 .../asio/local/datagram_protocol.hpp | 0 .../asio/local/detail/endpoint.hpp | 0 .../asio/local/detail/impl/endpoint.ipp | 0 .../asio/local/stream_protocol.hpp | 0 .../thirdparty}/asio/multiple_exceptions.hpp | 0 .../ylt/thirdparty}/asio/packaged_task.hpp | 0 .../ylt/thirdparty}/asio/placeholders.hpp | 0 .../asio/posix/basic_descriptor.hpp | 0 .../asio/posix/basic_stream_descriptor.hpp | 0 .../ylt/thirdparty}/asio/posix/descriptor.hpp | 0 .../asio/posix/descriptor_base.hpp | 0 .../asio/posix/stream_descriptor.hpp | 0 .../ylt/thirdparty}/asio/post.hpp | 0 .../ylt/thirdparty}/asio/prefer.hpp | 0 .../ylt/thirdparty}/asio/prepend.hpp | 0 .../ylt/thirdparty}/asio/query.hpp | 0 .../thirdparty}/asio/random_access_file.hpp | 0 .../ylt/thirdparty}/asio/read.hpp | 0 .../ylt/thirdparty}/asio/read_at.hpp | 0 .../ylt/thirdparty}/asio/read_until.hpp | 0 .../ylt/thirdparty}/asio/readable_pipe.hpp | 0 .../thirdparty}/asio/recycling_allocator.hpp | 0 .../ylt/thirdparty}/asio/redirect_error.hpp | 0 .../thirdparty}/asio/registered_buffer.hpp | 0 .../ylt/thirdparty}/asio/require.hpp | 0 .../ylt/thirdparty}/asio/require_concept.hpp | 0 .../ylt/thirdparty}/asio/serial_port.hpp | 0 .../ylt/thirdparty}/asio/serial_port_base.hpp | 0 .../ylt/thirdparty}/asio/signal_set.hpp | 0 .../ylt/thirdparty}/asio/socket_base.hpp | 0 .../ylt/thirdparty}/asio/spawn.hpp | 0 .../ylt/thirdparty}/asio/ssl.hpp | 0 .../ylt/thirdparty}/asio/ssl/context.hpp | 0 .../ylt/thirdparty}/asio/ssl/context_base.hpp | 0 .../asio/ssl/detail/buffered_handshake_op.hpp | 0 .../thirdparty}/asio/ssl/detail/engine.hpp | 0 .../asio/ssl/detail/handshake_op.hpp | 0 .../asio/ssl/detail/impl/engine.ipp | 0 .../asio/ssl/detail/impl/openssl_init.ipp | 0 .../ylt/thirdparty}/asio/ssl/detail/io.hpp | 0 .../asio/ssl/detail/openssl_init.hpp | 0 .../asio/ssl/detail/openssl_types.hpp | 0 .../asio/ssl/detail/password_callback.hpp | 0 .../thirdparty}/asio/ssl/detail/read_op.hpp | 0 .../asio/ssl/detail/shutdown_op.hpp | 0 .../asio/ssl/detail/stream_core.hpp | 0 .../asio/ssl/detail/verify_callback.hpp | 0 .../thirdparty}/asio/ssl/detail/write_op.hpp | 0 .../ylt/thirdparty}/asio/ssl/error.hpp | 0 .../asio/ssl/host_name_verification.hpp | 0 .../ylt/thirdparty}/asio/ssl/impl/context.hpp | 0 .../ylt/thirdparty}/asio/ssl/impl/context.ipp | 0 .../ylt/thirdparty}/asio/ssl/impl/error.ipp | 0 .../asio/ssl/impl/host_name_verification.ipp | 0 .../asio/ssl/impl/rfc2818_verification.ipp | 0 .../ylt/thirdparty}/asio/ssl/impl/src.hpp | 0 .../asio/ssl/rfc2818_verification.hpp | 0 .../ylt/thirdparty}/asio/ssl/stream.hpp | 0 .../ylt/thirdparty}/asio/ssl/stream_base.hpp | 0 .../thirdparty}/asio/ssl/verify_context.hpp | 0 .../ylt/thirdparty}/asio/ssl/verify_mode.hpp | 0 .../thirdparty}/asio/static_thread_pool.hpp | 0 .../ylt/thirdparty}/asio/steady_timer.hpp | 0 .../ylt/thirdparty}/asio/strand.hpp | 0 .../ylt/thirdparty}/asio/stream_file.hpp | 0 .../ylt/thirdparty}/asio/streambuf.hpp | 0 .../ylt/thirdparty}/asio/system_context.hpp | 0 .../ylt/thirdparty}/asio/system_error.hpp | 0 .../ylt/thirdparty}/asio/system_executor.hpp | 0 .../ylt/thirdparty}/asio/system_timer.hpp | 0 .../ylt/thirdparty}/asio/this_coro.hpp | 0 .../ylt/thirdparty}/asio/thread.hpp | 0 .../ylt/thirdparty}/asio/thread_pool.hpp | 0 .../ylt/thirdparty}/asio/time_traits.hpp | 0 .../asio/traits/bulk_execute_free.hpp | 0 .../asio/traits/bulk_execute_member.hpp | 0 .../thirdparty}/asio/traits/connect_free.hpp | 0 .../asio/traits/connect_member.hpp | 0 .../asio/traits/equality_comparable.hpp | 0 .../thirdparty}/asio/traits/execute_free.hpp | 0 .../asio/traits/execute_member.hpp | 0 .../thirdparty}/asio/traits/prefer_free.hpp | 0 .../thirdparty}/asio/traits/prefer_member.hpp | 0 .../thirdparty}/asio/traits/query_free.hpp | 0 .../thirdparty}/asio/traits/query_member.hpp | 0 .../traits/query_static_constexpr_member.hpp | 0 .../asio/traits/require_concept_free.hpp | 0 .../asio/traits/require_concept_member.hpp | 0 .../thirdparty}/asio/traits/require_free.hpp | 0 .../asio/traits/require_member.hpp | 0 .../thirdparty}/asio/traits/schedule_free.hpp | 0 .../asio/traits/schedule_member.hpp | 0 .../thirdparty}/asio/traits/set_done_free.hpp | 0 .../asio/traits/set_done_member.hpp | 0 .../asio/traits/set_error_free.hpp | 0 .../asio/traits/set_error_member.hpp | 0 .../asio/traits/set_value_free.hpp | 0 .../asio/traits/set_value_member.hpp | 0 .../thirdparty}/asio/traits/start_free.hpp | 0 .../thirdparty}/asio/traits/start_member.hpp | 0 .../thirdparty}/asio/traits/static_query.hpp | 0 .../asio/traits/static_require.hpp | 0 .../asio/traits/static_require_concept.hpp | 0 .../thirdparty}/asio/traits/submit_free.hpp | 0 .../thirdparty}/asio/traits/submit_member.hpp | 0 .../ylt/thirdparty}/asio/ts/buffer.hpp | 0 .../ylt/thirdparty}/asio/ts/executor.hpp | 0 .../ylt/thirdparty}/asio/ts/internet.hpp | 0 .../ylt/thirdparty}/asio/ts/io_context.hpp | 0 .../ylt/thirdparty}/asio/ts/net.hpp | 0 .../ylt/thirdparty}/asio/ts/netfwd.hpp | 0 .../ylt/thirdparty}/asio/ts/socket.hpp | 0 .../ylt/thirdparty}/asio/ts/timer.hpp | 0 .../ylt/thirdparty}/asio/unyield.hpp | 0 .../ylt/thirdparty}/asio/use_awaitable.hpp | 0 .../ylt/thirdparty}/asio/use_future.hpp | 0 .../ylt/thirdparty}/asio/uses_executor.hpp | 0 .../ylt/thirdparty}/asio/version.hpp | 0 .../ylt/thirdparty}/asio/wait_traits.hpp | 0 .../asio/windows/basic_object_handle.hpp | 0 .../asio/windows/basic_overlapped_handle.hpp | 0 .../windows/basic_random_access_handle.hpp | 0 .../asio/windows/basic_stream_handle.hpp | 0 .../asio/windows/object_handle.hpp | 0 .../asio/windows/overlapped_handle.hpp | 0 .../asio/windows/overlapped_ptr.hpp | 0 .../asio/windows/random_access_handle.hpp | 0 .../asio/windows/stream_handle.hpp | 0 .../ylt/thirdparty}/asio/writable_pipe.hpp | 0 .../ylt/thirdparty}/asio/write.hpp | 0 .../ylt/thirdparty}/asio/write_at.hpp | 0 .../ylt/thirdparty}/asio/yield.hpp | 0 .../thirdparty}/async_simple/CMakeLists.txt | 0 .../ylt/thirdparty}/async_simple/Collect.h | 79 +- .../ylt/thirdparty}/async_simple/Common.h | 8 +- .../ylt/thirdparty/async_simple/Executor.h | 177 + include/ylt/thirdparty/async_simple/Future.h | 366 ++ .../ylt/thirdparty/async_simple/FutureState.h | 331 ++ .../ylt/thirdparty}/async_simple/IOExecutor.h | 58 +- .../ylt/thirdparty/async_simple/LocalState.h | 96 + .../thirdparty}/async_simple/MoveWrapper.h | 0 include/ylt/thirdparty/async_simple/Promise.h | 122 + .../ylt/thirdparty}/async_simple/Traits.h | 29 +- .../ylt/thirdparty}/async_simple/Try.h | 0 .../ylt/thirdparty}/async_simple/Unit.h | 7 +- .../thirdparty/async_simple/coro/Collect.h | 589 +++ .../async_simple/coro/ConditionVariable.h | 216 + .../thirdparty/async_simple/coro/CountEvent.h | 76 + .../async_simple/coro/DetachedCoroutine.h | 54 +- .../async_simple/coro/FutureAwaiter.h | 29 +- .../thirdparty}/async_simple/coro/Generator.h | 0 .../ylt/thirdparty}/async_simple/coro/Latch.h | 73 +- .../ylt/thirdparty/async_simple/coro/Lazy.h | 520 ++ .../ylt/thirdparty}/async_simple/coro/Mutex.h | 0 .../async_simple/coro/PromiseAllocator.h | 0 .../thirdparty/async_simple/coro/Semaphore.h | 114 + .../async_simple/coro/SharedMutex.h | 0 .../ylt/thirdparty}/async_simple/coro/Sleep.h | 21 +- .../thirdparty/async_simple/coro/SpinLock.h | 86 + .../thirdparty}/async_simple/coro/SyncAwait.h | 33 +- .../thirdparty}/async_simple/coro/Traits.h | 21 +- .../async_simple/coro/ViaCoroutine.h | 200 + .../async_simple/executors/SimpleExecutor.cpp | 24 +- .../async_simple/executors/SimpleExecutor.h | 48 +- .../async_simple/executors/SimpleIOExecutor.h | 167 + .../async_simple/experimental/coroutine.h | 0 .../thirdparty}/async_simple/uthread/Async.h | 101 +- .../thirdparty}/async_simple/uthread/Await.h | 2 +- .../async_simple/uthread/Collect.h | 86 +- .../thirdparty}/async_simple/uthread/Latch.h | 53 +- .../thirdparty/async_simple/uthread/Uthread.h | 98 + .../Darwin/arm64/jump_arm64_aapcs_macho_gas.S | 0 .../Darwin/arm64/make_arm64_aapcs_macho_gas.S | 0 .../arm64/ontop_arm64_aapcs_macho_gas.S | 0 .../x86_64/jump_x86_64_sysv_macho_gas.S | 0 .../x86_64/make_x86_64_sysv_macho_gas.S | 0 .../x86_64/ontop_x86_64_sysv_macho_gas.S | 0 .../Linux/aarch64/jump_arm64_aapcs_elf_gas.S | 0 .../Linux/aarch64/make_arm64_aapcs_elf_gas.S | 0 .../Linux/aarch64/ontop_arm64_aapcs_elf_gas.S | 0 .../Linux/ppc64le/jump_ppc64_sysv_elf_gas.S | 0 .../Linux/ppc64le/make_ppc64_sysv_elf_gas.S | 0 .../Linux/ppc64le/ontop_ppc64_sysv_elf_gas.S | 0 .../Linux/x86_64/jump_x86_64_sysv_elf_gas.S | 0 .../Linux/x86_64/make_x86_64_sysv_elf_gas.S | 0 .../Linux/x86_64/ontop_x86_64_sysv_elf_gas.S | 0 .../async_simple/uthread/internal/thread.cc | 0 .../async_simple/uthread/internal/thread.h | 0 .../uthread/internal/thread_impl.h | 0 .../thirdparty}/async_simple/util/Condition.h | 38 +- .../ylt/thirdparty/async_simple/util/Queue.h | 120 + .../thirdparty/async_simple/util/ThreadPool.h | 221 + .../thirdparty}/cinatra/coro_http_client.hpp | 15 +- .../ylt/thirdparty}/cinatra/define.h | 0 .../ylt/thirdparty}/cinatra/http_parser.hpp | 0 .../ylt/thirdparty}/cinatra/picohttpparser.h | 0 .../ylt/thirdparty}/cinatra/response_cv.hpp | 0 .../ylt/thirdparty}/cinatra/sha1.hpp | 0 .../ylt/thirdparty}/cinatra/uri.hpp | 0 .../ylt/thirdparty}/cinatra/utils.hpp | 0 .../ylt/thirdparty}/cinatra/websocket.hpp | 0 .../ylt/thirdparty}/cinatra/ws_define.h | 0 .../ylt/thirdparty}/frozen/CMakeLists.txt | 0 .../ylt/thirdparty}/frozen/algorithm.h | 0 .../ylt/thirdparty}/frozen/bits/algorithms.h | 0 .../ylt/thirdparty}/frozen/bits/basic_types.h | 0 .../frozen/bits/constexpr_assert.h | 0 .../ylt/thirdparty}/frozen/bits/defines.h | 0 .../ylt/thirdparty}/frozen/bits/elsa.h | 0 .../ylt/thirdparty}/frozen/bits/elsa_std.h | 0 .../ylt/thirdparty}/frozen/bits/exceptions.h | 0 .../ylt/thirdparty}/frozen/bits/hash_string.h | 0 .../ylt/thirdparty}/frozen/bits/pmh.h | 0 .../ylt/thirdparty}/frozen/bits/version.h | 0 .../ylt/thirdparty}/frozen/map.h | 0 .../ylt/thirdparty}/frozen/random.h | 0 .../ylt/thirdparty}/frozen/set.h | 0 .../ylt/thirdparty}/frozen/string.h | 0 .../ylt/thirdparty}/frozen/unordered_map.h | 0 .../ylt/thirdparty}/frozen/unordered_set.h | 0 .../ylt/thirdparty}/iguana/define.h | 0 .../ylt/thirdparty}/iguana/detail/charconv.h | 0 .../thirdparty/iguana/detail}/dragonbox.h | 0 .../iguana/detail/dragonbox_to_chars.h | 0 .../thirdparty}/iguana/detail/fast_float.h | 0 .../ylt/thirdparty}/iguana/detail/itoa.hpp | 0 .../iguana/detail/string_stream.hpp | 0 .../ylt/thirdparty}/iguana/detail/traits.hpp | 0 .../ylt/thirdparty}/iguana/detail/utf.hpp | 0 .../ylt/thirdparty}/iguana/error_code.h | 0 .../ylt/thirdparty}/iguana/json_reader.hpp | 0 .../ylt/thirdparty}/iguana/json_util.hpp | 0 .../ylt/thirdparty}/iguana/json_writer.hpp | 0 .../ylt/thirdparty}/iguana/prettify.hpp | 0 .../ylt/thirdparty}/iguana/reflection.hpp | 0 .../ylt/thirdparty}/iguana/type_traits.hpp | 0 .../ylt/thirdparty}/iguana/value.hpp | 0 .../ylt/thirdparty}/iguana/xml_reader.hpp | 2 +- .../ylt/thirdparty}/iguana/xml_writer.hpp | 2 +- .../ylt/thirdparty}/iguana/yaml_reader.hpp | 0 .../ylt/thirdparty}/iguana/yaml_util.hpp | 0 .../ylt/thirdparty}/iguana/yaml_writer.hpp | 0 .../ylt}/thirdparty/rapidxml/rapidxml.hpp | 0 .../thirdparty/rapidxml/rapidxml_print.hpp | 0 include/ylt/util/concurrentqueue.h | 4377 +++++++++++++++++ .../detail => include/ylt/util}/dragonbox.h | 15 + include/{ => ylt}/util/dragonbox_to_chars.h | 15 + include/{ => ylt}/util/expected.hpp | 2 +- include/{ => ylt}/util/function_name.h | 4 +- include/{ => ylt}/util/magic_names.hpp | 6 +- include/{ => ylt}/util/meta_string.hpp | 2 +- include/{ => ylt}/util/string_finder.hpp | 2 +- include/{ => ylt}/util/time_util.h | 0 include/{ => ylt}/util/type_traits.h | 2 +- include/{ => ylt}/util/utils.hpp | 4 +- src/coro_file/examples/CMakeLists.txt | 25 - src/coro_file/tests/CMakeLists.txt | 36 - src/coro_http/CMakeLists.txt | 26 - src/coro_http/examples/BUILD.bazel | 4 +- src/coro_http/examples/CMakeLists.txt | 38 +- src/coro_http/examples/channel.cpp | 19 +- src/coro_http/examples/example.cpp | 2 +- src/coro_io/examples/CMakeLists.txt | 32 + src/{coro_file => coro_io}/examples/main.cpp | 12 +- src/coro_io/tests/CMakeLists.txt | 9 + src/{coro_file => coro_io}/tests/main.cpp | 2 +- .../tests/test_corofile.cpp | 16 +- src/coro_rpc/CMakeLists.txt | 54 - src/coro_rpc/benchmark/CMakeLists.txt | 20 +- src/coro_rpc/benchmark/api/Monster.h | 2 +- src/coro_rpc/benchmark/api/Rect.h | 2 +- src/coro_rpc/benchmark/api/ValidateRequest.h | 2 +- src/coro_rpc/benchmark/api/rpc_functions.hpp | 11 +- .../benchmark/{client => }/client.cpp | 2 +- src/coro_rpc/benchmark/client/CMakeLists.txt | 20 - .../benchmark/{client => }/data_gen.cpp | 8 +- .../{server/coro_server.cpp => server.cpp} | 2 +- src/coro_rpc/benchmark/server.hpp | 4 +- src/coro_rpc/benchmark/server/CMakeLists.txt | 4 - src/coro_rpc/examples/CMakeLists.txt | 9 +- .../examples/base_examples/CMakeLists.txt | 44 + .../main.cpp => base_examples/channel.cpp} | 23 +- .../main.cpp => base_examples/client.cpp} | 12 +- .../client_pool.cpp} | 13 +- .../client_pools.cpp} | 22 +- .../server => base_examples}/rpc_service.cpp | 24 +- .../rpc_service.h | 6 +- .../main.cpp => base_examples/server.cpp} | 6 +- src/coro_rpc/examples/channel/CMakeLists.txt | 36 - .../examples/client_pool/CMakeLists.txt | 36 - .../examples/client_pools/CMakeLists.txt | 36 - .../examples/file_transfer/BUILD.bazel | 14 +- .../examples/file_transfer/CMakeLists.txt | 71 +- .../{file_client/main.cpp => file_client.cpp} | 5 +- .../{file_server/main.cpp => file_server.cpp} | 4 +- .../{file_server => }/rpc_service.cpp | 2 +- .../{rpc_service => }/rpc_service.h | 2 +- src/coro_rpc/examples/helloworld/BUILD.bazel | 44 - .../examples/helloworld/CMakeLists.txt | 113 - .../helloworld/concurrency_clients/main.cpp | 79 - .../examples/nested_rpc_call/BUILD.bazel | 27 - .../examples/nested_rpc_call/CMakeLists.txt | 38 - .../examples/nested_rpc_call/client/main.cpp | 40 - .../nested_rpc_call/rpc_service/rpc_service.h | 54 - .../examples/nested_rpc_call/server/main.cpp | 34 - .../rest_rpc/CMakeLists.txt | 68 +- .../rest_rpc/config/msgpack_protocol.hpp | 2 +- .../rest_rpc/server/main.cpp | 2 +- .../rest_rpc/server/rpc_service.cpp | 3 +- src/coro_rpc/tests/BUILD.bazel | 6 +- src/coro_rpc/tests/CMakeLists.txt | 72 +- src/coro_rpc/tests/ServerTester.hpp | 12 +- src/coro_rpc/tests/inject_action.hpp | 2 +- src/coro_rpc/tests/main.cpp | 2 +- .../tests/{rpc_service.cpp => rpc_api.cpp} | 7 +- src/coro_rpc/tests/rpc_api.hpp | 4 +- src/coro_rpc/tests/test_connection.cpp | 4 +- src/coro_rpc/tests/test_coro_rpc_client.cpp | 22 +- src/coro_rpc/tests/test_coro_rpc_server.cpp | 13 +- src/coro_rpc/tests/test_function_name.cpp | 4 +- .../tests/test_register_duplication_1.cpp | 4 +- .../tests/test_register_duplication_2.cpp | 4 +- .../tests/test_register_duplication_3.cpp | 4 +- src/coro_rpc/tests/test_register_handler.cpp | 4 +- src/coro_rpc/tests/test_router.cpp | 14 +- src/coro_rpc/tests/test_variadic.cpp | 7 +- src/easylog/CMakeLists.txt | 11 - src/easylog/benchmark/CMakeLists.txt | 10 +- src/easylog/benchmark/main.cpp | 3 +- src/easylog/tests/BUILD.bazel | 7 +- src/easylog/tests/CMakeLists.txt | 19 +- src/easylog/tests/test_easylog.cpp | 2 +- {thirdparty/doctest => src/include}/doctest.h | 0 src/struct_json/CMakeLists.txt | 12 - src/struct_json/examples/BUILD.bazel | 2 +- src/struct_json/examples/CMakeLists.txt | 29 +- src/struct_json/examples/main.cpp | 4 +- src/struct_pack/CMakeLists.txt | 26 - src/struct_pack/benchmark/BUILD.bazel | 6 +- src/struct_pack/benchmark/CMakeLists.txt | 6 +- src/struct_pack/benchmark/config.hpp | 2 +- src/struct_pack/benchmark/data_def.hpp | 2 +- .../benchmark/flatbuffer_sample.hpp | 2 +- src/struct_pack/benchmark/protobuf_sample.hpp | 2 +- .../benchmark/struct_pack_sample.hpp | 8 +- src/struct_pack/examples/BUILD.bazel | 4 +- src/struct_pack/examples/CMakeLists.txt | 23 +- .../examples/{serialize => }/serialize.cpp | 4 +- .../examples/serialize/CMakeLists.txt | 1 - src/struct_pack/tests/BUILD.bazel | 3 +- src/struct_pack/tests/CMakeLists.txt | 10 +- src/struct_pack/tests/main.cpp | 2 +- src/struct_pack/tests/test_alignas.cpp | 5 +- src/struct_pack/tests/test_compatible.cpp | 3 +- .../tests/test_compile_time_calculate.cpp | 2 +- src/struct_pack/tests/test_data_struct.cpp | 3 +- src/struct_pack/tests/test_data_struct2.cpp | 3 +- src/struct_pack/tests/test_pragma_pack.cpp | 4 +- .../test_pragma_pack_and_alignas_mix.cpp | 7 +- src/struct_pack/tests/test_serialize.cpp | 4 +- src/struct_pack/tests/test_stream.cpp | 2 +- src/struct_pack/tests/test_struct.hpp | 5 +- src/struct_pack/tests/test_tuplet.cpp | 2 +- src/struct_pack/tests/test_varint.cpp | 3 +- src/struct_pb/CMakeLists.txt | 20 - src/struct_pb/conformance/CMakeLists.txt | 8 +- src/struct_pb/examples/CMakeLists.txt | 29 +- src/struct_pb/examples/main.cpp | 1 - src/struct_pb/protoc-plugin/CMakeLists.txt | 15 +- src/struct_pb/protoc-plugin/FileGenerator.cpp | 9 +- .../protoc-plugin/StructGenerator.cpp | 2 +- src/struct_pb/tests/CMakeLists.txt | 5 +- src/struct_pb/tests/helper.hpp | 2 +- src/struct_pb/tests/hex_printer.hpp | 2 +- src/struct_pb/tests/main.cpp | 2 +- src/struct_pb/tests/test_pb.cpp | 2 +- .../tests/test_pb_benchmark_struct.cpp | 2 +- src/struct_xml/CMakeLists.txt | 12 - src/struct_xml/examples/CMakeLists.txt | 28 +- src/struct_xml/examples/main.cpp | 4 +- src/struct_yaml/CMakeLists.txt | 12 - src/struct_yaml/examples/CMakeLists.txt | 29 +- src/struct_yaml/examples/main.cpp | 4 +- src/util/tests/CMakeLists.txt | 8 + .../tests/test_meta_string.cpp} | 6 +- .../tests/test_time_util.cpp | 2 +- src/coro_file/CMakeLists.txt => thirdparty | 0 thirdparty/BUILD.bazel | 60 - thirdparty/CMakeLists.txt | 58 - thirdparty/async_simple/.clang-format | 101 - .../async_simple/.github/ISSUE_TEMPLATE.md | 17 - .../.github/PULL_REQUEST_TEMPLATE.md | 13 - .../.github/workflows/PerformanceCommit.yml | 44 - .../.github/workflows/PerformancePR.yml | 44 - .../async_simple/.github/workflows/bazel.yml | 28 - .../.github/workflows/clang-format.yml | 30 - .../async_simple/.github/workflows/cmake.yml | 48 - .../.github/workflows/cmake_gcc.yml | 45 - .../async_simple/.github/workflows/conan.yml | 52 - .../async_simple/.github/workflows/macosx.yml | 48 - .../async_simple/.github/workflows/static.yml | 50 - .../.github/workflows/windows.yml | 60 - thirdparty/async_simple/.gitignore | 34 - .../async_simple/async_simple/Executor.h | 176 - thirdparty/async_simple/async_simple/Future.h | 356 -- .../async_simple/async_simple/FutureState.h | 338 -- .../async_simple/async_simple/LocalState.h | 96 - .../async_simple/async_simple/Promise.h | 122 - .../async_simple/async_simple/coro/Collect.h | 601 --- .../async_simple/coro/ConditionVariable.h | 219 - .../async_simple/coro/CountEvent.h | 74 - .../async_simple/async_simple/coro/Lazy.h | 519 -- .../async_simple/coro/Semaphore.h | 110 - .../async_simple/async_simple/coro/SpinLock.h | 85 - .../async_simple/coro/ViaCoroutine.h | 195 - .../async_simple/executors/SimpleIOExecutor.h | 165 - .../async_simple/uthread/Uthread.h | 92 - .../async_simple/async_simple/util/Queue.h | 117 - .../async_simple/util/ThreadPool.h | 222 - thirdparty/get_clean_async_simple.sh | 15 - .../docs/en/coro_rpc/coro_rpc_introduction.md | 14 +- .../docs/en/guide/what_is_yalantinglibs.md | 267 +- website/docs/zh/coro_rpc/coro_rpc_doc.hpp | 8 +- .../docs/zh/coro_rpc/coro_rpc_introduction.md | 12 +- .../docs/zh/guide/what_is_yalantinglibs.md | 233 +- .../docs/zh/struct_pack/struct_pack_doc.hpp | 4 +- 1018 files changed, 9950 insertions(+), 10434 deletions(-) create mode 100644 cmake/config.cmake delete mode 100644 cmake/dependency.cmake delete mode 100644 cmake/module.cmake delete mode 100644 cmake/platform.cmake create mode 100644 cmake/subdirectory.cmake delete mode 100644 cmake/yalantinglibsConfig.cmake.in delete mode 100644 conanfile.py delete mode 100644 include/struct_xml/xml_reader.h delete mode 100644 include/struct_xml/xml_writer.h delete mode 100644 include/struct_yaml/yaml_reader.h delete mode 100644 include/struct_yaml/yaml_writer.h delete mode 100644 include/util/concurrentqueue.h rename include/{coro_http/coro_http_client.h => ylt/coro_http/coro_http_client.hpp} (92%) rename include/{ => ylt}/coro_io/channel.hpp (98%) rename include/{ => ylt}/coro_io/client_pool.hpp (96%) rename include/{ => ylt}/coro_io/coro_file.hpp (94%) rename include/{ => ylt}/coro_io/coro_io.hpp (97%) rename include/{coro_io => ylt/coro_io/detail}/client_queue.hpp (71%) rename include/{ => ylt}/coro_io/io_context_pool.hpp (98%) rename include/{ => ylt}/coro_rpc/coro_rpc_client.hpp (86%) rename include/{coro_rpc/rpc_context.hpp => ylt/coro_rpc/coro_rpc_context.hpp} (83%) rename include/{ => ylt}/coro_rpc/coro_rpc_server.hpp (77%) rename include/{coro_rpc/coro_rpc => ylt/coro_rpc/impl}/common_service.hpp (95%) rename include/{coro_rpc/coro_rpc => ylt/coro_rpc/impl}/context.hpp (96%) rename include/{coro_rpc/coro_rpc => ylt/coro_rpc/impl}/coro_connection.hpp (97%) rename include/{coro_rpc/coro_rpc => ylt/coro_rpc/impl}/coro_rpc_client.hpp (96%) rename include/{coro_rpc/coro_rpc => ylt/coro_rpc/impl}/coro_rpc_server.hpp (96%) rename include/{coro_rpc/coro_rpc => ylt/coro_rpc/impl}/default_config/coro_rpc_config.hpp (82%) rename include/{coro_rpc/coro_rpc => ylt/coro_rpc/impl}/expected.hpp (89%) rename include/{coro_rpc/coro_rpc => ylt/coro_rpc/impl}/protocol/coro_rpc_protocol.hpp (93%) rename include/{coro_rpc/coro_rpc => ylt/coro_rpc/impl}/protocol/struct_pack_protocol.hpp (90%) rename include/{coro_rpc/coro_rpc => ylt/coro_rpc/impl}/router.hpp (98%) rename include/{coro_rpc/coro_rpc => ylt/coro_rpc/impl}/rpc_execute.hpp (98%) rename include/{easylog/easylog.h => ylt/easylog.hpp} (99%) rename include/{ => ylt}/easylog/appender.hpp (99%) rename include/{ => ylt}/easylog/record.hpp (97%) rename include/{ => ylt}/struct_json/json_reader.h (100%) rename include/{ => ylt}/struct_json/json_writer.h (100%) rename include/{struct_pack => ylt}/struct_pack.hpp (99%) rename include/{struct_pack => ylt}/struct_pack/error_code.hpp (58%) rename include/{struct_pack => ylt}/struct_pack/marco.h (94%) rename include/{struct_pack => ylt}/struct_pack/md5_constexpr.hpp (99%) rename include/{struct_pack => ylt}/struct_pack/reflection.hpp (99%) rename include/{struct_pack => ylt}/struct_pack/struct_pack_impl.hpp (99%) rename include/{struct_pack => ylt}/struct_pack/trivial_view.hpp (98%) rename include/{struct_pack => ylt}/struct_pack/tuple.hpp (99%) rename include/{struct_pack => ylt}/struct_pack/varint.hpp (99%) rename include/{struct_pb => ylt}/struct_pb.hpp (82%) rename include/{struct_pb => ylt}/struct_pb/struct_pb_impl.hpp (89%) create mode 100644 include/ylt/struct_xml/xml_reader.h create mode 100644 include/ylt/struct_xml/xml_writer.h create mode 100644 include/ylt/struct_yaml/yaml_reader.h create mode 100644 include/ylt/struct_yaml/yaml_writer.h rename {thirdparty/asio => include/ylt/thirdparty}/asio.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/any_io_executor.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/append.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/as_tuple.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/associated_allocator.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/associated_cancellation_slot.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/associated_executor.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/associator.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/async_result.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/awaitable.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/basic_datagram_socket.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/basic_deadline_timer.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/basic_file.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/basic_io_object.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/basic_random_access_file.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/basic_raw_socket.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/basic_readable_pipe.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/basic_seq_packet_socket.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/basic_serial_port.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/basic_signal_set.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/basic_socket.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/basic_socket_acceptor.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/basic_socket_iostream.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/basic_socket_streambuf.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/basic_stream_file.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/basic_stream_socket.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/basic_streambuf.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/basic_streambuf_fwd.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/basic_waitable_timer.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/basic_writable_pipe.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/bind_allocator.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/bind_cancellation_slot.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/bind_executor.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/buffer.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/buffer_registration.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/buffered_read_stream.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/buffered_read_stream_fwd.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/buffered_stream.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/buffered_stream_fwd.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/buffered_write_stream.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/buffered_write_stream_fwd.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/buffers_iterator.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/cancellation_signal.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/cancellation_state.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/cancellation_type.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/co_spawn.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/completion_condition.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/compose.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/connect.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/connect_pipe.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/coroutine.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/deadline_timer.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/defer.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/deferred.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detached.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/array.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/array_fwd.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/assert.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/atomic_count.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/base_from_cancellation_state.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/base_from_completion_cond.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/bind_handler.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/blocking_executor_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/buffer_resize_guard.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/buffer_sequence_adapter.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/buffered_stream_storage.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/bulk_executor_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/call_stack.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/chrono.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/chrono_time_traits.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/completion_handler.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/concurrency_hint.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/conditionally_enabled_event.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/conditionally_enabled_mutex.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/config.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/consuming_buffers.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/cstddef.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/cstdint.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/date_time_fwd.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/deadline_timer_service.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/dependent_type.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/descriptor_ops.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/descriptor_read_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/descriptor_write_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/dev_poll_reactor.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/epoll_reactor.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/event.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/eventfd_select_interrupter.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/exception.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/executor_function.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/executor_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/fd_set_adapter.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/fenced_block.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/functional.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/future.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/gcc_arm_fenced_block.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/gcc_hppa_fenced_block.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/gcc_sync_fenced_block.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/gcc_x86_fenced_block.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/global.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/handler_alloc_helpers.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/handler_cont_helpers.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/handler_invoke_helpers.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/handler_tracking.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/handler_type_requirements.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/handler_work.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/hash_map.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/buffer_sequence_adapter.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/descriptor_ops.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/dev_poll_reactor.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/dev_poll_reactor.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/epoll_reactor.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/epoll_reactor.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/eventfd_select_interrupter.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/handler_tracking.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/io_uring_descriptor_service.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/io_uring_file_service.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/io_uring_service.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/io_uring_service.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/io_uring_socket_service_base.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/kqueue_reactor.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/kqueue_reactor.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/null_event.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/pipe_select_interrupter.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/posix_event.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/posix_mutex.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/posix_serial_port_service.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/posix_thread.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/posix_tss_ptr.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/reactive_descriptor_service.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/reactive_socket_service_base.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/resolver_service_base.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/scheduler.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/select_reactor.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/select_reactor.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/service_registry.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/service_registry.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/signal_set_service.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/socket_ops.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/socket_select_interrupter.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/strand_executor_service.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/strand_executor_service.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/strand_service.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/strand_service.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/thread_context.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/throw_error.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/timer_queue_ptime.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/timer_queue_set.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/win_event.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/win_iocp_file_service.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/win_iocp_handle_service.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/win_iocp_io_context.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/win_iocp_io_context.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/win_iocp_serial_port_service.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/win_iocp_socket_service_base.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/win_mutex.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/win_object_handle_service.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/win_static_mutex.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/win_thread.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/win_tss_ptr.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/winrt_ssocket_service_base.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/winrt_timer_scheduler.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/winrt_timer_scheduler.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/impl/winsock_init.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/io_control.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/io_object_impl.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/io_uring_descriptor_read_at_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/io_uring_descriptor_read_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/io_uring_descriptor_service.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/io_uring_descriptor_write_at_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/io_uring_descriptor_write_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/io_uring_file_service.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/io_uring_null_buffers_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/io_uring_operation.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/io_uring_service.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/io_uring_socket_accept_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/io_uring_socket_connect_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/io_uring_socket_recv_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/io_uring_socket_recvfrom_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/io_uring_socket_recvmsg_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/io_uring_socket_send_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/io_uring_socket_sendto_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/io_uring_socket_service.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/io_uring_socket_service_base.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/io_uring_wait_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/is_buffer_sequence.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/is_executor.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/keyword_tss_ptr.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/kqueue_reactor.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/limits.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/local_free_on_block_exit.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/macos_fenced_block.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/memory.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/mutex.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/non_const_lvalue.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/noncopyable.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/null_event.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/null_fenced_block.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/null_global.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/null_mutex.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/null_reactor.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/null_signal_blocker.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/null_socket_service.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/null_static_mutex.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/null_thread.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/null_tss_ptr.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/object_pool.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/old_win_sdk_compat.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/op_queue.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/operation.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/pipe_select_interrupter.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/pop_options.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/posix_event.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/posix_fd_set_adapter.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/posix_global.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/posix_mutex.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/posix_serial_port_service.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/posix_signal_blocker.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/posix_static_mutex.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/posix_thread.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/posix_tss_ptr.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/push_options.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/reactive_descriptor_service.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/reactive_null_buffers_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/reactive_socket_accept_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/reactive_socket_connect_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/reactive_socket_recv_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/reactive_socket_recvfrom_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/reactive_socket_recvmsg_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/reactive_socket_send_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/reactive_socket_sendto_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/reactive_socket_service.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/reactive_socket_service_base.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/reactive_wait_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/reactor.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/reactor_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/reactor_op_queue.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/recycling_allocator.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/regex_fwd.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/resolve_endpoint_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/resolve_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/resolve_query_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/resolver_service.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/resolver_service_base.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/scheduler.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/scheduler_operation.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/scheduler_task.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/scheduler_thread_info.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/scoped_lock.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/scoped_ptr.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/select_interrupter.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/select_reactor.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/service_registry.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/signal_blocker.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/signal_handler.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/signal_init.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/signal_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/signal_set_service.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/socket_holder.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/socket_ops.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/socket_option.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/socket_select_interrupter.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/socket_types.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/solaris_fenced_block.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/source_location.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/static_mutex.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/std_event.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/std_fenced_block.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/std_global.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/std_mutex.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/std_static_mutex.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/std_thread.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/strand_executor_service.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/strand_service.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/string_view.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/thread.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/thread_context.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/thread_group.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/thread_info_base.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/throw_error.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/throw_exception.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/timer_queue.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/timer_queue_base.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/timer_queue_ptime.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/timer_queue_set.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/timer_scheduler.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/timer_scheduler_fwd.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/tss_ptr.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/type_traits.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/utility.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/variadic_templates.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/wait_handler.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/wait_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/win_event.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/win_fd_set_adapter.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/win_fenced_block.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/win_global.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/win_iocp_file_service.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/win_iocp_handle_read_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/win_iocp_handle_service.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/win_iocp_handle_write_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/win_iocp_io_context.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/win_iocp_null_buffers_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/win_iocp_operation.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/win_iocp_overlapped_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/win_iocp_overlapped_ptr.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/win_iocp_serial_port_service.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/win_iocp_socket_accept_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/win_iocp_socket_connect_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/win_iocp_socket_recv_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/win_iocp_socket_recvfrom_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/win_iocp_socket_recvmsg_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/win_iocp_socket_send_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/win_iocp_socket_service.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/win_iocp_socket_service_base.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/win_iocp_thread_info.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/win_iocp_wait_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/win_mutex.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/win_object_handle_service.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/win_static_mutex.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/win_thread.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/win_tss_ptr.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/winapp_thread.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/wince_thread.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/winrt_async_manager.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/winrt_async_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/winrt_resolve_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/winrt_resolver_service.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/winrt_socket_connect_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/winrt_socket_recv_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/winrt_socket_send_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/winrt_ssocket_service.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/winrt_ssocket_service_base.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/winrt_timer_scheduler.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/winrt_utils.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/winsock_init.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/work_dispatcher.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/detail/wrapped_handler.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/dispatch.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/error.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/error_code.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/allocator.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/any_executor.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/bad_executor.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/blocking.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/blocking_adaptation.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/bulk_execute.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/bulk_guarantee.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/connect.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/context.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/context_as.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/detail/as_invocable.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/detail/as_operation.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/detail/as_receiver.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/detail/bulk_sender.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/detail/submit_receiver.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/detail/void_receiver.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/execute.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/executor.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/impl/bad_executor.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/impl/receiver_invocation_error.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/invocable_archetype.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/mapping.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/occupancy.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/operation_state.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/outstanding_work.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/prefer_only.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/receiver.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/receiver_invocation_error.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/relationship.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/schedule.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/scheduler.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/sender.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/set_done.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/set_error.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/set_value.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/start.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution/submit.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/execution_context.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/executor.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/executor_work_guard.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/append.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/as_single.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/as_tuple.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/awaitable_operators.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/basic_channel.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/basic_concurrent_channel.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/cancellation_condition.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/channel.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/channel_error.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/channel_traits.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/co_spawn.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/concurrent_channel.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/coro.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/coro_traits.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/deferred.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/detail/channel_handler.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/detail/channel_message.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/detail/channel_operation.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/detail/channel_payload.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/detail/channel_receive_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/detail/channel_send_functions.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/detail/channel_send_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/detail/channel_service.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/detail/completion_handler_erasure.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/detail/coro_promise_allocator.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/detail/has_signature.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/detail/impl/channel_service.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/detail/partial_promise.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/impl/as_single.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/impl/channel_error.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/impl/coro.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/impl/parallel_group.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/impl/promise.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/impl/use_coro.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/parallel_group.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/prepend.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/promise.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/experimental/use_coro.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/file_base.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/generic/basic_endpoint.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/generic/datagram_protocol.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/generic/detail/endpoint.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/generic/detail/impl/endpoint.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/generic/raw_protocol.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/generic/seq_packet_protocol.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/generic/stream_protocol.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/handler_alloc_hook.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/handler_continuation_hook.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/handler_invoke_hook.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/high_resolution_timer.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/any_io_executor.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/append.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/as_tuple.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/awaitable.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/buffered_read_stream.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/buffered_write_stream.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/cancellation_signal.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/co_spawn.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/connect.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/connect_pipe.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/connect_pipe.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/defer.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/deferred.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/detached.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/dispatch.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/error.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/error_code.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/execution_context.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/execution_context.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/executor.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/executor.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/handler_alloc_hook.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/io_context.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/io_context.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/multiple_exceptions.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/post.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/prepend.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/read.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/read_at.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/read_until.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/redirect_error.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/serial_port_base.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/serial_port_base.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/spawn.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/src.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/system_context.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/system_context.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/system_executor.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/thread_pool.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/thread_pool.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/use_awaitable.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/use_future.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/write.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/impl/write_at.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/io_context.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/io_context_strand.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/io_service.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/io_service_strand.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/address.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/address_v4.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/address_v4_iterator.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/address_v4_range.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/address_v6.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/address_v6_iterator.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/address_v6_range.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/bad_address_cast.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/basic_endpoint.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/basic_resolver.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/basic_resolver_entry.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/basic_resolver_iterator.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/basic_resolver_query.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/basic_resolver_results.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/detail/endpoint.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/detail/impl/endpoint.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/detail/socket_option.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/host_name.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/icmp.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/impl/address.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/impl/address.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/impl/address_v4.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/impl/address_v4.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/impl/address_v6.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/impl/address_v6.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/impl/basic_endpoint.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/impl/host_name.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/impl/network_v4.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/impl/network_v4.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/impl/network_v6.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/impl/network_v6.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/multicast.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/network_v4.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/network_v6.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/resolver_base.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/resolver_query_base.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/tcp.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/udp.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/unicast.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ip/v6_only.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/is_applicable_property.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/is_contiguous_iterator.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/is_executor.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/is_read_buffered.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/is_write_buffered.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/local/basic_endpoint.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/local/connect_pair.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/local/datagram_protocol.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/local/detail/endpoint.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/local/detail/impl/endpoint.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/local/stream_protocol.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/multiple_exceptions.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/packaged_task.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/placeholders.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/posix/basic_descriptor.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/posix/basic_stream_descriptor.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/posix/descriptor.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/posix/descriptor_base.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/posix/stream_descriptor.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/post.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/prefer.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/prepend.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/query.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/random_access_file.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/read.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/read_at.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/read_until.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/readable_pipe.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/recycling_allocator.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/redirect_error.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/registered_buffer.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/require.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/require_concept.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/serial_port.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/serial_port_base.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/signal_set.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/socket_base.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/spawn.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ssl.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ssl/context.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ssl/context_base.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ssl/detail/buffered_handshake_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ssl/detail/engine.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ssl/detail/handshake_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ssl/detail/impl/engine.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ssl/detail/impl/openssl_init.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ssl/detail/io.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ssl/detail/openssl_init.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ssl/detail/openssl_types.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ssl/detail/password_callback.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ssl/detail/read_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ssl/detail/shutdown_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ssl/detail/stream_core.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ssl/detail/verify_callback.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ssl/detail/write_op.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ssl/error.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ssl/host_name_verification.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ssl/impl/context.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ssl/impl/context.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ssl/impl/error.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ssl/impl/host_name_verification.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ssl/impl/rfc2818_verification.ipp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ssl/impl/src.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ssl/rfc2818_verification.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ssl/stream.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ssl/stream_base.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ssl/verify_context.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ssl/verify_mode.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/static_thread_pool.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/steady_timer.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/strand.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/stream_file.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/streambuf.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/system_context.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/system_error.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/system_executor.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/system_timer.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/this_coro.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/thread.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/thread_pool.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/time_traits.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/bulk_execute_free.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/bulk_execute_member.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/connect_free.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/connect_member.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/equality_comparable.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/execute_free.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/execute_member.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/prefer_free.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/prefer_member.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/query_free.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/query_member.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/query_static_constexpr_member.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/require_concept_free.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/require_concept_member.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/require_free.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/require_member.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/schedule_free.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/schedule_member.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/set_done_free.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/set_done_member.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/set_error_free.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/set_error_member.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/set_value_free.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/set_value_member.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/start_free.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/start_member.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/static_query.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/static_require.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/static_require_concept.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/submit_free.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/traits/submit_member.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ts/buffer.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ts/executor.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ts/internet.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ts/io_context.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ts/net.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ts/netfwd.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ts/socket.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/ts/timer.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/unyield.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/use_awaitable.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/use_future.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/uses_executor.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/version.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/wait_traits.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/windows/basic_object_handle.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/windows/basic_overlapped_handle.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/windows/basic_random_access_handle.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/windows/basic_stream_handle.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/windows/object_handle.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/windows/overlapped_handle.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/windows/overlapped_ptr.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/windows/random_access_handle.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/windows/stream_handle.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/writable_pipe.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/write.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/write_at.hpp (100%) rename {thirdparty/asio => include/ylt/thirdparty}/asio/yield.hpp (100%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/CMakeLists.txt (100%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/Collect.h (62%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/Common.h (92%) create mode 100644 include/ylt/thirdparty/async_simple/Executor.h create mode 100644 include/ylt/thirdparty/async_simple/Future.h create mode 100644 include/ylt/thirdparty/async_simple/FutureState.h rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/IOExecutor.h (56%) create mode 100644 include/ylt/thirdparty/async_simple/LocalState.h rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/MoveWrapper.h (100%) create mode 100644 include/ylt/thirdparty/async_simple/Promise.h rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/Traits.h (69%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/Try.h (100%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/Unit.h (83%) create mode 100644 include/ylt/thirdparty/async_simple/coro/Collect.h create mode 100644 include/ylt/thirdparty/async_simple/coro/ConditionVariable.h create mode 100644 include/ylt/thirdparty/async_simple/coro/CountEvent.h rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/coro/DetachedCoroutine.h (55%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/coro/FutureAwaiter.h (57%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/coro/Generator.h (100%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/coro/Latch.h (51%) create mode 100644 include/ylt/thirdparty/async_simple/coro/Lazy.h rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/coro/Mutex.h (100%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/coro/PromiseAllocator.h (100%) create mode 100644 include/ylt/thirdparty/async_simple/coro/Semaphore.h rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/coro/SharedMutex.h (100%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/coro/Sleep.h (75%) create mode 100644 include/ylt/thirdparty/async_simple/coro/SpinLock.h rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/coro/SyncAwait.h (66%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/coro/Traits.h (75%) create mode 100644 include/ylt/thirdparty/async_simple/coro/ViaCoroutine.h rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/executors/SimpleExecutor.cpp (68%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/executors/SimpleExecutor.h (64%) create mode 100644 include/ylt/thirdparty/async_simple/executors/SimpleIOExecutor.h rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/experimental/coroutine.h (100%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/uthread/Async.h (63%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/uthread/Await.h (98%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/uthread/Collect.h (60%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/uthread/Latch.h (64%) create mode 100644 include/ylt/thirdparty/async_simple/uthread/Uthread.h rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/uthread/internal/Darwin/arm64/jump_arm64_aapcs_macho_gas.S (100%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/uthread/internal/Darwin/arm64/make_arm64_aapcs_macho_gas.S (100%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/uthread/internal/Darwin/arm64/ontop_arm64_aapcs_macho_gas.S (100%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/uthread/internal/Darwin/x86_64/jump_x86_64_sysv_macho_gas.S (100%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/uthread/internal/Darwin/x86_64/make_x86_64_sysv_macho_gas.S (100%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/uthread/internal/Darwin/x86_64/ontop_x86_64_sysv_macho_gas.S (100%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/uthread/internal/Linux/aarch64/jump_arm64_aapcs_elf_gas.S (100%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/uthread/internal/Linux/aarch64/make_arm64_aapcs_elf_gas.S (100%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/uthread/internal/Linux/aarch64/ontop_arm64_aapcs_elf_gas.S (100%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/uthread/internal/Linux/ppc64le/jump_ppc64_sysv_elf_gas.S (100%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/uthread/internal/Linux/ppc64le/make_ppc64_sysv_elf_gas.S (100%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/uthread/internal/Linux/ppc64le/ontop_ppc64_sysv_elf_gas.S (100%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/uthread/internal/Linux/x86_64/jump_x86_64_sysv_elf_gas.S (100%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/uthread/internal/Linux/x86_64/make_x86_64_sysv_elf_gas.S (100%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/uthread/internal/Linux/x86_64/ontop_x86_64_sysv_elf_gas.S (100%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/uthread/internal/thread.cc (100%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/uthread/internal/thread.h (100%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/uthread/internal/thread_impl.h (100%) rename {thirdparty/async_simple => include/ylt/thirdparty}/async_simple/util/Condition.h (69%) create mode 100644 include/ylt/thirdparty/async_simple/util/Queue.h create mode 100644 include/ylt/thirdparty/async_simple/util/ThreadPool.h rename {thirdparty/cinatra => include/ylt/thirdparty}/cinatra/coro_http_client.hpp (99%) rename {thirdparty/cinatra => include/ylt/thirdparty}/cinatra/define.h (100%) rename {thirdparty/cinatra => include/ylt/thirdparty}/cinatra/http_parser.hpp (100%) rename {thirdparty/cinatra => include/ylt/thirdparty}/cinatra/picohttpparser.h (100%) rename {thirdparty/cinatra => include/ylt/thirdparty}/cinatra/response_cv.hpp (100%) rename {thirdparty/cinatra => include/ylt/thirdparty}/cinatra/sha1.hpp (100%) rename {thirdparty/cinatra => include/ylt/thirdparty}/cinatra/uri.hpp (100%) rename {thirdparty/cinatra => include/ylt/thirdparty}/cinatra/utils.hpp (100%) rename {thirdparty/cinatra => include/ylt/thirdparty}/cinatra/websocket.hpp (100%) rename {thirdparty/cinatra => include/ylt/thirdparty}/cinatra/ws_define.h (100%) rename {thirdparty/frozen => include/ylt/thirdparty}/frozen/CMakeLists.txt (100%) rename {thirdparty/frozen => include/ylt/thirdparty}/frozen/algorithm.h (100%) rename {thirdparty/frozen => include/ylt/thirdparty}/frozen/bits/algorithms.h (100%) rename {thirdparty/frozen => include/ylt/thirdparty}/frozen/bits/basic_types.h (100%) rename {thirdparty/frozen => include/ylt/thirdparty}/frozen/bits/constexpr_assert.h (100%) rename {thirdparty/frozen => include/ylt/thirdparty}/frozen/bits/defines.h (100%) rename {thirdparty/frozen => include/ylt/thirdparty}/frozen/bits/elsa.h (100%) rename {thirdparty/frozen => include/ylt/thirdparty}/frozen/bits/elsa_std.h (100%) rename {thirdparty/frozen => include/ylt/thirdparty}/frozen/bits/exceptions.h (100%) rename {thirdparty/frozen => include/ylt/thirdparty}/frozen/bits/hash_string.h (100%) rename {thirdparty/frozen => include/ylt/thirdparty}/frozen/bits/pmh.h (100%) rename {thirdparty/frozen => include/ylt/thirdparty}/frozen/bits/version.h (100%) rename {thirdparty/frozen => include/ylt/thirdparty}/frozen/map.h (100%) rename {thirdparty/frozen => include/ylt/thirdparty}/frozen/random.h (100%) rename {thirdparty/frozen => include/ylt/thirdparty}/frozen/set.h (100%) rename {thirdparty/frozen => include/ylt/thirdparty}/frozen/string.h (100%) rename {thirdparty/frozen => include/ylt/thirdparty}/frozen/unordered_map.h (100%) rename {thirdparty/frozen => include/ylt/thirdparty}/frozen/unordered_set.h (100%) rename {thirdparty/iguana => include/ylt/thirdparty}/iguana/define.h (100%) rename {thirdparty/iguana => include/ylt/thirdparty}/iguana/detail/charconv.h (100%) rename include/{util => ylt/thirdparty/iguana/detail}/dragonbox.h (100%) rename {thirdparty/iguana => include/ylt/thirdparty}/iguana/detail/dragonbox_to_chars.h (100%) rename {thirdparty/iguana => include/ylt/thirdparty}/iguana/detail/fast_float.h (100%) rename {thirdparty/iguana => include/ylt/thirdparty}/iguana/detail/itoa.hpp (100%) rename {thirdparty/iguana => include/ylt/thirdparty}/iguana/detail/string_stream.hpp (100%) rename {thirdparty/iguana => include/ylt/thirdparty}/iguana/detail/traits.hpp (100%) rename {thirdparty/iguana => include/ylt/thirdparty}/iguana/detail/utf.hpp (100%) rename {thirdparty/iguana => include/ylt/thirdparty}/iguana/error_code.h (100%) rename {thirdparty/iguana => include/ylt/thirdparty}/iguana/json_reader.hpp (100%) rename {thirdparty/iguana => include/ylt/thirdparty}/iguana/json_util.hpp (100%) rename {thirdparty/iguana => include/ylt/thirdparty}/iguana/json_writer.hpp (100%) rename {thirdparty/iguana => include/ylt/thirdparty}/iguana/prettify.hpp (100%) rename {thirdparty/iguana => include/ylt/thirdparty}/iguana/reflection.hpp (100%) rename {thirdparty/iguana => include/ylt/thirdparty}/iguana/type_traits.hpp (100%) rename {thirdparty/iguana => include/ylt/thirdparty}/iguana/value.hpp (100%) rename {thirdparty/iguana => include/ylt/thirdparty}/iguana/xml_reader.hpp (99%) rename {thirdparty/iguana => include/ylt/thirdparty}/iguana/xml_writer.hpp (98%) rename {thirdparty/iguana => include/ylt/thirdparty}/iguana/yaml_reader.hpp (100%) rename {thirdparty/iguana => include/ylt/thirdparty}/iguana/yaml_util.hpp (100%) rename {thirdparty/iguana => include/ylt/thirdparty}/iguana/yaml_writer.hpp (100%) rename {thirdparty/iguana => include/ylt}/thirdparty/rapidxml/rapidxml.hpp (100%) rename {thirdparty/iguana => include/ylt}/thirdparty/rapidxml/rapidxml_print.hpp (100%) create mode 100644 include/ylt/util/concurrentqueue.h rename {thirdparty/iguana/iguana/detail => include/ylt/util}/dragonbox.h (99%) rename include/{ => ylt}/util/dragonbox_to_chars.h (97%) rename include/{ => ylt}/util/expected.hpp (99%) rename include/{ => ylt}/util/function_name.h (90%) rename include/{ => ylt}/util/magic_names.hpp (98%) rename include/{ => ylt}/util/meta_string.hpp (99%) rename include/{ => ylt}/util/string_finder.hpp (98%) rename include/{ => ylt}/util/time_util.h (100%) rename include/{ => ylt}/util/type_traits.h (99%) rename include/{ => ylt}/util/utils.hpp (89%) delete mode 100644 src/coro_file/examples/CMakeLists.txt delete mode 100644 src/coro_file/tests/CMakeLists.txt delete mode 100644 src/coro_http/CMakeLists.txt create mode 100644 src/coro_io/examples/CMakeLists.txt rename src/{coro_file => coro_io}/examples/main.cpp (95%) create mode 100644 src/coro_io/tests/CMakeLists.txt rename src/{coro_file => coro_io}/tests/main.cpp (90%) rename src/{coro_file => coro_io}/tests/test_corofile.cpp (98%) delete mode 100644 src/coro_rpc/CMakeLists.txt rename src/coro_rpc/benchmark/{client => }/client.cpp (99%) delete mode 100644 src/coro_rpc/benchmark/client/CMakeLists.txt rename src/coro_rpc/benchmark/{client => }/data_gen.cpp (95%) rename src/coro_rpc/benchmark/{server/coro_server.cpp => server.cpp} (93%) delete mode 100644 src/coro_rpc/benchmark/server/CMakeLists.txt create mode 100644 src/coro_rpc/examples/base_examples/CMakeLists.txt rename src/coro_rpc/examples/{channel/main.cpp => base_examples/channel.cpp} (88%) rename src/coro_rpc/examples/{helloworld/client/main.cpp => base_examples/client.cpp} (87%) rename src/coro_rpc/examples/{client_pool/main.cpp => base_examples/client_pool.cpp} (89%) rename src/coro_rpc/examples/{client_pools/main.cpp => base_examples/client_pools.cpp} (84%) rename src/coro_rpc/examples/{helloworld/server => base_examples}/rpc_service.cpp (74%) rename src/coro_rpc/examples/{helloworld/rpc_service => base_examples}/rpc_service.h (86%) rename src/coro_rpc/examples/{helloworld/server/main.cpp => base_examples/server.cpp} (89%) delete mode 100644 src/coro_rpc/examples/channel/CMakeLists.txt delete mode 100644 src/coro_rpc/examples/client_pool/CMakeLists.txt delete mode 100644 src/coro_rpc/examples/client_pools/CMakeLists.txt rename src/coro_rpc/examples/file_transfer/{file_client/main.cpp => file_client.cpp} (97%) rename src/coro_rpc/examples/file_transfer/{file_server/main.cpp => file_server.cpp} (79%) rename src/coro_rpc/examples/file_transfer/{file_server => }/rpc_service.cpp (98%) rename src/coro_rpc/examples/file_transfer/{rpc_service => }/rpc_service.h (91%) delete mode 100644 src/coro_rpc/examples/helloworld/BUILD.bazel delete mode 100644 src/coro_rpc/examples/helloworld/CMakeLists.txt delete mode 100644 src/coro_rpc/examples/helloworld/concurrency_clients/main.cpp delete mode 100644 src/coro_rpc/examples/nested_rpc_call/BUILD.bazel delete mode 100644 src/coro_rpc/examples/nested_rpc_call/CMakeLists.txt delete mode 100644 src/coro_rpc/examples/nested_rpc_call/client/main.cpp delete mode 100644 src/coro_rpc/examples/nested_rpc_call/rpc_service/rpc_service.h delete mode 100644 src/coro_rpc/examples/nested_rpc_call/server/main.cpp rename src/coro_rpc/tests/{rpc_service.cpp => rpc_api.cpp} (95%) delete mode 100644 src/easylog/CMakeLists.txt rename {thirdparty/doctest => src/include}/doctest.h (100%) delete mode 100644 src/struct_json/CMakeLists.txt delete mode 100644 src/struct_pack/CMakeLists.txt rename src/struct_pack/examples/{serialize => }/serialize.cpp (97%) delete mode 100644 src/struct_pack/examples/serialize/CMakeLists.txt delete mode 100644 src/struct_pb/examples/main.cpp delete mode 100644 src/struct_xml/CMakeLists.txt delete mode 100644 src/struct_yaml/CMakeLists.txt create mode 100644 src/util/tests/CMakeLists.txt rename src/{coro_rpc/tests/test_util.cpp => util/tests/test_meta_string.cpp} (98%) rename src/{coro_rpc => util}/tests/test_time_util.cpp (96%) rename src/coro_file/CMakeLists.txt => thirdparty (100%) delete mode 100644 thirdparty/BUILD.bazel delete mode 100644 thirdparty/CMakeLists.txt delete mode 100644 thirdparty/async_simple/.clang-format delete mode 100644 thirdparty/async_simple/.github/ISSUE_TEMPLATE.md delete mode 100644 thirdparty/async_simple/.github/PULL_REQUEST_TEMPLATE.md delete mode 100644 thirdparty/async_simple/.github/workflows/PerformanceCommit.yml delete mode 100644 thirdparty/async_simple/.github/workflows/PerformancePR.yml delete mode 100644 thirdparty/async_simple/.github/workflows/bazel.yml delete mode 100644 thirdparty/async_simple/.github/workflows/clang-format.yml delete mode 100644 thirdparty/async_simple/.github/workflows/cmake.yml delete mode 100644 thirdparty/async_simple/.github/workflows/cmake_gcc.yml delete mode 100644 thirdparty/async_simple/.github/workflows/conan.yml delete mode 100644 thirdparty/async_simple/.github/workflows/macosx.yml delete mode 100644 thirdparty/async_simple/.github/workflows/static.yml delete mode 100644 thirdparty/async_simple/.github/workflows/windows.yml delete mode 100644 thirdparty/async_simple/.gitignore delete mode 100644 thirdparty/async_simple/async_simple/Executor.h delete mode 100644 thirdparty/async_simple/async_simple/Future.h delete mode 100644 thirdparty/async_simple/async_simple/FutureState.h delete mode 100644 thirdparty/async_simple/async_simple/LocalState.h delete mode 100644 thirdparty/async_simple/async_simple/Promise.h delete mode 100644 thirdparty/async_simple/async_simple/coro/Collect.h delete mode 100644 thirdparty/async_simple/async_simple/coro/ConditionVariable.h delete mode 100644 thirdparty/async_simple/async_simple/coro/CountEvent.h delete mode 100644 thirdparty/async_simple/async_simple/coro/Lazy.h delete mode 100644 thirdparty/async_simple/async_simple/coro/Semaphore.h delete mode 100644 thirdparty/async_simple/async_simple/coro/SpinLock.h delete mode 100644 thirdparty/async_simple/async_simple/coro/ViaCoroutine.h delete mode 100644 thirdparty/async_simple/async_simple/executors/SimpleIOExecutor.h delete mode 100644 thirdparty/async_simple/async_simple/uthread/Uthread.h delete mode 100644 thirdparty/async_simple/async_simple/util/Queue.h delete mode 100644 thirdparty/async_simple/async_simple/util/ThreadPool.h delete mode 100644 thirdparty/get_clean_async_simple.sh diff --git a/.github/workflows/ubuntu_clang.yml b/.github/workflows/ubuntu_clang.yml index 9e047198..a250292c 100644 --- a/.github/workflows/ubuntu_clang.yml +++ b/.github/workflows/ubuntu_clang.yml @@ -95,7 +95,7 @@ jobs: mode: [ Release, Debug ] libcxx: [ OFF ] io_uring: [ ON ] - case_name: [ test_corofile ] + case_name: [ coro_io_test ] runs-on: ubuntu-22.04 diff --git a/.github/workflows/ubuntu_gcc.yml b/.github/workflows/ubuntu_gcc.yml index 9340d9c3..1229d328 100644 --- a/.github/workflows/ubuntu_gcc.yml +++ b/.github/workflows/ubuntu_gcc.yml @@ -92,7 +92,7 @@ jobs: matrix: mode: [Release, Debug] io_uring: [ ON ] - case_name: [ test_corofile ] + case_name: [ coro_io_test ] runs-on: ubuntu-22.04 steps: diff --git a/BUILD.bazel b/BUILD.bazel index 57c6b469..d291c09d 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -2,90 +2,12 @@ load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library") package(default_visibility = ["//visibility:public"]) cc_library( - name = "struct_pack", + name = "ylt", hdrs = glob([ - "include/util/expected.hpp", - "include/struct_pack/struct_pack/*.hpp", - "include/struct_pack/struct_pack/*.h", - ]) + ["include/struct_pack/struct_pack.hpp"], - include_prefix = "include", - includes = ["include"], - visibility = ["//visibility:public"], -) - -cc_library( - name = "struct_pb", - hdrs = glob([ - "include/struct_pb/struct_pb/*.hpp", - ]) + ["include/struct_pb/struct_pb.hpp"], - include_prefix = "include", - includes = ["include"], - visibility = ["//visibility:public"], -) - -cc_library( - name = "struct_json", - hdrs = glob([ - "include/struct_json/*.h", + "include/**", + "src/include/**" ]), - include_prefix = "include", - includes = ["include"], - visibility = ["//visibility:public"], - deps = [ - "//thirdparty:frozen", - "//thirdparty:iguana", - ], -) - -cc_library( - name = "easylog", - hdrs = glob([ - "include/easylog/*.hpp", - "include/easylog/*.h", - ]) + [ - "include/util/dragonbox.h", - "include/util/dragonbox_to_chars.h", - "include/util/meta_string.hpp", - "include/util/type_traits.h", - ], - include_prefix = "include", - includes = ["include"], + includes = ["include", "include/ylt/thirdparty","src/include"], + linkopts = ["-lpthread"], visibility = ["//visibility:public"], ) - -cc_library( - name = "coro_rpc", - hdrs = glob([ - "include/coro_rpc/**/*.hpp", - "include/coro_io/*.hpp", - "include/util/*.hpp", - "include/util/*.h", - ]), - include_prefix = "include", - includes = ["include"], - visibility = ["//visibility:public"], - deps = [ - "//:easylog", - "//:struct_pack", - "//thirdparty:asio", - "//thirdparty:async_simple", - ], -) - -cc_library( - name = "coro_http", - hdrs = glob([ - "include/coro_http/*.h", - "include/coro_io/*.hpp", - "include/util/*.h", - "include/util/*.hpp", - ]), - include_prefix = "include", - includes = ["include"], - visibility = ["//visibility:public"], - deps = [ - "//thirdparty:asio", - "//thirdparty:async_simple", - "//thirdparty:cinatra", - ], -) diff --git a/CMakeLists.txt b/CMakeLists.txt index 64017c62..bbb522c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,21 +1,27 @@ cmake_minimum_required(VERSION 3.15) project(yaLanTingLibs - VERSION 1.0.0 + VERSION 0.2.0 DESCRIPTION "yaLanTingLibs" HOMEPAGE_URL "https://github.com/alibaba/yalantinglibs" LANGUAGES CXX ) +# add include path include_directories(include) +include_directories(include/ylt/thirdparty) +include_directories(src/include) -#the thread library of the system. find_package(Threads REQUIRED) +link_libraries(Threads::Threads) include(cmake/utils.cmake) include(cmake/struct_pb.cmake) include(cmake/build.cmake) -include(cmake/platform.cmake) -include(cmake/dependency.cmake) include(cmake/develop.cmake) include(cmake/install.cmake) -include(cmake/module.cmake) +# add project config, such as enable_ssl. +include(cmake/config.cmake) +# add project's source such as unit test, example & benchmark +include(cmake/subdirectory.cmake) + + diff --git a/NOTICE b/NOTICE index 2bf9b1d2..9231e0d4 100644 --- a/NOTICE +++ b/NOTICE @@ -9,7 +9,7 @@ This section summarizes those components and their licenses. Apache Software Foundation License 2.0 -------------------------------------- -struct_pack/struct_pack/md5_constexpr.hpp +ylt/struct_pack/texpr.hpp BSD 3-Clause "New" or "Revised" License -------------------------------------- @@ -22,7 +22,7 @@ Creative Commons Zero v1.0 Universal License test/doctest.h -include/struct_pack/struct_pack/tuplet.hpp +include/ylt/struct_pack/pp Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at ) diff --git a/README.md b/README.md index b5f988e7..7bb06c50 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,78 @@ The target of yaLanTingLibs: provide very easy and high performance C++20 librar | macOS Monterey 12 (AppleClang 14.0.0.14000029) | ![macos-clang](https://github.com/alibaba/yalantinglibs/actions/workflows/mac.yml/badge.svg?branch=main) | | Windows Server 2022 (MSVC 19.33.31630.0) | ![win-msvc](https://github.com/alibaba/yalantinglibs/actions/workflows/windows.yml/badge.svg?branch=main) | + +# Quick Start +## compiler requirements + +make sure you have such compilers: +- clang11 and libstdc++-8 above; +- or gcc10 and g++10 above; +- msvc 14.29 above; + +## Install & Compile + +Yalantinglibs is a head-only library. You can just copy `./include/ylt` directory into your project. But we suggest you use cmake to install it. + +1. clone repo + +```shell +git clone https://github.com/alibaba/yalantinglibs.git +cd yalantinglibs +mkdir build +cd build +``` + +2. build & test + +- We suggest you compile the example and test the code first: + +```shell +cmake .. +cmake --build . --config debug # add -j, if you have enough memory to parallel compile +ctest . # run tests +``` + +You can see the test/example/benchmark executable file in `./build/output/`. + +- Or you can just skip build example/test/benchmark: + +```shell +# You can use those option to skip build unit-test & benchmark & example: +cmake .. -DBUILD_EXAMPLES=OFF -DBUILD_BENCHMARK=OFF -DBUILD_UNIT_TESTS=OFF +cmake --build . +``` + +3. install + +```shell +cmake --install . # --prefix ./user_defined_install_path +``` + +4. start develop + +- Use Cmake: + +After install ylt, copy then open the directory `src/*/examples`, then: + +```shell +mkdir build +cd build +cmake .. +cmake --build . +``` + +- Compile Manually: + +1. Add `include/`'s parent to include path(skip it if you have install ylt into system default path) +2. Add `include/ylt/thirdparty` to include path(skip it if you have install thirdparty independency by the cmake option -DINSTALL_INDEPENDENT_THIRDPARTY=ON) +3. If you use any header with `coro_` prefix, add link option `-pthread` in linux and add option `-fcoroutines` when you use `g++` +4. That's all. You can alos find other options in `example/cmakelist.txt`. + +- More Details: +For more details, except `example/cmakelist.txt`, You can also see the cmake file [here](https://github.com/alibaba/yalantinglibs/tree/main/CmakeLists.txt) and [there](https://github.com/alibaba/yalantinglibs/tree/main/cmake). + +# Introduction ## coro_rpc Very easy-to-use, coroutine-based, high performance rpc framework with C++20, more than 0.4M QPS per thread in pipeline mode. coro_rpc is a header only library. @@ -48,7 +120,7 @@ inline std::string_view echo(std::string_view str) { return str; } ```cpp #include "rpc_service.hpp" -#include +#include int main() { coro_rpc_server server(/*thread_num =*/10, /*port =*/9000); @@ -61,7 +133,7 @@ int main() { ```cpp #include "rpc_service.hpp" -#include +#include Lazy test_client() { coro_rpc_client client; @@ -120,8 +192,8 @@ reflection-based json lib, very easy to do struct to json and json to struct. ### quick example ```cpp -#include "struct_json/json_reader.h" -#include "struct_json/json_writer.h" +#include "ylt/struct_json/json_reader.h" +#include "ylt/struct_json/json_writer.h" struct person { std::string name; @@ -144,8 +216,8 @@ reflection-based xml lib, very easy to do struct to xml and xml to struct. ### quick example ```cpp -#include "struct_xml/xml_reader.h" -#include "struct_xml/xml_writer.h" +#include "ylt/struct_xml/xml_reader.h" +#include "ylt/struct_xml/xml_writer.h" struct person { std::string name; @@ -178,8 +250,8 @@ reflection-based yaml lib, very easy to do struct to yaml and yaml to struct. ### quick example ```cpp -#include "struct_yaml/yaml_reader.h" -#include "struct_yaml/yaml_writer.h" +#include "ylt/struct_yaml/yaml_reader.h" +#include "ylt/struct_yaml/yaml_writer.h" struct person { std::string name; @@ -210,7 +282,7 @@ coro_http is a C++20 coroutine http(https) client, include: get/post, websocket, ### get/post ```c++ -#include "coro_http/coro_http_client.h" +#include "ylt/coro_http/coro_http_client.hpp" using namespace coro_http; async_simple::coro::Lazy get_post(coro_http_client &client) { @@ -283,88 +355,74 @@ async_simple::coro::Lazy download_files(coro_http_client &client) { A C++ 20 coroutine library offering simple, light-weight and easy-to-use components to write asynchronous codes. See [async_simple](https://github.com/alibaba/async_simple) -## compiler requirements +# Details -make sure you have such compilers: -- clang11 and libstdc++-8 above; -- or gcc10 and g++10 above; -- msvc 14.29 或更高版本。 +## CMAKE OPTION -## Quick Start +These CMake options is used for yalantinglibs developing/installing itself. They are not effected for your project, because ylt is a head-only. -- clone repo +### INSTALL OPTION -```shell -git clone https://github.com/alibaba/yalantinglibs.git -``` +|option|default value| +|----------|------------| +|INSTALL_THIRDPARTY|ON| +|INSTALL_INDEPENDENT_THIRDPARTY|OFF| -- build, test & install (linux/macos) +### ylt develop option -```shell -cd yalantinglibs -mkdir build && cd build -cmake .. -# You can use those option to skip build unit-test & benchmark & example: -# cmake .. -DBUILD_EXAMPLES=OFF -DBUILD_BENCHMARK=OFF -DBUILD_UNIT_TESTS=OFF -make # if your machine has enough memory, use `make -j` to speed up -ctest . # run tests -make install -``` +|option|default value| +|----------|------------| +|BUILD_EXAMPLES|ON| +|BUILD_BENCHMARK|ON| +|BUILD_UNIT_TESTS|ON| +|COVERAGE_TEST|OFF| +|GENERATE_BENCHMARK_DATA|OFF| +|CORO_RPC_USE_OTHER_RPC|ON| -- build & test( windows) +### ylt config option -You can use the IDE which support CMake to build & test the source, such as Visual Studio/Clion/Visual Studio Code. +These option maybe useful for your project. If you want to enable it in your project, see the cmake code [here](https://github.com/alibaba/yalantinglibs/tree/main/cmake/config.cmake) -- start your coding +|option|default value| +|----------|------------| +|ENABLE_SSL|OFF| +|ENABLE_PMR|OFF| +|ENABLE_IO_URING|OFF| +|ENABLE_FILE_IO_URING|OFF| +|ENABLE_STRUCT_PACK_UNPORTABLE_TYPE|OFF| +|ENABLE_STRUCT_PACK_OPTIMIZE|OFF| -Here is the sample code, you can start your project on this. +## Thirdparty Dependency + +In default, yalantinglibs will install thirdparty librarys in `ylt/thirdparty`. You need add it to include path when compile. + +If you don't want to install the thirdparty librarys, you can turn off cmake option `-DINSTALL_THIRDPARTY=OFF`. +If you want to install the thirdparty independence(direct install it in system include path so that you don't need add `ylt/thirdparty` to include path), you can use turn on cmake option `-DINSTALL_INDEPENDENT_THIRDPARTY=ON`. + +Here are the thirdparty libraries we used(Although async_simple is a part of ylt, it open source first, so we import it as a independence thirdparty library). + +### coro_io + +- [asio](https://think-async.com/Asio) +- [async_simple](https://github.com/alibaba/async_simple) +- [openssl](https://www.openssl.org/) (optional) ### coro_rpc -```shell -cd yalantinglibs/src/coro_rpc/examples/helloworld -mkdir build && cd build -cmake .. -make -# For more detail, see Cmakelist.txt in helloworld. -``` +- [asio](https://think-async.com/Asio) +- [async_simple](https://github.com/alibaba/async_simple) +- [openssl](https://www.openssl.org/) (optional) -### struct_pack +### coro_http -TODO +- [asio](https://think-async.com/Asio) +- [async_simple](https://github.com/alibaba/async_simple) +- [cinatra](https://github.com/qicosmos/cinatra) -## Benchmark +### easylog -options: +No dependency. -```bash -./benchmark_client # [threads = hardware counts] [client_pre_thread = 20] [pipeline_size = 1] [host = 127.0.0.1] [port = 9000] [test_data_path = ./test_data/echo_test] [test_seconds = 30] [warm_up_seconds = 5] -``` - -## Build Options - -| option | description | default | -| ----------------- | ------------------------------------------------ | ------- | -| CMAKE_BUILD_TYPE | build type | Release | -| BUILD_WITH_LIBCXX | Build with libc++ | OFF | -| BUILD_EXAMPLES | Build examples | ON | -| BUILD_BENCHMARK | Build benchmark | ON | -| BUILD_UNIT_TESTS | Build unit test | ON | -| USE_CONAN | Use conan package manager to handle dependencies | OFF | -| ENABLE_SSL | Enable ssl support | OFF | -| ENABLE_IO_URING | Enable io_uring support | OFF | - -## Dependencies - -We use doctest for unit test. -All third-party dependencies are put in include/thirdparty. - -### coro_rpc - -- [struct_pack](https://github.com/alibaba/yalantinglibs) -- [easylog](https://github.com/alibaba/yalantinglibs) -- [asio](https://github.com/chriskohlhoff/asio) -- openssl (optional) ### struct_pack No dependency. @@ -373,26 +431,40 @@ No dependency. - [iguana](https://github.com/qicosmos/iguana) -### struct_pb +### struct_pb (optional) -TODO +- [protobuf](https://protobuf.dev/) -### easylog +### struct_xml -No dependency. +- [iguana](https://github.com/qicosmos/iguana) -# How to generate document +### struct_yaml + +- [iguana](https://github.com/qicosmos/iguana) + +## Benchmark + +### coro_rpc +options: + +```bash +./benchmark_client # [threads = hardware counts] [client_pre_thread = 20] [pipeline_size = 1] [host = 127.0.0.1] [port = 9000] [test_data_path = ./test_data/echo_test] [test_seconds = 30] [warm_up_seconds = 5] +``` + + +## How to generate document see [Build Website](https://github.com/alibaba/yalantinglibs/blob/main/website/README.md) -# How to Contribute +## How to Contribute 1. Create an issue in the issue template. 2. Run tests and `git-clang-format HEAD^` locally for the change. 3. Create a PR, fill in the PR template. 4. Choose one or more reviewers from contributors: (e.g., qicosmos, poor-circle, PikachuHyA). 5. Get approved and merged. -# License +## License yaLanTingLibs is distributed under the Apache License (Version 2.0) This product contains various third-party components under other open-source licenses. diff --git a/cmake/build.cmake b/cmake/build.cmake index e539f807..d4c3bd54 100644 --- a/cmake/build.cmake +++ b/cmake/build.cmake @@ -1,4 +1,5 @@ # Compile Standard +message(STATUS "-------------COMPILE Setting-------------") set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) message(STATUS "CXX Standard: ${CMAKE_CXX_STANDARD}") @@ -11,23 +12,47 @@ message(STATUS "Build type: ${CMAKE_BUILD_TYPE}") # libc++ or libstdc++&clang option(BUILD_WITH_LIBCXX "Build with libc++" OFF) +message(STATUS "BUILD_WITH_LIBCXX: ${BUILD_WITH_LIBCXX}") if(BUILD_WITH_LIBCXX AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") - message(STATUS "Build with libc++") else() - message(STATUS "Build with libstdc++") +endif() + +# force use lld if your compiler is clang + +# When using coro_rpc_client to send request, only remote function declarations are required. +# In the examples, RPC function declaration and definition are divided. +# However, clang + ld(gold linker) + '-g' will report 'undefined reference to xxx'. +# So you can use lld when compiler is clang by this code: +if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") +add_link_options(-fuse-ld=lld) endif() # ccache option(USE_CCACHE "use ccache to faster compile when develop" OFF) +message(STATUS "USE_CCACHE: ${USE_CCACHE}") if (USE_CCACHE) find_program(CCACHE_FOUND ccache) if (CCACHE_FOUND) set(CMAKE_CXX_COMPILER_LAUNCHER ccache) set(CMAKE_C_COMPILER_LAUNCHER ccache) #set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) # ccache for link is useless - message(STATUS "ccache found") - else () - message(WARNING "ccache not found :you'd better use ccache to faster compile if you are developer") endif () endif () + +# --------------------- GCC +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcoroutines") + #-ftree-slp-vectorize with coroutine cause link error. disable it util gcc fix. + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-tree-slp-vectorize") +endif() +# --------------------- Clang + +# --------------------- Msvc +# Resolves C1128 complained by MSVC: number of sections exceeded object file format limit: compile with /bigobj. +add_compile_options("$<$:/bigobj>") +# Resolves C4737 complained by MSVC: C4737: Unable to perform required tail call. Performance may be degraded. "Release-Type only" +if(CMAKE_BUILD_TYPE STREQUAL "Release") +add_compile_options("$<$:/EHa>") +endif() + diff --git a/cmake/config.cmake b/cmake/config.cmake new file mode 100644 index 00000000..90a1207e --- /dev/null +++ b/cmake/config.cmake @@ -0,0 +1,55 @@ +message(STATUS "-------------PROJECT SETTING-------------") +option(ENABLE_SSL "Enable ssl support" ON) +message(STATUS "ENABLE_SSL: ${ENABLE_SSL}") +if (ENABLE_SSL) + find_package(OpenSSL REQUIRED) + add_compile_definitions(YLT_ENABLE_SSL) + link_libraries(OpenSSL::SSL OpenSSL::Crypto) +endif () + +option(ENABLE_PMR "Enable pmr support" OFF) +message(STATUS "ENABLE_PMR: ${ENABLE_PMR}") +if (ENABLE_PMR) + add_compile_definitions(YLT_ENABLE_PMR IGUANA_ENABLE_PMR) +endif () + +option(ENABLE_IO_URING "Enable io_uring" OFF) +message(STATUS "ENABLE_IO_URING: ${ENABLE_IO_URING}") +if (ENABLE_IO_URING) + find_package(uring) + if (NOT URING_FOUND) + message(STATUS "liburing not found, the io_uring is disable") + else() + message(STATUS "Use IO_URING for all I/O in linux") + add_compile_definitions(ASIO_HAS_IO_URING ASIO_DISABLE_EPOLL ASIO_HAS_FILE YLT_ENABLE_FILE_IO_URING) + add_link_options(-luring) + endif() +endif() + +option(ENABLE_FILE_IO_URING "enable file io_uring" OFF) +if (NOT ENABLE_IO_URING) + message(STATUS "ENABLE_FILE_IO_URING: ${YLT_ENABLE_FILE_IO_URING}") +endif() +if(ENABLE_FILE_IO_URING) + if (NOT ENABLE_IO_URING) + if (NOT URING_FOUND) + message(STATUS "liburing not found, the file io_uring is disable") + else() + message(STATUS "Enable io_uring for file I/O in linux") + add_compile_definitions(ASIO_HAS_IO_URING ASIO_HAS_FILE YLT_ENABLE_FILE_IO_URING) + add_link_options(-luring) + endif() + endif() +endif() + +option(ENABLE_STRUCT_PACK_UNPORTABLE_TYPE "enable struct_pack unportable type(like wchar_t)" OFF) +message(STATUS "ENABLE_STRUCT_PACK_UNPORTABLE_TYPE: ${ENABLE_STRUCT_PACK_UNPORTABLE_TYPE}") +if(ENABLE_STRUCT_PACK_UNPORTABLE_TYPE) + add_compile_definitions(STRUCT_PACK_ENABLE_UNPORTABLE_TYPE) +endif() + +option(ENABLE_STRUCT_PACK_OPTIMIZE "enable struct_pack optimize(but cost more compile time)" OFF) +message(STATUS "ENABLE_STRUCT_PACK_OPTIMIZE: ${ENABLE_STRUCT_PACK_OPTIMIZE}") +if(ENABLE_STRUCT_PACK_OPTIMIZE) + add_compile_definitions(ENABLE_STRUCT_PACK_OPTIMIZE) +endif() \ No newline at end of file diff --git a/cmake/dependency.cmake b/cmake/dependency.cmake deleted file mode 100644 index 36d42a1f..00000000 --- a/cmake/dependency.cmake +++ /dev/null @@ -1,8 +0,0 @@ -# 3rd-party package load -option(USE_CONAN "Use conan package manager" OFF) -if(USE_CONAN) - message(STATUS "Use conan package manager") - find_package(asio REQUIRED) -else() - add_subdirectory(${yaLanTingLibs_SOURCE_DIR}/thirdparty) -endif() diff --git a/cmake/develop.cmake b/cmake/develop.cmake index 66526212..2daf3b31 100644 --- a/cmake/develop.cmake +++ b/cmake/develop.cmake @@ -1,17 +1,22 @@ +message(STATUS "-------------DEVELOP SETTING-------------") # extra option(BUILD_EXAMPLES "Build examples" ON) +message(STATUS "BUILD_EXAMPLES: ${BUILD_EXAMPLES}") # bench test option(BUILD_BENCHMARK "Build benchmark" ON) +message(STATUS "BUILD_BENCHMARK: ${BUILD_BENCHMARK}") # unit test option(BUILD_UNIT_TESTS "Build unit tests" ON) +message(STATUS "BUILD_UNIT_TESTS: ${BUILD_UNIT_TESTS}") if(BUILD_UNIT_TESTS) enable_testing() endif() # coverage test option(COVERAGE_TEST "Build with unit test coverage" OFF) +message(STATUS "COVERAGE_TEST: ${COVERAGE_TEST}") if(COVERAGE_TEST) if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage --coverage") @@ -20,6 +25,15 @@ if(COVERAGE_TEST) endif() endif() +# generator benchmark test data +option(GENERATE_BENCHMARK_DATA "Generate benchmark data" ON) +message(STATUS "GENERATE_BENCHMARK_DATA: ${GENERATE_BENCHMARK_DATA}") + + +# Enable coro_rpc user define protocol example +option(CORO_RPC_USE_OTHER_RPC "coro_rpc extend to support other rpc" OFF) +message(STATUS "CORO_RPC_USE_OTHER_RPC: ${CORO_RPC_USE_OTHER_RPC}") + # Enable address sanitizer option(ENABLE_SANITIZER "Enable sanitizer(Debug+Gcc/Clang/AppleClang)" ON) if(ENABLE_SANITIZER AND NOT MSVC) @@ -30,8 +44,6 @@ if(ENABLE_SANITIZER AND NOT MSVC) else() message(WARNING "sanitizer is no supported with current tool-chains") endif() - else() - message(WARNING "Sanitizer supported only for debug type") endif() endif() diff --git a/cmake/install.cmake b/cmake/install.cmake index 9d79412a..24c0d0e3 100644 --- a/cmake/install.cmake +++ b/cmake/install.cmake @@ -1,4 +1,8 @@ -# install public header files +message(STATUS "-------------INSTALL SETTING-------------") +option(INSTALL_THIRDPARTY "Install thirdparty" ON) +message(STATUS "INSTALL_THIRDPARTY: " ${INSTALL_THIRDPARTY}) +option(INSTALL_INDEPENDENT_THIRDPARTY "Install independent thirdparty" ON) + include(CMakePackageConfigHelpers) write_basic_package_version_file( "${yaLanTingLibs_BINARY_DIR}/cmake/yalantinglibsConfigVersion.cmake" @@ -7,41 +11,30 @@ write_basic_package_version_file( ) set(ConfigPackageLocation lib/cmake/yalantinglibs) -configure_file(cmake/yalantinglibsConfig.cmake.in - "${CMAKE_CURRENT_BINARY_DIR}/cmake/yalantinglibsConfig.cmake" - COPYONLY - ) -#install(DIRECTORY "${yaLanTingLibs_SOURCE_DIR}/include/" DESTINATION include/yalantinglibs) -install( - FILES - "${CMAKE_CURRENT_BINARY_DIR}/cmake/yalantinglibsConfig.cmake" - "${yaLanTingLibs_BINARY_DIR}/cmake/yalantinglibsConfigVersion.cmake" - DESTINATION ${ConfigPackageLocation} -) -function(ylt_install target) - cmake_parse_arguments(ylt_install_lib " " "NAME" "EXPORT" ${ARGN}) - set(_export_name ${target}Targets) - if (ylt_install_lib_NAME) - set(_export_name ${ylt_install_lib_NAME}) - endif () - install( - TARGETS ${target} - EXPORT ${_export_name} - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - RUNTIME DESTINATION bin - ) - include(CMakePackageConfigHelpers) - write_basic_package_version_file( - ${target}ConfigVersion.cmake - VERSION ${yaLanTingLibs_VERSION} - COMPATIBILITY SameMajorVersion - ) - install( - EXPORT ${_export_name} - FILE ${target}Targets.cmake - NAMESPACE yalantinglibs:: - DESTINATION ${ConfigPackageLocation} - ) -endfunction() \ No newline at end of file +add_library(yalantinglibs INTERFACE) +install(TARGETS yalantinglibs + EXPORT yalantinglibsTargets + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + RUNTIME DESTINATION bin + ) +install(EXPORT yalantinglibsTargets + FILE yalantinglibsConfig.cmake + NAMESPACE yalantinglibs:: + DESTINATION ${ConfigPackageLocation} + ) + +install(DIRECTORY "${yaLanTingLibs_SOURCE_DIR}/include/" DESTINATION include REGEX "${yaLanTingLibs_SOURCE_DIR}/include/ylt/thirdparty" EXCLUDE) + +if (INSTALL_THIRDPARTY) + message(STATUS "INSTALL_INDEPENDENT_THIRDPARTY: " ${INSTALL_INDEPENDENT_THIRDPARTY}) + if (INSTALL_INDEPENDENT_THIRDPARTY) + install(DIRECTORY "${yaLanTingLibs_SOURCE_DIR}/include/ylt/thirdparty/" DESTINATION include) + else() + install(DIRECTORY "${yaLanTingLibs_SOURCE_DIR}/include/ylt/thirdparty/" DESTINATION include/ylt/thirdparty) + target_include_directories(yalantinglibs INTERFACE + $ + ) + endif() +endif() \ No newline at end of file diff --git a/cmake/module.cmake b/cmake/module.cmake deleted file mode 100644 index ed8290ae..00000000 --- a/cmake/module.cmake +++ /dev/null @@ -1,42 +0,0 @@ -# module-list -set(yLT_ALL_PROJECTS "struct_pack;struct_pb;struct_json;struct_xml;struct_yaml;coro_rpc;easylog;coro_http;coro_file") -# separate -option(Build_ylt_struct_pack "Build struct_pack" ON) -option(Build_ylt_struct_pb "Build struct_pb" ON) -option(Build_ylt_struct_json "Build struct_json" ON) -option(Build_ylt_struct_xml "Build struct_xml" ON) -option(Build_ylt_struct_yaml "Build struct_yaml" ON) -option(Build_ylt_coro_rpc "Build coro_rpc" ON) -option(Build_ylt_easylog "Build easylog" ON) -option(Build_ylt_coro_http "Build coro_http" ON) -option(Build_ylt_coro_file "Build coro_file" ON) - -foreach (proj ${yLT_ALL_PROJECTS}) - set(build_proj "Build_ylt_${proj}") - if (${build_proj}) - list(APPEND yLT_ENABLE_PROJECTS ${proj}) - endif () -endforeach () - -message(STATUS "yLT_ENABLE_PROJECTS: ${yLT_ENABLE_PROJECTS}") - -foreach (module ${yLT_ENABLE_PROJECTS}) - set(module_location ${yaLanTingLibs_SOURCE_DIR}/src/${module}) - if (EXISTS ${module_location}) - add_subdirectory(${module_location}) - if ("${yaLanTingLibs_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") - if (BUILD_UNIT_TESTS AND EXISTS "${module_location}/tests") - message(STATUS "ylt_add_tests_${module}") - add_subdirectory(${module_location}/tests) - endif () - if (BUILD_BENCHMARK AND EXISTS "${module_location}/benchmark") - message(STATUS "ylt_add_benchmark_${module}") - add_subdirectory(${module_location}/benchmark) - endif () - if (BUILD_EXAMPLES AND EXISTS "${module_location}/examples") - message(STATUS "ylt_add_example_${module}") - add_subdirectory(${module_location}/examples) - endif () - endif () - endif () -endforeach () diff --git a/cmake/platform.cmake b/cmake/platform.cmake deleted file mode 100644 index 57cdb830..00000000 --- a/cmake/platform.cmake +++ /dev/null @@ -1,15 +0,0 @@ -# --------------------- Gcc -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcoroutines") - #-ftree-slp-vectorize with coroutine cause link error. disable it util gcc fix. - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-tree-slp-vectorize") -endif() -# --------------------- Clang - -# --------------------- Msvc -# Resolves C1128 complained by MSVC: number of sections exceeded object file format limit: compile with /bigobj. -add_compile_options("$<$:/bigobj>") -# Resolves C4737 complained by MSVC: C4737: Unable to perform required tail call. Performance may be degraded. "Release-Type only" -if(CMAKE_BUILD_TYPE STREQUAL "Release") -add_compile_options("$<$:/EHa>") -endif() diff --git a/cmake/struct_pb.cmake b/cmake/struct_pb.cmake index 2aac1a9e..decd4e3b 100644 --- a/cmake/struct_pb.cmake +++ b/cmake/struct_pb.cmake @@ -165,7 +165,7 @@ function(protobuf_generate_struct_pb SRCS HDRS) set(_outvar) protobuf_generate_modified(${_append_arg} ${_descriptors} LANGUAGE struct_pb EXPORT_MACRO ${protobuf_generate_struct_pb_EXPORT_MACRO} - PLUGIN $ + PLUGIN $ OUT_VAR _outvar ${_import_arg} PROTOS ${_proto_files} PROTOC_OPTION ${_opt} ) @@ -217,7 +217,7 @@ function(target_protos_struct_pb target) protobuf_generate_modified( TARGET ${target} LANGUAGE struct_pb EXPORT_MACRO ${target_protos_struct_pb_EXPORT_MACRO} - PLUGIN $ + PLUGIN $ ${_import_arg} PROTOS ${_proto_files} PROTOC_OPTION ${_opt} ) diff --git a/cmake/subdirectory.cmake b/cmake/subdirectory.cmake new file mode 100644 index 00000000..3ee6d2d0 --- /dev/null +++ b/cmake/subdirectory.cmake @@ -0,0 +1,13 @@ +file(GLOB children src/*) +foreach(child ${children}) + if(BUILD_UNIT_TESTS AND EXISTS ${child}/examples) + add_subdirectory(${child}/examples) + endif() + if(BUILD_BENCHMARK AND EXISTS ${child}/tests) + add_subdirectory(${child}/tests) + endif() + if(BUILD_EXAMPLES AND EXISTS ${child}/benchmark) + add_subdirectory(${child}/benchmark) + endif() +endforeach() +add_subdirectory(src/struct_pb) \ No newline at end of file diff --git a/cmake/utils.cmake b/cmake/utils.cmake index 3e2cf306..6f057d52 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -11,37 +11,4 @@ int main() ${_RESULT} ) unset(CMAKE_REQUIRED_FLAGS) -endmacro() - -# Enable address sanitizer for a target (gcc/clang only) -function(target_enable_sanitizer target_name) - if(NOT CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang") - message(FATAL_ERROR "Sanitizer supported only for gcc/clang") - endif() - message(STATUS "Address sanitizer enabled") - target_compile_options(${target_name} PRIVATE -fsanitize=address,undefined) - target_compile_options(${target_name} PRIVATE -fno-sanitize=signed-integer-overflow) - target_compile_options(${target_name} PRIVATE -fno-sanitize-recover=all) - target_compile_options(${target_name} PRIVATE -fno-omit-frame-pointer) - # target_link_libraries(${target_name} PRIVATE -fsanitize=address,undefined -fuse-ld=gold) # -endfunction() - -# Turn on warnings on the given target -function(target_enable_warnings target_name) - if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - list(APPEND MSVC_OPTIONS "/W3") - if(MSVC_VERSION GREATER 1900) # Allow non fatal security warnings for msvc 2015 - list(APPEND MSVC_OPTIONS "/WX") - endif() - endif() - target_compile_options( - ${target_name} - PRIVATE $<$,$,$>: - -Wall - -Wextra - -Wconversion - -pedantic - -Werror - -Wfatal-errors> - $<$:${MSVC_OPTIONS}>) -endfunction() +endmacro() \ No newline at end of file diff --git a/cmake/yalantinglibsConfig.cmake.in b/cmake/yalantinglibsConfig.cmake.in deleted file mode 100644 index 492440b9..00000000 --- a/cmake/yalantinglibsConfig.cmake.in +++ /dev/null @@ -1,39 +0,0 @@ -include(CMakeFindDependencyMacro) -if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/struct_packTargets.cmake") - include("${CMAKE_CURRENT_LIST_DIR}/struct_packTargets.cmake") - message(STATUS "Imported target: yalantinglibs::struct_pack") -endif () -if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/struct_pbTargets.cmake") - include("${CMAKE_CURRENT_LIST_DIR}/struct_pbTargets.cmake") - message(STATUS "Imported target: yalantinglibs::struct_pb") -endif () -if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/protoc-gen-struct_pbTargets.cmake") - include("${CMAKE_CURRENT_LIST_DIR}/protoc-gen-struct_pbTargets.cmake") - message(STATUS "Imported target: yalantinglibs::protoc-gen-struct_pb") - include("${CMAKE_CURRENT_LIST_DIR}/struct_pb.cmake") - message(STATUS "Now you can use cmake helper function protobuf_generate_struct_pb to generate xx.struct_pb.cc xx.struct_pb.h") -endif () -if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/struct_jsonTargets.cmake") - include("${CMAKE_CURRENT_LIST_DIR}/struct_jsonTargets.cmake") - message(STATUS "Imported target: yalantinglibs::struct_json") -endif () -if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/struct_xmlTargets.cmake") - include("${CMAKE_CURRENT_LIST_DIR}/struct_xmlTargets.cmake") - message(STATUS "Imported target: yalantinglibs::struct_xml") -endif () -if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/struct_yamlTargets.cmake") - include("${CMAKE_CURRENT_LIST_DIR}/struct_yamlTargets.cmake") - message(STATUS "Imported target: yalantinglibs::struct_yaml") -endif () -if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/easylogTargets.cmake") - include("${CMAKE_CURRENT_LIST_DIR}/easylogTargets.cmake") - message(STATUS "Imported target: yalantinglibs::easylog") -endif () -if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/coro_rpcTargets.cmake") - include("${CMAKE_CURRENT_LIST_DIR}/coro_rpcTargets.cmake") - message(STATUS "Imported target: yalantinglibs::coro_rpc") -endif () -if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/coro_httpTargets.cmake") - include("${CMAKE_CURRENT_LIST_DIR}/coro_httpTargets.cmake") - message(STATUS "Imported target: yalantinglibs::coro_http") -endif () diff --git a/conanfile.py b/conanfile.py deleted file mode 100644 index 0f924d60..00000000 --- a/conanfile.py +++ /dev/null @@ -1,57 +0,0 @@ -from conans import ConanFile -from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps - - -class CoroRpcConan(ConanFile): - name = "coro_rpc" - version = "0.1.0" - - # Binary configuration - settings = "os", "compiler", "build_type", "arch" - options = { - "shared": [True, False], - "fPIC": [True, False], - "BUILD_WITH_LIBCXX": [True, False], - "BUILD_EXAMPLES": [True, False], - } - default_options = { - "shared": False, - "fPIC": True, - "BUILD_WITH_LIBCXX": True, - "BUILD_EXAMPLES": False, - } - - # Sources are located in the same place as this recipe, copy them to the recipe - exports_sources = "CMakeLists.txt", \ - "coro_io/*", "examples/*", "easylog/*", "coro_rpc/*", "struct_pack/*", "util/*", "tests/*" - - def requirements(self): - self.requires("asio/1.23.0") - - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC - - def layout(self): - cmake_layout(self) - - def generate(self): - tc = CMakeToolchain(self) - tc.generate() - deps = CMakeDeps(self) - deps.generate() - - def build(self): - cmake = CMake(self) - variables = { - "USE_CONAN": "ON" - } - cmake.configure(variables) - cmake.build() - - def package(self): - cmake = CMake(self) - cmake.install() - - def package_info(self): - self.cpp_info.libs = ["hello"] diff --git a/coverage_gen.sh b/coverage_gen.sh index 951a2c9e..cf99f07a 100644 --- a/coverage_gen.sh +++ b/coverage_gen.sh @@ -32,11 +32,11 @@ make -j test_rpc # add %m to fix the bug on ARM # https://groups.google.com/g/llvm-dev/c/oaA58fbNMGg # https://github.com/llvm/llvm-project/issues/50966 -export LLVM_PROFILE_FILE="test_rpc-%m.profraw" +export LLVM_PROFILE_FILE="coro_rpc_test-%m.profraw" ls cd tests ./test_rpc -llvm-profdata merge -sparse test_rpc-*.profraw -o test_rpc.profdata -llvm-cov show ./test_rpc -instr-profile=test_rpc.profdata -format=html -output-dir=../../.coverage_llvm_cov -ignore-filename-regex="async_simple|thirdparty|tests|asio|util|logging|struct_pack" -show-instantiations=false +llvm-profdata merge -sparse coro_rpc_test-*.profraw -o coro_rpc_test.profdata +llvm-cov show ./coro_rpc_test -instr-profile=test_rpc.profdata -format=html -output-dir=../../.coverage_llvm_cov -ignore-filename-regex="async_simple|thirdparty|tests|asio|util|logging|struct_pack" -show-instantiations=false echo 'Done!!!' fi diff --git a/include/struct_xml/xml_reader.h b/include/struct_xml/xml_reader.h deleted file mode 100644 index 4be4778b..00000000 --- a/include/struct_xml/xml_reader.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once -#include - -namespace struct_xml { - -template -inline bool from_xml(T &&t, char *buf) { - return iguana::from_xml(std::forward(t), buf); -} - -template -inline bool from_xml(T &&t, const std::string &str) { - return from_xml(std::forward(t), str.data()); -} - -template -inline bool from_xml(T &&t, std::string_view str) { - return from_xml(std::forward(t), str.data()); -} - -inline std::string get_last_read_err() { return iguana::get_last_read_err(); } - -using any_t = iguana::any_t; -} // namespace struct_xml \ No newline at end of file diff --git a/include/struct_xml/xml_writer.h b/include/struct_xml/xml_writer.h deleted file mode 100644 index 416c9153..00000000 --- a/include/struct_xml/xml_writer.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once -#include - -namespace struct_xml { -template -inline void to_xml(T &&t, Stream &s) { - iguana::to_xml(std::forward(t), s); -} - -template -inline bool to_xml_pretty(T &&t, Stream &s) { - return iguana::to_xml_pretty(std::forward(t), s); -} -} // namespace struct_xml \ No newline at end of file diff --git a/include/struct_yaml/yaml_reader.h b/include/struct_yaml/yaml_reader.h deleted file mode 100644 index 6e8a48c8..00000000 --- a/include/struct_yaml/yaml_reader.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once -#include - -namespace struct_yaml { - -template -inline void from_yaml(T &value, const View &view) { - iguana::from_yaml(value, view); -} - -template -inline void from_yaml(T &value, const View &view, std::error_code &ec) { - iguana::from_yaml(value, view, ec); -} -} // namespace struct_yaml \ No newline at end of file diff --git a/include/struct_yaml/yaml_writer.h b/include/struct_yaml/yaml_writer.h deleted file mode 100644 index 129f2592..00000000 --- a/include/struct_yaml/yaml_writer.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once -#include - -namespace struct_yaml { -template -inline void to_yaml(T &&t, Stream &s, size_t min_spaces = 0) { - iguana::to_yaml(std::forward(t), s, min_spaces); -} -} // namespace struct_yaml \ No newline at end of file diff --git a/include/util/concurrentqueue.h b/include/util/concurrentqueue.h deleted file mode 100644 index 57de052d..00000000 --- a/include/util/concurrentqueue.h +++ /dev/null @@ -1,3747 +0,0 @@ -// Provides a C++11 implementation of a multi-producer, multi-consumer lock-free queue. -// An overview, including benchmark results, is provided here: -// http://moodycamel.com/blog/2014/a-fast-general-purpose-lock-free-queue-for-c++ -// The full design is also described in excruciating detail at: -// http://moodycamel.com/blog/2014/detailed-design-of-a-lock-free-queue - -// Simplified BSD license: -// Copyright (c) 2013-2020, Cameron Desrochers. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this list of -// conditions and the following disclaimer. -// - Redistributions in binary form must reproduce the above copyright notice, this list of -// conditions and the following disclaimer in the documentation and/or other materials -// provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT -// OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR -// TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Also dual-licensed under the Boost Software License (see LICENSE.md) - -#pragma once - -#if defined(__GNUC__) && !defined(__INTEL_COMPILER) -// Disable -Wconversion warnings (spuriously triggered when Traits::size_t and -// Traits::index_t are set to < 32 bits, causing integer promotion, causing warnings -// upon assigning any computed values) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" - -#ifdef MCDBGQ_USE_RELACY -#pragma GCC diagnostic ignored "-Wint-to-pointer-cast" -#endif -#endif - -#if defined(_MSC_VER) && (!defined(_HAS_CXX17) || !_HAS_CXX17) -// VS2019 with /W4 warns about constant conditional expressions but unless /std=c++17 or higher -// does not support `if constexpr`, so we have no choice but to simply disable the warning -#pragma warning(push) -#pragma warning(disable: 4127) // conditional expression is constant -#endif - -#if defined(__APPLE__) -#include "TargetConditionals.h" -#endif - -#ifdef MCDBGQ_USE_RELACY -#include "relacy/relacy_std.hpp" -#include "relacy_shims.h" -// We only use malloc/free anyway, and the delete macro messes up `= delete` method declarations. -// We'll override the default trait malloc ourselves without a macro. -#undef new -#undef delete -#undef malloc -#undef free -#else -#include // Requires C++11. Sorry VS2010. -#include -#endif -#include // for max_align_t -#include -#include -#include -#include -#include -#include -#include // for CHAR_BIT -#include -#include // partly for __WINPTHREADS_VERSION if on MinGW-w64 w/ POSIX threading -#include // used for thread exit synchronization - -// Platform-specific definitions of a numeric thread ID type and an invalid value -namespace moodycamel { namespace details { - template struct thread_id_converter { - typedef thread_id_t thread_id_numeric_size_t; - typedef thread_id_t thread_id_hash_t; - static thread_id_hash_t prehash(thread_id_t const& x) { return x; } - }; -} } -#if defined(MCDBGQ_USE_RELACY) -namespace moodycamel { namespace details { - typedef std::uint32_t thread_id_t; - static const thread_id_t invalid_thread_id = 0xFFFFFFFFU; - static const thread_id_t invalid_thread_id2 = 0xFFFFFFFEU; - static inline thread_id_t thread_id() { return rl::thread_index(); } -} } -#elif defined(_WIN32) || defined(__WINDOWS__) || defined(__WIN32__) -// No sense pulling in windows.h in a header, we'll manually declare the function -// we use and rely on backwards-compatibility for this not to break -extern "C" __declspec(dllimport) unsigned long __stdcall GetCurrentThreadId(void); -namespace moodycamel { namespace details { - static_assert(sizeof(unsigned long) == sizeof(std::uint32_t), "Expected size of unsigned long to be 32 bits on Windows"); - typedef std::uint32_t thread_id_t; - static const thread_id_t invalid_thread_id = 0; // See http://blogs.msdn.com/b/oldnewthing/archive/2004/02/23/78395.aspx - static const thread_id_t invalid_thread_id2 = 0xFFFFFFFFU; // Not technically guaranteed to be invalid, but is never used in practice. Note that all Win32 thread IDs are presently multiples of 4. - static inline thread_id_t thread_id() { return static_cast(::GetCurrentThreadId()); } -} } -#elif defined(__arm__) || defined(_M_ARM) || defined(__aarch64__) || (defined(__APPLE__) && TARGET_OS_IPHONE) || defined(MOODYCAMEL_NO_THREAD_LOCAL) -namespace moodycamel { namespace details { - static_assert(sizeof(std::thread::id) == 4 || sizeof(std::thread::id) == 8, "std::thread::id is expected to be either 4 or 8 bytes"); - - typedef std::thread::id thread_id_t; - static const thread_id_t invalid_thread_id; // Default ctor creates invalid ID - - // Note we don't define a invalid_thread_id2 since std::thread::id doesn't have one; it's - // only used if MOODYCAMEL_CPP11_THREAD_LOCAL_SUPPORTED is defined anyway, which it won't - // be. - static inline thread_id_t thread_id() { return std::this_thread::get_id(); } - - template struct thread_id_size { }; - template<> struct thread_id_size<4> { typedef std::uint32_t numeric_t; }; - template<> struct thread_id_size<8> { typedef std::uint64_t numeric_t; }; - - template<> struct thread_id_converter { - typedef thread_id_size::numeric_t thread_id_numeric_size_t; -#ifndef __APPLE__ - typedef std::size_t thread_id_hash_t; -#else - typedef thread_id_numeric_size_t thread_id_hash_t; -#endif - - static thread_id_hash_t prehash(thread_id_t const& x) - { -#ifndef __APPLE__ - return std::hash()(x); -#else - return *reinterpret_cast(&x); -#endif - } - }; -} } -#else -// Use a nice trick from this answer: http://stackoverflow.com/a/8438730/21475 -// In order to get a numeric thread ID in a platform-independent way, we use a thread-local -// static variable's address as a thread identifier :-) -#if defined(__GNUC__) || defined(__INTEL_COMPILER) -#define MOODYCAMEL_THREADLOCAL __thread -#elif defined(_MSC_VER) -#define MOODYCAMEL_THREADLOCAL __declspec(thread) -#else -// Assume C++11 compliant compiler -#define MOODYCAMEL_THREADLOCAL thread_local -#endif -namespace moodycamel { namespace details { - typedef std::uintptr_t thread_id_t; - static const thread_id_t invalid_thread_id = 0; // Address can't be nullptr - static const thread_id_t invalid_thread_id2 = 1; // Member accesses off a null pointer are also generally invalid. Plus it's not aligned. - inline thread_id_t thread_id() { static MOODYCAMEL_THREADLOCAL int x; return reinterpret_cast(&x); } -} } -#endif - -// Constexpr if -#ifndef MOODYCAMEL_CONSTEXPR_IF -#if (defined(_MSC_VER) && defined(_HAS_CXX17) && _HAS_CXX17) || __cplusplus > 201402L -#define MOODYCAMEL_CONSTEXPR_IF if constexpr -#define MOODYCAMEL_MAYBE_UNUSED [[maybe_unused]] -#else -#define MOODYCAMEL_CONSTEXPR_IF if -#define MOODYCAMEL_MAYBE_UNUSED -#endif -#endif - -// Exceptions -#ifndef MOODYCAMEL_EXCEPTIONS_ENABLED -#if (defined(_MSC_VER) && defined(_CPPUNWIND)) || (defined(__GNUC__) && defined(__EXCEPTIONS)) || (!defined(_MSC_VER) && !defined(__GNUC__)) -#define MOODYCAMEL_EXCEPTIONS_ENABLED -#endif -#endif -#ifdef MOODYCAMEL_EXCEPTIONS_ENABLED -#define MOODYCAMEL_TRY try -#define MOODYCAMEL_CATCH(...) catch(__VA_ARGS__) -#define MOODYCAMEL_RETHROW throw -#define MOODYCAMEL_THROW(expr) throw (expr) -#else -#define MOODYCAMEL_TRY MOODYCAMEL_CONSTEXPR_IF (true) -#define MOODYCAMEL_CATCH(...) else MOODYCAMEL_CONSTEXPR_IF (false) -#define MOODYCAMEL_RETHROW -#define MOODYCAMEL_THROW(expr) -#endif - -#ifndef MOODYCAMEL_NOEXCEPT -#if !defined(MOODYCAMEL_EXCEPTIONS_ENABLED) -#define MOODYCAMEL_NOEXCEPT -#define MOODYCAMEL_NOEXCEPT_CTOR(type, valueType, expr) true -#define MOODYCAMEL_NOEXCEPT_ASSIGN(type, valueType, expr) true -#elif defined(_MSC_VER) && defined(_NOEXCEPT) && _MSC_VER < 1800 -// VS2012's std::is_nothrow_[move_]constructible is broken and returns true when it shouldn't :-( -// We have to assume *all* non-trivial constructors may throw on VS2012! -#define MOODYCAMEL_NOEXCEPT _NOEXCEPT -#define MOODYCAMEL_NOEXCEPT_CTOR(type, valueType, expr) (std::is_rvalue_reference::value && std::is_move_constructible::value ? std::is_trivially_move_constructible::value : std::is_trivially_copy_constructible::value) -#define MOODYCAMEL_NOEXCEPT_ASSIGN(type, valueType, expr) ((std::is_rvalue_reference::value && std::is_move_assignable::value ? std::is_trivially_move_assignable::value || std::is_nothrow_move_assignable::value : std::is_trivially_copy_assignable::value || std::is_nothrow_copy_assignable::value) && MOODYCAMEL_NOEXCEPT_CTOR(type, valueType, expr)) -#elif defined(_MSC_VER) && defined(_NOEXCEPT) && _MSC_VER < 1900 -#define MOODYCAMEL_NOEXCEPT _NOEXCEPT -#define MOODYCAMEL_NOEXCEPT_CTOR(type, valueType, expr) (std::is_rvalue_reference::value && std::is_move_constructible::value ? std::is_trivially_move_constructible::value || std::is_nothrow_move_constructible::value : std::is_trivially_copy_constructible::value || std::is_nothrow_copy_constructible::value) -#define MOODYCAMEL_NOEXCEPT_ASSIGN(type, valueType, expr) ((std::is_rvalue_reference::value && std::is_move_assignable::value ? std::is_trivially_move_assignable::value || std::is_nothrow_move_assignable::value : std::is_trivially_copy_assignable::value || std::is_nothrow_copy_assignable::value) && MOODYCAMEL_NOEXCEPT_CTOR(type, valueType, expr)) -#else -#define MOODYCAMEL_NOEXCEPT noexcept -#define MOODYCAMEL_NOEXCEPT_CTOR(type, valueType, expr) noexcept(expr) -#define MOODYCAMEL_NOEXCEPT_ASSIGN(type, valueType, expr) noexcept(expr) -#endif -#endif - -#ifndef MOODYCAMEL_CPP11_THREAD_LOCAL_SUPPORTED -#ifdef MCDBGQ_USE_RELACY -#define MOODYCAMEL_CPP11_THREAD_LOCAL_SUPPORTED -#else -// VS2013 doesn't support `thread_local`, and MinGW-w64 w/ POSIX threading has a crippling bug: http://sourceforge.net/p/mingw-w64/bugs/445 -// g++ <=4.7 doesn't support thread_local either. -// Finally, iOS/ARM doesn't have support for it either, and g++/ARM allows it to compile but it's unconfirmed to actually work -#if (!defined(_MSC_VER) || _MSC_VER >= 1900) && (!defined(__MINGW32__) && !defined(__MINGW64__) || !defined(__WINPTHREADS_VERSION)) && (!defined(__GNUC__) || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)) && (!defined(__APPLE__) || !TARGET_OS_IPHONE) && !defined(__arm__) && !defined(_M_ARM) && !defined(__aarch64__) -// Assume `thread_local` is fully supported in all other C++11 compilers/platforms -#define MOODYCAMEL_CPP11_THREAD_LOCAL_SUPPORTED // tentatively enabled for now; years ago several users report having problems with it on -#endif -#endif -#endif - -// VS2012 doesn't support deleted functions. -// In this case, we declare the function normally but don't define it. A link error will be generated if the function is called. -#ifndef MOODYCAMEL_DELETE_FUNCTION -#if defined(_MSC_VER) && _MSC_VER < 1800 -#define MOODYCAMEL_DELETE_FUNCTION -#else -#define MOODYCAMEL_DELETE_FUNCTION = delete -#endif -#endif - -namespace moodycamel { namespace details { -#ifndef MOODYCAMEL_ALIGNAS -// VS2013 doesn't support alignas or alignof, and align() requires a constant literal -#if defined(_MSC_VER) && _MSC_VER <= 1800 -#define MOODYCAMEL_ALIGNAS(alignment) __declspec(align(alignment)) -#define MOODYCAMEL_ALIGNOF(obj) __alignof(obj) -#define MOODYCAMEL_ALIGNED_TYPE_LIKE(T, obj) typename details::Vs2013Aligned::value, T>::type - template struct Vs2013Aligned { }; // default, unsupported alignment - template struct Vs2013Aligned<1, T> { typedef __declspec(align(1)) T type; }; - template struct Vs2013Aligned<2, T> { typedef __declspec(align(2)) T type; }; - template struct Vs2013Aligned<4, T> { typedef __declspec(align(4)) T type; }; - template struct Vs2013Aligned<8, T> { typedef __declspec(align(8)) T type; }; - template struct Vs2013Aligned<16, T> { typedef __declspec(align(16)) T type; }; - template struct Vs2013Aligned<32, T> { typedef __declspec(align(32)) T type; }; - template struct Vs2013Aligned<64, T> { typedef __declspec(align(64)) T type; }; - template struct Vs2013Aligned<128, T> { typedef __declspec(align(128)) T type; }; - template struct Vs2013Aligned<256, T> { typedef __declspec(align(256)) T type; }; -#else - template struct identity { typedef T type; }; -#define MOODYCAMEL_ALIGNAS(alignment) alignas(alignment) -#define MOODYCAMEL_ALIGNOF(obj) alignof(obj) -#define MOODYCAMEL_ALIGNED_TYPE_LIKE(T, obj) alignas(alignof(obj)) typename details::identity::type -#endif -#endif -} } - - -// TSAN can false report races in lock-free code. To enable TSAN to be used from projects that use this one, -// we can apply per-function compile-time suppression. -// See https://clang.llvm.org/docs/ThreadSanitizer.html#has-feature-thread-sanitizer -#define MOODYCAMEL_NO_TSAN -#if defined(__has_feature) - #if __has_feature(thread_sanitizer) - #undef MOODYCAMEL_NO_TSAN - #define MOODYCAMEL_NO_TSAN __attribute__((no_sanitize("thread"))) - #endif // TSAN -#endif // TSAN - -// Compiler-specific likely/unlikely hints -namespace moodycamel { namespace details { -#if defined(__GNUC__) - static inline bool (likely)(bool x) { return __builtin_expect((x), true); } - static inline bool (unlikely)(bool x) { return __builtin_expect((x), false); } -#else - static inline bool (likely)(bool x) { return x; } - static inline bool (unlikely)(bool x) { return x; } -#endif -} } - -#ifdef MOODYCAMEL_QUEUE_INTERNAL_DEBUG -#include "internal/concurrentqueue_internal_debug.h" -#endif - -namespace moodycamel { -namespace details { - template - struct const_numeric_max { - static_assert(std::is_integral::value, "const_numeric_max can only be used with integers"); - static const T value = std::numeric_limits::is_signed - ? (static_cast(1) << (sizeof(T) * CHAR_BIT - 1)) - static_cast(1) - : static_cast(-1); - }; - -#if defined(__GLIBCXX__) - typedef ::max_align_t std_max_align_t; // libstdc++ forgot to add it to std:: for a while -#else - typedef std::max_align_t std_max_align_t; // Others (e.g. MSVC) insist it can *only* be accessed via std:: -#endif - - // Some platforms have incorrectly set max_align_t to a type with <8 bytes alignment even while supporting - // 8-byte aligned scalar values (*cough* 32-bit iOS). Work around this with our own union. See issue #64. - typedef union { - std_max_align_t x; - long long y; - void* z; - } max_align_t; -} - -// Default traits for the ConcurrentQueue. To change some of the -// traits without re-implementing all of them, inherit from this -// struct and shadow the declarations you wish to be different; -// since the traits are used as a template type parameter, the -// shadowed declarations will be used where defined, and the defaults -// otherwise. -struct ConcurrentQueueDefaultTraits -{ - // General-purpose size type. std::size_t is strongly recommended. - typedef std::size_t size_t; - - // The type used for the enqueue and dequeue indices. Must be at least as - // large as size_t. Should be significantly larger than the number of elements - // you expect to hold at once, especially if you have a high turnover rate; - // for example, on 32-bit x86, if you expect to have over a hundred million - // elements or pump several million elements through your queue in a very - // short space of time, using a 32-bit type *may* trigger a race condition. - // A 64-bit int type is recommended in that case, and in practice will - // prevent a race condition no matter the usage of the queue. Note that - // whether the queue is lock-free with a 64-int type depends on the whether - // std::atomic is lock-free, which is platform-specific. - typedef std::size_t index_t; - - // Internally, all elements are enqueued and dequeued from multi-element - // blocks; this is the smallest controllable unit. If you expect few elements - // but many producers, a smaller block size should be favoured. For few producers - // and/or many elements, a larger block size is preferred. A sane default - // is provided. Must be a power of 2. - static const size_t BLOCK_SIZE = 32; - - // For explicit producers (i.e. when using a producer token), the block is - // checked for being empty by iterating through a list of flags, one per element. - // For large block sizes, this is too inefficient, and switching to an atomic - // counter-based approach is faster. The switch is made for block sizes strictly - // larger than this threshold. - static const size_t EXPLICIT_BLOCK_EMPTY_COUNTER_THRESHOLD = 32; - - // How many full blocks can be expected for a single explicit producer? This should - // reflect that number's maximum for optimal performance. Must be a power of 2. - static const size_t EXPLICIT_INITIAL_INDEX_SIZE = 32; - - // How many full blocks can be expected for a single implicit producer? This should - // reflect that number's maximum for optimal performance. Must be a power of 2. - static const size_t IMPLICIT_INITIAL_INDEX_SIZE = 32; - - // The initial size of the hash table mapping thread IDs to implicit producers. - // Note that the hash is resized every time it becomes half full. - // Must be a power of two, and either 0 or at least 1. If 0, implicit production - // (using the enqueue methods without an explicit producer token) is disabled. - static const size_t INITIAL_IMPLICIT_PRODUCER_HASH_SIZE = 32; - - // Controls the number of items that an explicit consumer (i.e. one with a token) - // must consume before it causes all consumers to rotate and move on to the next - // internal queue. - static const std::uint32_t EXPLICIT_CONSUMER_CONSUMPTION_QUOTA_BEFORE_ROTATE = 256; - - // The maximum number of elements (inclusive) that can be enqueued to a sub-queue. - // Enqueue operations that would cause this limit to be surpassed will fail. Note - // that this limit is enforced at the block level (for performance reasons), i.e. - // it's rounded up to the nearest block size. - static const size_t MAX_SUBQUEUE_SIZE = details::const_numeric_max::value; - - // The number of times to spin before sleeping when waiting on a semaphore. - // Recommended values are on the order of 1000-10000 unless the number of - // consumer threads exceeds the number of idle cores (in which case try 0-100). - // Only affects instances of the BlockingConcurrentQueue. - static const int MAX_SEMA_SPINS = 10000; - - // Whether to recycle dynamically-allocated blocks into an internal free list or - // not. If false, only pre-allocated blocks (controlled by the constructor - // arguments) will be recycled, and all others will be `free`d back to the heap. - // Note that blocks consumed by explicit producers are only freed on destruction - // of the queue (not following destruction of the token) regardless of this trait. - static const bool RECYCLE_ALLOCATED_BLOCKS = false; - - -#ifndef MCDBGQ_USE_RELACY - // Memory allocation can be customized if needed. - // malloc should return nullptr on failure, and handle alignment like std::malloc. -#if defined(malloc) || defined(free) - // Gah, this is 2015, stop defining macros that break standard code already! - // Work around malloc/free being special macros: - static inline void* WORKAROUND_malloc(size_t size) { return malloc(size); } - static inline void WORKAROUND_free(void* ptr) { return free(ptr); } - static inline void* (malloc)(size_t size) { return WORKAROUND_malloc(size); } - static inline void (free)(void* ptr) { return WORKAROUND_free(ptr); } -#else - static inline void* malloc(size_t size) { return std::malloc(size); } - static inline void free(void* ptr) { return std::free(ptr); } -#endif -#else - // Debug versions when running under the Relacy race detector (ignore - // these in user code) - static inline void* malloc(size_t size) { return rl::rl_malloc(size, $); } - static inline void free(void* ptr) { return rl::rl_free(ptr, $); } -#endif -}; - - -// When producing or consuming many elements, the most efficient way is to: -// 1) Use one of the bulk-operation methods of the queue with a token -// 2) Failing that, use the bulk-operation methods without a token -// 3) Failing that, create a token and use that with the single-item methods -// 4) Failing that, use the single-parameter methods of the queue -// Having said that, don't create tokens willy-nilly -- ideally there should be -// a maximum of one token per thread (of each kind). -struct ProducerToken; -struct ConsumerToken; - -template class ConcurrentQueue; -template class BlockingConcurrentQueue; -class ConcurrentQueueTests; - - -namespace details -{ - struct ConcurrentQueueProducerTypelessBase - { - ConcurrentQueueProducerTypelessBase* next; - std::atomic inactive; - ProducerToken* token; - - ConcurrentQueueProducerTypelessBase() - : next(nullptr), inactive(false), token(nullptr) - { - } - }; - - template struct _hash_32_or_64 { - static inline std::uint32_t hash(std::uint32_t h) - { - // MurmurHash3 finalizer -- see https://code.google.com/p/smhasher/source/browse/trunk/MurmurHash3.cpp - // Since the thread ID is already unique, all we really want to do is propagate that - // uniqueness evenly across all the bits, so that we can use a subset of the bits while - // reducing collisions significantly - h ^= h >> 16; - h *= 0x85ebca6b; - h ^= h >> 13; - h *= 0xc2b2ae35; - return h ^ (h >> 16); - } - }; - template<> struct _hash_32_or_64<1> { - static inline std::uint64_t hash(std::uint64_t h) - { - h ^= h >> 33; - h *= 0xff51afd7ed558ccd; - h ^= h >> 33; - h *= 0xc4ceb9fe1a85ec53; - return h ^ (h >> 33); - } - }; - template struct hash_32_or_64 : public _hash_32_or_64<(size > 4)> { }; - - static inline size_t hash_thread_id(thread_id_t id) - { - static_assert(sizeof(thread_id_t) <= 8, "Expected a platform where thread IDs are at most 64-bit values"); - return static_cast(hash_32_or_64::thread_id_hash_t)>::hash( - thread_id_converter::prehash(id))); - } - - template - static inline bool circular_less_than(T a, T b) - { - static_assert(std::is_integral::value && !std::numeric_limits::is_signed, "circular_less_than is intended to be used only with unsigned integer types"); - return static_cast(a - b) > static_cast(static_cast(1) << (static_cast(sizeof(T) * CHAR_BIT - 1))); - // Note: extra parens around rhs of operator<< is MSVC bug: https://developercommunity2.visualstudio.com/t/C4554-triggers-when-both-lhs-and-rhs-is/10034931 - // silencing the bug requires #pragma warning(disable: 4554) around the calling code and has no effect when done here. - } - - template - static inline char* align_for(char* ptr) - { - const std::size_t alignment = std::alignment_of::value; - return ptr + (alignment - (reinterpret_cast(ptr) % alignment)) % alignment; - } - - template - static inline T ceil_to_pow_2(T x) - { - static_assert(std::is_integral::value && !std::numeric_limits::is_signed, "ceil_to_pow_2 is intended to be used only with unsigned integer types"); - - // Adapted from http://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2 - --x; - x |= x >> 1; - x |= x >> 2; - x |= x >> 4; - for (std::size_t i = 1; i < sizeof(T); i <<= 1) { - x |= x >> (i << 3); - } - ++x; - return x; - } - - template - static inline void swap_relaxed(std::atomic& left, std::atomic& right) - { - T temp = std::move(left.load(std::memory_order_relaxed)); - left.store(std::move(right.load(std::memory_order_relaxed)), std::memory_order_relaxed); - right.store(std::move(temp), std::memory_order_relaxed); - } - - template - static inline T const& nomove(T const& x) - { - return x; - } - - template - struct nomove_if - { - template - static inline T const& eval(T const& x) - { - return x; - } - }; - - template<> - struct nomove_if - { - template - static inline auto eval(U&& x) - -> decltype(std::forward(x)) - { - return std::forward(x); - } - }; - - template - static inline auto deref_noexcept(It& it) MOODYCAMEL_NOEXCEPT -> decltype(*it) - { - return *it; - } - -#if defined(__clang__) || !defined(__GNUC__) || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - template struct is_trivially_destructible : std::is_trivially_destructible { }; -#else - template struct is_trivially_destructible : std::has_trivial_destructor { }; -#endif - -#ifdef MOODYCAMEL_CPP11_THREAD_LOCAL_SUPPORTED -#ifdef MCDBGQ_USE_RELACY - typedef RelacyThreadExitListener ThreadExitListener; - typedef RelacyThreadExitNotifier ThreadExitNotifier; -#else - class ThreadExitNotifier; - - struct ThreadExitListener - { - typedef void (*callback_t)(void*); - callback_t callback; - void* userData; - - ThreadExitListener* next; // reserved for use by the ThreadExitNotifier - ThreadExitNotifier* chain; // reserved for use by the ThreadExitNotifier - }; - - class ThreadExitNotifier - { - public: - static void subscribe(ThreadExitListener* listener) - { - auto& tlsInst = instance(); - std::lock_guard guard(mutex()); - listener->next = tlsInst.tail; - listener->chain = &tlsInst; - tlsInst.tail = listener; - } - - static void unsubscribe(ThreadExitListener* listener) - { - std::lock_guard guard(mutex()); - if (!listener->chain) { - return; // race with ~ThreadExitNotifier - } - auto& tlsInst = *listener->chain; - listener->chain = nullptr; - ThreadExitListener** prev = &tlsInst.tail; - for (auto ptr = tlsInst.tail; ptr != nullptr; ptr = ptr->next) { - if (ptr == listener) { - *prev = ptr->next; - break; - } - prev = &ptr->next; - } - } - - private: - ThreadExitNotifier() : tail(nullptr) { } - ThreadExitNotifier(ThreadExitNotifier const&) MOODYCAMEL_DELETE_FUNCTION; - ThreadExitNotifier& operator=(ThreadExitNotifier const&) MOODYCAMEL_DELETE_FUNCTION; - - ~ThreadExitNotifier() - { - // This thread is about to exit, let everyone know! - assert(this == &instance() && "If this assert fails, you likely have a buggy compiler! Change the preprocessor conditions such that MOODYCAMEL_CPP11_THREAD_LOCAL_SUPPORTED is no longer defined."); - std::lock_guard guard(mutex()); - for (auto ptr = tail; ptr != nullptr; ptr = ptr->next) { - ptr->chain = nullptr; - ptr->callback(ptr->userData); - } - } - - // Thread-local - static inline ThreadExitNotifier& instance() - { - static thread_local ThreadExitNotifier notifier; - return notifier; - } - - static inline std::mutex& mutex() - { - // Must be static because the ThreadExitNotifier could be destroyed while unsubscribe is called - static std::mutex mutex; - return mutex; - } - - private: - ThreadExitListener* tail; - }; -#endif -#endif - - template struct static_is_lock_free_num { enum { value = 0 }; }; - template<> struct static_is_lock_free_num { enum { value = ATOMIC_CHAR_LOCK_FREE }; }; - template<> struct static_is_lock_free_num { enum { value = ATOMIC_SHORT_LOCK_FREE }; }; - template<> struct static_is_lock_free_num { enum { value = ATOMIC_INT_LOCK_FREE }; }; - template<> struct static_is_lock_free_num { enum { value = ATOMIC_LONG_LOCK_FREE }; }; - template<> struct static_is_lock_free_num { enum { value = ATOMIC_LLONG_LOCK_FREE }; }; - template struct static_is_lock_free : static_is_lock_free_num::type> { }; - template<> struct static_is_lock_free { enum { value = ATOMIC_BOOL_LOCK_FREE }; }; - template struct static_is_lock_free { enum { value = ATOMIC_POINTER_LOCK_FREE }; }; -} - - -struct ProducerToken -{ - template - explicit ProducerToken(ConcurrentQueue& queue); - - template - explicit ProducerToken(BlockingConcurrentQueue& queue); - - ProducerToken(ProducerToken&& other) MOODYCAMEL_NOEXCEPT - : producer(other.producer) - { - other.producer = nullptr; - if (producer != nullptr) { - producer->token = this; - } - } - - inline ProducerToken& operator=(ProducerToken&& other) MOODYCAMEL_NOEXCEPT - { - swap(other); - return *this; - } - - void swap(ProducerToken& other) MOODYCAMEL_NOEXCEPT - { - std::swap(producer, other.producer); - if (producer != nullptr) { - producer->token = this; - } - if (other.producer != nullptr) { - other.producer->token = &other; - } - } - - // A token is always valid unless: - // 1) Memory allocation failed during construction - // 2) It was moved via the move constructor - // (Note: assignment does a swap, leaving both potentially valid) - // 3) The associated queue was destroyed - // Note that if valid() returns true, that only indicates - // that the token is valid for use with a specific queue, - // but not which one; that's up to the user to track. - inline bool valid() const { return producer != nullptr; } - - ~ProducerToken() - { - if (producer != nullptr) { - producer->token = nullptr; - producer->inactive.store(true, std::memory_order_release); - } - } - - // Disable copying and assignment - ProducerToken(ProducerToken const&) MOODYCAMEL_DELETE_FUNCTION; - ProducerToken& operator=(ProducerToken const&) MOODYCAMEL_DELETE_FUNCTION; - -private: - template friend class ConcurrentQueue; - friend class ConcurrentQueueTests; - -protected: - details::ConcurrentQueueProducerTypelessBase* producer; -}; - - -struct ConsumerToken -{ - template - explicit ConsumerToken(ConcurrentQueue& q); - - template - explicit ConsumerToken(BlockingConcurrentQueue& q); - - ConsumerToken(ConsumerToken&& other) MOODYCAMEL_NOEXCEPT - : initialOffset(other.initialOffset), lastKnownGlobalOffset(other.lastKnownGlobalOffset), itemsConsumedFromCurrent(other.itemsConsumedFromCurrent), currentProducer(other.currentProducer), desiredProducer(other.desiredProducer) - { - } - - inline ConsumerToken& operator=(ConsumerToken&& other) MOODYCAMEL_NOEXCEPT - { - swap(other); - return *this; - } - - void swap(ConsumerToken& other) MOODYCAMEL_NOEXCEPT - { - std::swap(initialOffset, other.initialOffset); - std::swap(lastKnownGlobalOffset, other.lastKnownGlobalOffset); - std::swap(itemsConsumedFromCurrent, other.itemsConsumedFromCurrent); - std::swap(currentProducer, other.currentProducer); - std::swap(desiredProducer, other.desiredProducer); - } - - // Disable copying and assignment - ConsumerToken(ConsumerToken const&) MOODYCAMEL_DELETE_FUNCTION; - ConsumerToken& operator=(ConsumerToken const&) MOODYCAMEL_DELETE_FUNCTION; - -private: - template friend class ConcurrentQueue; - friend class ConcurrentQueueTests; - -private: // but shared with ConcurrentQueue - std::uint32_t initialOffset; - std::uint32_t lastKnownGlobalOffset; - std::uint32_t itemsConsumedFromCurrent; - details::ConcurrentQueueProducerTypelessBase* currentProducer; - details::ConcurrentQueueProducerTypelessBase* desiredProducer; -}; - -// Need to forward-declare this swap because it's in a namespace. -// See http://stackoverflow.com/questions/4492062/why-does-a-c-friend-class-need-a-forward-declaration-only-in-other-namespaces -template -inline void swap(typename ConcurrentQueue::ImplicitProducerKVP& a, typename ConcurrentQueue::ImplicitProducerKVP& b) MOODYCAMEL_NOEXCEPT; - - -template -class ConcurrentQueue -{ -public: - typedef ::moodycamel::ProducerToken producer_token_t; - typedef ::moodycamel::ConsumerToken consumer_token_t; - - typedef typename Traits::index_t index_t; - typedef typename Traits::size_t size_t; - - static const size_t BLOCK_SIZE = static_cast(Traits::BLOCK_SIZE); - static const size_t EXPLICIT_BLOCK_EMPTY_COUNTER_THRESHOLD = static_cast(Traits::EXPLICIT_BLOCK_EMPTY_COUNTER_THRESHOLD); - static const size_t EXPLICIT_INITIAL_INDEX_SIZE = static_cast(Traits::EXPLICIT_INITIAL_INDEX_SIZE); - static const size_t IMPLICIT_INITIAL_INDEX_SIZE = static_cast(Traits::IMPLICIT_INITIAL_INDEX_SIZE); - static const size_t INITIAL_IMPLICIT_PRODUCER_HASH_SIZE = static_cast(Traits::INITIAL_IMPLICIT_PRODUCER_HASH_SIZE); - static const std::uint32_t EXPLICIT_CONSUMER_CONSUMPTION_QUOTA_BEFORE_ROTATE = static_cast(Traits::EXPLICIT_CONSUMER_CONSUMPTION_QUOTA_BEFORE_ROTATE); -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable: 4307) // + integral constant overflow (that's what the ternary expression is for!) -#pragma warning(disable: 4309) // static_cast: Truncation of constant value -#endif - static const size_t MAX_SUBQUEUE_SIZE = (details::const_numeric_max::value - static_cast(Traits::MAX_SUBQUEUE_SIZE) < BLOCK_SIZE) ? details::const_numeric_max::value : ((static_cast(Traits::MAX_SUBQUEUE_SIZE) + (BLOCK_SIZE - 1)) / BLOCK_SIZE * BLOCK_SIZE); -#ifdef _MSC_VER -#pragma warning(pop) -#endif - - static_assert(!std::numeric_limits::is_signed && std::is_integral::value, "Traits::size_t must be an unsigned integral type"); - static_assert(!std::numeric_limits::is_signed && std::is_integral::value, "Traits::index_t must be an unsigned integral type"); - static_assert(sizeof(index_t) >= sizeof(size_t), "Traits::index_t must be at least as wide as Traits::size_t"); - static_assert((BLOCK_SIZE > 1) && !(BLOCK_SIZE & (BLOCK_SIZE - 1)), "Traits::BLOCK_SIZE must be a power of 2 (and at least 2)"); - static_assert((EXPLICIT_BLOCK_EMPTY_COUNTER_THRESHOLD > 1) && !(EXPLICIT_BLOCK_EMPTY_COUNTER_THRESHOLD & (EXPLICIT_BLOCK_EMPTY_COUNTER_THRESHOLD - 1)), "Traits::EXPLICIT_BLOCK_EMPTY_COUNTER_THRESHOLD must be a power of 2 (and greater than 1)"); - static_assert((EXPLICIT_INITIAL_INDEX_SIZE > 1) && !(EXPLICIT_INITIAL_INDEX_SIZE & (EXPLICIT_INITIAL_INDEX_SIZE - 1)), "Traits::EXPLICIT_INITIAL_INDEX_SIZE must be a power of 2 (and greater than 1)"); - static_assert((IMPLICIT_INITIAL_INDEX_SIZE > 1) && !(IMPLICIT_INITIAL_INDEX_SIZE & (IMPLICIT_INITIAL_INDEX_SIZE - 1)), "Traits::IMPLICIT_INITIAL_INDEX_SIZE must be a power of 2 (and greater than 1)"); - static_assert((INITIAL_IMPLICIT_PRODUCER_HASH_SIZE == 0) || !(INITIAL_IMPLICIT_PRODUCER_HASH_SIZE & (INITIAL_IMPLICIT_PRODUCER_HASH_SIZE - 1)), "Traits::INITIAL_IMPLICIT_PRODUCER_HASH_SIZE must be a power of 2"); - static_assert(INITIAL_IMPLICIT_PRODUCER_HASH_SIZE == 0 || INITIAL_IMPLICIT_PRODUCER_HASH_SIZE >= 1, "Traits::INITIAL_IMPLICIT_PRODUCER_HASH_SIZE must be at least 1 (or 0 to disable implicit enqueueing)"); - -public: - // Creates a queue with at least `capacity` element slots; note that the - // actual number of elements that can be inserted without additional memory - // allocation depends on the number of producers and the block size (e.g. if - // the block size is equal to `capacity`, only a single block will be allocated - // up-front, which means only a single producer will be able to enqueue elements - // without an extra allocation -- blocks aren't shared between producers). - // This method is not thread safe -- it is up to the user to ensure that the - // queue is fully constructed before it starts being used by other threads (this - // includes making the memory effects of construction visible, possibly with a - // memory barrier). - explicit ConcurrentQueue(size_t capacity = 32 * BLOCK_SIZE) - : producerListTail(nullptr), - producerCount(0), - initialBlockPoolIndex(0), - nextExplicitConsumerId(0), - globalExplicitConsumerOffset(0) - { - implicitProducerHashResizeInProgress.clear(std::memory_order_relaxed); - populate_initial_implicit_producer_hash(); - populate_initial_block_list(capacity / BLOCK_SIZE + ((capacity & (BLOCK_SIZE - 1)) == 0 ? 0 : 1)); - -#ifdef MOODYCAMEL_QUEUE_INTERNAL_DEBUG - // Track all the producers using a fully-resolved typed list for - // each kind; this makes it possible to debug them starting from - // the root queue object (otherwise wacky casts are needed that - // don't compile in the debugger's expression evaluator). - explicitProducers.store(nullptr, std::memory_order_relaxed); - implicitProducers.store(nullptr, std::memory_order_relaxed); -#endif - } - - // Computes the correct amount of pre-allocated blocks for you based - // on the minimum number of elements you want available at any given - // time, and the maximum concurrent number of each type of producer. - ConcurrentQueue(size_t minCapacity, size_t maxExplicitProducers, size_t maxImplicitProducers) - : producerListTail(nullptr), - producerCount(0), - initialBlockPoolIndex(0), - nextExplicitConsumerId(0), - globalExplicitConsumerOffset(0) - { - implicitProducerHashResizeInProgress.clear(std::memory_order_relaxed); - populate_initial_implicit_producer_hash(); - size_t blocks = (((minCapacity + BLOCK_SIZE - 1) / BLOCK_SIZE) - 1) * (maxExplicitProducers + 1) + 2 * (maxExplicitProducers + maxImplicitProducers); - populate_initial_block_list(blocks); - -#ifdef MOODYCAMEL_QUEUE_INTERNAL_DEBUG - explicitProducers.store(nullptr, std::memory_order_relaxed); - implicitProducers.store(nullptr, std::memory_order_relaxed); -#endif - } - - // Note: The queue should not be accessed concurrently while it's - // being deleted. It's up to the user to synchronize this. - // This method is not thread safe. - ~ConcurrentQueue() - { - // Destroy producers - auto ptr = producerListTail.load(std::memory_order_relaxed); - while (ptr != nullptr) { - auto next = ptr->next_prod(); - if (ptr->token != nullptr) { - ptr->token->producer = nullptr; - } - destroy(ptr); - ptr = next; - } - - // Destroy implicit producer hash tables - MOODYCAMEL_CONSTEXPR_IF (INITIAL_IMPLICIT_PRODUCER_HASH_SIZE != 0) { - auto hash = implicitProducerHash.load(std::memory_order_relaxed); - while (hash != nullptr) { - auto prev = hash->prev; - if (prev != nullptr) { // The last hash is part of this object and was not allocated dynamically - for (size_t i = 0; i != hash->capacity; ++i) { - hash->entries[i].~ImplicitProducerKVP(); - } - hash->~ImplicitProducerHash(); - (Traits::free)(hash); - } - hash = prev; - } - } - - // Destroy global free list - auto block = freeList.head_unsafe(); - while (block != nullptr) { - auto next = block->freeListNext.load(std::memory_order_relaxed); - if (block->dynamicallyAllocated) { - destroy(block); - } - block = next; - } - - // Destroy initial free list - destroy_array(initialBlockPool, initialBlockPoolSize); - } - - // Disable copying and copy assignment - ConcurrentQueue(ConcurrentQueue const&) MOODYCAMEL_DELETE_FUNCTION; - ConcurrentQueue& operator=(ConcurrentQueue const&) MOODYCAMEL_DELETE_FUNCTION; - - // Moving is supported, but note that it is *not* a thread-safe operation. - // Nobody can use the queue while it's being moved, and the memory effects - // of that move must be propagated to other threads before they can use it. - // Note: When a queue is moved, its tokens are still valid but can only be - // used with the destination queue (i.e. semantically they are moved along - // with the queue itself). - ConcurrentQueue(ConcurrentQueue&& other) MOODYCAMEL_NOEXCEPT - : producerListTail(other.producerListTail.load(std::memory_order_relaxed)), - producerCount(other.producerCount.load(std::memory_order_relaxed)), - initialBlockPoolIndex(other.initialBlockPoolIndex.load(std::memory_order_relaxed)), - initialBlockPool(other.initialBlockPool), - initialBlockPoolSize(other.initialBlockPoolSize), - freeList(std::move(other.freeList)), - nextExplicitConsumerId(other.nextExplicitConsumerId.load(std::memory_order_relaxed)), - globalExplicitConsumerOffset(other.globalExplicitConsumerOffset.load(std::memory_order_relaxed)) - { - // Move the other one into this, and leave the other one as an empty queue - implicitProducerHashResizeInProgress.clear(std::memory_order_relaxed); - populate_initial_implicit_producer_hash(); - swap_implicit_producer_hashes(other); - - other.producerListTail.store(nullptr, std::memory_order_relaxed); - other.producerCount.store(0, std::memory_order_relaxed); - other.nextExplicitConsumerId.store(0, std::memory_order_relaxed); - other.globalExplicitConsumerOffset.store(0, std::memory_order_relaxed); - -#ifdef MOODYCAMEL_QUEUE_INTERNAL_DEBUG - explicitProducers.store(other.explicitProducers.load(std::memory_order_relaxed), std::memory_order_relaxed); - other.explicitProducers.store(nullptr, std::memory_order_relaxed); - implicitProducers.store(other.implicitProducers.load(std::memory_order_relaxed), std::memory_order_relaxed); - other.implicitProducers.store(nullptr, std::memory_order_relaxed); -#endif - - other.initialBlockPoolIndex.store(0, std::memory_order_relaxed); - other.initialBlockPoolSize = 0; - other.initialBlockPool = nullptr; - - reown_producers(); - } - - inline ConcurrentQueue& operator=(ConcurrentQueue&& other) MOODYCAMEL_NOEXCEPT - { - return swap_internal(other); - } - - // Swaps this queue's state with the other's. Not thread-safe. - // Swapping two queues does not invalidate their tokens, however - // the tokens that were created for one queue must be used with - // only the swapped queue (i.e. the tokens are tied to the - // queue's movable state, not the object itself). - inline void swap(ConcurrentQueue& other) MOODYCAMEL_NOEXCEPT - { - swap_internal(other); - } - -private: - ConcurrentQueue& swap_internal(ConcurrentQueue& other) - { - if (this == &other) { - return *this; - } - - details::swap_relaxed(producerListTail, other.producerListTail); - details::swap_relaxed(producerCount, other.producerCount); - details::swap_relaxed(initialBlockPoolIndex, other.initialBlockPoolIndex); - std::swap(initialBlockPool, other.initialBlockPool); - std::swap(initialBlockPoolSize, other.initialBlockPoolSize); - freeList.swap(other.freeList); - details::swap_relaxed(nextExplicitConsumerId, other.nextExplicitConsumerId); - details::swap_relaxed(globalExplicitConsumerOffset, other.globalExplicitConsumerOffset); - - swap_implicit_producer_hashes(other); - - reown_producers(); - other.reown_producers(); - -#ifdef MOODYCAMEL_QUEUE_INTERNAL_DEBUG - details::swap_relaxed(explicitProducers, other.explicitProducers); - details::swap_relaxed(implicitProducers, other.implicitProducers); -#endif - - return *this; - } - -public: - // Enqueues a single item (by copying it). - // Allocates memory if required. Only fails if memory allocation fails (or implicit - // production is disabled because Traits::INITIAL_IMPLICIT_PRODUCER_HASH_SIZE is 0, - // or Traits::MAX_SUBQUEUE_SIZE has been defined and would be surpassed). - // Thread-safe. - inline bool enqueue(T const& item) - { - MOODYCAMEL_CONSTEXPR_IF (INITIAL_IMPLICIT_PRODUCER_HASH_SIZE == 0) return false; - else return inner_enqueue(item); - } - - // Enqueues a single item (by moving it, if possible). - // Allocates memory if required. Only fails if memory allocation fails (or implicit - // production is disabled because Traits::INITIAL_IMPLICIT_PRODUCER_HASH_SIZE is 0, - // or Traits::MAX_SUBQUEUE_SIZE has been defined and would be surpassed). - // Thread-safe. - inline bool enqueue(T&& item) - { - MOODYCAMEL_CONSTEXPR_IF (INITIAL_IMPLICIT_PRODUCER_HASH_SIZE == 0) return false; - else return inner_enqueue(std::move(item)); - } - - // Enqueues a single item (by copying it) using an explicit producer token. - // Allocates memory if required. Only fails if memory allocation fails (or - // Traits::MAX_SUBQUEUE_SIZE has been defined and would be surpassed). - // Thread-safe. - inline bool enqueue(producer_token_t const& token, T const& item) - { - return inner_enqueue(token, item); - } - - // Enqueues a single item (by moving it, if possible) using an explicit producer token. - // Allocates memory if required. Only fails if memory allocation fails (or - // Traits::MAX_SUBQUEUE_SIZE has been defined and would be surpassed). - // Thread-safe. - inline bool enqueue(producer_token_t const& token, T&& item) - { - return inner_enqueue(token, std::move(item)); - } - - // Enqueues several items. - // Allocates memory if required. Only fails if memory allocation fails (or - // implicit production is disabled because Traits::INITIAL_IMPLICIT_PRODUCER_HASH_SIZE - // is 0, or Traits::MAX_SUBQUEUE_SIZE has been defined and would be surpassed). - // Note: Use std::make_move_iterator if the elements should be moved instead of copied. - // Thread-safe. - template - bool enqueue_bulk(It itemFirst, size_t count) - { - MOODYCAMEL_CONSTEXPR_IF (INITIAL_IMPLICIT_PRODUCER_HASH_SIZE == 0) return false; - else return inner_enqueue_bulk(itemFirst, count); - } - - // Enqueues several items using an explicit producer token. - // Allocates memory if required. Only fails if memory allocation fails - // (or Traits::MAX_SUBQUEUE_SIZE has been defined and would be surpassed). - // Note: Use std::make_move_iterator if the elements should be moved - // instead of copied. - // Thread-safe. - template - bool enqueue_bulk(producer_token_t const& token, It itemFirst, size_t count) - { - return inner_enqueue_bulk(token, itemFirst, count); - } - - // Enqueues a single item (by copying it). - // Does not allocate memory. Fails if not enough room to enqueue (or implicit - // production is disabled because Traits::INITIAL_IMPLICIT_PRODUCER_HASH_SIZE - // is 0). - // Thread-safe. - inline bool try_enqueue(T const& item) - { - MOODYCAMEL_CONSTEXPR_IF (INITIAL_IMPLICIT_PRODUCER_HASH_SIZE == 0) return false; - else return inner_enqueue(item); - } - - // Enqueues a single item (by moving it, if possible). - // Does not allocate memory (except for one-time implicit producer). - // Fails if not enough room to enqueue (or implicit production is - // disabled because Traits::INITIAL_IMPLICIT_PRODUCER_HASH_SIZE is 0). - // Thread-safe. - inline bool try_enqueue(T&& item) - { - MOODYCAMEL_CONSTEXPR_IF (INITIAL_IMPLICIT_PRODUCER_HASH_SIZE == 0) return false; - else return inner_enqueue(std::move(item)); - } - - // Enqueues a single item (by copying it) using an explicit producer token. - // Does not allocate memory. Fails if not enough room to enqueue. - // Thread-safe. - inline bool try_enqueue(producer_token_t const& token, T const& item) - { - return inner_enqueue(token, item); - } - - // Enqueues a single item (by moving it, if possible) using an explicit producer token. - // Does not allocate memory. Fails if not enough room to enqueue. - // Thread-safe. - inline bool try_enqueue(producer_token_t const& token, T&& item) - { - return inner_enqueue(token, std::move(item)); - } - - // Enqueues several items. - // Does not allocate memory (except for one-time implicit producer). - // Fails if not enough room to enqueue (or implicit production is - // disabled because Traits::INITIAL_IMPLICIT_PRODUCER_HASH_SIZE is 0). - // Note: Use std::make_move_iterator if the elements should be moved - // instead of copied. - // Thread-safe. - template - bool try_enqueue_bulk(It itemFirst, size_t count) - { - MOODYCAMEL_CONSTEXPR_IF (INITIAL_IMPLICIT_PRODUCER_HASH_SIZE == 0) return false; - else return inner_enqueue_bulk(itemFirst, count); - } - - // Enqueues several items using an explicit producer token. - // Does not allocate memory. Fails if not enough room to enqueue. - // Note: Use std::make_move_iterator if the elements should be moved - // instead of copied. - // Thread-safe. - template - bool try_enqueue_bulk(producer_token_t const& token, It itemFirst, size_t count) - { - return inner_enqueue_bulk(token, itemFirst, count); - } - - - - // Attempts to dequeue from the queue. - // Returns false if all producer streams appeared empty at the time they - // were checked (so, the queue is likely but not guaranteed to be empty). - // Never allocates. Thread-safe. - template - bool try_dequeue(U& item) - { - // Instead of simply trying each producer in turn (which could cause needless contention on the first - // producer), we score them heuristically. - size_t nonEmptyCount = 0; - ProducerBase* best = nullptr; - size_t bestSize = 0; - for (auto ptr = producerListTail.load(std::memory_order_acquire); nonEmptyCount < 3 && ptr != nullptr; ptr = ptr->next_prod()) { - auto size = ptr->size_approx(); - if (size > 0) { - if (size > bestSize) { - bestSize = size; - best = ptr; - } - ++nonEmptyCount; - } - } - - // If there was at least one non-empty queue but it appears empty at the time - // we try to dequeue from it, we need to make sure every queue's been tried - if (nonEmptyCount > 0) { - if ((details::likely)(best->dequeue(item))) { - return true; - } - for (auto ptr = producerListTail.load(std::memory_order_acquire); ptr != nullptr; ptr = ptr->next_prod()) { - if (ptr != best && ptr->dequeue(item)) { - return true; - } - } - } - return false; - } - - // Attempts to dequeue from the queue. - // Returns false if all producer streams appeared empty at the time they - // were checked (so, the queue is likely but not guaranteed to be empty). - // This differs from the try_dequeue(item) method in that this one does - // not attempt to reduce contention by interleaving the order that producer - // streams are dequeued from. So, using this method can reduce overall throughput - // under contention, but will give more predictable results in single-threaded - // consumer scenarios. This is mostly only useful for internal unit tests. - // Never allocates. Thread-safe. - template - bool try_dequeue_non_interleaved(U& item) - { - for (auto ptr = producerListTail.load(std::memory_order_acquire); ptr != nullptr; ptr = ptr->next_prod()) { - if (ptr->dequeue(item)) { - return true; - } - } - return false; - } - - // Attempts to dequeue from the queue using an explicit consumer token. - // Returns false if all producer streams appeared empty at the time they - // were checked (so, the queue is likely but not guaranteed to be empty). - // Never allocates. Thread-safe. - template - bool try_dequeue(consumer_token_t& token, U& item) - { - // The idea is roughly as follows: - // Every 256 items from one producer, make everyone rotate (increase the global offset) -> this means the highest efficiency consumer dictates the rotation speed of everyone else, more or less - // If you see that the global offset has changed, you must reset your consumption counter and move to your designated place - // If there's no items where you're supposed to be, keep moving until you find a producer with some items - // If the global offset has not changed but you've run out of items to consume, move over from your current position until you find an producer with something in it - - if (token.desiredProducer == nullptr || token.lastKnownGlobalOffset != globalExplicitConsumerOffset.load(std::memory_order_relaxed)) { - if (!update_current_producer_after_rotation(token)) { - return false; - } - } - - // If there was at least one non-empty queue but it appears empty at the time - // we try to dequeue from it, we need to make sure every queue's been tried - if (static_cast(token.currentProducer)->dequeue(item)) { - if (++token.itemsConsumedFromCurrent == EXPLICIT_CONSUMER_CONSUMPTION_QUOTA_BEFORE_ROTATE) { - globalExplicitConsumerOffset.fetch_add(1, std::memory_order_relaxed); - } - return true; - } - - auto tail = producerListTail.load(std::memory_order_acquire); - auto ptr = static_cast(token.currentProducer)->next_prod(); - if (ptr == nullptr) { - ptr = tail; - } - while (ptr != static_cast(token.currentProducer)) { - if (ptr->dequeue(item)) { - token.currentProducer = ptr; - token.itemsConsumedFromCurrent = 1; - return true; - } - ptr = ptr->next_prod(); - if (ptr == nullptr) { - ptr = tail; - } - } - return false; - } - - // Attempts to dequeue several elements from the queue. - // Returns the number of items actually dequeued. - // Returns 0 if all producer streams appeared empty at the time they - // were checked (so, the queue is likely but not guaranteed to be empty). - // Never allocates. Thread-safe. - template - size_t try_dequeue_bulk(It itemFirst, size_t max) - { - size_t count = 0; - for (auto ptr = producerListTail.load(std::memory_order_acquire); ptr != nullptr; ptr = ptr->next_prod()) { - count += ptr->dequeue_bulk(itemFirst, max - count); - if (count == max) { - break; - } - } - return count; - } - - // Attempts to dequeue several elements from the queue using an explicit consumer token. - // Returns the number of items actually dequeued. - // Returns 0 if all producer streams appeared empty at the time they - // were checked (so, the queue is likely but not guaranteed to be empty). - // Never allocates. Thread-safe. - template - size_t try_dequeue_bulk(consumer_token_t& token, It itemFirst, size_t max) - { - if (token.desiredProducer == nullptr || token.lastKnownGlobalOffset != globalExplicitConsumerOffset.load(std::memory_order_relaxed)) { - if (!update_current_producer_after_rotation(token)) { - return 0; - } - } - - size_t count = static_cast(token.currentProducer)->dequeue_bulk(itemFirst, max); - if (count == max) { - if ((token.itemsConsumedFromCurrent += static_cast(max)) >= EXPLICIT_CONSUMER_CONSUMPTION_QUOTA_BEFORE_ROTATE) { - globalExplicitConsumerOffset.fetch_add(1, std::memory_order_relaxed); - } - return max; - } - token.itemsConsumedFromCurrent += static_cast(count); - max -= count; - - auto tail = producerListTail.load(std::memory_order_acquire); - auto ptr = static_cast(token.currentProducer)->next_prod(); - if (ptr == nullptr) { - ptr = tail; - } - while (ptr != static_cast(token.currentProducer)) { - auto dequeued = ptr->dequeue_bulk(itemFirst, max); - count += dequeued; - if (dequeued != 0) { - token.currentProducer = ptr; - token.itemsConsumedFromCurrent = static_cast(dequeued); - } - if (dequeued == max) { - break; - } - max -= dequeued; - ptr = ptr->next_prod(); - if (ptr == nullptr) { - ptr = tail; - } - } - return count; - } - - - - // Attempts to dequeue from a specific producer's inner queue. - // If you happen to know which producer you want to dequeue from, this - // is significantly faster than using the general-case try_dequeue methods. - // Returns false if the producer's queue appeared empty at the time it - // was checked (so, the queue is likely but not guaranteed to be empty). - // Never allocates. Thread-safe. - template - inline bool try_dequeue_from_producer(producer_token_t const& producer, U& item) - { - return static_cast(producer.producer)->dequeue(item); - } - - // Attempts to dequeue several elements from a specific producer's inner queue. - // Returns the number of items actually dequeued. - // If you happen to know which producer you want to dequeue from, this - // is significantly faster than using the general-case try_dequeue methods. - // Returns 0 if the producer's queue appeared empty at the time it - // was checked (so, the queue is likely but not guaranteed to be empty). - // Never allocates. Thread-safe. - template - inline size_t try_dequeue_bulk_from_producer(producer_token_t const& producer, It itemFirst, size_t max) - { - return static_cast(producer.producer)->dequeue_bulk(itemFirst, max); - } - - - // Returns an estimate of the total number of elements currently in the queue. This - // estimate is only accurate if the queue has completely stabilized before it is called - // (i.e. all enqueue and dequeue operations have completed and their memory effects are - // visible on the calling thread, and no further operations start while this method is - // being called). - // Thread-safe. - size_t size_approx() const - { - size_t size = 0; - for (auto ptr = producerListTail.load(std::memory_order_acquire); ptr != nullptr; ptr = ptr->next_prod()) { - size += ptr->size_approx(); - } - return size; - } - - - // Returns true if the underlying atomic variables used by - // the queue are lock-free (they should be on most platforms). - // Thread-safe. - static constexpr bool is_lock_free() - { - return - details::static_is_lock_free::value == 2 && - details::static_is_lock_free::value == 2 && - details::static_is_lock_free::value == 2 && - details::static_is_lock_free::value == 2 && - details::static_is_lock_free::value == 2 && - details::static_is_lock_free::thread_id_numeric_size_t>::value == 2; - } - - -private: - friend struct ProducerToken; - friend struct ConsumerToken; - struct ExplicitProducer; - friend struct ExplicitProducer; - struct ImplicitProducer; - friend struct ImplicitProducer; - friend class ConcurrentQueueTests; - - enum AllocationMode { CanAlloc, CannotAlloc }; - - - /////////////////////////////// - // Queue methods - /////////////////////////////// - - template - inline bool inner_enqueue(producer_token_t const& token, U&& element) - { - return static_cast(token.producer)->ConcurrentQueue::ExplicitProducer::template enqueue(std::forward(element)); - } - - template - inline bool inner_enqueue(U&& element) - { - auto producer = get_or_add_implicit_producer(); - return producer == nullptr ? false : producer->ConcurrentQueue::ImplicitProducer::template enqueue(std::forward(element)); - } - - template - inline bool inner_enqueue_bulk(producer_token_t const& token, It itemFirst, size_t count) - { - return static_cast(token.producer)->ConcurrentQueue::ExplicitProducer::template enqueue_bulk(itemFirst, count); - } - - template - inline bool inner_enqueue_bulk(It itemFirst, size_t count) - { - auto producer = get_or_add_implicit_producer(); - return producer == nullptr ? false : producer->ConcurrentQueue::ImplicitProducer::template enqueue_bulk(itemFirst, count); - } - - inline bool update_current_producer_after_rotation(consumer_token_t& token) - { - // Ah, there's been a rotation, figure out where we should be! - auto tail = producerListTail.load(std::memory_order_acquire); - if (token.desiredProducer == nullptr && tail == nullptr) { - return false; - } - auto prodCount = producerCount.load(std::memory_order_relaxed); - auto globalOffset = globalExplicitConsumerOffset.load(std::memory_order_relaxed); - if ((details::unlikely)(token.desiredProducer == nullptr)) { - // Aha, first time we're dequeueing anything. - // Figure out our local position - // Note: offset is from start, not end, but we're traversing from end -- subtract from count first - std::uint32_t offset = prodCount - 1 - (token.initialOffset % prodCount); - token.desiredProducer = tail; - for (std::uint32_t i = 0; i != offset; ++i) { - token.desiredProducer = static_cast(token.desiredProducer)->next_prod(); - if (token.desiredProducer == nullptr) { - token.desiredProducer = tail; - } - } - } - - std::uint32_t delta = globalOffset - token.lastKnownGlobalOffset; - if (delta >= prodCount) { - delta = delta % prodCount; - } - for (std::uint32_t i = 0; i != delta; ++i) { - token.desiredProducer = static_cast(token.desiredProducer)->next_prod(); - if (token.desiredProducer == nullptr) { - token.desiredProducer = tail; - } - } - - token.lastKnownGlobalOffset = globalOffset; - token.currentProducer = token.desiredProducer; - token.itemsConsumedFromCurrent = 0; - return true; - } - - - /////////////////////////// - // Free list - /////////////////////////// - - template - struct FreeListNode - { - FreeListNode() : freeListRefs(0), freeListNext(nullptr) { } - - std::atomic freeListRefs; - std::atomic freeListNext; - }; - - // A simple CAS-based lock-free free list. Not the fastest thing in the world under heavy contention, but - // simple and correct (assuming nodes are never freed until after the free list is destroyed), and fairly - // speedy under low contention. - template // N must inherit FreeListNode or have the same fields (and initialization of them) - struct FreeList - { - FreeList() : freeListHead(nullptr) { } - FreeList(FreeList&& other) : freeListHead(other.freeListHead.load(std::memory_order_relaxed)) { other.freeListHead.store(nullptr, std::memory_order_relaxed); } - void swap(FreeList& other) { details::swap_relaxed(freeListHead, other.freeListHead); } - - FreeList(FreeList const&) MOODYCAMEL_DELETE_FUNCTION; - FreeList& operator=(FreeList const&) MOODYCAMEL_DELETE_FUNCTION; - - inline void add(N* node) - { -#ifdef MCDBGQ_NOLOCKFREE_FREELIST - debug::DebugLock lock(mutex); -#endif - // We know that the should-be-on-freelist bit is 0 at this point, so it's safe to - // set it using a fetch_add - if (node->freeListRefs.fetch_add(SHOULD_BE_ON_FREELIST, std::memory_order_acq_rel) == 0) { - // Oh look! We were the last ones referencing this node, and we know - // we want to add it to the free list, so let's do it! - add_knowing_refcount_is_zero(node); - } - } - - inline N* try_get() - { -#ifdef MCDBGQ_NOLOCKFREE_FREELIST - debug::DebugLock lock(mutex); -#endif - auto head = freeListHead.load(std::memory_order_acquire); - while (head != nullptr) { - auto prevHead = head; - auto refs = head->freeListRefs.load(std::memory_order_relaxed); - if ((refs & REFS_MASK) == 0 || !head->freeListRefs.compare_exchange_strong(refs, refs + 1, std::memory_order_acquire, std::memory_order_relaxed)) { - head = freeListHead.load(std::memory_order_acquire); - continue; - } - - // Good, reference count has been incremented (it wasn't at zero), which means we can read the - // next and not worry about it changing between now and the time we do the CAS - auto next = head->freeListNext.load(std::memory_order_relaxed); - if (freeListHead.compare_exchange_strong(head, next, std::memory_order_acquire, std::memory_order_relaxed)) { - // Yay, got the node. This means it was on the list, which means shouldBeOnFreeList must be false no - // matter the refcount (because nobody else knows it's been taken off yet, it can't have been put back on). - assert((head->freeListRefs.load(std::memory_order_relaxed) & SHOULD_BE_ON_FREELIST) == 0); - - // Decrease refcount twice, once for our ref, and once for the list's ref - head->freeListRefs.fetch_sub(2, std::memory_order_release); - return head; - } - - // OK, the head must have changed on us, but we still need to decrease the refcount we increased. - // Note that we don't need to release any memory effects, but we do need to ensure that the reference - // count decrement happens-after the CAS on the head. - refs = prevHead->freeListRefs.fetch_sub(1, std::memory_order_acq_rel); - if (refs == SHOULD_BE_ON_FREELIST + 1) { - add_knowing_refcount_is_zero(prevHead); - } - } - - return nullptr; - } - - // Useful for traversing the list when there's no contention (e.g. to destroy remaining nodes) - N* head_unsafe() const { return freeListHead.load(std::memory_order_relaxed); } - - private: - inline void add_knowing_refcount_is_zero(N* node) - { - // Since the refcount is zero, and nobody can increase it once it's zero (except us, and we run - // only one copy of this method per node at a time, i.e. the single thread case), then we know - // we can safely change the next pointer of the node; however, once the refcount is back above - // zero, then other threads could increase it (happens under heavy contention, when the refcount - // goes to zero in between a load and a refcount increment of a node in try_get, then back up to - // something non-zero, then the refcount increment is done by the other thread) -- so, if the CAS - // to add the node to the actual list fails, decrease the refcount and leave the add operation to - // the next thread who puts the refcount back at zero (which could be us, hence the loop). - auto head = freeListHead.load(std::memory_order_relaxed); - while (true) { - node->freeListNext.store(head, std::memory_order_relaxed); - node->freeListRefs.store(1, std::memory_order_release); - if (!freeListHead.compare_exchange_strong(head, node, std::memory_order_release, std::memory_order_relaxed)) { - // Hmm, the add failed, but we can only try again when the refcount goes back to zero - if (node->freeListRefs.fetch_add(SHOULD_BE_ON_FREELIST - 1, std::memory_order_release) == 1) { - continue; - } - } - return; - } - } - - private: - // Implemented like a stack, but where node order doesn't matter (nodes are inserted out of order under contention) - std::atomic freeListHead; - - static const std::uint32_t REFS_MASK = 0x7FFFFFFF; - static const std::uint32_t SHOULD_BE_ON_FREELIST = 0x80000000; - -#ifdef MCDBGQ_NOLOCKFREE_FREELIST - debug::DebugMutex mutex; -#endif - }; - - - /////////////////////////// - // Block - /////////////////////////// - - enum InnerQueueContext { implicit_context = 0, explicit_context = 1 }; - - struct Block - { - Block() - : next(nullptr), elementsCompletelyDequeued(0), freeListRefs(0), freeListNext(nullptr), dynamicallyAllocated(true) - { -#ifdef MCDBGQ_TRACKMEM - owner = nullptr; -#endif - } - - template - inline bool is_empty() const - { - MOODYCAMEL_CONSTEXPR_IF (context == explicit_context && BLOCK_SIZE <= EXPLICIT_BLOCK_EMPTY_COUNTER_THRESHOLD) { - // Check flags - for (size_t i = 0; i < BLOCK_SIZE; ++i) { - if (!emptyFlags[i].load(std::memory_order_relaxed)) { - return false; - } - } - - // Aha, empty; make sure we have all other memory effects that happened before the empty flags were set - std::atomic_thread_fence(std::memory_order_acquire); - return true; - } - else { - // Check counter - if (elementsCompletelyDequeued.load(std::memory_order_relaxed) == BLOCK_SIZE) { - std::atomic_thread_fence(std::memory_order_acquire); - return true; - } - assert(elementsCompletelyDequeued.load(std::memory_order_relaxed) <= BLOCK_SIZE); - return false; - } - } - - // Returns true if the block is now empty (does not apply in explicit context) - template - inline bool set_empty(MOODYCAMEL_MAYBE_UNUSED index_t i) - { - MOODYCAMEL_CONSTEXPR_IF (context == explicit_context && BLOCK_SIZE <= EXPLICIT_BLOCK_EMPTY_COUNTER_THRESHOLD) { - // Set flag - assert(!emptyFlags[BLOCK_SIZE - 1 - static_cast(i & static_cast(BLOCK_SIZE - 1))].load(std::memory_order_relaxed)); - emptyFlags[BLOCK_SIZE - 1 - static_cast(i & static_cast(BLOCK_SIZE - 1))].store(true, std::memory_order_release); - return false; - } - else { - // Increment counter - auto prevVal = elementsCompletelyDequeued.fetch_add(1, std::memory_order_release); - assert(prevVal < BLOCK_SIZE); - return prevVal == BLOCK_SIZE - 1; - } - } - - // Sets multiple contiguous item statuses to 'empty' (assumes no wrapping and count > 0). - // Returns true if the block is now empty (does not apply in explicit context). - template - inline bool set_many_empty(MOODYCAMEL_MAYBE_UNUSED index_t i, size_t count) - { - MOODYCAMEL_CONSTEXPR_IF (context == explicit_context && BLOCK_SIZE <= EXPLICIT_BLOCK_EMPTY_COUNTER_THRESHOLD) { - // Set flags - std::atomic_thread_fence(std::memory_order_release); - i = BLOCK_SIZE - 1 - static_cast(i & static_cast(BLOCK_SIZE - 1)) - count + 1; - for (size_t j = 0; j != count; ++j) { - assert(!emptyFlags[i + j].load(std::memory_order_relaxed)); - emptyFlags[i + j].store(true, std::memory_order_relaxed); - } - return false; - } - else { - // Increment counter - auto prevVal = elementsCompletelyDequeued.fetch_add(count, std::memory_order_release); - assert(prevVal + count <= BLOCK_SIZE); - return prevVal + count == BLOCK_SIZE; - } - } - - template - inline void set_all_empty() - { - MOODYCAMEL_CONSTEXPR_IF (context == explicit_context && BLOCK_SIZE <= EXPLICIT_BLOCK_EMPTY_COUNTER_THRESHOLD) { - // Set all flags - for (size_t i = 0; i != BLOCK_SIZE; ++i) { - emptyFlags[i].store(true, std::memory_order_relaxed); - } - } - else { - // Reset counter - elementsCompletelyDequeued.store(BLOCK_SIZE, std::memory_order_relaxed); - } - } - - template - inline void reset_empty() - { - MOODYCAMEL_CONSTEXPR_IF (context == explicit_context && BLOCK_SIZE <= EXPLICIT_BLOCK_EMPTY_COUNTER_THRESHOLD) { - // Reset flags - for (size_t i = 0; i != BLOCK_SIZE; ++i) { - emptyFlags[i].store(false, std::memory_order_relaxed); - } - } - else { - // Reset counter - elementsCompletelyDequeued.store(0, std::memory_order_relaxed); - } - } - - inline T* operator[](index_t idx) MOODYCAMEL_NOEXCEPT { return static_cast(static_cast(elements)) + static_cast(idx & static_cast(BLOCK_SIZE - 1)); } - inline T const* operator[](index_t idx) const MOODYCAMEL_NOEXCEPT { return static_cast(static_cast(elements)) + static_cast(idx & static_cast(BLOCK_SIZE - 1)); } - - private: - static_assert(std::alignment_of::value <= sizeof(T), "The queue does not support types with an alignment greater than their size at this time"); - MOODYCAMEL_ALIGNED_TYPE_LIKE(char[sizeof(T) * BLOCK_SIZE], T) elements; - public: - Block* next; - std::atomic elementsCompletelyDequeued; - std::atomic emptyFlags[BLOCK_SIZE <= EXPLICIT_BLOCK_EMPTY_COUNTER_THRESHOLD ? BLOCK_SIZE : 1]; - public: - std::atomic freeListRefs; - std::atomic freeListNext; - bool dynamicallyAllocated; // Perhaps a better name for this would be 'isNotPartOfInitialBlockPool' - -#ifdef MCDBGQ_TRACKMEM - void* owner; -#endif - }; - static_assert(std::alignment_of::value >= std::alignment_of::value, "Internal error: Blocks must be at least as aligned as the type they are wrapping"); - - -#ifdef MCDBGQ_TRACKMEM -public: - struct MemStats; -private: -#endif - - /////////////////////////// - // Producer base - /////////////////////////// - - struct ProducerBase : public details::ConcurrentQueueProducerTypelessBase - { - ProducerBase(ConcurrentQueue* parent_, bool isExplicit_) : - tailIndex(0), - headIndex(0), - dequeueOptimisticCount(0), - dequeueOvercommit(0), - tailBlock(nullptr), - isExplicit(isExplicit_), - parent(parent_) - { - } - - virtual ~ProducerBase() { } - - template - inline bool dequeue(U& element) - { - if (isExplicit) { - return static_cast(this)->dequeue(element); - } - else { - return static_cast(this)->dequeue(element); - } - } - - template - inline size_t dequeue_bulk(It& itemFirst, size_t max) - { - if (isExplicit) { - return static_cast(this)->dequeue_bulk(itemFirst, max); - } - else { - return static_cast(this)->dequeue_bulk(itemFirst, max); - } - } - - inline ProducerBase* next_prod() const { return static_cast(next); } - - inline size_t size_approx() const - { - auto tail = tailIndex.load(std::memory_order_relaxed); - auto head = headIndex.load(std::memory_order_relaxed); - return details::circular_less_than(head, tail) ? static_cast(tail - head) : 0; - } - - inline index_t getTail() const { return tailIndex.load(std::memory_order_relaxed); } - protected: - std::atomic tailIndex; // Where to enqueue to next - std::atomic headIndex; // Where to dequeue from next - - std::atomic dequeueOptimisticCount; - std::atomic dequeueOvercommit; - - Block* tailBlock; - - public: - bool isExplicit; - ConcurrentQueue* parent; - - protected: -#ifdef MCDBGQ_TRACKMEM - friend struct MemStats; -#endif - }; - - - /////////////////////////// - // Explicit queue - /////////////////////////// - - struct ExplicitProducer : public ProducerBase - { - explicit ExplicitProducer(ConcurrentQueue* parent_) : - ProducerBase(parent_, true), - blockIndex(nullptr), - pr_blockIndexSlotsUsed(0), - pr_blockIndexSize(EXPLICIT_INITIAL_INDEX_SIZE >> 1), - pr_blockIndexFront(0), - pr_blockIndexEntries(nullptr), - pr_blockIndexRaw(nullptr) - { - size_t poolBasedIndexSize = details::ceil_to_pow_2(parent_->initialBlockPoolSize) >> 1; - if (poolBasedIndexSize > pr_blockIndexSize) { - pr_blockIndexSize = poolBasedIndexSize; - } - - new_block_index(0); // This creates an index with double the number of current entries, i.e. EXPLICIT_INITIAL_INDEX_SIZE - } - - ~ExplicitProducer() - { - // Destruct any elements not yet dequeued. - // Since we're in the destructor, we can assume all elements - // are either completely dequeued or completely not (no halfways). - if (this->tailBlock != nullptr) { // Note this means there must be a block index too - // First find the block that's partially dequeued, if any - Block* halfDequeuedBlock = nullptr; - if ((this->headIndex.load(std::memory_order_relaxed) & static_cast(BLOCK_SIZE - 1)) != 0) { - // The head's not on a block boundary, meaning a block somewhere is partially dequeued - // (or the head block is the tail block and was fully dequeued, but the head/tail are still not on a boundary) - size_t i = (pr_blockIndexFront - pr_blockIndexSlotsUsed) & (pr_blockIndexSize - 1); - while (details::circular_less_than(pr_blockIndexEntries[i].base + BLOCK_SIZE, this->headIndex.load(std::memory_order_relaxed))) { - i = (i + 1) & (pr_blockIndexSize - 1); - } - assert(details::circular_less_than(pr_blockIndexEntries[i].base, this->headIndex.load(std::memory_order_relaxed))); - halfDequeuedBlock = pr_blockIndexEntries[i].block; - } - - // Start at the head block (note the first line in the loop gives us the head from the tail on the first iteration) - auto block = this->tailBlock; - do { - block = block->next; - if (block->ConcurrentQueue::Block::template is_empty()) { - continue; - } - - size_t i = 0; // Offset into block - if (block == halfDequeuedBlock) { - i = static_cast(this->headIndex.load(std::memory_order_relaxed) & static_cast(BLOCK_SIZE - 1)); - } - - // Walk through all the items in the block; if this is the tail block, we need to stop when we reach the tail index - auto lastValidIndex = (this->tailIndex.load(std::memory_order_relaxed) & static_cast(BLOCK_SIZE - 1)) == 0 ? BLOCK_SIZE : static_cast(this->tailIndex.load(std::memory_order_relaxed) & static_cast(BLOCK_SIZE - 1)); - while (i != BLOCK_SIZE && (block != this->tailBlock || i != lastValidIndex)) { - (*block)[i++]->~T(); - } - } while (block != this->tailBlock); - } - - // Destroy all blocks that we own - if (this->tailBlock != nullptr) { - auto block = this->tailBlock; - do { - auto nextBlock = block->next; - this->parent->add_block_to_free_list(block); - block = nextBlock; - } while (block != this->tailBlock); - } - - // Destroy the block indices - auto header = static_cast(pr_blockIndexRaw); - while (header != nullptr) { - auto prev = static_cast(header->prev); - header->~BlockIndexHeader(); - (Traits::free)(header); - header = prev; - } - } - - template - inline bool enqueue(U&& element) - { - index_t currentTailIndex = this->tailIndex.load(std::memory_order_relaxed); - index_t newTailIndex = 1 + currentTailIndex; - if ((currentTailIndex & static_cast(BLOCK_SIZE - 1)) == 0) { - // We reached the end of a block, start a new one - auto startBlock = this->tailBlock; - auto originalBlockIndexSlotsUsed = pr_blockIndexSlotsUsed; - if (this->tailBlock != nullptr && this->tailBlock->next->ConcurrentQueue::Block::template is_empty()) { - // We can re-use the block ahead of us, it's empty! - this->tailBlock = this->tailBlock->next; - this->tailBlock->ConcurrentQueue::Block::template reset_empty(); - - // We'll put the block on the block index (guaranteed to be room since we're conceptually removing the - // last block from it first -- except instead of removing then adding, we can just overwrite). - // Note that there must be a valid block index here, since even if allocation failed in the ctor, - // it would have been re-attempted when adding the first block to the queue; since there is such - // a block, a block index must have been successfully allocated. - } - else { - // Whatever head value we see here is >= the last value we saw here (relatively), - // and <= its current value. Since we have the most recent tail, the head must be - // <= to it. - auto head = this->headIndex.load(std::memory_order_relaxed); - assert(!details::circular_less_than(currentTailIndex, head)); - if (!details::circular_less_than(head, currentTailIndex + BLOCK_SIZE) - || (MAX_SUBQUEUE_SIZE != details::const_numeric_max::value && (MAX_SUBQUEUE_SIZE == 0 || MAX_SUBQUEUE_SIZE - BLOCK_SIZE < currentTailIndex - head))) { - // We can't enqueue in another block because there's not enough leeway -- the - // tail could surpass the head by the time the block fills up! (Or we'll exceed - // the size limit, if the second part of the condition was true.) - return false; - } - // We're going to need a new block; check that the block index has room - if (pr_blockIndexRaw == nullptr || pr_blockIndexSlotsUsed == pr_blockIndexSize) { - // Hmm, the circular block index is already full -- we'll need - // to allocate a new index. Note pr_blockIndexRaw can only be nullptr if - // the initial allocation failed in the constructor. - - MOODYCAMEL_CONSTEXPR_IF (allocMode == CannotAlloc) { - return false; - } - else if (!new_block_index(pr_blockIndexSlotsUsed)) { - return false; - } - } - - // Insert a new block in the circular linked list - auto newBlock = this->parent->ConcurrentQueue::template requisition_block(); - if (newBlock == nullptr) { - return false; - } -#ifdef MCDBGQ_TRACKMEM - newBlock->owner = this; -#endif - newBlock->ConcurrentQueue::Block::template reset_empty(); - if (this->tailBlock == nullptr) { - newBlock->next = newBlock; - } - else { - newBlock->next = this->tailBlock->next; - this->tailBlock->next = newBlock; - } - this->tailBlock = newBlock; - ++pr_blockIndexSlotsUsed; - } - - MOODYCAMEL_CONSTEXPR_IF (!MOODYCAMEL_NOEXCEPT_CTOR(T, U, new (static_cast(nullptr)) T(std::forward(element)))) { - // The constructor may throw. We want the element not to appear in the queue in - // that case (without corrupting the queue): - MOODYCAMEL_TRY { - new ((*this->tailBlock)[currentTailIndex]) T(std::forward(element)); - } - MOODYCAMEL_CATCH (...) { - // Revert change to the current block, but leave the new block available - // for next time - pr_blockIndexSlotsUsed = originalBlockIndexSlotsUsed; - this->tailBlock = startBlock == nullptr ? this->tailBlock : startBlock; - MOODYCAMEL_RETHROW; - } - } - else { - (void)startBlock; - (void)originalBlockIndexSlotsUsed; - } - - // Add block to block index - auto& entry = blockIndex.load(std::memory_order_relaxed)->entries[pr_blockIndexFront]; - entry.base = currentTailIndex; - entry.block = this->tailBlock; - blockIndex.load(std::memory_order_relaxed)->front.store(pr_blockIndexFront, std::memory_order_release); - pr_blockIndexFront = (pr_blockIndexFront + 1) & (pr_blockIndexSize - 1); - - MOODYCAMEL_CONSTEXPR_IF (!MOODYCAMEL_NOEXCEPT_CTOR(T, U, new (static_cast(nullptr)) T(std::forward(element)))) { - this->tailIndex.store(newTailIndex, std::memory_order_release); - return true; - } - } - - // Enqueue - new ((*this->tailBlock)[currentTailIndex]) T(std::forward(element)); - - this->tailIndex.store(newTailIndex, std::memory_order_release); - return true; - } - - template - bool dequeue(U& element) - { - auto tail = this->tailIndex.load(std::memory_order_relaxed); - auto overcommit = this->dequeueOvercommit.load(std::memory_order_relaxed); - if (details::circular_less_than(this->dequeueOptimisticCount.load(std::memory_order_relaxed) - overcommit, tail)) { - // Might be something to dequeue, let's give it a try - - // Note that this if is purely for performance purposes in the common case when the queue is - // empty and the values are eventually consistent -- we may enter here spuriously. - - // Note that whatever the values of overcommit and tail are, they are not going to change (unless we - // change them) and must be the same value at this point (inside the if) as when the if condition was - // evaluated. - - // We insert an acquire fence here to synchronize-with the release upon incrementing dequeueOvercommit below. - // This ensures that whatever the value we got loaded into overcommit, the load of dequeueOptisticCount in - // the fetch_add below will result in a value at least as recent as that (and therefore at least as large). - // Note that I believe a compiler (signal) fence here would be sufficient due to the nature of fetch_add (all - // read-modify-write operations are guaranteed to work on the latest value in the modification order), but - // unfortunately that can't be shown to be correct using only the C++11 standard. - // See http://stackoverflow.com/questions/18223161/what-are-the-c11-memory-ordering-guarantees-in-this-corner-case - std::atomic_thread_fence(std::memory_order_acquire); - - // Increment optimistic counter, then check if it went over the boundary - auto myDequeueCount = this->dequeueOptimisticCount.fetch_add(1, std::memory_order_relaxed); - - // Note that since dequeueOvercommit must be <= dequeueOptimisticCount (because dequeueOvercommit is only ever - // incremented after dequeueOptimisticCount -- this is enforced in the `else` block below), and since we now - // have a version of dequeueOptimisticCount that is at least as recent as overcommit (due to the release upon - // incrementing dequeueOvercommit and the acquire above that synchronizes with it), overcommit <= myDequeueCount. - // However, we can't assert this since both dequeueOptimisticCount and dequeueOvercommit may (independently) - // overflow; in such a case, though, the logic still holds since the difference between the two is maintained. - - // Note that we reload tail here in case it changed; it will be the same value as before or greater, since - // this load is sequenced after (happens after) the earlier load above. This is supported by read-read - // coherency (as defined in the standard), explained here: http://en.cppreference.com/w/cpp/atomic/memory_order - tail = this->tailIndex.load(std::memory_order_acquire); - if ((details::likely)(details::circular_less_than(myDequeueCount - overcommit, tail))) { - // Guaranteed to be at least one element to dequeue! - - // Get the index. Note that since there's guaranteed to be at least one element, this - // will never exceed tail. We need to do an acquire-release fence here since it's possible - // that whatever condition got us to this point was for an earlier enqueued element (that - // we already see the memory effects for), but that by the time we increment somebody else - // has incremented it, and we need to see the memory effects for *that* element, which is - // in such a case is necessarily visible on the thread that incremented it in the first - // place with the more current condition (they must have acquired a tail that is at least - // as recent). - auto index = this->headIndex.fetch_add(1, std::memory_order_acq_rel); - - - // Determine which block the element is in - - auto localBlockIndex = blockIndex.load(std::memory_order_acquire); - auto localBlockIndexHead = localBlockIndex->front.load(std::memory_order_acquire); - - // We need to be careful here about subtracting and dividing because of index wrap-around. - // When an index wraps, we need to preserve the sign of the offset when dividing it by the - // block size (in order to get a correct signed block count offset in all cases): - auto headBase = localBlockIndex->entries[localBlockIndexHead].base; - auto blockBaseIndex = index & ~static_cast(BLOCK_SIZE - 1); - auto offset = static_cast(static_cast::type>(blockBaseIndex - headBase) / static_cast::type>(BLOCK_SIZE)); - auto block = localBlockIndex->entries[(localBlockIndexHead + offset) & (localBlockIndex->size - 1)].block; - - // Dequeue - auto& el = *((*block)[index]); - if (!MOODYCAMEL_NOEXCEPT_ASSIGN(T, T&&, element = std::move(el))) { - // Make sure the element is still fully dequeued and destroyed even if the assignment - // throws - struct Guard { - Block* block; - index_t index; - - ~Guard() - { - (*block)[index]->~T(); - block->ConcurrentQueue::Block::template set_empty(index); - } - } guard = { block, index }; - - element = std::move(el); // NOLINT - } - else { - element = std::move(el); // NOLINT - el.~T(); // NOLINT - block->ConcurrentQueue::Block::template set_empty(index); - } - - return true; - } - else { - // Wasn't anything to dequeue after all; make the effective dequeue count eventually consistent - this->dequeueOvercommit.fetch_add(1, std::memory_order_release); // Release so that the fetch_add on dequeueOptimisticCount is guaranteed to happen before this write - } - } - - return false; - } - - template - bool MOODYCAMEL_NO_TSAN enqueue_bulk(It itemFirst, size_t count) - { - // First, we need to make sure we have enough room to enqueue all of the elements; - // this means pre-allocating blocks and putting them in the block index (but only if - // all the allocations succeeded). - index_t startTailIndex = this->tailIndex.load(std::memory_order_relaxed); - auto startBlock = this->tailBlock; - auto originalBlockIndexFront = pr_blockIndexFront; - auto originalBlockIndexSlotsUsed = pr_blockIndexSlotsUsed; - - Block* firstAllocatedBlock = nullptr; - - // Figure out how many blocks we'll need to allocate, and do so - size_t blockBaseDiff = ((startTailIndex + count - 1) & ~static_cast(BLOCK_SIZE - 1)) - ((startTailIndex - 1) & ~static_cast(BLOCK_SIZE - 1)); - index_t currentTailIndex = (startTailIndex - 1) & ~static_cast(BLOCK_SIZE - 1); - if (blockBaseDiff > 0) { - // Allocate as many blocks as possible from ahead - while (blockBaseDiff > 0 && this->tailBlock != nullptr && this->tailBlock->next != firstAllocatedBlock && this->tailBlock->next->ConcurrentQueue::Block::template is_empty()) { - blockBaseDiff -= static_cast(BLOCK_SIZE); - currentTailIndex += static_cast(BLOCK_SIZE); - - this->tailBlock = this->tailBlock->next; - firstAllocatedBlock = firstAllocatedBlock == nullptr ? this->tailBlock : firstAllocatedBlock; - - auto& entry = blockIndex.load(std::memory_order_relaxed)->entries[pr_blockIndexFront]; - entry.base = currentTailIndex; - entry.block = this->tailBlock; - pr_blockIndexFront = (pr_blockIndexFront + 1) & (pr_blockIndexSize - 1); - } - - // Now allocate as many blocks as necessary from the block pool - while (blockBaseDiff > 0) { - blockBaseDiff -= static_cast(BLOCK_SIZE); - currentTailIndex += static_cast(BLOCK_SIZE); - - auto head = this->headIndex.load(std::memory_order_relaxed); - assert(!details::circular_less_than(currentTailIndex, head)); - bool full = !details::circular_less_than(head, currentTailIndex + BLOCK_SIZE) || (MAX_SUBQUEUE_SIZE != details::const_numeric_max::value && (MAX_SUBQUEUE_SIZE == 0 || MAX_SUBQUEUE_SIZE - BLOCK_SIZE < currentTailIndex - head)); - if (pr_blockIndexRaw == nullptr || pr_blockIndexSlotsUsed == pr_blockIndexSize || full) { - MOODYCAMEL_CONSTEXPR_IF (allocMode == CannotAlloc) { - // Failed to allocate, undo changes (but keep injected blocks) - pr_blockIndexFront = originalBlockIndexFront; - pr_blockIndexSlotsUsed = originalBlockIndexSlotsUsed; - this->tailBlock = startBlock == nullptr ? firstAllocatedBlock : startBlock; - return false; - } - else if (full || !new_block_index(originalBlockIndexSlotsUsed)) { - // Failed to allocate, undo changes (but keep injected blocks) - pr_blockIndexFront = originalBlockIndexFront; - pr_blockIndexSlotsUsed = originalBlockIndexSlotsUsed; - this->tailBlock = startBlock == nullptr ? firstAllocatedBlock : startBlock; - return false; - } - - // pr_blockIndexFront is updated inside new_block_index, so we need to - // update our fallback value too (since we keep the new index even if we - // later fail) - originalBlockIndexFront = originalBlockIndexSlotsUsed; - } - - // Insert a new block in the circular linked list - auto newBlock = this->parent->ConcurrentQueue::template requisition_block(); - if (newBlock == nullptr) { - pr_blockIndexFront = originalBlockIndexFront; - pr_blockIndexSlotsUsed = originalBlockIndexSlotsUsed; - this->tailBlock = startBlock == nullptr ? firstAllocatedBlock : startBlock; - return false; - } - -#ifdef MCDBGQ_TRACKMEM - newBlock->owner = this; -#endif - newBlock->ConcurrentQueue::Block::template set_all_empty(); - if (this->tailBlock == nullptr) { - newBlock->next = newBlock; - } - else { - newBlock->next = this->tailBlock->next; - this->tailBlock->next = newBlock; - } - this->tailBlock = newBlock; - firstAllocatedBlock = firstAllocatedBlock == nullptr ? this->tailBlock : firstAllocatedBlock; - - ++pr_blockIndexSlotsUsed; - - auto& entry = blockIndex.load(std::memory_order_relaxed)->entries[pr_blockIndexFront]; - entry.base = currentTailIndex; - entry.block = this->tailBlock; - pr_blockIndexFront = (pr_blockIndexFront + 1) & (pr_blockIndexSize - 1); - } - - // Excellent, all allocations succeeded. Reset each block's emptiness before we fill them up, and - // publish the new block index front - auto block = firstAllocatedBlock; - while (true) { - block->ConcurrentQueue::Block::template reset_empty(); - if (block == this->tailBlock) { - break; - } - block = block->next; - } - - MOODYCAMEL_CONSTEXPR_IF (MOODYCAMEL_NOEXCEPT_CTOR(T, decltype(*itemFirst), new (static_cast(nullptr)) T(details::deref_noexcept(itemFirst)))) { - blockIndex.load(std::memory_order_relaxed)->front.store((pr_blockIndexFront - 1) & (pr_blockIndexSize - 1), std::memory_order_release); - } - } - - // Enqueue, one block at a time - index_t newTailIndex = startTailIndex + static_cast(count); - currentTailIndex = startTailIndex; - auto endBlock = this->tailBlock; - this->tailBlock = startBlock; - assert((startTailIndex & static_cast(BLOCK_SIZE - 1)) != 0 || firstAllocatedBlock != nullptr || count == 0); - if ((startTailIndex & static_cast(BLOCK_SIZE - 1)) == 0 && firstAllocatedBlock != nullptr) { - this->tailBlock = firstAllocatedBlock; - } - while (true) { - index_t stopIndex = (currentTailIndex & ~static_cast(BLOCK_SIZE - 1)) + static_cast(BLOCK_SIZE); - if (details::circular_less_than(newTailIndex, stopIndex)) { - stopIndex = newTailIndex; - } - MOODYCAMEL_CONSTEXPR_IF (MOODYCAMEL_NOEXCEPT_CTOR(T, decltype(*itemFirst), new (static_cast(nullptr)) T(details::deref_noexcept(itemFirst)))) { - while (currentTailIndex != stopIndex) { - new ((*this->tailBlock)[currentTailIndex++]) T(*itemFirst++); - } - } - else { - MOODYCAMEL_TRY { - while (currentTailIndex != stopIndex) { - // Must use copy constructor even if move constructor is available - // because we may have to revert if there's an exception. - // Sorry about the horrible templated next line, but it was the only way - // to disable moving *at compile time*, which is important because a type - // may only define a (noexcept) move constructor, and so calls to the - // cctor will not compile, even if they are in an if branch that will never - // be executed - new ((*this->tailBlock)[currentTailIndex]) T(details::nomove_if(nullptr)) T(details::deref_noexcept(itemFirst)))>::eval(*itemFirst)); - ++currentTailIndex; - ++itemFirst; - } - } - MOODYCAMEL_CATCH (...) { - // Oh dear, an exception's been thrown -- destroy the elements that - // were enqueued so far and revert the entire bulk operation (we'll keep - // any allocated blocks in our linked list for later, though). - auto constructedStopIndex = currentTailIndex; - auto lastBlockEnqueued = this->tailBlock; - - pr_blockIndexFront = originalBlockIndexFront; - pr_blockIndexSlotsUsed = originalBlockIndexSlotsUsed; - this->tailBlock = startBlock == nullptr ? firstAllocatedBlock : startBlock; - - if (!details::is_trivially_destructible::value) { - auto block = startBlock; - if ((startTailIndex & static_cast(BLOCK_SIZE - 1)) == 0) { - block = firstAllocatedBlock; - } - currentTailIndex = startTailIndex; - while (true) { - stopIndex = (currentTailIndex & ~static_cast(BLOCK_SIZE - 1)) + static_cast(BLOCK_SIZE); - if (details::circular_less_than(constructedStopIndex, stopIndex)) { - stopIndex = constructedStopIndex; - } - while (currentTailIndex != stopIndex) { - (*block)[currentTailIndex++]->~T(); - } - if (block == lastBlockEnqueued) { - break; - } - block = block->next; - } - } - MOODYCAMEL_RETHROW; - } - } - - if (this->tailBlock == endBlock) { - assert(currentTailIndex == newTailIndex); - break; - } - this->tailBlock = this->tailBlock->next; - } - - MOODYCAMEL_CONSTEXPR_IF (!MOODYCAMEL_NOEXCEPT_CTOR(T, decltype(*itemFirst), new (static_cast(nullptr)) T(details::deref_noexcept(itemFirst)))) { - if (firstAllocatedBlock != nullptr) - blockIndex.load(std::memory_order_relaxed)->front.store((pr_blockIndexFront - 1) & (pr_blockIndexSize - 1), std::memory_order_release); - } - - this->tailIndex.store(newTailIndex, std::memory_order_release); - return true; - } - - template - size_t dequeue_bulk(It& itemFirst, size_t max) - { - auto tail = this->tailIndex.load(std::memory_order_relaxed); - auto overcommit = this->dequeueOvercommit.load(std::memory_order_relaxed); - auto desiredCount = static_cast(tail - (this->dequeueOptimisticCount.load(std::memory_order_relaxed) - overcommit)); - if (details::circular_less_than(0, desiredCount)) { - desiredCount = desiredCount < max ? desiredCount : max; - std::atomic_thread_fence(std::memory_order_acquire); - - auto myDequeueCount = this->dequeueOptimisticCount.fetch_add(desiredCount, std::memory_order_relaxed); - - tail = this->tailIndex.load(std::memory_order_acquire); - auto actualCount = static_cast(tail - (myDequeueCount - overcommit)); - if (details::circular_less_than(0, actualCount)) { - actualCount = desiredCount < actualCount ? desiredCount : actualCount; - if (actualCount < desiredCount) { - this->dequeueOvercommit.fetch_add(desiredCount - actualCount, std::memory_order_release); - } - - // Get the first index. Note that since there's guaranteed to be at least actualCount elements, this - // will never exceed tail. - auto firstIndex = this->headIndex.fetch_add(actualCount, std::memory_order_acq_rel); - - // Determine which block the first element is in - auto localBlockIndex = blockIndex.load(std::memory_order_acquire); - auto localBlockIndexHead = localBlockIndex->front.load(std::memory_order_acquire); - - auto headBase = localBlockIndex->entries[localBlockIndexHead].base; - auto firstBlockBaseIndex = firstIndex & ~static_cast(BLOCK_SIZE - 1); - auto offset = static_cast(static_cast::type>(firstBlockBaseIndex - headBase) / static_cast::type>(BLOCK_SIZE)); - auto indexIndex = (localBlockIndexHead + offset) & (localBlockIndex->size - 1); - - // Iterate the blocks and dequeue - auto index = firstIndex; - do { - auto firstIndexInBlock = index; - index_t endIndex = (index & ~static_cast(BLOCK_SIZE - 1)) + static_cast(BLOCK_SIZE); - endIndex = details::circular_less_than(firstIndex + static_cast(actualCount), endIndex) ? firstIndex + static_cast(actualCount) : endIndex; - auto block = localBlockIndex->entries[indexIndex].block; - if (MOODYCAMEL_NOEXCEPT_ASSIGN(T, T&&, details::deref_noexcept(itemFirst) = std::move((*(*block)[index])))) { - while (index != endIndex) { - auto& el = *((*block)[index]); - *itemFirst++ = std::move(el); - el.~T(); - ++index; - } - } - else { - MOODYCAMEL_TRY { - while (index != endIndex) { - auto& el = *((*block)[index]); - *itemFirst = std::move(el); - ++itemFirst; - el.~T(); - ++index; - } - } - MOODYCAMEL_CATCH (...) { - // It's too late to revert the dequeue, but we can make sure that all - // the dequeued objects are properly destroyed and the block index - // (and empty count) are properly updated before we propagate the exception - do { - block = localBlockIndex->entries[indexIndex].block; - while (index != endIndex) { - (*block)[index++]->~T(); - } - block->ConcurrentQueue::Block::template set_many_empty(firstIndexInBlock, static_cast(endIndex - firstIndexInBlock)); - indexIndex = (indexIndex + 1) & (localBlockIndex->size - 1); - - firstIndexInBlock = index; - endIndex = (index & ~static_cast(BLOCK_SIZE - 1)) + static_cast(BLOCK_SIZE); - endIndex = details::circular_less_than(firstIndex + static_cast(actualCount), endIndex) ? firstIndex + static_cast(actualCount) : endIndex; - } while (index != firstIndex + actualCount); - - MOODYCAMEL_RETHROW; - } - } - block->ConcurrentQueue::Block::template set_many_empty(firstIndexInBlock, static_cast(endIndex - firstIndexInBlock)); - indexIndex = (indexIndex + 1) & (localBlockIndex->size - 1); - } while (index != firstIndex + actualCount); - - return actualCount; - } - else { - // Wasn't anything to dequeue after all; make the effective dequeue count eventually consistent - this->dequeueOvercommit.fetch_add(desiredCount, std::memory_order_release); - } - } - - return 0; - } - - private: - struct BlockIndexEntry - { - index_t base; - Block* block; - }; - - struct BlockIndexHeader - { - size_t size; - std::atomic front; // Current slot (not next, like pr_blockIndexFront) - BlockIndexEntry* entries; - void* prev; - }; - - - bool new_block_index(size_t numberOfFilledSlotsToExpose) - { - auto prevBlockSizeMask = pr_blockIndexSize - 1; - - // Create the new block - pr_blockIndexSize <<= 1; - auto newRawPtr = static_cast((Traits::malloc)(sizeof(BlockIndexHeader) + std::alignment_of::value - 1 + sizeof(BlockIndexEntry) * pr_blockIndexSize)); - if (newRawPtr == nullptr) { - pr_blockIndexSize >>= 1; // Reset to allow graceful retry - return false; - } - - auto newBlockIndexEntries = reinterpret_cast(details::align_for(newRawPtr + sizeof(BlockIndexHeader))); - - // Copy in all the old indices, if any - size_t j = 0; - if (pr_blockIndexSlotsUsed != 0) { - auto i = (pr_blockIndexFront - pr_blockIndexSlotsUsed) & prevBlockSizeMask; - do { - newBlockIndexEntries[j++] = pr_blockIndexEntries[i]; - i = (i + 1) & prevBlockSizeMask; - } while (i != pr_blockIndexFront); - } - - // Update everything - auto header = new (newRawPtr) BlockIndexHeader; - header->size = pr_blockIndexSize; - header->front.store(numberOfFilledSlotsToExpose - 1, std::memory_order_relaxed); - header->entries = newBlockIndexEntries; - header->prev = pr_blockIndexRaw; // we link the new block to the old one so we can free it later - - pr_blockIndexFront = j; - pr_blockIndexEntries = newBlockIndexEntries; - pr_blockIndexRaw = newRawPtr; - blockIndex.store(header, std::memory_order_release); - - return true; - } - - private: - std::atomic blockIndex; - - // To be used by producer only -- consumer must use the ones in referenced by blockIndex - size_t pr_blockIndexSlotsUsed; - size_t pr_blockIndexSize; - size_t pr_blockIndexFront; // Next slot (not current) - BlockIndexEntry* pr_blockIndexEntries; - void* pr_blockIndexRaw; - -#ifdef MOODYCAMEL_QUEUE_INTERNAL_DEBUG - public: - ExplicitProducer* nextExplicitProducer; - private: -#endif - -#ifdef MCDBGQ_TRACKMEM - friend struct MemStats; -#endif - }; - - - ////////////////////////////////// - // Implicit queue - ////////////////////////////////// - - struct ImplicitProducer : public ProducerBase - { - ImplicitProducer(ConcurrentQueue* parent_) : - ProducerBase(parent_, false), - nextBlockIndexCapacity(IMPLICIT_INITIAL_INDEX_SIZE), - blockIndex(nullptr) - { - new_block_index(); - } - - ~ImplicitProducer() - { - // Note that since we're in the destructor we can assume that all enqueue/dequeue operations - // completed already; this means that all undequeued elements are placed contiguously across - // contiguous blocks, and that only the first and last remaining blocks can be only partially - // empty (all other remaining blocks must be completely full). - -#ifdef MOODYCAMEL_CPP11_THREAD_LOCAL_SUPPORTED - // Unregister ourselves for thread termination notification - if (!this->inactive.load(std::memory_order_relaxed)) { - details::ThreadExitNotifier::unsubscribe(&threadExitListener); - } -#endif - - // Destroy all remaining elements! - auto tail = this->tailIndex.load(std::memory_order_relaxed); - auto index = this->headIndex.load(std::memory_order_relaxed); - Block* block = nullptr; - assert(index == tail || details::circular_less_than(index, tail)); - bool forceFreeLastBlock = index != tail; // If we enter the loop, then the last (tail) block will not be freed - while (index != tail) { - if ((index & static_cast(BLOCK_SIZE - 1)) == 0 || block == nullptr) { - if (block != nullptr) { - // Free the old block - this->parent->add_block_to_free_list(block); - } - - block = get_block_index_entry_for_index(index)->value.load(std::memory_order_relaxed); - } - - ((*block)[index])->~T(); - ++index; - } - // Even if the queue is empty, there's still one block that's not on the free list - // (unless the head index reached the end of it, in which case the tail will be poised - // to create a new block). - if (this->tailBlock != nullptr && (forceFreeLastBlock || (tail & static_cast(BLOCK_SIZE - 1)) != 0)) { - this->parent->add_block_to_free_list(this->tailBlock); - } - - // Destroy block index - auto localBlockIndex = blockIndex.load(std::memory_order_relaxed); - if (localBlockIndex != nullptr) { - for (size_t i = 0; i != localBlockIndex->capacity; ++i) { - localBlockIndex->index[i]->~BlockIndexEntry(); - } - do { - auto prev = localBlockIndex->prev; - localBlockIndex->~BlockIndexHeader(); - (Traits::free)(localBlockIndex); - localBlockIndex = prev; - } while (localBlockIndex != nullptr); - } - } - - template - inline bool enqueue(U&& element) - { - index_t currentTailIndex = this->tailIndex.load(std::memory_order_relaxed); - index_t newTailIndex = 1 + currentTailIndex; - if ((currentTailIndex & static_cast(BLOCK_SIZE - 1)) == 0) { - // We reached the end of a block, start a new one - auto head = this->headIndex.load(std::memory_order_relaxed); - assert(!details::circular_less_than(currentTailIndex, head)); - if (!details::circular_less_than(head, currentTailIndex + BLOCK_SIZE) || (MAX_SUBQUEUE_SIZE != details::const_numeric_max::value && (MAX_SUBQUEUE_SIZE == 0 || MAX_SUBQUEUE_SIZE - BLOCK_SIZE < currentTailIndex - head))) { - return false; - } -#ifdef MCDBGQ_NOLOCKFREE_IMPLICITPRODBLOCKINDEX - debug::DebugLock lock(mutex); -#endif - // Find out where we'll be inserting this block in the block index - BlockIndexEntry* idxEntry; - if (!insert_block_index_entry(idxEntry, currentTailIndex)) { - return false; - } - - // Get ahold of a new block - auto newBlock = this->parent->ConcurrentQueue::template requisition_block(); - if (newBlock == nullptr) { - rewind_block_index_tail(); - idxEntry->value.store(nullptr, std::memory_order_relaxed); - return false; - } -#ifdef MCDBGQ_TRACKMEM - newBlock->owner = this; -#endif - newBlock->ConcurrentQueue::Block::template reset_empty(); - - MOODYCAMEL_CONSTEXPR_IF (!MOODYCAMEL_NOEXCEPT_CTOR(T, U, new (static_cast(nullptr)) T(std::forward(element)))) { - // May throw, try to insert now before we publish the fact that we have this new block - MOODYCAMEL_TRY { - new ((*newBlock)[currentTailIndex]) T(std::forward(element)); - } - MOODYCAMEL_CATCH (...) { - rewind_block_index_tail(); - idxEntry->value.store(nullptr, std::memory_order_relaxed); - this->parent->add_block_to_free_list(newBlock); - MOODYCAMEL_RETHROW; - } - } - - // Insert the new block into the index - idxEntry->value.store(newBlock, std::memory_order_relaxed); - - this->tailBlock = newBlock; - - MOODYCAMEL_CONSTEXPR_IF (!MOODYCAMEL_NOEXCEPT_CTOR(T, U, new (static_cast(nullptr)) T(std::forward(element)))) { - this->tailIndex.store(newTailIndex, std::memory_order_release); - return true; - } - } - - // Enqueue - new ((*this->tailBlock)[currentTailIndex]) T(std::forward(element)); - - this->tailIndex.store(newTailIndex, std::memory_order_release); - return true; - } - - template - bool dequeue(U& element) - { - // See ExplicitProducer::dequeue for rationale and explanation - index_t tail = this->tailIndex.load(std::memory_order_relaxed); - index_t overcommit = this->dequeueOvercommit.load(std::memory_order_relaxed); - if (details::circular_less_than(this->dequeueOptimisticCount.load(std::memory_order_relaxed) - overcommit, tail)) { - std::atomic_thread_fence(std::memory_order_acquire); - - index_t myDequeueCount = this->dequeueOptimisticCount.fetch_add(1, std::memory_order_relaxed); - tail = this->tailIndex.load(std::memory_order_acquire); - if ((details::likely)(details::circular_less_than(myDequeueCount - overcommit, tail))) { - index_t index = this->headIndex.fetch_add(1, std::memory_order_acq_rel); - - // Determine which block the element is in - auto entry = get_block_index_entry_for_index(index); - - // Dequeue - auto block = entry->value.load(std::memory_order_relaxed); - auto& el = *((*block)[index]); - - if (!MOODYCAMEL_NOEXCEPT_ASSIGN(T, T&&, element = std::move(el))) { -#ifdef MCDBGQ_NOLOCKFREE_IMPLICITPRODBLOCKINDEX - // Note: Acquiring the mutex with every dequeue instead of only when a block - // is released is very sub-optimal, but it is, after all, purely debug code. - debug::DebugLock lock(producer->mutex); -#endif - struct Guard { - Block* block; - index_t index; - BlockIndexEntry* entry; - ConcurrentQueue* parent; - - ~Guard() - { - (*block)[index]->~T(); - if (block->ConcurrentQueue::Block::template set_empty(index)) { - entry->value.store(nullptr, std::memory_order_relaxed); - parent->add_block_to_free_list(block); - } - } - } guard = { block, index, entry, this->parent }; - - element = std::move(el); // NOLINT - } - else { - element = std::move(el); // NOLINT - el.~T(); // NOLINT - - if (block->ConcurrentQueue::Block::template set_empty(index)) { - { -#ifdef MCDBGQ_NOLOCKFREE_IMPLICITPRODBLOCKINDEX - debug::DebugLock lock(mutex); -#endif - // Add the block back into the global free pool (and remove from block index) - entry->value.store(nullptr, std::memory_order_relaxed); - } - this->parent->add_block_to_free_list(block); // releases the above store - } - } - - return true; - } - else { - this->dequeueOvercommit.fetch_add(1, std::memory_order_release); - } - } - - return false; - } - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable: 4706) // assignment within conditional expression -#endif - template - bool enqueue_bulk(It itemFirst, size_t count) - { - // First, we need to make sure we have enough room to enqueue all of the elements; - // this means pre-allocating blocks and putting them in the block index (but only if - // all the allocations succeeded). - - // Note that the tailBlock we start off with may not be owned by us any more; - // this happens if it was filled up exactly to the top (setting tailIndex to - // the first index of the next block which is not yet allocated), then dequeued - // completely (putting it on the free list) before we enqueue again. - - index_t startTailIndex = this->tailIndex.load(std::memory_order_relaxed); - auto startBlock = this->tailBlock; - Block* firstAllocatedBlock = nullptr; - auto endBlock = this->tailBlock; - - // Figure out how many blocks we'll need to allocate, and do so - size_t blockBaseDiff = ((startTailIndex + count - 1) & ~static_cast(BLOCK_SIZE - 1)) - ((startTailIndex - 1) & ~static_cast(BLOCK_SIZE - 1)); - index_t currentTailIndex = (startTailIndex - 1) & ~static_cast(BLOCK_SIZE - 1); - if (blockBaseDiff > 0) { -#ifdef MCDBGQ_NOLOCKFREE_IMPLICITPRODBLOCKINDEX - debug::DebugLock lock(mutex); -#endif - do { - blockBaseDiff -= static_cast(BLOCK_SIZE); - currentTailIndex += static_cast(BLOCK_SIZE); - - // Find out where we'll be inserting this block in the block index - BlockIndexEntry* idxEntry = nullptr; // initialization here unnecessary but compiler can't always tell - Block* newBlock; - bool indexInserted = false; - auto head = this->headIndex.load(std::memory_order_relaxed); - assert(!details::circular_less_than(currentTailIndex, head)); - bool full = !details::circular_less_than(head, currentTailIndex + BLOCK_SIZE) || (MAX_SUBQUEUE_SIZE != details::const_numeric_max::value && (MAX_SUBQUEUE_SIZE == 0 || MAX_SUBQUEUE_SIZE - BLOCK_SIZE < currentTailIndex - head)); - - if (full || !(indexInserted = insert_block_index_entry(idxEntry, currentTailIndex)) || (newBlock = this->parent->ConcurrentQueue::template requisition_block()) == nullptr) { - // Index allocation or block allocation failed; revert any other allocations - // and index insertions done so far for this operation - if (indexInserted) { - rewind_block_index_tail(); - idxEntry->value.store(nullptr, std::memory_order_relaxed); - } - currentTailIndex = (startTailIndex - 1) & ~static_cast(BLOCK_SIZE - 1); - for (auto block = firstAllocatedBlock; block != nullptr; block = block->next) { - currentTailIndex += static_cast(BLOCK_SIZE); - idxEntry = get_block_index_entry_for_index(currentTailIndex); - idxEntry->value.store(nullptr, std::memory_order_relaxed); - rewind_block_index_tail(); - } - this->parent->add_blocks_to_free_list(firstAllocatedBlock); - this->tailBlock = startBlock; - - return false; - } - -#ifdef MCDBGQ_TRACKMEM - newBlock->owner = this; -#endif - newBlock->ConcurrentQueue::Block::template reset_empty(); - newBlock->next = nullptr; - - // Insert the new block into the index - idxEntry->value.store(newBlock, std::memory_order_relaxed); - - // Store the chain of blocks so that we can undo if later allocations fail, - // and so that we can find the blocks when we do the actual enqueueing - if ((startTailIndex & static_cast(BLOCK_SIZE - 1)) != 0 || firstAllocatedBlock != nullptr) { - assert(this->tailBlock != nullptr); - this->tailBlock->next = newBlock; - } - this->tailBlock = newBlock; - endBlock = newBlock; - firstAllocatedBlock = firstAllocatedBlock == nullptr ? newBlock : firstAllocatedBlock; - } while (blockBaseDiff > 0); - } - - // Enqueue, one block at a time - index_t newTailIndex = startTailIndex + static_cast(count); - currentTailIndex = startTailIndex; - this->tailBlock = startBlock; - assert((startTailIndex & static_cast(BLOCK_SIZE - 1)) != 0 || firstAllocatedBlock != nullptr || count == 0); - if ((startTailIndex & static_cast(BLOCK_SIZE - 1)) == 0 && firstAllocatedBlock != nullptr) { - this->tailBlock = firstAllocatedBlock; - } - while (true) { - index_t stopIndex = (currentTailIndex & ~static_cast(BLOCK_SIZE - 1)) + static_cast(BLOCK_SIZE); - if (details::circular_less_than(newTailIndex, stopIndex)) { - stopIndex = newTailIndex; - } - MOODYCAMEL_CONSTEXPR_IF (MOODYCAMEL_NOEXCEPT_CTOR(T, decltype(*itemFirst), new (static_cast(nullptr)) T(details::deref_noexcept(itemFirst)))) { - while (currentTailIndex != stopIndex) { - new ((*this->tailBlock)[currentTailIndex++]) T(*itemFirst++); - } - } - else { - MOODYCAMEL_TRY { - while (currentTailIndex != stopIndex) { - new ((*this->tailBlock)[currentTailIndex]) T(details::nomove_if(nullptr)) T(details::deref_noexcept(itemFirst)))>::eval(*itemFirst)); - ++currentTailIndex; - ++itemFirst; - } - } - MOODYCAMEL_CATCH (...) { - auto constructedStopIndex = currentTailIndex; - auto lastBlockEnqueued = this->tailBlock; - - if (!details::is_trivially_destructible::value) { - auto block = startBlock; - if ((startTailIndex & static_cast(BLOCK_SIZE - 1)) == 0) { - block = firstAllocatedBlock; - } - currentTailIndex = startTailIndex; - while (true) { - stopIndex = (currentTailIndex & ~static_cast(BLOCK_SIZE - 1)) + static_cast(BLOCK_SIZE); - if (details::circular_less_than(constructedStopIndex, stopIndex)) { - stopIndex = constructedStopIndex; - } - while (currentTailIndex != stopIndex) { - (*block)[currentTailIndex++]->~T(); - } - if (block == lastBlockEnqueued) { - break; - } - block = block->next; - } - } - - currentTailIndex = (startTailIndex - 1) & ~static_cast(BLOCK_SIZE - 1); - for (auto block = firstAllocatedBlock; block != nullptr; block = block->next) { - currentTailIndex += static_cast(BLOCK_SIZE); - auto idxEntry = get_block_index_entry_for_index(currentTailIndex); - idxEntry->value.store(nullptr, std::memory_order_relaxed); - rewind_block_index_tail(); - } - this->parent->add_blocks_to_free_list(firstAllocatedBlock); - this->tailBlock = startBlock; - MOODYCAMEL_RETHROW; - } - } - - if (this->tailBlock == endBlock) { - assert(currentTailIndex == newTailIndex); - break; - } - this->tailBlock = this->tailBlock->next; - } - this->tailIndex.store(newTailIndex, std::memory_order_release); - return true; - } -#ifdef _MSC_VER -#pragma warning(pop) -#endif - - template - size_t dequeue_bulk(It& itemFirst, size_t max) - { - auto tail = this->tailIndex.load(std::memory_order_relaxed); - auto overcommit = this->dequeueOvercommit.load(std::memory_order_relaxed); - auto desiredCount = static_cast(tail - (this->dequeueOptimisticCount.load(std::memory_order_relaxed) - overcommit)); - if (details::circular_less_than(0, desiredCount)) { - desiredCount = desiredCount < max ? desiredCount : max; - std::atomic_thread_fence(std::memory_order_acquire); - - auto myDequeueCount = this->dequeueOptimisticCount.fetch_add(desiredCount, std::memory_order_relaxed); - - tail = this->tailIndex.load(std::memory_order_acquire); - auto actualCount = static_cast(tail - (myDequeueCount - overcommit)); - if (details::circular_less_than(0, actualCount)) { - actualCount = desiredCount < actualCount ? desiredCount : actualCount; - if (actualCount < desiredCount) { - this->dequeueOvercommit.fetch_add(desiredCount - actualCount, std::memory_order_release); - } - - // Get the first index. Note that since there's guaranteed to be at least actualCount elements, this - // will never exceed tail. - auto firstIndex = this->headIndex.fetch_add(actualCount, std::memory_order_acq_rel); - - // Iterate the blocks and dequeue - auto index = firstIndex; - BlockIndexHeader* localBlockIndex; - auto indexIndex = get_block_index_index_for_index(index, localBlockIndex); - do { - auto blockStartIndex = index; - index_t endIndex = (index & ~static_cast(BLOCK_SIZE - 1)) + static_cast(BLOCK_SIZE); - endIndex = details::circular_less_than(firstIndex + static_cast(actualCount), endIndex) ? firstIndex + static_cast(actualCount) : endIndex; - - auto entry = localBlockIndex->index[indexIndex]; - auto block = entry->value.load(std::memory_order_relaxed); - if (MOODYCAMEL_NOEXCEPT_ASSIGN(T, T&&, details::deref_noexcept(itemFirst) = std::move((*(*block)[index])))) { - while (index != endIndex) { - auto& el = *((*block)[index]); - *itemFirst++ = std::move(el); - el.~T(); - ++index; - } - } - else { - MOODYCAMEL_TRY { - while (index != endIndex) { - auto& el = *((*block)[index]); - *itemFirst = std::move(el); - ++itemFirst; - el.~T(); - ++index; - } - } - MOODYCAMEL_CATCH (...) { - do { - entry = localBlockIndex->index[indexIndex]; - block = entry->value.load(std::memory_order_relaxed); - while (index != endIndex) { - (*block)[index++]->~T(); - } - - if (block->ConcurrentQueue::Block::template set_many_empty(blockStartIndex, static_cast(endIndex - blockStartIndex))) { -#ifdef MCDBGQ_NOLOCKFREE_IMPLICITPRODBLOCKINDEX - debug::DebugLock lock(mutex); -#endif - entry->value.store(nullptr, std::memory_order_relaxed); - this->parent->add_block_to_free_list(block); - } - indexIndex = (indexIndex + 1) & (localBlockIndex->capacity - 1); - - blockStartIndex = index; - endIndex = (index & ~static_cast(BLOCK_SIZE - 1)) + static_cast(BLOCK_SIZE); - endIndex = details::circular_less_than(firstIndex + static_cast(actualCount), endIndex) ? firstIndex + static_cast(actualCount) : endIndex; - } while (index != firstIndex + actualCount); - - MOODYCAMEL_RETHROW; - } - } - if (block->ConcurrentQueue::Block::template set_many_empty(blockStartIndex, static_cast(endIndex - blockStartIndex))) { - { -#ifdef MCDBGQ_NOLOCKFREE_IMPLICITPRODBLOCKINDEX - debug::DebugLock lock(mutex); -#endif - // Note that the set_many_empty above did a release, meaning that anybody who acquires the block - // we're about to free can use it safely since our writes (and reads!) will have happened-before then. - entry->value.store(nullptr, std::memory_order_relaxed); - } - this->parent->add_block_to_free_list(block); // releases the above store - } - indexIndex = (indexIndex + 1) & (localBlockIndex->capacity - 1); - } while (index != firstIndex + actualCount); - - return actualCount; - } - else { - this->dequeueOvercommit.fetch_add(desiredCount, std::memory_order_release); - } - } - - return 0; - } - - private: - // The block size must be > 1, so any number with the low bit set is an invalid block base index - static const index_t INVALID_BLOCK_BASE = 1; - - struct BlockIndexEntry - { - std::atomic key; - std::atomic value; - }; - - struct BlockIndexHeader - { - size_t capacity; - std::atomic tail; - BlockIndexEntry* entries; - BlockIndexEntry** index; - BlockIndexHeader* prev; - }; - - template - inline bool insert_block_index_entry(BlockIndexEntry*& idxEntry, index_t blockStartIndex) - { - auto localBlockIndex = blockIndex.load(std::memory_order_relaxed); // We're the only writer thread, relaxed is OK - if (localBlockIndex == nullptr) { - return false; // this can happen if new_block_index failed in the constructor - } - size_t newTail = (localBlockIndex->tail.load(std::memory_order_relaxed) + 1) & (localBlockIndex->capacity - 1); - idxEntry = localBlockIndex->index[newTail]; - if (idxEntry->key.load(std::memory_order_relaxed) == INVALID_BLOCK_BASE || - idxEntry->value.load(std::memory_order_relaxed) == nullptr) { - - idxEntry->key.store(blockStartIndex, std::memory_order_relaxed); - localBlockIndex->tail.store(newTail, std::memory_order_release); - return true; - } - - // No room in the old block index, try to allocate another one! - MOODYCAMEL_CONSTEXPR_IF (allocMode == CannotAlloc) { - return false; - } - else if (!new_block_index()) { - return false; - } - else { - localBlockIndex = blockIndex.load(std::memory_order_relaxed); - newTail = (localBlockIndex->tail.load(std::memory_order_relaxed) + 1) & (localBlockIndex->capacity - 1); - idxEntry = localBlockIndex->index[newTail]; - assert(idxEntry->key.load(std::memory_order_relaxed) == INVALID_BLOCK_BASE); - idxEntry->key.store(blockStartIndex, std::memory_order_relaxed); - localBlockIndex->tail.store(newTail, std::memory_order_release); - return true; - } - } - - inline void rewind_block_index_tail() - { - auto localBlockIndex = blockIndex.load(std::memory_order_relaxed); - localBlockIndex->tail.store((localBlockIndex->tail.load(std::memory_order_relaxed) - 1) & (localBlockIndex->capacity - 1), std::memory_order_relaxed); - } - - inline BlockIndexEntry* get_block_index_entry_for_index(index_t index) const - { - BlockIndexHeader* localBlockIndex; - auto idx = get_block_index_index_for_index(index, localBlockIndex); - return localBlockIndex->index[idx]; - } - - inline size_t get_block_index_index_for_index(index_t index, BlockIndexHeader*& localBlockIndex) const - { -#ifdef MCDBGQ_NOLOCKFREE_IMPLICITPRODBLOCKINDEX - debug::DebugLock lock(mutex); -#endif - index &= ~static_cast(BLOCK_SIZE - 1); - localBlockIndex = blockIndex.load(std::memory_order_acquire); - auto tail = localBlockIndex->tail.load(std::memory_order_acquire); - auto tailBase = localBlockIndex->index[tail]->key.load(std::memory_order_relaxed); - assert(tailBase != INVALID_BLOCK_BASE); - // Note: Must use division instead of shift because the index may wrap around, causing a negative - // offset, whose negativity we want to preserve - auto offset = static_cast(static_cast::type>(index - tailBase) / static_cast::type>(BLOCK_SIZE)); - size_t idx = (tail + offset) & (localBlockIndex->capacity - 1); - assert(localBlockIndex->index[idx]->key.load(std::memory_order_relaxed) == index && localBlockIndex->index[idx]->value.load(std::memory_order_relaxed) != nullptr); - return idx; - } - - bool new_block_index() - { - auto prev = blockIndex.load(std::memory_order_relaxed); - size_t prevCapacity = prev == nullptr ? 0 : prev->capacity; - auto entryCount = prev == nullptr ? nextBlockIndexCapacity : prevCapacity; - auto raw = static_cast((Traits::malloc)( - sizeof(BlockIndexHeader) + - std::alignment_of::value - 1 + sizeof(BlockIndexEntry) * entryCount + - std::alignment_of::value - 1 + sizeof(BlockIndexEntry*) * nextBlockIndexCapacity)); - if (raw == nullptr) { - return false; - } - - auto header = new (raw) BlockIndexHeader; - auto entries = reinterpret_cast(details::align_for(raw + sizeof(BlockIndexHeader))); - auto index = reinterpret_cast(details::align_for(reinterpret_cast(entries) + sizeof(BlockIndexEntry) * entryCount)); - if (prev != nullptr) { - auto prevTail = prev->tail.load(std::memory_order_relaxed); - auto prevPos = prevTail; - size_t i = 0; - do { - prevPos = (prevPos + 1) & (prev->capacity - 1); - index[i++] = prev->index[prevPos]; - } while (prevPos != prevTail); - assert(i == prevCapacity); - } - for (size_t i = 0; i != entryCount; ++i) { - new (entries + i) BlockIndexEntry; - entries[i].key.store(INVALID_BLOCK_BASE, std::memory_order_relaxed); - index[prevCapacity + i] = entries + i; - } - header->prev = prev; - header->entries = entries; - header->index = index; - header->capacity = nextBlockIndexCapacity; - header->tail.store((prevCapacity - 1) & (nextBlockIndexCapacity - 1), std::memory_order_relaxed); - - blockIndex.store(header, std::memory_order_release); - - nextBlockIndexCapacity <<= 1; - - return true; - } - - private: - size_t nextBlockIndexCapacity; - std::atomic blockIndex; - -#ifdef MOODYCAMEL_CPP11_THREAD_LOCAL_SUPPORTED - public: - details::ThreadExitListener threadExitListener; - private: -#endif - -#ifdef MOODYCAMEL_QUEUE_INTERNAL_DEBUG - public: - ImplicitProducer* nextImplicitProducer; - private: -#endif - -#ifdef MCDBGQ_NOLOCKFREE_IMPLICITPRODBLOCKINDEX - mutable debug::DebugMutex mutex; -#endif -#ifdef MCDBGQ_TRACKMEM - friend struct MemStats; -#endif - }; - - - ////////////////////////////////// - // Block pool manipulation - ////////////////////////////////// - - void populate_initial_block_list(size_t blockCount) - { - initialBlockPoolSize = blockCount; - if (initialBlockPoolSize == 0) { - initialBlockPool = nullptr; - return; - } - - initialBlockPool = create_array(blockCount); - if (initialBlockPool == nullptr) { - initialBlockPoolSize = 0; - } - for (size_t i = 0; i < initialBlockPoolSize; ++i) { - initialBlockPool[i].dynamicallyAllocated = false; - } - } - - inline Block* try_get_block_from_initial_pool() - { - if (initialBlockPoolIndex.load(std::memory_order_relaxed) >= initialBlockPoolSize) { - return nullptr; - } - - auto index = initialBlockPoolIndex.fetch_add(1, std::memory_order_relaxed); - - return index < initialBlockPoolSize ? (initialBlockPool + index) : nullptr; - } - - inline void add_block_to_free_list(Block* block) - { -#ifdef MCDBGQ_TRACKMEM - block->owner = nullptr; -#endif - if (!Traits::RECYCLE_ALLOCATED_BLOCKS && block->dynamicallyAllocated) { - destroy(block); - } - else { - freeList.add(block); - } - } - - inline void add_blocks_to_free_list(Block* block) - { - while (block != nullptr) { - auto next = block->next; - add_block_to_free_list(block); - block = next; - } - } - - inline Block* try_get_block_from_free_list() - { - return freeList.try_get(); - } - - // Gets a free block from one of the memory pools, or allocates a new one (if applicable) - template - Block* requisition_block() - { - auto block = try_get_block_from_initial_pool(); - if (block != nullptr) { - return block; - } - - block = try_get_block_from_free_list(); - if (block != nullptr) { - return block; - } - - MOODYCAMEL_CONSTEXPR_IF (canAlloc == CanAlloc) { - return create(); - } - else { - return nullptr; - } - } - - -#ifdef MCDBGQ_TRACKMEM - public: - struct MemStats { - size_t allocatedBlocks; - size_t usedBlocks; - size_t freeBlocks; - size_t ownedBlocksExplicit; - size_t ownedBlocksImplicit; - size_t implicitProducers; - size_t explicitProducers; - size_t elementsEnqueued; - size_t blockClassBytes; - size_t queueClassBytes; - size_t implicitBlockIndexBytes; - size_t explicitBlockIndexBytes; - - friend class ConcurrentQueue; - - private: - static MemStats getFor(ConcurrentQueue* q) - { - MemStats stats = { 0 }; - - stats.elementsEnqueued = q->size_approx(); - - auto block = q->freeList.head_unsafe(); - while (block != nullptr) { - ++stats.allocatedBlocks; - ++stats.freeBlocks; - block = block->freeListNext.load(std::memory_order_relaxed); - } - - for (auto ptr = q->producerListTail.load(std::memory_order_acquire); ptr != nullptr; ptr = ptr->next_prod()) { - bool implicit = dynamic_cast(ptr) != nullptr; - stats.implicitProducers += implicit ? 1 : 0; - stats.explicitProducers += implicit ? 0 : 1; - - if (implicit) { - auto prod = static_cast(ptr); - stats.queueClassBytes += sizeof(ImplicitProducer); - auto head = prod->headIndex.load(std::memory_order_relaxed); - auto tail = prod->tailIndex.load(std::memory_order_relaxed); - auto hash = prod->blockIndex.load(std::memory_order_relaxed); - if (hash != nullptr) { - for (size_t i = 0; i != hash->capacity; ++i) { - if (hash->index[i]->key.load(std::memory_order_relaxed) != ImplicitProducer::INVALID_BLOCK_BASE && hash->index[i]->value.load(std::memory_order_relaxed) != nullptr) { - ++stats.allocatedBlocks; - ++stats.ownedBlocksImplicit; - } - } - stats.implicitBlockIndexBytes += hash->capacity * sizeof(typename ImplicitProducer::BlockIndexEntry); - for (; hash != nullptr; hash = hash->prev) { - stats.implicitBlockIndexBytes += sizeof(typename ImplicitProducer::BlockIndexHeader) + hash->capacity * sizeof(typename ImplicitProducer::BlockIndexEntry*); - } - } - for (; details::circular_less_than(head, tail); head += BLOCK_SIZE) { - //auto block = prod->get_block_index_entry_for_index(head); - ++stats.usedBlocks; - } - } - else { - auto prod = static_cast(ptr); - stats.queueClassBytes += sizeof(ExplicitProducer); - auto tailBlock = prod->tailBlock; - bool wasNonEmpty = false; - if (tailBlock != nullptr) { - auto block = tailBlock; - do { - ++stats.allocatedBlocks; - if (!block->ConcurrentQueue::Block::template is_empty() || wasNonEmpty) { - ++stats.usedBlocks; - wasNonEmpty = wasNonEmpty || block != tailBlock; - } - ++stats.ownedBlocksExplicit; - block = block->next; - } while (block != tailBlock); - } - auto index = prod->blockIndex.load(std::memory_order_relaxed); - while (index != nullptr) { - stats.explicitBlockIndexBytes += sizeof(typename ExplicitProducer::BlockIndexHeader) + index->size * sizeof(typename ExplicitProducer::BlockIndexEntry); - index = static_cast(index->prev); - } - } - } - - auto freeOnInitialPool = q->initialBlockPoolIndex.load(std::memory_order_relaxed) >= q->initialBlockPoolSize ? 0 : q->initialBlockPoolSize - q->initialBlockPoolIndex.load(std::memory_order_relaxed); - stats.allocatedBlocks += freeOnInitialPool; - stats.freeBlocks += freeOnInitialPool; - - stats.blockClassBytes = sizeof(Block) * stats.allocatedBlocks; - stats.queueClassBytes += sizeof(ConcurrentQueue); - - return stats; - } - }; - - // For debugging only. Not thread-safe. - MemStats getMemStats() - { - return MemStats::getFor(this); - } - private: - friend struct MemStats; -#endif - - - ////////////////////////////////// - // Producer list manipulation - ////////////////////////////////// - - ProducerBase* recycle_or_create_producer(bool isExplicit) - { -#ifdef MCDBGQ_NOLOCKFREE_IMPLICITPRODHASH - debug::DebugLock lock(implicitProdMutex); -#endif - // Try to re-use one first - for (auto ptr = producerListTail.load(std::memory_order_acquire); ptr != nullptr; ptr = ptr->next_prod()) { - if (ptr->inactive.load(std::memory_order_relaxed) && ptr->isExplicit == isExplicit) { - bool expected = true; - if (ptr->inactive.compare_exchange_strong(expected, /* desired */ false, std::memory_order_acquire, std::memory_order_relaxed)) { - // We caught one! It's been marked as activated, the caller can have it - return ptr; - } - } - } - - return add_producer(isExplicit ? static_cast(create(this)) : create(this)); - } - - ProducerBase* add_producer(ProducerBase* producer) - { - // Handle failed memory allocation - if (producer == nullptr) { - return nullptr; - } - - producerCount.fetch_add(1, std::memory_order_relaxed); - - // Add it to the lock-free list - auto prevTail = producerListTail.load(std::memory_order_relaxed); - do { - producer->next = prevTail; - } while (!producerListTail.compare_exchange_weak(prevTail, producer, std::memory_order_release, std::memory_order_relaxed)); - -#ifdef MOODYCAMEL_QUEUE_INTERNAL_DEBUG - if (producer->isExplicit) { - auto prevTailExplicit = explicitProducers.load(std::memory_order_relaxed); - do { - static_cast(producer)->nextExplicitProducer = prevTailExplicit; - } while (!explicitProducers.compare_exchange_weak(prevTailExplicit, static_cast(producer), std::memory_order_release, std::memory_order_relaxed)); - } - else { - auto prevTailImplicit = implicitProducers.load(std::memory_order_relaxed); - do { - static_cast(producer)->nextImplicitProducer = prevTailImplicit; - } while (!implicitProducers.compare_exchange_weak(prevTailImplicit, static_cast(producer), std::memory_order_release, std::memory_order_relaxed)); - } -#endif - - return producer; - } - - void reown_producers() - { - // After another instance is moved-into/swapped-with this one, all the - // producers we stole still think their parents are the other queue. - // So fix them up! - for (auto ptr = producerListTail.load(std::memory_order_relaxed); ptr != nullptr; ptr = ptr->next_prod()) { - ptr->parent = this; - } - } - - - ////////////////////////////////// - // Implicit producer hash - ////////////////////////////////// - - struct ImplicitProducerKVP - { - std::atomic key; - ImplicitProducer* value; // No need for atomicity since it's only read by the thread that sets it in the first place - - ImplicitProducerKVP() : value(nullptr) { } - - ImplicitProducerKVP(ImplicitProducerKVP&& other) MOODYCAMEL_NOEXCEPT - { - key.store(other.key.load(std::memory_order_relaxed), std::memory_order_relaxed); - value = other.value; - } - - inline ImplicitProducerKVP& operator=(ImplicitProducerKVP&& other) MOODYCAMEL_NOEXCEPT - { - swap(other); - return *this; - } - - inline void swap(ImplicitProducerKVP& other) MOODYCAMEL_NOEXCEPT - { - if (this != &other) { - details::swap_relaxed(key, other.key); - std::swap(value, other.value); - } - } - }; - - template - friend void moodycamel::swap(typename ConcurrentQueue::ImplicitProducerKVP&, typename ConcurrentQueue::ImplicitProducerKVP&) MOODYCAMEL_NOEXCEPT; - - struct ImplicitProducerHash - { - size_t capacity; - ImplicitProducerKVP* entries; - ImplicitProducerHash* prev; - }; - - inline void populate_initial_implicit_producer_hash() - { - MOODYCAMEL_CONSTEXPR_IF (INITIAL_IMPLICIT_PRODUCER_HASH_SIZE == 0) { - return; - } - else { - implicitProducerHashCount.store(0, std::memory_order_relaxed); - auto hash = &initialImplicitProducerHash; - hash->capacity = INITIAL_IMPLICIT_PRODUCER_HASH_SIZE; - hash->entries = &initialImplicitProducerHashEntries[0]; - for (size_t i = 0; i != INITIAL_IMPLICIT_PRODUCER_HASH_SIZE; ++i) { - initialImplicitProducerHashEntries[i].key.store(details::invalid_thread_id, std::memory_order_relaxed); - } - hash->prev = nullptr; - implicitProducerHash.store(hash, std::memory_order_relaxed); - } - } - - void swap_implicit_producer_hashes(ConcurrentQueue& other) - { - MOODYCAMEL_CONSTEXPR_IF (INITIAL_IMPLICIT_PRODUCER_HASH_SIZE == 0) { - return; - } - else { - // Swap (assumes our implicit producer hash is initialized) - initialImplicitProducerHashEntries.swap(other.initialImplicitProducerHashEntries); - initialImplicitProducerHash.entries = &initialImplicitProducerHashEntries[0]; - other.initialImplicitProducerHash.entries = &other.initialImplicitProducerHashEntries[0]; - - details::swap_relaxed(implicitProducerHashCount, other.implicitProducerHashCount); - - details::swap_relaxed(implicitProducerHash, other.implicitProducerHash); - if (implicitProducerHash.load(std::memory_order_relaxed) == &other.initialImplicitProducerHash) { - implicitProducerHash.store(&initialImplicitProducerHash, std::memory_order_relaxed); - } - else { - ImplicitProducerHash* hash; - for (hash = implicitProducerHash.load(std::memory_order_relaxed); hash->prev != &other.initialImplicitProducerHash; hash = hash->prev) { - continue; - } - hash->prev = &initialImplicitProducerHash; - } - if (other.implicitProducerHash.load(std::memory_order_relaxed) == &initialImplicitProducerHash) { - other.implicitProducerHash.store(&other.initialImplicitProducerHash, std::memory_order_relaxed); - } - else { - ImplicitProducerHash* hash; - for (hash = other.implicitProducerHash.load(std::memory_order_relaxed); hash->prev != &initialImplicitProducerHash; hash = hash->prev) { - continue; - } - hash->prev = &other.initialImplicitProducerHash; - } - } - } - - // Only fails (returns nullptr) if memory allocation fails - ImplicitProducer* get_or_add_implicit_producer() - { - // Note that since the data is essentially thread-local (key is thread ID), - // there's a reduced need for fences (memory ordering is already consistent - // for any individual thread), except for the current table itself. - - // Start by looking for the thread ID in the current and all previous hash tables. - // If it's not found, it must not be in there yet, since this same thread would - // have added it previously to one of the tables that we traversed. - - // Code and algorithm adapted from http://preshing.com/20130605/the-worlds-simplest-lock-free-hash-table - -#ifdef MCDBGQ_NOLOCKFREE_IMPLICITPRODHASH - debug::DebugLock lock(implicitProdMutex); -#endif - - auto id = details::thread_id(); - auto hashedId = details::hash_thread_id(id); - - auto mainHash = implicitProducerHash.load(std::memory_order_acquire); - assert(mainHash != nullptr); // silence clang-tidy and MSVC warnings (hash cannot be null) - for (auto hash = mainHash; hash != nullptr; hash = hash->prev) { - // Look for the id in this hash - auto index = hashedId; - while (true) { // Not an infinite loop because at least one slot is free in the hash table - index &= hash->capacity - 1u; - - auto probedKey = hash->entries[index].key.load(std::memory_order_relaxed); - if (probedKey == id) { - // Found it! If we had to search several hashes deep, though, we should lazily add it - // to the current main hash table to avoid the extended search next time. - // Note there's guaranteed to be room in the current hash table since every subsequent - // table implicitly reserves space for all previous tables (there's only one - // implicitProducerHashCount). - auto value = hash->entries[index].value; - if (hash != mainHash) { - index = hashedId; - while (true) { - index &= mainHash->capacity - 1u; - auto empty = details::invalid_thread_id; -#ifdef MOODYCAMEL_CPP11_THREAD_LOCAL_SUPPORTED - auto reusable = details::invalid_thread_id2; - if (mainHash->entries[index].key.compare_exchange_strong(empty, id, std::memory_order_seq_cst, std::memory_order_relaxed) || - mainHash->entries[index].key.compare_exchange_strong(reusable, id, std::memory_order_seq_cst, std::memory_order_relaxed)) { -#else - if (mainHash->entries[index].key.compare_exchange_strong(empty, id, std::memory_order_seq_cst, std::memory_order_relaxed)) { -#endif - mainHash->entries[index].value = value; - break; - } - ++index; - } - } - - return value; - } - if (probedKey == details::invalid_thread_id) { - break; // Not in this hash table - } - ++index; - } - } - - // Insert! - auto newCount = 1 + implicitProducerHashCount.fetch_add(1, std::memory_order_relaxed); - while (true) { - // NOLINTNEXTLINE(clang-analyzer-core.NullDereference) - if (newCount >= (mainHash->capacity >> 1) && !implicitProducerHashResizeInProgress.test_and_set(std::memory_order_acquire)) { - // We've acquired the resize lock, try to allocate a bigger hash table. - // Note the acquire fence synchronizes with the release fence at the end of this block, and hence when - // we reload implicitProducerHash it must be the most recent version (it only gets changed within this - // locked block). - mainHash = implicitProducerHash.load(std::memory_order_acquire); - if (newCount >= (mainHash->capacity >> 1)) { - size_t newCapacity = mainHash->capacity << 1; - while (newCount >= (newCapacity >> 1)) { - newCapacity <<= 1; - } - auto raw = static_cast((Traits::malloc)(sizeof(ImplicitProducerHash) + std::alignment_of::value - 1 + sizeof(ImplicitProducerKVP) * newCapacity)); - if (raw == nullptr) { - // Allocation failed - implicitProducerHashCount.fetch_sub(1, std::memory_order_relaxed); - implicitProducerHashResizeInProgress.clear(std::memory_order_relaxed); - return nullptr; - } - - auto newHash = new (raw) ImplicitProducerHash; - newHash->capacity = static_cast(newCapacity); - newHash->entries = reinterpret_cast(details::align_for(raw + sizeof(ImplicitProducerHash))); - for (size_t i = 0; i != newCapacity; ++i) { - new (newHash->entries + i) ImplicitProducerKVP; - newHash->entries[i].key.store(details::invalid_thread_id, std::memory_order_relaxed); - } - newHash->prev = mainHash; - implicitProducerHash.store(newHash, std::memory_order_release); - implicitProducerHashResizeInProgress.clear(std::memory_order_release); - mainHash = newHash; - } - else { - implicitProducerHashResizeInProgress.clear(std::memory_order_release); - } - } - - // If it's < three-quarters full, add to the old one anyway so that we don't have to wait for the next table - // to finish being allocated by another thread (and if we just finished allocating above, the condition will - // always be true) - if (newCount < (mainHash->capacity >> 1) + (mainHash->capacity >> 2)) { - auto producer = static_cast(recycle_or_create_producer(false)); - if (producer == nullptr) { - implicitProducerHashCount.fetch_sub(1, std::memory_order_relaxed); - return nullptr; - } - -#ifdef MOODYCAMEL_CPP11_THREAD_LOCAL_SUPPORTED - producer->threadExitListener.callback = &ConcurrentQueue::implicit_producer_thread_exited_callback; - producer->threadExitListener.userData = producer; - details::ThreadExitNotifier::subscribe(&producer->threadExitListener); -#endif - - auto index = hashedId; - while (true) { - index &= mainHash->capacity - 1u; - auto empty = details::invalid_thread_id; -#ifdef MOODYCAMEL_CPP11_THREAD_LOCAL_SUPPORTED - auto reusable = details::invalid_thread_id2; - if (mainHash->entries[index].key.compare_exchange_strong(reusable, id, std::memory_order_seq_cst, std::memory_order_relaxed)) { - implicitProducerHashCount.fetch_sub(1, std::memory_order_relaxed); // already counted as a used slot - mainHash->entries[index].value = producer; - break; - } -#endif - if (mainHash->entries[index].key.compare_exchange_strong(empty, id, std::memory_order_seq_cst, std::memory_order_relaxed)) { - mainHash->entries[index].value = producer; - break; - } - ++index; - } - return producer; - } - - // Hmm, the old hash is quite full and somebody else is busy allocating a new one. - // We need to wait for the allocating thread to finish (if it succeeds, we add, if not, - // we try to allocate ourselves). - mainHash = implicitProducerHash.load(std::memory_order_acquire); - } - } - -#ifdef MOODYCAMEL_CPP11_THREAD_LOCAL_SUPPORTED - void implicit_producer_thread_exited(ImplicitProducer* producer) - { - // Remove from hash -#ifdef MCDBGQ_NOLOCKFREE_IMPLICITPRODHASH - debug::DebugLock lock(implicitProdMutex); -#endif - auto hash = implicitProducerHash.load(std::memory_order_acquire); - assert(hash != nullptr); // The thread exit listener is only registered if we were added to a hash in the first place - auto id = details::thread_id(); - auto hashedId = details::hash_thread_id(id); - details::thread_id_t probedKey; - - // We need to traverse all the hashes just in case other threads aren't on the current one yet and are - // trying to add an entry thinking there's a free slot (because they reused a producer) - for (; hash != nullptr; hash = hash->prev) { - auto index = hashedId; - do { - index &= hash->capacity - 1u; - probedKey = id; - if (hash->entries[index].key.compare_exchange_strong(probedKey, details::invalid_thread_id2, std::memory_order_seq_cst, std::memory_order_relaxed)) { - break; - } - ++index; - } while (probedKey != details::invalid_thread_id); // Can happen if the hash has changed but we weren't put back in it yet, or if we weren't added to this hash in the first place - } - - // Mark the queue as being recyclable - producer->inactive.store(true, std::memory_order_release); - } - - static void implicit_producer_thread_exited_callback(void* userData) - { - auto producer = static_cast(userData); - auto queue = producer->parent; - queue->implicit_producer_thread_exited(producer); - } -#endif - - ////////////////////////////////// - // Utility functions - ////////////////////////////////// - - template - static inline void* aligned_malloc(size_t size) - { - MOODYCAMEL_CONSTEXPR_IF (std::alignment_of::value <= std::alignment_of::value) - return (Traits::malloc)(size); - else { - size_t alignment = std::alignment_of::value; - void* raw = (Traits::malloc)(size + alignment - 1 + sizeof(void*)); - if (!raw) - return nullptr; - char* ptr = details::align_for(reinterpret_cast(raw) + sizeof(void*)); - *(reinterpret_cast(ptr) - 1) = raw; - return ptr; - } - } - - template - static inline void aligned_free(void* ptr) - { - MOODYCAMEL_CONSTEXPR_IF (std::alignment_of::value <= std::alignment_of::value) - return (Traits::free)(ptr); - else - (Traits::free)(ptr ? *(reinterpret_cast(ptr) - 1) : nullptr); - } - - template - static inline U* create_array(size_t count) - { - assert(count > 0); - U* p = static_cast(aligned_malloc(sizeof(U) * count)); - if (p == nullptr) - return nullptr; - - for (size_t i = 0; i != count; ++i) - new (p + i) U(); - return p; - } - - template - static inline void destroy_array(U* p, size_t count) - { - if (p != nullptr) { - assert(count > 0); - for (size_t i = count; i != 0; ) - (p + --i)->~U(); - } - aligned_free(p); - } - - template - static inline U* create() - { - void* p = aligned_malloc(sizeof(U)); - return p != nullptr ? new (p) U : nullptr; - } - - template - static inline U* create(A1&& a1) - { - void* p = aligned_malloc(sizeof(U)); - return p != nullptr ? new (p) U(std::forward(a1)) : nullptr; - } - - template - static inline void destroy(U* p) - { - if (p != nullptr) - p->~U(); - aligned_free(p); - } - -private: - std::atomic producerListTail; - std::atomic producerCount; - - std::atomic initialBlockPoolIndex; - Block* initialBlockPool; - size_t initialBlockPoolSize; - -#ifndef MCDBGQ_USEDEBUGFREELIST - FreeList freeList; -#else - debug::DebugFreeList freeList; -#endif - - std::atomic implicitProducerHash; - std::atomic implicitProducerHashCount; // Number of slots logically used - ImplicitProducerHash initialImplicitProducerHash; - std::array initialImplicitProducerHashEntries; - std::atomic_flag implicitProducerHashResizeInProgress; - - std::atomic nextExplicitConsumerId; - std::atomic globalExplicitConsumerOffset; - -#ifdef MCDBGQ_NOLOCKFREE_IMPLICITPRODHASH - debug::DebugMutex implicitProdMutex; -#endif - -#ifdef MOODYCAMEL_QUEUE_INTERNAL_DEBUG - std::atomic explicitProducers; - std::atomic implicitProducers; -#endif -}; - - -template -ProducerToken::ProducerToken(ConcurrentQueue& queue) - : producer(queue.recycle_or_create_producer(true)) -{ - if (producer != nullptr) { - producer->token = this; - } -} - -template -ProducerToken::ProducerToken(BlockingConcurrentQueue& queue) - : producer(reinterpret_cast*>(&queue)->recycle_or_create_producer(true)) -{ - if (producer != nullptr) { - producer->token = this; - } -} - -template -ConsumerToken::ConsumerToken(ConcurrentQueue& queue) - : itemsConsumedFromCurrent(0), currentProducer(nullptr), desiredProducer(nullptr) -{ - initialOffset = queue.nextExplicitConsumerId.fetch_add(1, std::memory_order_release); - lastKnownGlobalOffset = static_cast(-1); -} - -template -ConsumerToken::ConsumerToken(BlockingConcurrentQueue& queue) - : itemsConsumedFromCurrent(0), currentProducer(nullptr), desiredProducer(nullptr) -{ - initialOffset = reinterpret_cast*>(&queue)->nextExplicitConsumerId.fetch_add(1, std::memory_order_release); - lastKnownGlobalOffset = static_cast(-1); -} - -template -inline void swap(ConcurrentQueue& a, ConcurrentQueue& b) MOODYCAMEL_NOEXCEPT -{ - a.swap(b); -} - -inline void swap(ProducerToken& a, ProducerToken& b) MOODYCAMEL_NOEXCEPT -{ - a.swap(b); -} - -inline void swap(ConsumerToken& a, ConsumerToken& b) MOODYCAMEL_NOEXCEPT -{ - a.swap(b); -} - -template -inline void swap(typename ConcurrentQueue::ImplicitProducerKVP& a, typename ConcurrentQueue::ImplicitProducerKVP& b) MOODYCAMEL_NOEXCEPT -{ - a.swap(b); -} - -} - -#if defined(_MSC_VER) && (!defined(_HAS_CXX17) || !_HAS_CXX17) -#pragma warning(pop) -#endif - -#if defined(__GNUC__) && !defined(__INTEL_COMPILER) -#pragma GCC diagnostic pop -#endif \ No newline at end of file diff --git a/include/coro_http/coro_http_client.h b/include/ylt/coro_http/coro_http_client.hpp similarity index 92% rename from include/coro_http/coro_http_client.h rename to include/ylt/coro_http/coro_http_client.hpp index 6c684f39..5cb86967 100644 --- a/include/coro_http/coro_http_client.h +++ b/include/ylt/coro_http/coro_http_client.hpp @@ -14,6 +14,9 @@ * limitations under the License. */ #pragma once +#ifdef YLT_ENABLE_SSL +#define CINATRA_ENABLE_SSL +#endif #include namespace coro_http { diff --git a/include/coro_io/channel.hpp b/include/ylt/coro_io/channel.hpp similarity index 98% rename from include/coro_io/channel.hpp rename to include/ylt/coro_io/channel.hpp index 25ef12a1..9f2cb067 100644 --- a/include/coro_io/channel.hpp +++ b/include/ylt/coro_io/channel.hpp @@ -14,13 +14,14 @@ * limitations under the License. */ #pragma once +#include + #include #include #include -#include "async_simple/coro/Lazy.h" #include "client_pool.hpp" -#include "coro_io/io_context_pool.hpp" +#include "io_context_pool.hpp" namespace coro_io { enum class load_blance_algorithm { diff --git a/include/coro_io/client_pool.hpp b/include/ylt/coro_io/client_pool.hpp similarity index 96% rename from include/coro_io/client_pool.hpp rename to include/ylt/coro_io/client_pool.hpp index bf261db5..24c014bd 100644 --- a/include/coro_io/client_pool.hpp +++ b/include/ylt/coro_io/client_pool.hpp @@ -14,6 +14,17 @@ * limitations under the License. */ #pragma once + +#include +#include +#include +#include +#include +#include +#include + +#include +#include #include #include #include @@ -27,20 +38,11 @@ #include #include #include +#include -#include "asio/io_context.hpp" -#include "asio/steady_timer.hpp" -#include "async_simple/Executor.h" -#include "async_simple/Promise.h" -#include "async_simple/Try.h" -#include "async_simple/Unit.h" -#include "async_simple/coro/Lazy.h" -#include "async_simple/coro/Sleep.h" -#include "async_simple/coro/SpinLock.h" -#include "coro_io/client_queue.hpp" -#include "coro_io/coro_io.hpp" -#include "coro_io/io_context_pool.hpp" -#include "util/expected.hpp" +#include "detail/client_queue.hpp" +#include "coro_io.hpp" +#include "io_context_pool.hpp" namespace coro_io { template diff --git a/include/coro_io/coro_file.hpp b/include/ylt/coro_io/coro_file.hpp similarity index 94% rename from include/coro_io/coro_file.hpp rename to include/ylt/coro_io/coro_file.hpp index bc99134a..1254ad62 100644 --- a/include/coro_io/coro_file.hpp +++ b/include/ylt/coro_io/coro_file.hpp @@ -14,20 +14,22 @@ * limitations under the License. */ #pragma once -#include -#include -#include -#include "async_simple/Promise.h" -#include "async_simple/Traits.h" -#include "async_simple/coro/FutureAwaiter.h" -#include "io_context_pool.hpp" -#if defined(ENABLE_FILE_IO_URING) +#include +#include +#include +#if defined(YLT_ENABLE_FILE_IO_URING) #include #include #endif +#include + +#include +#include #include #include +#include +#include #include #include #include @@ -36,12 +38,11 @@ #include #include -#include "asio/error.hpp" -#include "async_simple/coro/Lazy.h" #include "coro_io.hpp" +#include "io_context_pool.hpp" namespace coro_io { -#if defined(ENABLE_FILE_IO_URING) +#if defined(YLT_ENABLE_FILE_IO_URING) inline asio::file_base::flags default_flags() { return asio::stream_file::read_write | asio::stream_file::append | asio::stream_file::create; @@ -52,7 +53,7 @@ enum class open_mode { read, write }; class coro_file { public: -#if defined(ENABLE_FILE_IO_URING) +#if defined(YLT_ENABLE_FILE_IO_URING) coro_file( std::string_view filepath, open_mode flags = open_mode::read, coro_io::ExecutorWrapper<>* executor = coro_io::get_global_executor()) @@ -97,7 +98,7 @@ class coro_file { #endif bool is_open() { -#if defined(ENABLE_FILE_IO_URING) +#if defined(YLT_ENABLE_FILE_IO_URING) return stream_file_ && stream_file_->is_open(); #else return stream_file_ && stream_file_->is_open(); @@ -114,7 +115,7 @@ class coro_file { return size; } -#if defined(ENABLE_FILE_IO_URING) +#if defined(YLT_ENABLE_FILE_IO_URING) async_simple::coro::Lazy> async_read( char* data, size_t size) { size_t left_size = size; @@ -240,7 +241,7 @@ class coro_file { #endif private: -#if defined(ENABLE_FILE_IO_URING) +#if defined(YLT_ENABLE_FILE_IO_URING) std::unique_ptr stream_file_; std::atomic seek_offset_ = 0; #else diff --git a/include/coro_io/coro_io.hpp b/include/ylt/coro_io/coro_io.hpp similarity index 97% rename from include/coro_io/coro_io.hpp rename to include/ylt/coro_io/coro_io.hpp index 1f831a32..98477a3b 100644 --- a/include/coro_io/coro_io.hpp +++ b/include/ylt/coro_io/coro_io.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Alibaba Group Holding Limited; + * Copyright (c) 2023, Alibaba Group Holding Limited; * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,16 +14,13 @@ * limitations under the License. */ #pragma once + +#include #include +#include #include -#include -#include - -#include "async_simple/Executor.h" -#include "async_simple/coro/Sleep.h" - -#if defined(ENABLE_SSL) || defined(CINATRA_ENABLE_SSL) +#if defined(YLT_ENABLE_SSL) || defined(CINATRA_ENABLE_SSL) #include #endif @@ -32,6 +29,8 @@ #include #include #include +#include +#include #include "io_context_pool.hpp" @@ -233,7 +232,7 @@ inline async_simple::coro::Lazy async_close(Socket &socket) noexcept { }); } -#if defined(ENABLE_SSL) || defined(CINATRA_ENABLE_SSL) +#if defined(YLT_ENABLE_SSL) || defined(CINATRA_ENABLE_SSL) inline async_simple::coro::Lazy async_handshake( auto &ssl_stream, asio::ssl::stream_base::handshake_type type) noexcept { callback_awaitor awaitor; diff --git a/include/coro_io/client_queue.hpp b/include/ylt/coro_io/detail/client_queue.hpp similarity index 71% rename from include/coro_io/client_queue.hpp rename to include/ylt/coro_io/detail/client_queue.hpp index 6d81824c..04a1d435 100644 --- a/include/coro_io/client_queue.hpp +++ b/include/ylt/coro_io/detail/client_queue.hpp @@ -1,8 +1,23 @@ +/* + * Copyright (c) 2023, Alibaba Group Holding Limited; + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #pragma once #include #include -#include "util/concurrentqueue.h" +#include "ylt/util/concurrentqueue.h" namespace coro_io::detail { template class client_queue { diff --git a/include/coro_io/io_context_pool.hpp b/include/ylt/coro_io/io_context_pool.hpp similarity index 98% rename from include/coro_io/io_context_pool.hpp rename to include/ylt/coro_io/io_context_pool.hpp index 7ec6b0c9..79755bb5 100644 --- a/include/coro_io/io_context_pool.hpp +++ b/include/ylt/coro_io/io_context_pool.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Alibaba Group Holding Limited; + * Copyright (c) 2023, Alibaba Group Holding Limited; * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ */ #pragma once #include +#include #include #include @@ -26,8 +27,6 @@ #include #include -#include "async_simple/coro/Lazy.h" - namespace coro_io { template diff --git a/include/coro_rpc/coro_rpc_client.hpp b/include/ylt/coro_rpc/coro_rpc_client.hpp similarity index 86% rename from include/coro_rpc/coro_rpc_client.hpp rename to include/ylt/coro_rpc/coro_rpc_client.hpp index dbf26976..86fb2e94 100644 --- a/include/coro_rpc/coro_rpc_client.hpp +++ b/include/ylt/coro_rpc/coro_rpc_client.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Alibaba Group Holding Limited; + * Copyright (c) 2023, Alibaba Group Holding Limited; * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,4 +14,4 @@ * limitations under the License. */ #pragma once -#include "coro_rpc/coro_rpc_client.hpp" \ No newline at end of file +#include "impl/coro_rpc_client.hpp" \ No newline at end of file diff --git a/include/coro_rpc/rpc_context.hpp b/include/ylt/coro_rpc/coro_rpc_context.hpp similarity index 83% rename from include/coro_rpc/rpc_context.hpp rename to include/ylt/coro_rpc/coro_rpc_context.hpp index 5a8ee1e6..2557e32b 100644 --- a/include/coro_rpc/rpc_context.hpp +++ b/include/ylt/coro_rpc/coro_rpc_context.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Alibaba Group Holding Limited; + * Copyright (c) 2023, Alibaba Group Holding Limited; * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,4 +15,4 @@ */ #pragma once -#include +#include "impl/protocol/coro_rpc_protocol.hpp" diff --git a/include/coro_rpc/coro_rpc_server.hpp b/include/ylt/coro_rpc/coro_rpc_server.hpp similarity index 77% rename from include/coro_rpc/coro_rpc_server.hpp rename to include/ylt/coro_rpc/coro_rpc_server.hpp index 5cc8d926..cdece4fd 100644 --- a/include/coro_rpc/coro_rpc_server.hpp +++ b/include/ylt/coro_rpc/coro_rpc_server.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Alibaba Group Holding Limited; + * Copyright (c) 2023, Alibaba Group Holding Limited; * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,5 +14,5 @@ * limitations under the License. */ #pragma once -#include -#include +#include "impl/coro_rpc_server.hpp" +#include "impl/default_config/coro_rpc_config.hpp" diff --git a/include/coro_rpc/coro_rpc/common_service.hpp b/include/ylt/coro_rpc/impl/common_service.hpp similarity index 95% rename from include/coro_rpc/coro_rpc/common_service.hpp rename to include/ylt/coro_rpc/impl/common_service.hpp index 7314e30e..8e10d779 100644 --- a/include/coro_rpc/coro_rpc/common_service.hpp +++ b/include/ylt/coro_rpc/impl/common_service.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Alibaba Group Holding Limited; + * Copyright (c) 2023, Alibaba Group Holding Limited; * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,11 +15,10 @@ */ #pragma once -#include - #include +#include -#ifdef ENABLE_SSL +#ifdef YLT_ENABLE_SSL #include #endif @@ -55,7 +54,7 @@ inline bool file_exists(auto &path) { return false; }; -#ifdef ENABLE_SSL +#ifdef YLT_ENABLE_SSL /*! * Initialize SSL Context `context` with SSL Config `conf` * diff --git a/include/coro_rpc/coro_rpc/context.hpp b/include/ylt/coro_rpc/impl/context.hpp similarity index 96% rename from include/coro_rpc/coro_rpc/context.hpp rename to include/ylt/coro_rpc/impl/context.hpp index 21eb8a24..d9f1e6d5 100644 --- a/include/coro_rpc/coro_rpc/context.hpp +++ b/include/ylt/coro_rpc/impl/context.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Alibaba Group Holding Limited; + * Copyright (c) 2023, Alibaba Group Holding Limited; * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,8 @@ */ #pragma once +#include + #include #include #include @@ -22,11 +24,10 @@ #include #include #include +#include -#include "async_simple/coro/Lazy.h" #include "coro_connection.hpp" -#include "easylog/easylog.h" -#include "util/type_traits.h" +#include "ylt/util/type_traits.h" namespace coro_rpc { /*! diff --git a/include/coro_rpc/coro_rpc/coro_connection.hpp b/include/ylt/coro_rpc/impl/coro_connection.hpp similarity index 97% rename from include/coro_rpc/coro_rpc/coro_connection.hpp rename to include/ylt/coro_rpc/impl/coro_connection.hpp index 5c9ae6ac..565a86af 100644 --- a/include/coro_rpc/coro_rpc/coro_connection.hpp +++ b/include/ylt/coro_rpc/impl/coro_connection.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Alibaba Group Holding Limited; + * Copyright (c) 2023, Alibaba Group Holding Limited; * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,8 +14,12 @@ * limitations under the License. */ #pragma once +#include +#include + #include #include +#include #include #include #include @@ -25,12 +29,9 @@ #include #include #include +#include -#include "asio/buffer.hpp" -#include "async_simple/Executor.h" -#include "async_simple/coro/SyncAwait.h" -#include "coro_io/coro_io.hpp" -#include "easylog/easylog.h" +#include "ylt/coro_io/coro_io.hpp" #ifdef UNIT_TEST_INJECT #include "inject_action.hpp" #endif @@ -103,7 +104,7 @@ class coro_connection : public std::enable_shared_from_this { } } -#ifdef ENABLE_SSL +#ifdef YLT_ENABLE_SSL void init_ssl(asio::ssl::context &ssl_ctx) { ssl_stream_ = std::make_unique>( socket_, ssl_ctx); @@ -114,7 +115,7 @@ class coro_connection : public std::enable_shared_from_this { template async_simple::coro::Lazy start( typename rpc_protocol::router &router) noexcept { -#ifdef ENABLE_SSL +#ifdef YLT_ENABLE_SSL if (use_ssl_) { assert(ssl_stream_); ELOGV(INFO, "begin to handshake conn_id %d", conn_id_); @@ -135,7 +136,7 @@ class coro_connection : public std::enable_shared_from_this { else { #endif co_await start_impl(router, socket_); -#ifdef ENABLE_SSL +#ifdef YLT_ENABLE_SSL } #endif } @@ -394,7 +395,7 @@ class coro_connection : public std::enable_shared_from_this { #endif std::array buffers{asio::buffer(msg.first), asio::buffer(msg.second)}; -#ifdef ENABLE_SSL +#ifdef YLT_ENABLE_SSL if (use_ssl_) { assert(ssl_stream_); ret = co_await coro_io::async_write(*ssl_stream_, buffers); @@ -402,7 +403,7 @@ class coro_connection : public std::enable_shared_from_this { else { #endif ret = co_await coro_io::async_write(socket_, buffers); -#ifdef ENABLE_SSL +#ifdef YLT_ENABLE_SSL } #endif if (ret.first) @@ -509,7 +510,7 @@ class coro_connection : public std::enable_shared_from_this { std::any tag_; -#ifdef ENABLE_SSL +#ifdef YLT_ENABLE_SSL std::unique_ptr> ssl_stream_ = nullptr; bool use_ssl_ = false; diff --git a/include/coro_rpc/coro_rpc/coro_rpc_client.hpp b/include/ylt/coro_rpc/impl/coro_rpc_client.hpp similarity index 96% rename from include/coro_rpc/coro_rpc/coro_rpc_client.hpp rename to include/ylt/coro_rpc/impl/coro_rpc_client.hpp index 0bb7d21f..12d116aa 100644 --- a/include/coro_rpc/coro_rpc/coro_rpc_client.hpp +++ b/include/ylt/coro_rpc/impl/coro_rpc_client.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Alibaba Group Holding Limited; + * Copyright (c) 2023, Alibaba Group Holding Limited; * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,11 @@ #pragma once #include #include +#include +#include +#include +#include #include #include #include @@ -30,24 +34,19 @@ #include #include #include +#include -#include "asio/io_context.hpp" -#include "asio/ip/tcp.hpp" -#include "async_simple/coro/Lazy.h" -#include "async_simple/coro/SyncAwait.h" #include "common_service.hpp" -#include "coro_io/coro_io.hpp" -#include "coro_io/io_context_pool.hpp" -#include "coro_rpc/coro_rpc/context.hpp" -#include "coro_rpc/coro_rpc/protocol/coro_rpc_protocol.hpp" -#include "easylog/easylog.h" +#include "context.hpp" #include "expected.hpp" -#include "struct_pack/struct_pack.hpp" -#include "util/function_name.h" -#include "util/type_traits.h" -#include "util/utils.hpp" +#include "protocol/coro_rpc_protocol.hpp" +#include "ylt/coro_io/coro_io.hpp" +#include "ylt/coro_io/io_context_pool.hpp" +#include "ylt/struct_pack.hpp" +#include "ylt/util/function_name.h" +#include "ylt/util/type_traits.h" +#include "ylt/util/utils.hpp" #ifdef UNIT_TEST_INJECT -#include "coro_io/coro_io.hpp" #include "inject_action.hpp" #endif @@ -79,7 +78,7 @@ template using rpc_return_type_t = typename rpc_return_type::type; /*! * ```cpp - * #include + * #include * * using namespace coro_rpc; * using namespace async_simple::coro; @@ -112,7 +111,7 @@ class coro_rpc_client { std::chrono::milliseconds{5000}; std::string host; std::string port; -#ifdef ENABLE_SSL +#ifdef YLT_ENABLE_SSL std::filesystem::path ssl_cert_path; std::string ssl_domain; #endif @@ -161,7 +160,7 @@ class coro_rpc_client { [[nodiscard]] bool init_config(const config &conf) { config_ = conf; -#ifdef ENABLE_SSL +#ifdef YLT_ENABLE_SSL return init_ssl_impl(); #else return true; @@ -243,7 +242,7 @@ class coro_rpc_client { return connect(); } -#ifdef ENABLE_SSL +#ifdef YLT_ENABLE_SSL [[nodiscard]] bool init_ssl(std::string_view cert_base_path, std::string_view cert_file_name, @@ -303,7 +302,7 @@ class coro_rpc_client { } rpc_result ret; -#ifdef ENABLE_SSL +#ifdef YLT_ENABLE_SSL if (!ssl_init_ret_) { ret = rpc_result{ unexpect_t{}, coro_rpc_protocol::rpc_error{std::errc::not_connected, @@ -320,7 +319,7 @@ class coro_rpc_client { .via(&executor) .detach(); -#ifdef ENABLE_SSL +#ifdef YLT_ENABLE_SSL if (!config_.ssl_cert_path.empty()) { assert(ssl_stream_); ret = co_await call_impl(*ssl_stream_, std::move(args)...); @@ -328,7 +327,7 @@ class coro_rpc_client { else { #endif ret = co_await call_impl(socket_, std::move(args)...); -#ifdef ENABLE_SSL +#ifdef YLT_ENABLE_SSL } #endif @@ -370,8 +369,9 @@ class coro_rpc_client { static bool is_ok(std::errc ec) noexcept { return ec == std::errc{}; } [[nodiscard]] async_simple::coro::Lazy connect( bool is_reconnect = false) { -#ifdef ENABLE_SSL +#ifdef YLT_ENABLE_SSL if (!ssl_init_ret_) { + std::cout << "ssl_init_ret_: " << ssl_init_ret_ << std::endl; co_return std::errc::not_connected; } #endif @@ -411,7 +411,7 @@ class coro_rpc_client { co_return std::errc::timed_out; } -#ifdef ENABLE_SSL +#ifdef YLT_ENABLE_SSL if (!config_.ssl_cert_path.empty()) { assert(ssl_stream_); auto shake_ec = co_await coro_io::async_handshake( @@ -426,7 +426,7 @@ class coro_rpc_client { co_return std::errc{}; }; -#ifdef ENABLE_SSL +#ifdef YLT_ENABLE_SSL [[nodiscard]] bool init_ssl_impl() { try { ssl_init_ret_ = false; @@ -798,7 +798,7 @@ class coro_rpc_client { std::vector read_buf_; config config_; constexpr static std::size_t default_read_buf_size_ = 256; -#ifdef ENABLE_SSL +#ifdef YLT_ENABLE_SSL asio::ssl::context ssl_ctx_{asio::ssl::context::sslv23}; std::unique_ptr> ssl_stream_; bool ssl_init_ret_ = true; diff --git a/include/coro_rpc/coro_rpc/coro_rpc_server.hpp b/include/ylt/coro_rpc/impl/coro_rpc_server.hpp similarity index 96% rename from include/coro_rpc/coro_rpc/coro_rpc_server.hpp rename to include/ylt/coro_rpc/impl/coro_rpc_server.hpp index 8ec730fb..e36654ce 100644 --- a/include/coro_rpc/coro_rpc/coro_rpc_server.hpp +++ b/include/ylt/coro_rpc/impl/coro_rpc_server.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Alibaba Group Holding Limited; + * Copyright (c) 2023, Alibaba Group Holding Limited; * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,6 +14,11 @@ * limitations under the License. */ #pragma once +#include + +#include +#include +#include #include #include #include @@ -25,20 +30,16 @@ #include #include #include +#include -#include "asio/dispatch.hpp" -#include "asio/error_code.hpp" -#include "asio/io_context.hpp" -#include "async_simple/coro/Lazy.h" #include "common_service.hpp" #include "coro_connection.hpp" -#include "coro_io/coro_io.hpp" -#include "coro_io/io_context_pool.hpp" -#include "easylog/easylog.h" +#include "ylt/coro_io/coro_io.hpp" +#include "ylt/coro_io/io_context_pool.hpp" namespace coro_rpc { /*! * ```cpp - * #include + * #include * inline std::string hello_coro_rpc() { return "hello coro_rpc"; } * int main(){ * register_handler(); @@ -87,7 +88,7 @@ class coro_rpc_server_base { stop(); } -#ifdef ENABLE_SSL +#ifdef YLT_ENABLE_SSL void init_ssl_context(const ssl_configure &conf) { use_ssl_ = init_ssl_context_helper(context_, conf); } @@ -381,7 +382,7 @@ class coro_rpc_server_base { } async_simple::coro::Lazy start_one(auto conn) noexcept { -#ifdef ENABLE_SSL +#ifdef YLT_ENABLE_SSL if (use_ssl_) { conn->init_ssl(context_); } @@ -416,7 +417,7 @@ class coro_rpc_server_base { std::atomic port_; std::chrono::steady_clock::duration conn_timeout_duration_; -#ifdef ENABLE_SSL +#ifdef YLT_ENABLE_SSL asio::ssl::context context_{asio::ssl::context::sslv23}; bool use_ssl_ = false; #endif diff --git a/include/coro_rpc/coro_rpc/default_config/coro_rpc_config.hpp b/include/ylt/coro_rpc/impl/default_config/coro_rpc_config.hpp similarity index 82% rename from include/coro_rpc/coro_rpc/default_config/coro_rpc_config.hpp rename to include/ylt/coro_rpc/impl/default_config/coro_rpc_config.hpp index 9b1269e0..cc9185ee 100644 --- a/include/coro_rpc/coro_rpc/default_config/coro_rpc_config.hpp +++ b/include/ylt/coro_rpc/impl/default_config/coro_rpc_config.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Alibaba Group Holding Limited; + * Copyright (c) 2023, Alibaba Group Holding Limited; * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,10 +18,10 @@ #include #include -#include "coro_io/io_context_pool.hpp" -#include "coro_rpc/coro_rpc/context.hpp" -#include "coro_rpc/coro_rpc/protocol/coro_rpc_protocol.hpp" -#include "coro_rpc/coro_rpc_server.hpp" +#include "ylt/coro_io/io_context_pool.hpp" +#include "ylt/coro_rpc/coro_rpc_server.hpp" +#include "ylt/coro_rpc/impl/context.hpp" +#include "ylt/coro_rpc/impl/protocol/coro_rpc_protocol.hpp" namespace coro_rpc { diff --git a/include/coro_rpc/coro_rpc/expected.hpp b/include/ylt/coro_rpc/impl/expected.hpp similarity index 89% rename from include/coro_rpc/coro_rpc/expected.hpp rename to include/ylt/coro_rpc/impl/expected.hpp index 40922b75..e6d4c108 100644 --- a/include/coro_rpc/coro_rpc/expected.hpp +++ b/include/ylt/coro_rpc/impl/expected.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Alibaba Group Holding Limited; + * Copyright (c) 2023, Alibaba Group Holding Limited; * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,10 +18,10 @@ #include #if __cpp_lib_expected >= 202202L #else -#include "util/expected.hpp" +#include #endif #else -#include "util/expected.hpp" +#include #endif namespace coro_rpc { diff --git a/include/coro_rpc/coro_rpc/protocol/coro_rpc_protocol.hpp b/include/ylt/coro_rpc/impl/protocol/coro_rpc_protocol.hpp similarity index 93% rename from include/coro_rpc/coro_rpc/protocol/coro_rpc_protocol.hpp rename to include/ylt/coro_rpc/impl/protocol/coro_rpc_protocol.hpp index a2e98f37..e5ad8f99 100644 --- a/include/coro_rpc/coro_rpc/protocol/coro_rpc_protocol.hpp +++ b/include/ylt/coro_rpc/impl/protocol/coro_rpc_protocol.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Alibaba Group Holding Limited; + * Copyright (c) 2023, Alibaba Group Holding Limited; * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,19 +14,19 @@ * limitations under the License. */ #pragma once +#include + #include #include #include +#include +#include -#include "../expected.hpp" -#include "asio/buffer.hpp" -#include "async_simple/coro/Lazy.h" -#include "coro_io/coro_io.hpp" -#include "coro_rpc/coro_rpc/context.hpp" -#include "coro_rpc/coro_rpc/router.hpp" -#include "easylog/easylog.h" -#include "struct_pack/struct_pack.hpp" #include "struct_pack_protocol.hpp" +#include "ylt/coro_io/coro_io.hpp" +#include "ylt/coro_rpc/impl/context.hpp" +#include "ylt/coro_rpc/impl/expected.hpp" +#include "ylt/coro_rpc/impl/router.hpp" namespace coro_rpc { namespace protocol { diff --git a/include/coro_rpc/coro_rpc/protocol/struct_pack_protocol.hpp b/include/ylt/coro_rpc/impl/protocol/struct_pack_protocol.hpp similarity index 90% rename from include/coro_rpc/coro_rpc/protocol/struct_pack_protocol.hpp rename to include/ylt/coro_rpc/impl/protocol/struct_pack_protocol.hpp index b9977c4a..e9072527 100644 --- a/include/coro_rpc/coro_rpc/protocol/struct_pack_protocol.hpp +++ b/include/ylt/coro_rpc/impl/protocol/struct_pack_protocol.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Alibaba Group Holding Limited; + * Copyright (c) 2023, Alibaba Group Holding Limited; * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ #pragma once -#include +#include namespace coro_rpc::protocol { struct struct_pack_protocol { diff --git a/include/coro_rpc/coro_rpc/router.hpp b/include/ylt/coro_rpc/impl/router.hpp similarity index 98% rename from include/coro_rpc/coro_rpc/router.hpp rename to include/ylt/coro_rpc/impl/router.hpp index df893a78..c28f361c 100644 --- a/include/coro_rpc/coro_rpc/router.hpp +++ b/include/ylt/coro_rpc/impl/router.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Alibaba Group Holding Limited; + * Copyright (c) 2023, Alibaba Group Holding Limited; * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,8 @@ */ #pragma once #include -#include +#include +#include #include #include @@ -24,11 +25,10 @@ #include #include #include +#include +#include -#include "easylog/easylog.h" #include "rpc_execute.hpp" -#include "struct_pack/struct_pack/md5_constexpr.hpp" -#include "util/function_name.h" namespace coro_rpc { diff --git a/include/coro_rpc/coro_rpc/rpc_execute.hpp b/include/ylt/coro_rpc/impl/rpc_execute.hpp similarity index 98% rename from include/coro_rpc/coro_rpc/rpc_execute.hpp rename to include/ylt/coro_rpc/impl/rpc_execute.hpp index 26dee272..1c0223e0 100644 --- a/include/coro_rpc/coro_rpc/rpc_execute.hpp +++ b/include/ylt/coro_rpc/impl/rpc_execute.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Alibaba Group Holding Limited; + * Copyright (c) 2023, Alibaba Group Holding Limited; * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ #include "context.hpp" #include "coro_connection.hpp" -#include "util/type_traits.h" +#include "ylt/util/type_traits.h" namespace coro_rpc::internal { // TODO: remove this later diff --git a/include/easylog/easylog.h b/include/ylt/easylog.hpp similarity index 99% rename from include/easylog/easylog.h rename to include/ylt/easylog.hpp index 4db2890b..7a0745f2 100644 --- a/include/easylog/easylog.h +++ b/include/ylt/easylog.hpp @@ -19,7 +19,7 @@ #include #include -#include "appender.hpp" +#include "easylog/appender.hpp" namespace easylog { diff --git a/include/easylog/appender.hpp b/include/ylt/easylog/appender.hpp similarity index 99% rename from include/easylog/appender.hpp rename to include/ylt/easylog/appender.hpp index 79ec9fb6..d2d213be 100644 --- a/include/easylog/appender.hpp +++ b/include/ylt/easylog/appender.hpp @@ -24,7 +24,7 @@ #include #include "record.hpp" -#include "util/concurrentqueue.h" +#include "ylt/util/concurrentqueue.h" namespace easylog { constexpr inline std::string_view BOM_STR = "\xEF\xBB\xBF"; diff --git a/include/easylog/record.hpp b/include/ylt/easylog/record.hpp similarity index 97% rename from include/easylog/record.hpp rename to include/ylt/easylog/record.hpp index b49c4f5a..ed477c36 100644 --- a/include/easylog/record.hpp +++ b/include/ylt/easylog/record.hpp @@ -14,7 +14,6 @@ * limitations under the License. */ #pragma once -#include #include #include @@ -29,10 +28,11 @@ #include #include #include -#include #include -#include "util/dragonbox_to_chars.h" +#include "ylt/util/dragonbox_to_chars.h" +#include "ylt/util/meta_string.hpp" +#include "ylt/util/type_traits.h" #if defined(_WIN32) #ifndef _WINDOWS_ diff --git a/include/struct_json/json_reader.h b/include/ylt/struct_json/json_reader.h similarity index 100% rename from include/struct_json/json_reader.h rename to include/ylt/struct_json/json_reader.h diff --git a/include/struct_json/json_writer.h b/include/ylt/struct_json/json_writer.h similarity index 100% rename from include/struct_json/json_writer.h rename to include/ylt/struct_json/json_writer.h diff --git a/include/struct_pack/struct_pack.hpp b/include/ylt/struct_pack.hpp similarity index 99% rename from include/struct_pack/struct_pack.hpp rename to include/ylt/struct_pack.hpp index 6c507481..3ff762ae 100644 --- a/include/struct_pack/struct_pack.hpp +++ b/include/ylt/struct_pack.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Alibaba Group Holding Limited; + * Copyright (c) 2023, Alibaba Group Holding Limited; * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/struct_pack/struct_pack/error_code.hpp b/include/ylt/struct_pack/error_code.hpp similarity index 58% rename from include/struct_pack/struct_pack/error_code.hpp rename to include/ylt/struct_pack/error_code.hpp index e581d7b7..268cf87e 100644 --- a/include/struct_pack/struct_pack/error_code.hpp +++ b/include/ylt/struct_pack/error_code.hpp @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2023, Alibaba Group Holding Limited; + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #pragma once #include diff --git a/include/struct_pack/struct_pack/marco.h b/include/ylt/struct_pack/marco.h similarity index 94% rename from include/struct_pack/struct_pack/marco.h rename to include/ylt/struct_pack/marco.h index ca7b79a7..10a2e27a 100644 --- a/include/struct_pack/struct_pack/marco.h +++ b/include/ylt/struct_pack/marco.h @@ -1,6 +1,6 @@ #pragma once /* - * Copyright (c) 2022, Alibaba Group Holding Limited; + * Copyright (c) 2023, Alibaba Group Holding Limited; * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/struct_pack/struct_pack/md5_constexpr.hpp b/include/ylt/struct_pack/md5_constexpr.hpp similarity index 99% rename from include/struct_pack/struct_pack/md5_constexpr.hpp rename to include/ylt/struct_pack/md5_constexpr.hpp index e7ef1513..3af3686b 100644 --- a/include/struct_pack/struct_pack/md5_constexpr.hpp +++ b/include/ylt/struct_pack/md5_constexpr.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Alibaba Group Holding Limited; + * Copyright (c) 2023, Alibaba Group Holding Limited; * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ #pragma once #include #include -// #include #include #include diff --git a/include/struct_pack/struct_pack/reflection.hpp b/include/ylt/struct_pack/reflection.hpp similarity index 99% rename from include/struct_pack/struct_pack/reflection.hpp rename to include/ylt/struct_pack/reflection.hpp index 73b54c2d..b88147a3 100644 --- a/include/struct_pack/struct_pack/reflection.hpp +++ b/include/ylt/struct_pack/reflection.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Alibaba Group Holding Limited; + * Copyright (c) 2023, Alibaba Group Holding Limited; * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/struct_pack/struct_pack/struct_pack_impl.hpp b/include/ylt/struct_pack/struct_pack_impl.hpp similarity index 99% rename from include/struct_pack/struct_pack/struct_pack_impl.hpp rename to include/ylt/struct_pack/struct_pack_impl.hpp index 932230d7..1e889447 100644 --- a/include/struct_pack/struct_pack/struct_pack_impl.hpp +++ b/include/ylt/struct_pack/struct_pack_impl.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Alibaba Group Holding Limited; + * Copyright (c) 2023, Alibaba Group Holding Limited; * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,13 +35,12 @@ #include #include -#include "struct_pack/struct_pack.hpp" -#include "struct_pack/struct_pack/error_code.hpp" -#include "struct_pack/struct_pack/md5_constexpr.hpp" -#include "struct_pack/struct_pack/reflection.hpp" -#include "struct_pack/struct_pack/trivial_view.hpp" -#include "struct_pack/struct_pack/tuple.hpp" -#include "struct_pack/struct_pack/varint.hpp" +#include "error_code.hpp" +#include "md5_constexpr.hpp" +#include "reflection.hpp" +#include "trivial_view.hpp" +#include "tuple.hpp" +#include "varint.hpp" static_assert(std::endian::native == std::endian::little, "only support little endian now"); diff --git a/include/struct_pack/struct_pack/trivial_view.hpp b/include/ylt/struct_pack/trivial_view.hpp similarity index 98% rename from include/struct_pack/struct_pack/trivial_view.hpp rename to include/ylt/struct_pack/trivial_view.hpp index e30d3621..4ad14f18 100644 --- a/include/struct_pack/struct_pack/trivial_view.hpp +++ b/include/ylt/struct_pack/trivial_view.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Alibaba Group Holding Limited; + * Copyright (c) 2023, Alibaba Group Holding Limited; * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/struct_pack/struct_pack/tuple.hpp b/include/ylt/struct_pack/tuple.hpp similarity index 99% rename from include/struct_pack/struct_pack/tuple.hpp rename to include/ylt/struct_pack/tuple.hpp index e6aaaa87..71424051 100644 --- a/include/struct_pack/struct_pack/tuple.hpp +++ b/include/ylt/struct_pack/tuple.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Alibaba Group Holding Limited; + * Copyright (c) 2023, Alibaba Group Holding Limited; * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/struct_pack/struct_pack/varint.hpp b/include/ylt/struct_pack/varint.hpp similarity index 99% rename from include/struct_pack/struct_pack/varint.hpp rename to include/ylt/struct_pack/varint.hpp index 214323e4..b1fb365e 100644 --- a/include/struct_pack/struct_pack/varint.hpp +++ b/include/ylt/struct_pack/varint.hpp @@ -4,7 +4,7 @@ #include #include -#include "struct_pack/struct_pack/reflection.hpp" +#include "reflection.hpp" namespace struct_pack { namespace detail { diff --git a/include/struct_pb/struct_pb.hpp b/include/ylt/struct_pb.hpp similarity index 82% rename from include/struct_pb/struct_pb.hpp rename to include/ylt/struct_pb.hpp index e3f3fb1c..a57ea241 100644 --- a/include/struct_pb/struct_pb.hpp +++ b/include/ylt/struct_pb.hpp @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2023, Alibaba Group Holding Limited; + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #pragma once #include #include diff --git a/include/struct_pb/struct_pb/struct_pb_impl.hpp b/include/ylt/struct_pb/struct_pb_impl.hpp similarity index 89% rename from include/struct_pb/struct_pb/struct_pb_impl.hpp rename to include/ylt/struct_pb/struct_pb_impl.hpp index 7c29fb44..12a2a76c 100644 --- a/include/struct_pb/struct_pb/struct_pb_impl.hpp +++ b/include/ylt/struct_pb/struct_pb_impl.hpp @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2023, Alibaba Group Holding Limited; + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #pragma once #include #include @@ -5,7 +20,7 @@ #include #include -#include "struct_pb/struct_pb.hpp" +#include "ylt/struct_pb.hpp" namespace struct_pb { diff --git a/include/ylt/struct_xml/xml_reader.h b/include/ylt/struct_xml/xml_reader.h new file mode 100644 index 00000000..2e69e1b1 --- /dev/null +++ b/include/ylt/struct_xml/xml_reader.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2023, Alibaba Group Holding Limited; + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once +#include + +namespace struct_xml { + +template +inline bool from_xml(T &&t, char *buf) { + return iguana::from_xml(std::forward(t), buf); +} + +template +inline bool from_xml(T &&t, const std::string &str) { + return from_xml(std::forward(t), str.data()); +} + +template +inline bool from_xml(T &&t, std::string_view str) { + return from_xml(std::forward(t), str.data()); +} + +inline std::string get_last_read_err() { return iguana::get_last_read_err(); } + +using any_t = iguana::any_t; +} // namespace struct_xml \ No newline at end of file diff --git a/include/ylt/struct_xml/xml_writer.h b/include/ylt/struct_xml/xml_writer.h new file mode 100644 index 00000000..16d52521 --- /dev/null +++ b/include/ylt/struct_xml/xml_writer.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2023, Alibaba Group Holding Limited; + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once +#include + +namespace struct_xml { +template +inline void to_xml(T &&t, Stream &s) { + iguana::to_xml(std::forward(t), s); +} + +template +inline bool to_xml_pretty(T &&t, Stream &s) { + return iguana::to_xml_pretty(std::forward(t), s); +} +} // namespace struct_xml \ No newline at end of file diff --git a/include/ylt/struct_yaml/yaml_reader.h b/include/ylt/struct_yaml/yaml_reader.h new file mode 100644 index 00000000..f38c4c77 --- /dev/null +++ b/include/ylt/struct_yaml/yaml_reader.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023, Alibaba Group Holding Limited; + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once +#include + +namespace struct_yaml { + +template +inline void from_yaml(T &value, const View &view) { + iguana::from_yaml(value, view); +} + +template +inline void from_yaml(T &value, const View &view, std::error_code &ec) { + iguana::from_yaml(value, view, ec); +} +} // namespace struct_yaml \ No newline at end of file diff --git a/include/ylt/struct_yaml/yaml_writer.h b/include/ylt/struct_yaml/yaml_writer.h new file mode 100644 index 00000000..fc3d98f6 --- /dev/null +++ b/include/ylt/struct_yaml/yaml_writer.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2023, Alibaba Group Holding Limited; + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once +#include + +namespace struct_yaml { +template +inline void to_yaml(T &&t, Stream &s, size_t min_spaces = 0) { + iguana::to_yaml(std::forward(t), s, min_spaces); +} +} // namespace struct_yaml \ No newline at end of file diff --git a/thirdparty/asio/asio.hpp b/include/ylt/thirdparty/asio.hpp similarity index 100% rename from thirdparty/asio/asio.hpp rename to include/ylt/thirdparty/asio.hpp diff --git a/thirdparty/asio/asio/any_io_executor.hpp b/include/ylt/thirdparty/asio/any_io_executor.hpp similarity index 100% rename from thirdparty/asio/asio/any_io_executor.hpp rename to include/ylt/thirdparty/asio/any_io_executor.hpp diff --git a/thirdparty/asio/asio/append.hpp b/include/ylt/thirdparty/asio/append.hpp similarity index 100% rename from thirdparty/asio/asio/append.hpp rename to include/ylt/thirdparty/asio/append.hpp diff --git a/thirdparty/asio/asio/as_tuple.hpp b/include/ylt/thirdparty/asio/as_tuple.hpp similarity index 100% rename from thirdparty/asio/asio/as_tuple.hpp rename to include/ylt/thirdparty/asio/as_tuple.hpp diff --git a/thirdparty/asio/asio/associated_allocator.hpp b/include/ylt/thirdparty/asio/associated_allocator.hpp similarity index 100% rename from thirdparty/asio/asio/associated_allocator.hpp rename to include/ylt/thirdparty/asio/associated_allocator.hpp diff --git a/thirdparty/asio/asio/associated_cancellation_slot.hpp b/include/ylt/thirdparty/asio/associated_cancellation_slot.hpp similarity index 100% rename from thirdparty/asio/asio/associated_cancellation_slot.hpp rename to include/ylt/thirdparty/asio/associated_cancellation_slot.hpp diff --git a/thirdparty/asio/asio/associated_executor.hpp b/include/ylt/thirdparty/asio/associated_executor.hpp similarity index 100% rename from thirdparty/asio/asio/associated_executor.hpp rename to include/ylt/thirdparty/asio/associated_executor.hpp diff --git a/thirdparty/asio/asio/associator.hpp b/include/ylt/thirdparty/asio/associator.hpp similarity index 100% rename from thirdparty/asio/asio/associator.hpp rename to include/ylt/thirdparty/asio/associator.hpp diff --git a/thirdparty/asio/asio/async_result.hpp b/include/ylt/thirdparty/asio/async_result.hpp similarity index 100% rename from thirdparty/asio/asio/async_result.hpp rename to include/ylt/thirdparty/asio/async_result.hpp diff --git a/thirdparty/asio/asio/awaitable.hpp b/include/ylt/thirdparty/asio/awaitable.hpp similarity index 100% rename from thirdparty/asio/asio/awaitable.hpp rename to include/ylt/thirdparty/asio/awaitable.hpp diff --git a/thirdparty/asio/asio/basic_datagram_socket.hpp b/include/ylt/thirdparty/asio/basic_datagram_socket.hpp similarity index 100% rename from thirdparty/asio/asio/basic_datagram_socket.hpp rename to include/ylt/thirdparty/asio/basic_datagram_socket.hpp diff --git a/thirdparty/asio/asio/basic_deadline_timer.hpp b/include/ylt/thirdparty/asio/basic_deadline_timer.hpp similarity index 100% rename from thirdparty/asio/asio/basic_deadline_timer.hpp rename to include/ylt/thirdparty/asio/basic_deadline_timer.hpp diff --git a/thirdparty/asio/asio/basic_file.hpp b/include/ylt/thirdparty/asio/basic_file.hpp similarity index 100% rename from thirdparty/asio/asio/basic_file.hpp rename to include/ylt/thirdparty/asio/basic_file.hpp diff --git a/thirdparty/asio/asio/basic_io_object.hpp b/include/ylt/thirdparty/asio/basic_io_object.hpp similarity index 100% rename from thirdparty/asio/asio/basic_io_object.hpp rename to include/ylt/thirdparty/asio/basic_io_object.hpp diff --git a/thirdparty/asio/asio/basic_random_access_file.hpp b/include/ylt/thirdparty/asio/basic_random_access_file.hpp similarity index 100% rename from thirdparty/asio/asio/basic_random_access_file.hpp rename to include/ylt/thirdparty/asio/basic_random_access_file.hpp diff --git a/thirdparty/asio/asio/basic_raw_socket.hpp b/include/ylt/thirdparty/asio/basic_raw_socket.hpp similarity index 100% rename from thirdparty/asio/asio/basic_raw_socket.hpp rename to include/ylt/thirdparty/asio/basic_raw_socket.hpp diff --git a/thirdparty/asio/asio/basic_readable_pipe.hpp b/include/ylt/thirdparty/asio/basic_readable_pipe.hpp similarity index 100% rename from thirdparty/asio/asio/basic_readable_pipe.hpp rename to include/ylt/thirdparty/asio/basic_readable_pipe.hpp diff --git a/thirdparty/asio/asio/basic_seq_packet_socket.hpp b/include/ylt/thirdparty/asio/basic_seq_packet_socket.hpp similarity index 100% rename from thirdparty/asio/asio/basic_seq_packet_socket.hpp rename to include/ylt/thirdparty/asio/basic_seq_packet_socket.hpp diff --git a/thirdparty/asio/asio/basic_serial_port.hpp b/include/ylt/thirdparty/asio/basic_serial_port.hpp similarity index 100% rename from thirdparty/asio/asio/basic_serial_port.hpp rename to include/ylt/thirdparty/asio/basic_serial_port.hpp diff --git a/thirdparty/asio/asio/basic_signal_set.hpp b/include/ylt/thirdparty/asio/basic_signal_set.hpp similarity index 100% rename from thirdparty/asio/asio/basic_signal_set.hpp rename to include/ylt/thirdparty/asio/basic_signal_set.hpp diff --git a/thirdparty/asio/asio/basic_socket.hpp b/include/ylt/thirdparty/asio/basic_socket.hpp similarity index 100% rename from thirdparty/asio/asio/basic_socket.hpp rename to include/ylt/thirdparty/asio/basic_socket.hpp diff --git a/thirdparty/asio/asio/basic_socket_acceptor.hpp b/include/ylt/thirdparty/asio/basic_socket_acceptor.hpp similarity index 100% rename from thirdparty/asio/asio/basic_socket_acceptor.hpp rename to include/ylt/thirdparty/asio/basic_socket_acceptor.hpp diff --git a/thirdparty/asio/asio/basic_socket_iostream.hpp b/include/ylt/thirdparty/asio/basic_socket_iostream.hpp similarity index 100% rename from thirdparty/asio/asio/basic_socket_iostream.hpp rename to include/ylt/thirdparty/asio/basic_socket_iostream.hpp diff --git a/thirdparty/asio/asio/basic_socket_streambuf.hpp b/include/ylt/thirdparty/asio/basic_socket_streambuf.hpp similarity index 100% rename from thirdparty/asio/asio/basic_socket_streambuf.hpp rename to include/ylt/thirdparty/asio/basic_socket_streambuf.hpp diff --git a/thirdparty/asio/asio/basic_stream_file.hpp b/include/ylt/thirdparty/asio/basic_stream_file.hpp similarity index 100% rename from thirdparty/asio/asio/basic_stream_file.hpp rename to include/ylt/thirdparty/asio/basic_stream_file.hpp diff --git a/thirdparty/asio/asio/basic_stream_socket.hpp b/include/ylt/thirdparty/asio/basic_stream_socket.hpp similarity index 100% rename from thirdparty/asio/asio/basic_stream_socket.hpp rename to include/ylt/thirdparty/asio/basic_stream_socket.hpp diff --git a/thirdparty/asio/asio/basic_streambuf.hpp b/include/ylt/thirdparty/asio/basic_streambuf.hpp similarity index 100% rename from thirdparty/asio/asio/basic_streambuf.hpp rename to include/ylt/thirdparty/asio/basic_streambuf.hpp diff --git a/thirdparty/asio/asio/basic_streambuf_fwd.hpp b/include/ylt/thirdparty/asio/basic_streambuf_fwd.hpp similarity index 100% rename from thirdparty/asio/asio/basic_streambuf_fwd.hpp rename to include/ylt/thirdparty/asio/basic_streambuf_fwd.hpp diff --git a/thirdparty/asio/asio/basic_waitable_timer.hpp b/include/ylt/thirdparty/asio/basic_waitable_timer.hpp similarity index 100% rename from thirdparty/asio/asio/basic_waitable_timer.hpp rename to include/ylt/thirdparty/asio/basic_waitable_timer.hpp diff --git a/thirdparty/asio/asio/basic_writable_pipe.hpp b/include/ylt/thirdparty/asio/basic_writable_pipe.hpp similarity index 100% rename from thirdparty/asio/asio/basic_writable_pipe.hpp rename to include/ylt/thirdparty/asio/basic_writable_pipe.hpp diff --git a/thirdparty/asio/asio/bind_allocator.hpp b/include/ylt/thirdparty/asio/bind_allocator.hpp similarity index 100% rename from thirdparty/asio/asio/bind_allocator.hpp rename to include/ylt/thirdparty/asio/bind_allocator.hpp diff --git a/thirdparty/asio/asio/bind_cancellation_slot.hpp b/include/ylt/thirdparty/asio/bind_cancellation_slot.hpp similarity index 100% rename from thirdparty/asio/asio/bind_cancellation_slot.hpp rename to include/ylt/thirdparty/asio/bind_cancellation_slot.hpp diff --git a/thirdparty/asio/asio/bind_executor.hpp b/include/ylt/thirdparty/asio/bind_executor.hpp similarity index 100% rename from thirdparty/asio/asio/bind_executor.hpp rename to include/ylt/thirdparty/asio/bind_executor.hpp diff --git a/thirdparty/asio/asio/buffer.hpp b/include/ylt/thirdparty/asio/buffer.hpp similarity index 100% rename from thirdparty/asio/asio/buffer.hpp rename to include/ylt/thirdparty/asio/buffer.hpp diff --git a/thirdparty/asio/asio/buffer_registration.hpp b/include/ylt/thirdparty/asio/buffer_registration.hpp similarity index 100% rename from thirdparty/asio/asio/buffer_registration.hpp rename to include/ylt/thirdparty/asio/buffer_registration.hpp diff --git a/thirdparty/asio/asio/buffered_read_stream.hpp b/include/ylt/thirdparty/asio/buffered_read_stream.hpp similarity index 100% rename from thirdparty/asio/asio/buffered_read_stream.hpp rename to include/ylt/thirdparty/asio/buffered_read_stream.hpp diff --git a/thirdparty/asio/asio/buffered_read_stream_fwd.hpp b/include/ylt/thirdparty/asio/buffered_read_stream_fwd.hpp similarity index 100% rename from thirdparty/asio/asio/buffered_read_stream_fwd.hpp rename to include/ylt/thirdparty/asio/buffered_read_stream_fwd.hpp diff --git a/thirdparty/asio/asio/buffered_stream.hpp b/include/ylt/thirdparty/asio/buffered_stream.hpp similarity index 100% rename from thirdparty/asio/asio/buffered_stream.hpp rename to include/ylt/thirdparty/asio/buffered_stream.hpp diff --git a/thirdparty/asio/asio/buffered_stream_fwd.hpp b/include/ylt/thirdparty/asio/buffered_stream_fwd.hpp similarity index 100% rename from thirdparty/asio/asio/buffered_stream_fwd.hpp rename to include/ylt/thirdparty/asio/buffered_stream_fwd.hpp diff --git a/thirdparty/asio/asio/buffered_write_stream.hpp b/include/ylt/thirdparty/asio/buffered_write_stream.hpp similarity index 100% rename from thirdparty/asio/asio/buffered_write_stream.hpp rename to include/ylt/thirdparty/asio/buffered_write_stream.hpp diff --git a/thirdparty/asio/asio/buffered_write_stream_fwd.hpp b/include/ylt/thirdparty/asio/buffered_write_stream_fwd.hpp similarity index 100% rename from thirdparty/asio/asio/buffered_write_stream_fwd.hpp rename to include/ylt/thirdparty/asio/buffered_write_stream_fwd.hpp diff --git a/thirdparty/asio/asio/buffers_iterator.hpp b/include/ylt/thirdparty/asio/buffers_iterator.hpp similarity index 100% rename from thirdparty/asio/asio/buffers_iterator.hpp rename to include/ylt/thirdparty/asio/buffers_iterator.hpp diff --git a/thirdparty/asio/asio/cancellation_signal.hpp b/include/ylt/thirdparty/asio/cancellation_signal.hpp similarity index 100% rename from thirdparty/asio/asio/cancellation_signal.hpp rename to include/ylt/thirdparty/asio/cancellation_signal.hpp diff --git a/thirdparty/asio/asio/cancellation_state.hpp b/include/ylt/thirdparty/asio/cancellation_state.hpp similarity index 100% rename from thirdparty/asio/asio/cancellation_state.hpp rename to include/ylt/thirdparty/asio/cancellation_state.hpp diff --git a/thirdparty/asio/asio/cancellation_type.hpp b/include/ylt/thirdparty/asio/cancellation_type.hpp similarity index 100% rename from thirdparty/asio/asio/cancellation_type.hpp rename to include/ylt/thirdparty/asio/cancellation_type.hpp diff --git a/thirdparty/asio/asio/co_spawn.hpp b/include/ylt/thirdparty/asio/co_spawn.hpp similarity index 100% rename from thirdparty/asio/asio/co_spawn.hpp rename to include/ylt/thirdparty/asio/co_spawn.hpp diff --git a/thirdparty/asio/asio/completion_condition.hpp b/include/ylt/thirdparty/asio/completion_condition.hpp similarity index 100% rename from thirdparty/asio/asio/completion_condition.hpp rename to include/ylt/thirdparty/asio/completion_condition.hpp diff --git a/thirdparty/asio/asio/compose.hpp b/include/ylt/thirdparty/asio/compose.hpp similarity index 100% rename from thirdparty/asio/asio/compose.hpp rename to include/ylt/thirdparty/asio/compose.hpp diff --git a/thirdparty/asio/asio/connect.hpp b/include/ylt/thirdparty/asio/connect.hpp similarity index 100% rename from thirdparty/asio/asio/connect.hpp rename to include/ylt/thirdparty/asio/connect.hpp diff --git a/thirdparty/asio/asio/connect_pipe.hpp b/include/ylt/thirdparty/asio/connect_pipe.hpp similarity index 100% rename from thirdparty/asio/asio/connect_pipe.hpp rename to include/ylt/thirdparty/asio/connect_pipe.hpp diff --git a/thirdparty/asio/asio/coroutine.hpp b/include/ylt/thirdparty/asio/coroutine.hpp similarity index 100% rename from thirdparty/asio/asio/coroutine.hpp rename to include/ylt/thirdparty/asio/coroutine.hpp diff --git a/thirdparty/asio/asio/deadline_timer.hpp b/include/ylt/thirdparty/asio/deadline_timer.hpp similarity index 100% rename from thirdparty/asio/asio/deadline_timer.hpp rename to include/ylt/thirdparty/asio/deadline_timer.hpp diff --git a/thirdparty/asio/asio/defer.hpp b/include/ylt/thirdparty/asio/defer.hpp similarity index 100% rename from thirdparty/asio/asio/defer.hpp rename to include/ylt/thirdparty/asio/defer.hpp diff --git a/thirdparty/asio/asio/deferred.hpp b/include/ylt/thirdparty/asio/deferred.hpp similarity index 100% rename from thirdparty/asio/asio/deferred.hpp rename to include/ylt/thirdparty/asio/deferred.hpp diff --git a/thirdparty/asio/asio/detached.hpp b/include/ylt/thirdparty/asio/detached.hpp similarity index 100% rename from thirdparty/asio/asio/detached.hpp rename to include/ylt/thirdparty/asio/detached.hpp diff --git a/thirdparty/asio/asio/detail/array.hpp b/include/ylt/thirdparty/asio/detail/array.hpp similarity index 100% rename from thirdparty/asio/asio/detail/array.hpp rename to include/ylt/thirdparty/asio/detail/array.hpp diff --git a/thirdparty/asio/asio/detail/array_fwd.hpp b/include/ylt/thirdparty/asio/detail/array_fwd.hpp similarity index 100% rename from thirdparty/asio/asio/detail/array_fwd.hpp rename to include/ylt/thirdparty/asio/detail/array_fwd.hpp diff --git a/thirdparty/asio/asio/detail/assert.hpp b/include/ylt/thirdparty/asio/detail/assert.hpp similarity index 100% rename from thirdparty/asio/asio/detail/assert.hpp rename to include/ylt/thirdparty/asio/detail/assert.hpp diff --git a/thirdparty/asio/asio/detail/atomic_count.hpp b/include/ylt/thirdparty/asio/detail/atomic_count.hpp similarity index 100% rename from thirdparty/asio/asio/detail/atomic_count.hpp rename to include/ylt/thirdparty/asio/detail/atomic_count.hpp diff --git a/thirdparty/asio/asio/detail/base_from_cancellation_state.hpp b/include/ylt/thirdparty/asio/detail/base_from_cancellation_state.hpp similarity index 100% rename from thirdparty/asio/asio/detail/base_from_cancellation_state.hpp rename to include/ylt/thirdparty/asio/detail/base_from_cancellation_state.hpp diff --git a/thirdparty/asio/asio/detail/base_from_completion_cond.hpp b/include/ylt/thirdparty/asio/detail/base_from_completion_cond.hpp similarity index 100% rename from thirdparty/asio/asio/detail/base_from_completion_cond.hpp rename to include/ylt/thirdparty/asio/detail/base_from_completion_cond.hpp diff --git a/thirdparty/asio/asio/detail/bind_handler.hpp b/include/ylt/thirdparty/asio/detail/bind_handler.hpp similarity index 100% rename from thirdparty/asio/asio/detail/bind_handler.hpp rename to include/ylt/thirdparty/asio/detail/bind_handler.hpp diff --git a/thirdparty/asio/asio/detail/blocking_executor_op.hpp b/include/ylt/thirdparty/asio/detail/blocking_executor_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/blocking_executor_op.hpp rename to include/ylt/thirdparty/asio/detail/blocking_executor_op.hpp diff --git a/thirdparty/asio/asio/detail/buffer_resize_guard.hpp b/include/ylt/thirdparty/asio/detail/buffer_resize_guard.hpp similarity index 100% rename from thirdparty/asio/asio/detail/buffer_resize_guard.hpp rename to include/ylt/thirdparty/asio/detail/buffer_resize_guard.hpp diff --git a/thirdparty/asio/asio/detail/buffer_sequence_adapter.hpp b/include/ylt/thirdparty/asio/detail/buffer_sequence_adapter.hpp similarity index 100% rename from thirdparty/asio/asio/detail/buffer_sequence_adapter.hpp rename to include/ylt/thirdparty/asio/detail/buffer_sequence_adapter.hpp diff --git a/thirdparty/asio/asio/detail/buffered_stream_storage.hpp b/include/ylt/thirdparty/asio/detail/buffered_stream_storage.hpp similarity index 100% rename from thirdparty/asio/asio/detail/buffered_stream_storage.hpp rename to include/ylt/thirdparty/asio/detail/buffered_stream_storage.hpp diff --git a/thirdparty/asio/asio/detail/bulk_executor_op.hpp b/include/ylt/thirdparty/asio/detail/bulk_executor_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/bulk_executor_op.hpp rename to include/ylt/thirdparty/asio/detail/bulk_executor_op.hpp diff --git a/thirdparty/asio/asio/detail/call_stack.hpp b/include/ylt/thirdparty/asio/detail/call_stack.hpp similarity index 100% rename from thirdparty/asio/asio/detail/call_stack.hpp rename to include/ylt/thirdparty/asio/detail/call_stack.hpp diff --git a/thirdparty/asio/asio/detail/chrono.hpp b/include/ylt/thirdparty/asio/detail/chrono.hpp similarity index 100% rename from thirdparty/asio/asio/detail/chrono.hpp rename to include/ylt/thirdparty/asio/detail/chrono.hpp diff --git a/thirdparty/asio/asio/detail/chrono_time_traits.hpp b/include/ylt/thirdparty/asio/detail/chrono_time_traits.hpp similarity index 100% rename from thirdparty/asio/asio/detail/chrono_time_traits.hpp rename to include/ylt/thirdparty/asio/detail/chrono_time_traits.hpp diff --git a/thirdparty/asio/asio/detail/completion_handler.hpp b/include/ylt/thirdparty/asio/detail/completion_handler.hpp similarity index 100% rename from thirdparty/asio/asio/detail/completion_handler.hpp rename to include/ylt/thirdparty/asio/detail/completion_handler.hpp diff --git a/thirdparty/asio/asio/detail/concurrency_hint.hpp b/include/ylt/thirdparty/asio/detail/concurrency_hint.hpp similarity index 100% rename from thirdparty/asio/asio/detail/concurrency_hint.hpp rename to include/ylt/thirdparty/asio/detail/concurrency_hint.hpp diff --git a/thirdparty/asio/asio/detail/conditionally_enabled_event.hpp b/include/ylt/thirdparty/asio/detail/conditionally_enabled_event.hpp similarity index 100% rename from thirdparty/asio/asio/detail/conditionally_enabled_event.hpp rename to include/ylt/thirdparty/asio/detail/conditionally_enabled_event.hpp diff --git a/thirdparty/asio/asio/detail/conditionally_enabled_mutex.hpp b/include/ylt/thirdparty/asio/detail/conditionally_enabled_mutex.hpp similarity index 100% rename from thirdparty/asio/asio/detail/conditionally_enabled_mutex.hpp rename to include/ylt/thirdparty/asio/detail/conditionally_enabled_mutex.hpp diff --git a/thirdparty/asio/asio/detail/config.hpp b/include/ylt/thirdparty/asio/detail/config.hpp similarity index 100% rename from thirdparty/asio/asio/detail/config.hpp rename to include/ylt/thirdparty/asio/detail/config.hpp diff --git a/thirdparty/asio/asio/detail/consuming_buffers.hpp b/include/ylt/thirdparty/asio/detail/consuming_buffers.hpp similarity index 100% rename from thirdparty/asio/asio/detail/consuming_buffers.hpp rename to include/ylt/thirdparty/asio/detail/consuming_buffers.hpp diff --git a/thirdparty/asio/asio/detail/cstddef.hpp b/include/ylt/thirdparty/asio/detail/cstddef.hpp similarity index 100% rename from thirdparty/asio/asio/detail/cstddef.hpp rename to include/ylt/thirdparty/asio/detail/cstddef.hpp diff --git a/thirdparty/asio/asio/detail/cstdint.hpp b/include/ylt/thirdparty/asio/detail/cstdint.hpp similarity index 100% rename from thirdparty/asio/asio/detail/cstdint.hpp rename to include/ylt/thirdparty/asio/detail/cstdint.hpp diff --git a/thirdparty/asio/asio/detail/date_time_fwd.hpp b/include/ylt/thirdparty/asio/detail/date_time_fwd.hpp similarity index 100% rename from thirdparty/asio/asio/detail/date_time_fwd.hpp rename to include/ylt/thirdparty/asio/detail/date_time_fwd.hpp diff --git a/thirdparty/asio/asio/detail/deadline_timer_service.hpp b/include/ylt/thirdparty/asio/detail/deadline_timer_service.hpp similarity index 100% rename from thirdparty/asio/asio/detail/deadline_timer_service.hpp rename to include/ylt/thirdparty/asio/detail/deadline_timer_service.hpp diff --git a/thirdparty/asio/asio/detail/dependent_type.hpp b/include/ylt/thirdparty/asio/detail/dependent_type.hpp similarity index 100% rename from thirdparty/asio/asio/detail/dependent_type.hpp rename to include/ylt/thirdparty/asio/detail/dependent_type.hpp diff --git a/thirdparty/asio/asio/detail/descriptor_ops.hpp b/include/ylt/thirdparty/asio/detail/descriptor_ops.hpp similarity index 100% rename from thirdparty/asio/asio/detail/descriptor_ops.hpp rename to include/ylt/thirdparty/asio/detail/descriptor_ops.hpp diff --git a/thirdparty/asio/asio/detail/descriptor_read_op.hpp b/include/ylt/thirdparty/asio/detail/descriptor_read_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/descriptor_read_op.hpp rename to include/ylt/thirdparty/asio/detail/descriptor_read_op.hpp diff --git a/thirdparty/asio/asio/detail/descriptor_write_op.hpp b/include/ylt/thirdparty/asio/detail/descriptor_write_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/descriptor_write_op.hpp rename to include/ylt/thirdparty/asio/detail/descriptor_write_op.hpp diff --git a/thirdparty/asio/asio/detail/dev_poll_reactor.hpp b/include/ylt/thirdparty/asio/detail/dev_poll_reactor.hpp similarity index 100% rename from thirdparty/asio/asio/detail/dev_poll_reactor.hpp rename to include/ylt/thirdparty/asio/detail/dev_poll_reactor.hpp diff --git a/thirdparty/asio/asio/detail/epoll_reactor.hpp b/include/ylt/thirdparty/asio/detail/epoll_reactor.hpp similarity index 100% rename from thirdparty/asio/asio/detail/epoll_reactor.hpp rename to include/ylt/thirdparty/asio/detail/epoll_reactor.hpp diff --git a/thirdparty/asio/asio/detail/event.hpp b/include/ylt/thirdparty/asio/detail/event.hpp similarity index 100% rename from thirdparty/asio/asio/detail/event.hpp rename to include/ylt/thirdparty/asio/detail/event.hpp diff --git a/thirdparty/asio/asio/detail/eventfd_select_interrupter.hpp b/include/ylt/thirdparty/asio/detail/eventfd_select_interrupter.hpp similarity index 100% rename from thirdparty/asio/asio/detail/eventfd_select_interrupter.hpp rename to include/ylt/thirdparty/asio/detail/eventfd_select_interrupter.hpp diff --git a/thirdparty/asio/asio/detail/exception.hpp b/include/ylt/thirdparty/asio/detail/exception.hpp similarity index 100% rename from thirdparty/asio/asio/detail/exception.hpp rename to include/ylt/thirdparty/asio/detail/exception.hpp diff --git a/thirdparty/asio/asio/detail/executor_function.hpp b/include/ylt/thirdparty/asio/detail/executor_function.hpp similarity index 100% rename from thirdparty/asio/asio/detail/executor_function.hpp rename to include/ylt/thirdparty/asio/detail/executor_function.hpp diff --git a/thirdparty/asio/asio/detail/executor_op.hpp b/include/ylt/thirdparty/asio/detail/executor_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/executor_op.hpp rename to include/ylt/thirdparty/asio/detail/executor_op.hpp diff --git a/thirdparty/asio/asio/detail/fd_set_adapter.hpp b/include/ylt/thirdparty/asio/detail/fd_set_adapter.hpp similarity index 100% rename from thirdparty/asio/asio/detail/fd_set_adapter.hpp rename to include/ylt/thirdparty/asio/detail/fd_set_adapter.hpp diff --git a/thirdparty/asio/asio/detail/fenced_block.hpp b/include/ylt/thirdparty/asio/detail/fenced_block.hpp similarity index 100% rename from thirdparty/asio/asio/detail/fenced_block.hpp rename to include/ylt/thirdparty/asio/detail/fenced_block.hpp diff --git a/thirdparty/asio/asio/detail/functional.hpp b/include/ylt/thirdparty/asio/detail/functional.hpp similarity index 100% rename from thirdparty/asio/asio/detail/functional.hpp rename to include/ylt/thirdparty/asio/detail/functional.hpp diff --git a/thirdparty/asio/asio/detail/future.hpp b/include/ylt/thirdparty/asio/detail/future.hpp similarity index 100% rename from thirdparty/asio/asio/detail/future.hpp rename to include/ylt/thirdparty/asio/detail/future.hpp diff --git a/thirdparty/asio/asio/detail/gcc_arm_fenced_block.hpp b/include/ylt/thirdparty/asio/detail/gcc_arm_fenced_block.hpp similarity index 100% rename from thirdparty/asio/asio/detail/gcc_arm_fenced_block.hpp rename to include/ylt/thirdparty/asio/detail/gcc_arm_fenced_block.hpp diff --git a/thirdparty/asio/asio/detail/gcc_hppa_fenced_block.hpp b/include/ylt/thirdparty/asio/detail/gcc_hppa_fenced_block.hpp similarity index 100% rename from thirdparty/asio/asio/detail/gcc_hppa_fenced_block.hpp rename to include/ylt/thirdparty/asio/detail/gcc_hppa_fenced_block.hpp diff --git a/thirdparty/asio/asio/detail/gcc_sync_fenced_block.hpp b/include/ylt/thirdparty/asio/detail/gcc_sync_fenced_block.hpp similarity index 100% rename from thirdparty/asio/asio/detail/gcc_sync_fenced_block.hpp rename to include/ylt/thirdparty/asio/detail/gcc_sync_fenced_block.hpp diff --git a/thirdparty/asio/asio/detail/gcc_x86_fenced_block.hpp b/include/ylt/thirdparty/asio/detail/gcc_x86_fenced_block.hpp similarity index 100% rename from thirdparty/asio/asio/detail/gcc_x86_fenced_block.hpp rename to include/ylt/thirdparty/asio/detail/gcc_x86_fenced_block.hpp diff --git a/thirdparty/asio/asio/detail/global.hpp b/include/ylt/thirdparty/asio/detail/global.hpp similarity index 100% rename from thirdparty/asio/asio/detail/global.hpp rename to include/ylt/thirdparty/asio/detail/global.hpp diff --git a/thirdparty/asio/asio/detail/handler_alloc_helpers.hpp b/include/ylt/thirdparty/asio/detail/handler_alloc_helpers.hpp similarity index 100% rename from thirdparty/asio/asio/detail/handler_alloc_helpers.hpp rename to include/ylt/thirdparty/asio/detail/handler_alloc_helpers.hpp diff --git a/thirdparty/asio/asio/detail/handler_cont_helpers.hpp b/include/ylt/thirdparty/asio/detail/handler_cont_helpers.hpp similarity index 100% rename from thirdparty/asio/asio/detail/handler_cont_helpers.hpp rename to include/ylt/thirdparty/asio/detail/handler_cont_helpers.hpp diff --git a/thirdparty/asio/asio/detail/handler_invoke_helpers.hpp b/include/ylt/thirdparty/asio/detail/handler_invoke_helpers.hpp similarity index 100% rename from thirdparty/asio/asio/detail/handler_invoke_helpers.hpp rename to include/ylt/thirdparty/asio/detail/handler_invoke_helpers.hpp diff --git a/thirdparty/asio/asio/detail/handler_tracking.hpp b/include/ylt/thirdparty/asio/detail/handler_tracking.hpp similarity index 100% rename from thirdparty/asio/asio/detail/handler_tracking.hpp rename to include/ylt/thirdparty/asio/detail/handler_tracking.hpp diff --git a/thirdparty/asio/asio/detail/handler_type_requirements.hpp b/include/ylt/thirdparty/asio/detail/handler_type_requirements.hpp similarity index 100% rename from thirdparty/asio/asio/detail/handler_type_requirements.hpp rename to include/ylt/thirdparty/asio/detail/handler_type_requirements.hpp diff --git a/thirdparty/asio/asio/detail/handler_work.hpp b/include/ylt/thirdparty/asio/detail/handler_work.hpp similarity index 100% rename from thirdparty/asio/asio/detail/handler_work.hpp rename to include/ylt/thirdparty/asio/detail/handler_work.hpp diff --git a/thirdparty/asio/asio/detail/hash_map.hpp b/include/ylt/thirdparty/asio/detail/hash_map.hpp similarity index 100% rename from thirdparty/asio/asio/detail/hash_map.hpp rename to include/ylt/thirdparty/asio/detail/hash_map.hpp diff --git a/thirdparty/asio/asio/detail/impl/buffer_sequence_adapter.ipp b/include/ylt/thirdparty/asio/detail/impl/buffer_sequence_adapter.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/buffer_sequence_adapter.ipp rename to include/ylt/thirdparty/asio/detail/impl/buffer_sequence_adapter.ipp diff --git a/thirdparty/asio/asio/detail/impl/descriptor_ops.ipp b/include/ylt/thirdparty/asio/detail/impl/descriptor_ops.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/descriptor_ops.ipp rename to include/ylt/thirdparty/asio/detail/impl/descriptor_ops.ipp diff --git a/thirdparty/asio/asio/detail/impl/dev_poll_reactor.hpp b/include/ylt/thirdparty/asio/detail/impl/dev_poll_reactor.hpp similarity index 100% rename from thirdparty/asio/asio/detail/impl/dev_poll_reactor.hpp rename to include/ylt/thirdparty/asio/detail/impl/dev_poll_reactor.hpp diff --git a/thirdparty/asio/asio/detail/impl/dev_poll_reactor.ipp b/include/ylt/thirdparty/asio/detail/impl/dev_poll_reactor.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/dev_poll_reactor.ipp rename to include/ylt/thirdparty/asio/detail/impl/dev_poll_reactor.ipp diff --git a/thirdparty/asio/asio/detail/impl/epoll_reactor.hpp b/include/ylt/thirdparty/asio/detail/impl/epoll_reactor.hpp similarity index 100% rename from thirdparty/asio/asio/detail/impl/epoll_reactor.hpp rename to include/ylt/thirdparty/asio/detail/impl/epoll_reactor.hpp diff --git a/thirdparty/asio/asio/detail/impl/epoll_reactor.ipp b/include/ylt/thirdparty/asio/detail/impl/epoll_reactor.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/epoll_reactor.ipp rename to include/ylt/thirdparty/asio/detail/impl/epoll_reactor.ipp diff --git a/thirdparty/asio/asio/detail/impl/eventfd_select_interrupter.ipp b/include/ylt/thirdparty/asio/detail/impl/eventfd_select_interrupter.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/eventfd_select_interrupter.ipp rename to include/ylt/thirdparty/asio/detail/impl/eventfd_select_interrupter.ipp diff --git a/thirdparty/asio/asio/detail/impl/handler_tracking.ipp b/include/ylt/thirdparty/asio/detail/impl/handler_tracking.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/handler_tracking.ipp rename to include/ylt/thirdparty/asio/detail/impl/handler_tracking.ipp diff --git a/thirdparty/asio/asio/detail/impl/io_uring_descriptor_service.ipp b/include/ylt/thirdparty/asio/detail/impl/io_uring_descriptor_service.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/io_uring_descriptor_service.ipp rename to include/ylt/thirdparty/asio/detail/impl/io_uring_descriptor_service.ipp diff --git a/thirdparty/asio/asio/detail/impl/io_uring_file_service.ipp b/include/ylt/thirdparty/asio/detail/impl/io_uring_file_service.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/io_uring_file_service.ipp rename to include/ylt/thirdparty/asio/detail/impl/io_uring_file_service.ipp diff --git a/thirdparty/asio/asio/detail/impl/io_uring_service.hpp b/include/ylt/thirdparty/asio/detail/impl/io_uring_service.hpp similarity index 100% rename from thirdparty/asio/asio/detail/impl/io_uring_service.hpp rename to include/ylt/thirdparty/asio/detail/impl/io_uring_service.hpp diff --git a/thirdparty/asio/asio/detail/impl/io_uring_service.ipp b/include/ylt/thirdparty/asio/detail/impl/io_uring_service.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/io_uring_service.ipp rename to include/ylt/thirdparty/asio/detail/impl/io_uring_service.ipp diff --git a/thirdparty/asio/asio/detail/impl/io_uring_socket_service_base.ipp b/include/ylt/thirdparty/asio/detail/impl/io_uring_socket_service_base.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/io_uring_socket_service_base.ipp rename to include/ylt/thirdparty/asio/detail/impl/io_uring_socket_service_base.ipp diff --git a/thirdparty/asio/asio/detail/impl/kqueue_reactor.hpp b/include/ylt/thirdparty/asio/detail/impl/kqueue_reactor.hpp similarity index 100% rename from thirdparty/asio/asio/detail/impl/kqueue_reactor.hpp rename to include/ylt/thirdparty/asio/detail/impl/kqueue_reactor.hpp diff --git a/thirdparty/asio/asio/detail/impl/kqueue_reactor.ipp b/include/ylt/thirdparty/asio/detail/impl/kqueue_reactor.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/kqueue_reactor.ipp rename to include/ylt/thirdparty/asio/detail/impl/kqueue_reactor.ipp diff --git a/thirdparty/asio/asio/detail/impl/null_event.ipp b/include/ylt/thirdparty/asio/detail/impl/null_event.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/null_event.ipp rename to include/ylt/thirdparty/asio/detail/impl/null_event.ipp diff --git a/thirdparty/asio/asio/detail/impl/pipe_select_interrupter.ipp b/include/ylt/thirdparty/asio/detail/impl/pipe_select_interrupter.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/pipe_select_interrupter.ipp rename to include/ylt/thirdparty/asio/detail/impl/pipe_select_interrupter.ipp diff --git a/thirdparty/asio/asio/detail/impl/posix_event.ipp b/include/ylt/thirdparty/asio/detail/impl/posix_event.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/posix_event.ipp rename to include/ylt/thirdparty/asio/detail/impl/posix_event.ipp diff --git a/thirdparty/asio/asio/detail/impl/posix_mutex.ipp b/include/ylt/thirdparty/asio/detail/impl/posix_mutex.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/posix_mutex.ipp rename to include/ylt/thirdparty/asio/detail/impl/posix_mutex.ipp diff --git a/thirdparty/asio/asio/detail/impl/posix_serial_port_service.ipp b/include/ylt/thirdparty/asio/detail/impl/posix_serial_port_service.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/posix_serial_port_service.ipp rename to include/ylt/thirdparty/asio/detail/impl/posix_serial_port_service.ipp diff --git a/thirdparty/asio/asio/detail/impl/posix_thread.ipp b/include/ylt/thirdparty/asio/detail/impl/posix_thread.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/posix_thread.ipp rename to include/ylt/thirdparty/asio/detail/impl/posix_thread.ipp diff --git a/thirdparty/asio/asio/detail/impl/posix_tss_ptr.ipp b/include/ylt/thirdparty/asio/detail/impl/posix_tss_ptr.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/posix_tss_ptr.ipp rename to include/ylt/thirdparty/asio/detail/impl/posix_tss_ptr.ipp diff --git a/thirdparty/asio/asio/detail/impl/reactive_descriptor_service.ipp b/include/ylt/thirdparty/asio/detail/impl/reactive_descriptor_service.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/reactive_descriptor_service.ipp rename to include/ylt/thirdparty/asio/detail/impl/reactive_descriptor_service.ipp diff --git a/thirdparty/asio/asio/detail/impl/reactive_socket_service_base.ipp b/include/ylt/thirdparty/asio/detail/impl/reactive_socket_service_base.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/reactive_socket_service_base.ipp rename to include/ylt/thirdparty/asio/detail/impl/reactive_socket_service_base.ipp diff --git a/thirdparty/asio/asio/detail/impl/resolver_service_base.ipp b/include/ylt/thirdparty/asio/detail/impl/resolver_service_base.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/resolver_service_base.ipp rename to include/ylt/thirdparty/asio/detail/impl/resolver_service_base.ipp diff --git a/thirdparty/asio/asio/detail/impl/scheduler.ipp b/include/ylt/thirdparty/asio/detail/impl/scheduler.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/scheduler.ipp rename to include/ylt/thirdparty/asio/detail/impl/scheduler.ipp diff --git a/thirdparty/asio/asio/detail/impl/select_reactor.hpp b/include/ylt/thirdparty/asio/detail/impl/select_reactor.hpp similarity index 100% rename from thirdparty/asio/asio/detail/impl/select_reactor.hpp rename to include/ylt/thirdparty/asio/detail/impl/select_reactor.hpp diff --git a/thirdparty/asio/asio/detail/impl/select_reactor.ipp b/include/ylt/thirdparty/asio/detail/impl/select_reactor.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/select_reactor.ipp rename to include/ylt/thirdparty/asio/detail/impl/select_reactor.ipp diff --git a/thirdparty/asio/asio/detail/impl/service_registry.hpp b/include/ylt/thirdparty/asio/detail/impl/service_registry.hpp similarity index 100% rename from thirdparty/asio/asio/detail/impl/service_registry.hpp rename to include/ylt/thirdparty/asio/detail/impl/service_registry.hpp diff --git a/thirdparty/asio/asio/detail/impl/service_registry.ipp b/include/ylt/thirdparty/asio/detail/impl/service_registry.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/service_registry.ipp rename to include/ylt/thirdparty/asio/detail/impl/service_registry.ipp diff --git a/thirdparty/asio/asio/detail/impl/signal_set_service.ipp b/include/ylt/thirdparty/asio/detail/impl/signal_set_service.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/signal_set_service.ipp rename to include/ylt/thirdparty/asio/detail/impl/signal_set_service.ipp diff --git a/thirdparty/asio/asio/detail/impl/socket_ops.ipp b/include/ylt/thirdparty/asio/detail/impl/socket_ops.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/socket_ops.ipp rename to include/ylt/thirdparty/asio/detail/impl/socket_ops.ipp diff --git a/thirdparty/asio/asio/detail/impl/socket_select_interrupter.ipp b/include/ylt/thirdparty/asio/detail/impl/socket_select_interrupter.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/socket_select_interrupter.ipp rename to include/ylt/thirdparty/asio/detail/impl/socket_select_interrupter.ipp diff --git a/thirdparty/asio/asio/detail/impl/strand_executor_service.hpp b/include/ylt/thirdparty/asio/detail/impl/strand_executor_service.hpp similarity index 100% rename from thirdparty/asio/asio/detail/impl/strand_executor_service.hpp rename to include/ylt/thirdparty/asio/detail/impl/strand_executor_service.hpp diff --git a/thirdparty/asio/asio/detail/impl/strand_executor_service.ipp b/include/ylt/thirdparty/asio/detail/impl/strand_executor_service.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/strand_executor_service.ipp rename to include/ylt/thirdparty/asio/detail/impl/strand_executor_service.ipp diff --git a/thirdparty/asio/asio/detail/impl/strand_service.hpp b/include/ylt/thirdparty/asio/detail/impl/strand_service.hpp similarity index 100% rename from thirdparty/asio/asio/detail/impl/strand_service.hpp rename to include/ylt/thirdparty/asio/detail/impl/strand_service.hpp diff --git a/thirdparty/asio/asio/detail/impl/strand_service.ipp b/include/ylt/thirdparty/asio/detail/impl/strand_service.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/strand_service.ipp rename to include/ylt/thirdparty/asio/detail/impl/strand_service.ipp diff --git a/thirdparty/asio/asio/detail/impl/thread_context.ipp b/include/ylt/thirdparty/asio/detail/impl/thread_context.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/thread_context.ipp rename to include/ylt/thirdparty/asio/detail/impl/thread_context.ipp diff --git a/thirdparty/asio/asio/detail/impl/throw_error.ipp b/include/ylt/thirdparty/asio/detail/impl/throw_error.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/throw_error.ipp rename to include/ylt/thirdparty/asio/detail/impl/throw_error.ipp diff --git a/thirdparty/asio/asio/detail/impl/timer_queue_ptime.ipp b/include/ylt/thirdparty/asio/detail/impl/timer_queue_ptime.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/timer_queue_ptime.ipp rename to include/ylt/thirdparty/asio/detail/impl/timer_queue_ptime.ipp diff --git a/thirdparty/asio/asio/detail/impl/timer_queue_set.ipp b/include/ylt/thirdparty/asio/detail/impl/timer_queue_set.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/timer_queue_set.ipp rename to include/ylt/thirdparty/asio/detail/impl/timer_queue_set.ipp diff --git a/thirdparty/asio/asio/detail/impl/win_event.ipp b/include/ylt/thirdparty/asio/detail/impl/win_event.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/win_event.ipp rename to include/ylt/thirdparty/asio/detail/impl/win_event.ipp diff --git a/thirdparty/asio/asio/detail/impl/win_iocp_file_service.ipp b/include/ylt/thirdparty/asio/detail/impl/win_iocp_file_service.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/win_iocp_file_service.ipp rename to include/ylt/thirdparty/asio/detail/impl/win_iocp_file_service.ipp diff --git a/thirdparty/asio/asio/detail/impl/win_iocp_handle_service.ipp b/include/ylt/thirdparty/asio/detail/impl/win_iocp_handle_service.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/win_iocp_handle_service.ipp rename to include/ylt/thirdparty/asio/detail/impl/win_iocp_handle_service.ipp diff --git a/thirdparty/asio/asio/detail/impl/win_iocp_io_context.hpp b/include/ylt/thirdparty/asio/detail/impl/win_iocp_io_context.hpp similarity index 100% rename from thirdparty/asio/asio/detail/impl/win_iocp_io_context.hpp rename to include/ylt/thirdparty/asio/detail/impl/win_iocp_io_context.hpp diff --git a/thirdparty/asio/asio/detail/impl/win_iocp_io_context.ipp b/include/ylt/thirdparty/asio/detail/impl/win_iocp_io_context.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/win_iocp_io_context.ipp rename to include/ylt/thirdparty/asio/detail/impl/win_iocp_io_context.ipp diff --git a/thirdparty/asio/asio/detail/impl/win_iocp_serial_port_service.ipp b/include/ylt/thirdparty/asio/detail/impl/win_iocp_serial_port_service.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/win_iocp_serial_port_service.ipp rename to include/ylt/thirdparty/asio/detail/impl/win_iocp_serial_port_service.ipp diff --git a/thirdparty/asio/asio/detail/impl/win_iocp_socket_service_base.ipp b/include/ylt/thirdparty/asio/detail/impl/win_iocp_socket_service_base.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/win_iocp_socket_service_base.ipp rename to include/ylt/thirdparty/asio/detail/impl/win_iocp_socket_service_base.ipp diff --git a/thirdparty/asio/asio/detail/impl/win_mutex.ipp b/include/ylt/thirdparty/asio/detail/impl/win_mutex.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/win_mutex.ipp rename to include/ylt/thirdparty/asio/detail/impl/win_mutex.ipp diff --git a/thirdparty/asio/asio/detail/impl/win_object_handle_service.ipp b/include/ylt/thirdparty/asio/detail/impl/win_object_handle_service.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/win_object_handle_service.ipp rename to include/ylt/thirdparty/asio/detail/impl/win_object_handle_service.ipp diff --git a/thirdparty/asio/asio/detail/impl/win_static_mutex.ipp b/include/ylt/thirdparty/asio/detail/impl/win_static_mutex.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/win_static_mutex.ipp rename to include/ylt/thirdparty/asio/detail/impl/win_static_mutex.ipp diff --git a/thirdparty/asio/asio/detail/impl/win_thread.ipp b/include/ylt/thirdparty/asio/detail/impl/win_thread.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/win_thread.ipp rename to include/ylt/thirdparty/asio/detail/impl/win_thread.ipp diff --git a/thirdparty/asio/asio/detail/impl/win_tss_ptr.ipp b/include/ylt/thirdparty/asio/detail/impl/win_tss_ptr.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/win_tss_ptr.ipp rename to include/ylt/thirdparty/asio/detail/impl/win_tss_ptr.ipp diff --git a/thirdparty/asio/asio/detail/impl/winrt_ssocket_service_base.ipp b/include/ylt/thirdparty/asio/detail/impl/winrt_ssocket_service_base.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/winrt_ssocket_service_base.ipp rename to include/ylt/thirdparty/asio/detail/impl/winrt_ssocket_service_base.ipp diff --git a/thirdparty/asio/asio/detail/impl/winrt_timer_scheduler.hpp b/include/ylt/thirdparty/asio/detail/impl/winrt_timer_scheduler.hpp similarity index 100% rename from thirdparty/asio/asio/detail/impl/winrt_timer_scheduler.hpp rename to include/ylt/thirdparty/asio/detail/impl/winrt_timer_scheduler.hpp diff --git a/thirdparty/asio/asio/detail/impl/winrt_timer_scheduler.ipp b/include/ylt/thirdparty/asio/detail/impl/winrt_timer_scheduler.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/winrt_timer_scheduler.ipp rename to include/ylt/thirdparty/asio/detail/impl/winrt_timer_scheduler.ipp diff --git a/thirdparty/asio/asio/detail/impl/winsock_init.ipp b/include/ylt/thirdparty/asio/detail/impl/winsock_init.ipp similarity index 100% rename from thirdparty/asio/asio/detail/impl/winsock_init.ipp rename to include/ylt/thirdparty/asio/detail/impl/winsock_init.ipp diff --git a/thirdparty/asio/asio/detail/io_control.hpp b/include/ylt/thirdparty/asio/detail/io_control.hpp similarity index 100% rename from thirdparty/asio/asio/detail/io_control.hpp rename to include/ylt/thirdparty/asio/detail/io_control.hpp diff --git a/thirdparty/asio/asio/detail/io_object_impl.hpp b/include/ylt/thirdparty/asio/detail/io_object_impl.hpp similarity index 100% rename from thirdparty/asio/asio/detail/io_object_impl.hpp rename to include/ylt/thirdparty/asio/detail/io_object_impl.hpp diff --git a/thirdparty/asio/asio/detail/io_uring_descriptor_read_at_op.hpp b/include/ylt/thirdparty/asio/detail/io_uring_descriptor_read_at_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/io_uring_descriptor_read_at_op.hpp rename to include/ylt/thirdparty/asio/detail/io_uring_descriptor_read_at_op.hpp diff --git a/thirdparty/asio/asio/detail/io_uring_descriptor_read_op.hpp b/include/ylt/thirdparty/asio/detail/io_uring_descriptor_read_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/io_uring_descriptor_read_op.hpp rename to include/ylt/thirdparty/asio/detail/io_uring_descriptor_read_op.hpp diff --git a/thirdparty/asio/asio/detail/io_uring_descriptor_service.hpp b/include/ylt/thirdparty/asio/detail/io_uring_descriptor_service.hpp similarity index 100% rename from thirdparty/asio/asio/detail/io_uring_descriptor_service.hpp rename to include/ylt/thirdparty/asio/detail/io_uring_descriptor_service.hpp diff --git a/thirdparty/asio/asio/detail/io_uring_descriptor_write_at_op.hpp b/include/ylt/thirdparty/asio/detail/io_uring_descriptor_write_at_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/io_uring_descriptor_write_at_op.hpp rename to include/ylt/thirdparty/asio/detail/io_uring_descriptor_write_at_op.hpp diff --git a/thirdparty/asio/asio/detail/io_uring_descriptor_write_op.hpp b/include/ylt/thirdparty/asio/detail/io_uring_descriptor_write_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/io_uring_descriptor_write_op.hpp rename to include/ylt/thirdparty/asio/detail/io_uring_descriptor_write_op.hpp diff --git a/thirdparty/asio/asio/detail/io_uring_file_service.hpp b/include/ylt/thirdparty/asio/detail/io_uring_file_service.hpp similarity index 100% rename from thirdparty/asio/asio/detail/io_uring_file_service.hpp rename to include/ylt/thirdparty/asio/detail/io_uring_file_service.hpp diff --git a/thirdparty/asio/asio/detail/io_uring_null_buffers_op.hpp b/include/ylt/thirdparty/asio/detail/io_uring_null_buffers_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/io_uring_null_buffers_op.hpp rename to include/ylt/thirdparty/asio/detail/io_uring_null_buffers_op.hpp diff --git a/thirdparty/asio/asio/detail/io_uring_operation.hpp b/include/ylt/thirdparty/asio/detail/io_uring_operation.hpp similarity index 100% rename from thirdparty/asio/asio/detail/io_uring_operation.hpp rename to include/ylt/thirdparty/asio/detail/io_uring_operation.hpp diff --git a/thirdparty/asio/asio/detail/io_uring_service.hpp b/include/ylt/thirdparty/asio/detail/io_uring_service.hpp similarity index 100% rename from thirdparty/asio/asio/detail/io_uring_service.hpp rename to include/ylt/thirdparty/asio/detail/io_uring_service.hpp diff --git a/thirdparty/asio/asio/detail/io_uring_socket_accept_op.hpp b/include/ylt/thirdparty/asio/detail/io_uring_socket_accept_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/io_uring_socket_accept_op.hpp rename to include/ylt/thirdparty/asio/detail/io_uring_socket_accept_op.hpp diff --git a/thirdparty/asio/asio/detail/io_uring_socket_connect_op.hpp b/include/ylt/thirdparty/asio/detail/io_uring_socket_connect_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/io_uring_socket_connect_op.hpp rename to include/ylt/thirdparty/asio/detail/io_uring_socket_connect_op.hpp diff --git a/thirdparty/asio/asio/detail/io_uring_socket_recv_op.hpp b/include/ylt/thirdparty/asio/detail/io_uring_socket_recv_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/io_uring_socket_recv_op.hpp rename to include/ylt/thirdparty/asio/detail/io_uring_socket_recv_op.hpp diff --git a/thirdparty/asio/asio/detail/io_uring_socket_recvfrom_op.hpp b/include/ylt/thirdparty/asio/detail/io_uring_socket_recvfrom_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/io_uring_socket_recvfrom_op.hpp rename to include/ylt/thirdparty/asio/detail/io_uring_socket_recvfrom_op.hpp diff --git a/thirdparty/asio/asio/detail/io_uring_socket_recvmsg_op.hpp b/include/ylt/thirdparty/asio/detail/io_uring_socket_recvmsg_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/io_uring_socket_recvmsg_op.hpp rename to include/ylt/thirdparty/asio/detail/io_uring_socket_recvmsg_op.hpp diff --git a/thirdparty/asio/asio/detail/io_uring_socket_send_op.hpp b/include/ylt/thirdparty/asio/detail/io_uring_socket_send_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/io_uring_socket_send_op.hpp rename to include/ylt/thirdparty/asio/detail/io_uring_socket_send_op.hpp diff --git a/thirdparty/asio/asio/detail/io_uring_socket_sendto_op.hpp b/include/ylt/thirdparty/asio/detail/io_uring_socket_sendto_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/io_uring_socket_sendto_op.hpp rename to include/ylt/thirdparty/asio/detail/io_uring_socket_sendto_op.hpp diff --git a/thirdparty/asio/asio/detail/io_uring_socket_service.hpp b/include/ylt/thirdparty/asio/detail/io_uring_socket_service.hpp similarity index 100% rename from thirdparty/asio/asio/detail/io_uring_socket_service.hpp rename to include/ylt/thirdparty/asio/detail/io_uring_socket_service.hpp diff --git a/thirdparty/asio/asio/detail/io_uring_socket_service_base.hpp b/include/ylt/thirdparty/asio/detail/io_uring_socket_service_base.hpp similarity index 100% rename from thirdparty/asio/asio/detail/io_uring_socket_service_base.hpp rename to include/ylt/thirdparty/asio/detail/io_uring_socket_service_base.hpp diff --git a/thirdparty/asio/asio/detail/io_uring_wait_op.hpp b/include/ylt/thirdparty/asio/detail/io_uring_wait_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/io_uring_wait_op.hpp rename to include/ylt/thirdparty/asio/detail/io_uring_wait_op.hpp diff --git a/thirdparty/asio/asio/detail/is_buffer_sequence.hpp b/include/ylt/thirdparty/asio/detail/is_buffer_sequence.hpp similarity index 100% rename from thirdparty/asio/asio/detail/is_buffer_sequence.hpp rename to include/ylt/thirdparty/asio/detail/is_buffer_sequence.hpp diff --git a/thirdparty/asio/asio/detail/is_executor.hpp b/include/ylt/thirdparty/asio/detail/is_executor.hpp similarity index 100% rename from thirdparty/asio/asio/detail/is_executor.hpp rename to include/ylt/thirdparty/asio/detail/is_executor.hpp diff --git a/thirdparty/asio/asio/detail/keyword_tss_ptr.hpp b/include/ylt/thirdparty/asio/detail/keyword_tss_ptr.hpp similarity index 100% rename from thirdparty/asio/asio/detail/keyword_tss_ptr.hpp rename to include/ylt/thirdparty/asio/detail/keyword_tss_ptr.hpp diff --git a/thirdparty/asio/asio/detail/kqueue_reactor.hpp b/include/ylt/thirdparty/asio/detail/kqueue_reactor.hpp similarity index 100% rename from thirdparty/asio/asio/detail/kqueue_reactor.hpp rename to include/ylt/thirdparty/asio/detail/kqueue_reactor.hpp diff --git a/thirdparty/asio/asio/detail/limits.hpp b/include/ylt/thirdparty/asio/detail/limits.hpp similarity index 100% rename from thirdparty/asio/asio/detail/limits.hpp rename to include/ylt/thirdparty/asio/detail/limits.hpp diff --git a/thirdparty/asio/asio/detail/local_free_on_block_exit.hpp b/include/ylt/thirdparty/asio/detail/local_free_on_block_exit.hpp similarity index 100% rename from thirdparty/asio/asio/detail/local_free_on_block_exit.hpp rename to include/ylt/thirdparty/asio/detail/local_free_on_block_exit.hpp diff --git a/thirdparty/asio/asio/detail/macos_fenced_block.hpp b/include/ylt/thirdparty/asio/detail/macos_fenced_block.hpp similarity index 100% rename from thirdparty/asio/asio/detail/macos_fenced_block.hpp rename to include/ylt/thirdparty/asio/detail/macos_fenced_block.hpp diff --git a/thirdparty/asio/asio/detail/memory.hpp b/include/ylt/thirdparty/asio/detail/memory.hpp similarity index 100% rename from thirdparty/asio/asio/detail/memory.hpp rename to include/ylt/thirdparty/asio/detail/memory.hpp diff --git a/thirdparty/asio/asio/detail/mutex.hpp b/include/ylt/thirdparty/asio/detail/mutex.hpp similarity index 100% rename from thirdparty/asio/asio/detail/mutex.hpp rename to include/ylt/thirdparty/asio/detail/mutex.hpp diff --git a/thirdparty/asio/asio/detail/non_const_lvalue.hpp b/include/ylt/thirdparty/asio/detail/non_const_lvalue.hpp similarity index 100% rename from thirdparty/asio/asio/detail/non_const_lvalue.hpp rename to include/ylt/thirdparty/asio/detail/non_const_lvalue.hpp diff --git a/thirdparty/asio/asio/detail/noncopyable.hpp b/include/ylt/thirdparty/asio/detail/noncopyable.hpp similarity index 100% rename from thirdparty/asio/asio/detail/noncopyable.hpp rename to include/ylt/thirdparty/asio/detail/noncopyable.hpp diff --git a/thirdparty/asio/asio/detail/null_event.hpp b/include/ylt/thirdparty/asio/detail/null_event.hpp similarity index 100% rename from thirdparty/asio/asio/detail/null_event.hpp rename to include/ylt/thirdparty/asio/detail/null_event.hpp diff --git a/thirdparty/asio/asio/detail/null_fenced_block.hpp b/include/ylt/thirdparty/asio/detail/null_fenced_block.hpp similarity index 100% rename from thirdparty/asio/asio/detail/null_fenced_block.hpp rename to include/ylt/thirdparty/asio/detail/null_fenced_block.hpp diff --git a/thirdparty/asio/asio/detail/null_global.hpp b/include/ylt/thirdparty/asio/detail/null_global.hpp similarity index 100% rename from thirdparty/asio/asio/detail/null_global.hpp rename to include/ylt/thirdparty/asio/detail/null_global.hpp diff --git a/thirdparty/asio/asio/detail/null_mutex.hpp b/include/ylt/thirdparty/asio/detail/null_mutex.hpp similarity index 100% rename from thirdparty/asio/asio/detail/null_mutex.hpp rename to include/ylt/thirdparty/asio/detail/null_mutex.hpp diff --git a/thirdparty/asio/asio/detail/null_reactor.hpp b/include/ylt/thirdparty/asio/detail/null_reactor.hpp similarity index 100% rename from thirdparty/asio/asio/detail/null_reactor.hpp rename to include/ylt/thirdparty/asio/detail/null_reactor.hpp diff --git a/thirdparty/asio/asio/detail/null_signal_blocker.hpp b/include/ylt/thirdparty/asio/detail/null_signal_blocker.hpp similarity index 100% rename from thirdparty/asio/asio/detail/null_signal_blocker.hpp rename to include/ylt/thirdparty/asio/detail/null_signal_blocker.hpp diff --git a/thirdparty/asio/asio/detail/null_socket_service.hpp b/include/ylt/thirdparty/asio/detail/null_socket_service.hpp similarity index 100% rename from thirdparty/asio/asio/detail/null_socket_service.hpp rename to include/ylt/thirdparty/asio/detail/null_socket_service.hpp diff --git a/thirdparty/asio/asio/detail/null_static_mutex.hpp b/include/ylt/thirdparty/asio/detail/null_static_mutex.hpp similarity index 100% rename from thirdparty/asio/asio/detail/null_static_mutex.hpp rename to include/ylt/thirdparty/asio/detail/null_static_mutex.hpp diff --git a/thirdparty/asio/asio/detail/null_thread.hpp b/include/ylt/thirdparty/asio/detail/null_thread.hpp similarity index 100% rename from thirdparty/asio/asio/detail/null_thread.hpp rename to include/ylt/thirdparty/asio/detail/null_thread.hpp diff --git a/thirdparty/asio/asio/detail/null_tss_ptr.hpp b/include/ylt/thirdparty/asio/detail/null_tss_ptr.hpp similarity index 100% rename from thirdparty/asio/asio/detail/null_tss_ptr.hpp rename to include/ylt/thirdparty/asio/detail/null_tss_ptr.hpp diff --git a/thirdparty/asio/asio/detail/object_pool.hpp b/include/ylt/thirdparty/asio/detail/object_pool.hpp similarity index 100% rename from thirdparty/asio/asio/detail/object_pool.hpp rename to include/ylt/thirdparty/asio/detail/object_pool.hpp diff --git a/thirdparty/asio/asio/detail/old_win_sdk_compat.hpp b/include/ylt/thirdparty/asio/detail/old_win_sdk_compat.hpp similarity index 100% rename from thirdparty/asio/asio/detail/old_win_sdk_compat.hpp rename to include/ylt/thirdparty/asio/detail/old_win_sdk_compat.hpp diff --git a/thirdparty/asio/asio/detail/op_queue.hpp b/include/ylt/thirdparty/asio/detail/op_queue.hpp similarity index 100% rename from thirdparty/asio/asio/detail/op_queue.hpp rename to include/ylt/thirdparty/asio/detail/op_queue.hpp diff --git a/thirdparty/asio/asio/detail/operation.hpp b/include/ylt/thirdparty/asio/detail/operation.hpp similarity index 100% rename from thirdparty/asio/asio/detail/operation.hpp rename to include/ylt/thirdparty/asio/detail/operation.hpp diff --git a/thirdparty/asio/asio/detail/pipe_select_interrupter.hpp b/include/ylt/thirdparty/asio/detail/pipe_select_interrupter.hpp similarity index 100% rename from thirdparty/asio/asio/detail/pipe_select_interrupter.hpp rename to include/ylt/thirdparty/asio/detail/pipe_select_interrupter.hpp diff --git a/thirdparty/asio/asio/detail/pop_options.hpp b/include/ylt/thirdparty/asio/detail/pop_options.hpp similarity index 100% rename from thirdparty/asio/asio/detail/pop_options.hpp rename to include/ylt/thirdparty/asio/detail/pop_options.hpp diff --git a/thirdparty/asio/asio/detail/posix_event.hpp b/include/ylt/thirdparty/asio/detail/posix_event.hpp similarity index 100% rename from thirdparty/asio/asio/detail/posix_event.hpp rename to include/ylt/thirdparty/asio/detail/posix_event.hpp diff --git a/thirdparty/asio/asio/detail/posix_fd_set_adapter.hpp b/include/ylt/thirdparty/asio/detail/posix_fd_set_adapter.hpp similarity index 100% rename from thirdparty/asio/asio/detail/posix_fd_set_adapter.hpp rename to include/ylt/thirdparty/asio/detail/posix_fd_set_adapter.hpp diff --git a/thirdparty/asio/asio/detail/posix_global.hpp b/include/ylt/thirdparty/asio/detail/posix_global.hpp similarity index 100% rename from thirdparty/asio/asio/detail/posix_global.hpp rename to include/ylt/thirdparty/asio/detail/posix_global.hpp diff --git a/thirdparty/asio/asio/detail/posix_mutex.hpp b/include/ylt/thirdparty/asio/detail/posix_mutex.hpp similarity index 100% rename from thirdparty/asio/asio/detail/posix_mutex.hpp rename to include/ylt/thirdparty/asio/detail/posix_mutex.hpp diff --git a/thirdparty/asio/asio/detail/posix_serial_port_service.hpp b/include/ylt/thirdparty/asio/detail/posix_serial_port_service.hpp similarity index 100% rename from thirdparty/asio/asio/detail/posix_serial_port_service.hpp rename to include/ylt/thirdparty/asio/detail/posix_serial_port_service.hpp diff --git a/thirdparty/asio/asio/detail/posix_signal_blocker.hpp b/include/ylt/thirdparty/asio/detail/posix_signal_blocker.hpp similarity index 100% rename from thirdparty/asio/asio/detail/posix_signal_blocker.hpp rename to include/ylt/thirdparty/asio/detail/posix_signal_blocker.hpp diff --git a/thirdparty/asio/asio/detail/posix_static_mutex.hpp b/include/ylt/thirdparty/asio/detail/posix_static_mutex.hpp similarity index 100% rename from thirdparty/asio/asio/detail/posix_static_mutex.hpp rename to include/ylt/thirdparty/asio/detail/posix_static_mutex.hpp diff --git a/thirdparty/asio/asio/detail/posix_thread.hpp b/include/ylt/thirdparty/asio/detail/posix_thread.hpp similarity index 100% rename from thirdparty/asio/asio/detail/posix_thread.hpp rename to include/ylt/thirdparty/asio/detail/posix_thread.hpp diff --git a/thirdparty/asio/asio/detail/posix_tss_ptr.hpp b/include/ylt/thirdparty/asio/detail/posix_tss_ptr.hpp similarity index 100% rename from thirdparty/asio/asio/detail/posix_tss_ptr.hpp rename to include/ylt/thirdparty/asio/detail/posix_tss_ptr.hpp diff --git a/thirdparty/asio/asio/detail/push_options.hpp b/include/ylt/thirdparty/asio/detail/push_options.hpp similarity index 100% rename from thirdparty/asio/asio/detail/push_options.hpp rename to include/ylt/thirdparty/asio/detail/push_options.hpp diff --git a/thirdparty/asio/asio/detail/reactive_descriptor_service.hpp b/include/ylt/thirdparty/asio/detail/reactive_descriptor_service.hpp similarity index 100% rename from thirdparty/asio/asio/detail/reactive_descriptor_service.hpp rename to include/ylt/thirdparty/asio/detail/reactive_descriptor_service.hpp diff --git a/thirdparty/asio/asio/detail/reactive_null_buffers_op.hpp b/include/ylt/thirdparty/asio/detail/reactive_null_buffers_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/reactive_null_buffers_op.hpp rename to include/ylt/thirdparty/asio/detail/reactive_null_buffers_op.hpp diff --git a/thirdparty/asio/asio/detail/reactive_socket_accept_op.hpp b/include/ylt/thirdparty/asio/detail/reactive_socket_accept_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/reactive_socket_accept_op.hpp rename to include/ylt/thirdparty/asio/detail/reactive_socket_accept_op.hpp diff --git a/thirdparty/asio/asio/detail/reactive_socket_connect_op.hpp b/include/ylt/thirdparty/asio/detail/reactive_socket_connect_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/reactive_socket_connect_op.hpp rename to include/ylt/thirdparty/asio/detail/reactive_socket_connect_op.hpp diff --git a/thirdparty/asio/asio/detail/reactive_socket_recv_op.hpp b/include/ylt/thirdparty/asio/detail/reactive_socket_recv_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/reactive_socket_recv_op.hpp rename to include/ylt/thirdparty/asio/detail/reactive_socket_recv_op.hpp diff --git a/thirdparty/asio/asio/detail/reactive_socket_recvfrom_op.hpp b/include/ylt/thirdparty/asio/detail/reactive_socket_recvfrom_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/reactive_socket_recvfrom_op.hpp rename to include/ylt/thirdparty/asio/detail/reactive_socket_recvfrom_op.hpp diff --git a/thirdparty/asio/asio/detail/reactive_socket_recvmsg_op.hpp b/include/ylt/thirdparty/asio/detail/reactive_socket_recvmsg_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/reactive_socket_recvmsg_op.hpp rename to include/ylt/thirdparty/asio/detail/reactive_socket_recvmsg_op.hpp diff --git a/thirdparty/asio/asio/detail/reactive_socket_send_op.hpp b/include/ylt/thirdparty/asio/detail/reactive_socket_send_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/reactive_socket_send_op.hpp rename to include/ylt/thirdparty/asio/detail/reactive_socket_send_op.hpp diff --git a/thirdparty/asio/asio/detail/reactive_socket_sendto_op.hpp b/include/ylt/thirdparty/asio/detail/reactive_socket_sendto_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/reactive_socket_sendto_op.hpp rename to include/ylt/thirdparty/asio/detail/reactive_socket_sendto_op.hpp diff --git a/thirdparty/asio/asio/detail/reactive_socket_service.hpp b/include/ylt/thirdparty/asio/detail/reactive_socket_service.hpp similarity index 100% rename from thirdparty/asio/asio/detail/reactive_socket_service.hpp rename to include/ylt/thirdparty/asio/detail/reactive_socket_service.hpp diff --git a/thirdparty/asio/asio/detail/reactive_socket_service_base.hpp b/include/ylt/thirdparty/asio/detail/reactive_socket_service_base.hpp similarity index 100% rename from thirdparty/asio/asio/detail/reactive_socket_service_base.hpp rename to include/ylt/thirdparty/asio/detail/reactive_socket_service_base.hpp diff --git a/thirdparty/asio/asio/detail/reactive_wait_op.hpp b/include/ylt/thirdparty/asio/detail/reactive_wait_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/reactive_wait_op.hpp rename to include/ylt/thirdparty/asio/detail/reactive_wait_op.hpp diff --git a/thirdparty/asio/asio/detail/reactor.hpp b/include/ylt/thirdparty/asio/detail/reactor.hpp similarity index 100% rename from thirdparty/asio/asio/detail/reactor.hpp rename to include/ylt/thirdparty/asio/detail/reactor.hpp diff --git a/thirdparty/asio/asio/detail/reactor_op.hpp b/include/ylt/thirdparty/asio/detail/reactor_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/reactor_op.hpp rename to include/ylt/thirdparty/asio/detail/reactor_op.hpp diff --git a/thirdparty/asio/asio/detail/reactor_op_queue.hpp b/include/ylt/thirdparty/asio/detail/reactor_op_queue.hpp similarity index 100% rename from thirdparty/asio/asio/detail/reactor_op_queue.hpp rename to include/ylt/thirdparty/asio/detail/reactor_op_queue.hpp diff --git a/thirdparty/asio/asio/detail/recycling_allocator.hpp b/include/ylt/thirdparty/asio/detail/recycling_allocator.hpp similarity index 100% rename from thirdparty/asio/asio/detail/recycling_allocator.hpp rename to include/ylt/thirdparty/asio/detail/recycling_allocator.hpp diff --git a/thirdparty/asio/asio/detail/regex_fwd.hpp b/include/ylt/thirdparty/asio/detail/regex_fwd.hpp similarity index 100% rename from thirdparty/asio/asio/detail/regex_fwd.hpp rename to include/ylt/thirdparty/asio/detail/regex_fwd.hpp diff --git a/thirdparty/asio/asio/detail/resolve_endpoint_op.hpp b/include/ylt/thirdparty/asio/detail/resolve_endpoint_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/resolve_endpoint_op.hpp rename to include/ylt/thirdparty/asio/detail/resolve_endpoint_op.hpp diff --git a/thirdparty/asio/asio/detail/resolve_op.hpp b/include/ylt/thirdparty/asio/detail/resolve_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/resolve_op.hpp rename to include/ylt/thirdparty/asio/detail/resolve_op.hpp diff --git a/thirdparty/asio/asio/detail/resolve_query_op.hpp b/include/ylt/thirdparty/asio/detail/resolve_query_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/resolve_query_op.hpp rename to include/ylt/thirdparty/asio/detail/resolve_query_op.hpp diff --git a/thirdparty/asio/asio/detail/resolver_service.hpp b/include/ylt/thirdparty/asio/detail/resolver_service.hpp similarity index 100% rename from thirdparty/asio/asio/detail/resolver_service.hpp rename to include/ylt/thirdparty/asio/detail/resolver_service.hpp diff --git a/thirdparty/asio/asio/detail/resolver_service_base.hpp b/include/ylt/thirdparty/asio/detail/resolver_service_base.hpp similarity index 100% rename from thirdparty/asio/asio/detail/resolver_service_base.hpp rename to include/ylt/thirdparty/asio/detail/resolver_service_base.hpp diff --git a/thirdparty/asio/asio/detail/scheduler.hpp b/include/ylt/thirdparty/asio/detail/scheduler.hpp similarity index 100% rename from thirdparty/asio/asio/detail/scheduler.hpp rename to include/ylt/thirdparty/asio/detail/scheduler.hpp diff --git a/thirdparty/asio/asio/detail/scheduler_operation.hpp b/include/ylt/thirdparty/asio/detail/scheduler_operation.hpp similarity index 100% rename from thirdparty/asio/asio/detail/scheduler_operation.hpp rename to include/ylt/thirdparty/asio/detail/scheduler_operation.hpp diff --git a/thirdparty/asio/asio/detail/scheduler_task.hpp b/include/ylt/thirdparty/asio/detail/scheduler_task.hpp similarity index 100% rename from thirdparty/asio/asio/detail/scheduler_task.hpp rename to include/ylt/thirdparty/asio/detail/scheduler_task.hpp diff --git a/thirdparty/asio/asio/detail/scheduler_thread_info.hpp b/include/ylt/thirdparty/asio/detail/scheduler_thread_info.hpp similarity index 100% rename from thirdparty/asio/asio/detail/scheduler_thread_info.hpp rename to include/ylt/thirdparty/asio/detail/scheduler_thread_info.hpp diff --git a/thirdparty/asio/asio/detail/scoped_lock.hpp b/include/ylt/thirdparty/asio/detail/scoped_lock.hpp similarity index 100% rename from thirdparty/asio/asio/detail/scoped_lock.hpp rename to include/ylt/thirdparty/asio/detail/scoped_lock.hpp diff --git a/thirdparty/asio/asio/detail/scoped_ptr.hpp b/include/ylt/thirdparty/asio/detail/scoped_ptr.hpp similarity index 100% rename from thirdparty/asio/asio/detail/scoped_ptr.hpp rename to include/ylt/thirdparty/asio/detail/scoped_ptr.hpp diff --git a/thirdparty/asio/asio/detail/select_interrupter.hpp b/include/ylt/thirdparty/asio/detail/select_interrupter.hpp similarity index 100% rename from thirdparty/asio/asio/detail/select_interrupter.hpp rename to include/ylt/thirdparty/asio/detail/select_interrupter.hpp diff --git a/thirdparty/asio/asio/detail/select_reactor.hpp b/include/ylt/thirdparty/asio/detail/select_reactor.hpp similarity index 100% rename from thirdparty/asio/asio/detail/select_reactor.hpp rename to include/ylt/thirdparty/asio/detail/select_reactor.hpp diff --git a/thirdparty/asio/asio/detail/service_registry.hpp b/include/ylt/thirdparty/asio/detail/service_registry.hpp similarity index 100% rename from thirdparty/asio/asio/detail/service_registry.hpp rename to include/ylt/thirdparty/asio/detail/service_registry.hpp diff --git a/thirdparty/asio/asio/detail/signal_blocker.hpp b/include/ylt/thirdparty/asio/detail/signal_blocker.hpp similarity index 100% rename from thirdparty/asio/asio/detail/signal_blocker.hpp rename to include/ylt/thirdparty/asio/detail/signal_blocker.hpp diff --git a/thirdparty/asio/asio/detail/signal_handler.hpp b/include/ylt/thirdparty/asio/detail/signal_handler.hpp similarity index 100% rename from thirdparty/asio/asio/detail/signal_handler.hpp rename to include/ylt/thirdparty/asio/detail/signal_handler.hpp diff --git a/thirdparty/asio/asio/detail/signal_init.hpp b/include/ylt/thirdparty/asio/detail/signal_init.hpp similarity index 100% rename from thirdparty/asio/asio/detail/signal_init.hpp rename to include/ylt/thirdparty/asio/detail/signal_init.hpp diff --git a/thirdparty/asio/asio/detail/signal_op.hpp b/include/ylt/thirdparty/asio/detail/signal_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/signal_op.hpp rename to include/ylt/thirdparty/asio/detail/signal_op.hpp diff --git a/thirdparty/asio/asio/detail/signal_set_service.hpp b/include/ylt/thirdparty/asio/detail/signal_set_service.hpp similarity index 100% rename from thirdparty/asio/asio/detail/signal_set_service.hpp rename to include/ylt/thirdparty/asio/detail/signal_set_service.hpp diff --git a/thirdparty/asio/asio/detail/socket_holder.hpp b/include/ylt/thirdparty/asio/detail/socket_holder.hpp similarity index 100% rename from thirdparty/asio/asio/detail/socket_holder.hpp rename to include/ylt/thirdparty/asio/detail/socket_holder.hpp diff --git a/thirdparty/asio/asio/detail/socket_ops.hpp b/include/ylt/thirdparty/asio/detail/socket_ops.hpp similarity index 100% rename from thirdparty/asio/asio/detail/socket_ops.hpp rename to include/ylt/thirdparty/asio/detail/socket_ops.hpp diff --git a/thirdparty/asio/asio/detail/socket_option.hpp b/include/ylt/thirdparty/asio/detail/socket_option.hpp similarity index 100% rename from thirdparty/asio/asio/detail/socket_option.hpp rename to include/ylt/thirdparty/asio/detail/socket_option.hpp diff --git a/thirdparty/asio/asio/detail/socket_select_interrupter.hpp b/include/ylt/thirdparty/asio/detail/socket_select_interrupter.hpp similarity index 100% rename from thirdparty/asio/asio/detail/socket_select_interrupter.hpp rename to include/ylt/thirdparty/asio/detail/socket_select_interrupter.hpp diff --git a/thirdparty/asio/asio/detail/socket_types.hpp b/include/ylt/thirdparty/asio/detail/socket_types.hpp similarity index 100% rename from thirdparty/asio/asio/detail/socket_types.hpp rename to include/ylt/thirdparty/asio/detail/socket_types.hpp diff --git a/thirdparty/asio/asio/detail/solaris_fenced_block.hpp b/include/ylt/thirdparty/asio/detail/solaris_fenced_block.hpp similarity index 100% rename from thirdparty/asio/asio/detail/solaris_fenced_block.hpp rename to include/ylt/thirdparty/asio/detail/solaris_fenced_block.hpp diff --git a/thirdparty/asio/asio/detail/source_location.hpp b/include/ylt/thirdparty/asio/detail/source_location.hpp similarity index 100% rename from thirdparty/asio/asio/detail/source_location.hpp rename to include/ylt/thirdparty/asio/detail/source_location.hpp diff --git a/thirdparty/asio/asio/detail/static_mutex.hpp b/include/ylt/thirdparty/asio/detail/static_mutex.hpp similarity index 100% rename from thirdparty/asio/asio/detail/static_mutex.hpp rename to include/ylt/thirdparty/asio/detail/static_mutex.hpp diff --git a/thirdparty/asio/asio/detail/std_event.hpp b/include/ylt/thirdparty/asio/detail/std_event.hpp similarity index 100% rename from thirdparty/asio/asio/detail/std_event.hpp rename to include/ylt/thirdparty/asio/detail/std_event.hpp diff --git a/thirdparty/asio/asio/detail/std_fenced_block.hpp b/include/ylt/thirdparty/asio/detail/std_fenced_block.hpp similarity index 100% rename from thirdparty/asio/asio/detail/std_fenced_block.hpp rename to include/ylt/thirdparty/asio/detail/std_fenced_block.hpp diff --git a/thirdparty/asio/asio/detail/std_global.hpp b/include/ylt/thirdparty/asio/detail/std_global.hpp similarity index 100% rename from thirdparty/asio/asio/detail/std_global.hpp rename to include/ylt/thirdparty/asio/detail/std_global.hpp diff --git a/thirdparty/asio/asio/detail/std_mutex.hpp b/include/ylt/thirdparty/asio/detail/std_mutex.hpp similarity index 100% rename from thirdparty/asio/asio/detail/std_mutex.hpp rename to include/ylt/thirdparty/asio/detail/std_mutex.hpp diff --git a/thirdparty/asio/asio/detail/std_static_mutex.hpp b/include/ylt/thirdparty/asio/detail/std_static_mutex.hpp similarity index 100% rename from thirdparty/asio/asio/detail/std_static_mutex.hpp rename to include/ylt/thirdparty/asio/detail/std_static_mutex.hpp diff --git a/thirdparty/asio/asio/detail/std_thread.hpp b/include/ylt/thirdparty/asio/detail/std_thread.hpp similarity index 100% rename from thirdparty/asio/asio/detail/std_thread.hpp rename to include/ylt/thirdparty/asio/detail/std_thread.hpp diff --git a/thirdparty/asio/asio/detail/strand_executor_service.hpp b/include/ylt/thirdparty/asio/detail/strand_executor_service.hpp similarity index 100% rename from thirdparty/asio/asio/detail/strand_executor_service.hpp rename to include/ylt/thirdparty/asio/detail/strand_executor_service.hpp diff --git a/thirdparty/asio/asio/detail/strand_service.hpp b/include/ylt/thirdparty/asio/detail/strand_service.hpp similarity index 100% rename from thirdparty/asio/asio/detail/strand_service.hpp rename to include/ylt/thirdparty/asio/detail/strand_service.hpp diff --git a/thirdparty/asio/asio/detail/string_view.hpp b/include/ylt/thirdparty/asio/detail/string_view.hpp similarity index 100% rename from thirdparty/asio/asio/detail/string_view.hpp rename to include/ylt/thirdparty/asio/detail/string_view.hpp diff --git a/thirdparty/asio/asio/detail/thread.hpp b/include/ylt/thirdparty/asio/detail/thread.hpp similarity index 100% rename from thirdparty/asio/asio/detail/thread.hpp rename to include/ylt/thirdparty/asio/detail/thread.hpp diff --git a/thirdparty/asio/asio/detail/thread_context.hpp b/include/ylt/thirdparty/asio/detail/thread_context.hpp similarity index 100% rename from thirdparty/asio/asio/detail/thread_context.hpp rename to include/ylt/thirdparty/asio/detail/thread_context.hpp diff --git a/thirdparty/asio/asio/detail/thread_group.hpp b/include/ylt/thirdparty/asio/detail/thread_group.hpp similarity index 100% rename from thirdparty/asio/asio/detail/thread_group.hpp rename to include/ylt/thirdparty/asio/detail/thread_group.hpp diff --git a/thirdparty/asio/asio/detail/thread_info_base.hpp b/include/ylt/thirdparty/asio/detail/thread_info_base.hpp similarity index 100% rename from thirdparty/asio/asio/detail/thread_info_base.hpp rename to include/ylt/thirdparty/asio/detail/thread_info_base.hpp diff --git a/thirdparty/asio/asio/detail/throw_error.hpp b/include/ylt/thirdparty/asio/detail/throw_error.hpp similarity index 100% rename from thirdparty/asio/asio/detail/throw_error.hpp rename to include/ylt/thirdparty/asio/detail/throw_error.hpp diff --git a/thirdparty/asio/asio/detail/throw_exception.hpp b/include/ylt/thirdparty/asio/detail/throw_exception.hpp similarity index 100% rename from thirdparty/asio/asio/detail/throw_exception.hpp rename to include/ylt/thirdparty/asio/detail/throw_exception.hpp diff --git a/thirdparty/asio/asio/detail/timer_queue.hpp b/include/ylt/thirdparty/asio/detail/timer_queue.hpp similarity index 100% rename from thirdparty/asio/asio/detail/timer_queue.hpp rename to include/ylt/thirdparty/asio/detail/timer_queue.hpp diff --git a/thirdparty/asio/asio/detail/timer_queue_base.hpp b/include/ylt/thirdparty/asio/detail/timer_queue_base.hpp similarity index 100% rename from thirdparty/asio/asio/detail/timer_queue_base.hpp rename to include/ylt/thirdparty/asio/detail/timer_queue_base.hpp diff --git a/thirdparty/asio/asio/detail/timer_queue_ptime.hpp b/include/ylt/thirdparty/asio/detail/timer_queue_ptime.hpp similarity index 100% rename from thirdparty/asio/asio/detail/timer_queue_ptime.hpp rename to include/ylt/thirdparty/asio/detail/timer_queue_ptime.hpp diff --git a/thirdparty/asio/asio/detail/timer_queue_set.hpp b/include/ylt/thirdparty/asio/detail/timer_queue_set.hpp similarity index 100% rename from thirdparty/asio/asio/detail/timer_queue_set.hpp rename to include/ylt/thirdparty/asio/detail/timer_queue_set.hpp diff --git a/thirdparty/asio/asio/detail/timer_scheduler.hpp b/include/ylt/thirdparty/asio/detail/timer_scheduler.hpp similarity index 100% rename from thirdparty/asio/asio/detail/timer_scheduler.hpp rename to include/ylt/thirdparty/asio/detail/timer_scheduler.hpp diff --git a/thirdparty/asio/asio/detail/timer_scheduler_fwd.hpp b/include/ylt/thirdparty/asio/detail/timer_scheduler_fwd.hpp similarity index 100% rename from thirdparty/asio/asio/detail/timer_scheduler_fwd.hpp rename to include/ylt/thirdparty/asio/detail/timer_scheduler_fwd.hpp diff --git a/thirdparty/asio/asio/detail/tss_ptr.hpp b/include/ylt/thirdparty/asio/detail/tss_ptr.hpp similarity index 100% rename from thirdparty/asio/asio/detail/tss_ptr.hpp rename to include/ylt/thirdparty/asio/detail/tss_ptr.hpp diff --git a/thirdparty/asio/asio/detail/type_traits.hpp b/include/ylt/thirdparty/asio/detail/type_traits.hpp similarity index 100% rename from thirdparty/asio/asio/detail/type_traits.hpp rename to include/ylt/thirdparty/asio/detail/type_traits.hpp diff --git a/thirdparty/asio/asio/detail/utility.hpp b/include/ylt/thirdparty/asio/detail/utility.hpp similarity index 100% rename from thirdparty/asio/asio/detail/utility.hpp rename to include/ylt/thirdparty/asio/detail/utility.hpp diff --git a/thirdparty/asio/asio/detail/variadic_templates.hpp b/include/ylt/thirdparty/asio/detail/variadic_templates.hpp similarity index 100% rename from thirdparty/asio/asio/detail/variadic_templates.hpp rename to include/ylt/thirdparty/asio/detail/variadic_templates.hpp diff --git a/thirdparty/asio/asio/detail/wait_handler.hpp b/include/ylt/thirdparty/asio/detail/wait_handler.hpp similarity index 100% rename from thirdparty/asio/asio/detail/wait_handler.hpp rename to include/ylt/thirdparty/asio/detail/wait_handler.hpp diff --git a/thirdparty/asio/asio/detail/wait_op.hpp b/include/ylt/thirdparty/asio/detail/wait_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/wait_op.hpp rename to include/ylt/thirdparty/asio/detail/wait_op.hpp diff --git a/thirdparty/asio/asio/detail/win_event.hpp b/include/ylt/thirdparty/asio/detail/win_event.hpp similarity index 100% rename from thirdparty/asio/asio/detail/win_event.hpp rename to include/ylt/thirdparty/asio/detail/win_event.hpp diff --git a/thirdparty/asio/asio/detail/win_fd_set_adapter.hpp b/include/ylt/thirdparty/asio/detail/win_fd_set_adapter.hpp similarity index 100% rename from thirdparty/asio/asio/detail/win_fd_set_adapter.hpp rename to include/ylt/thirdparty/asio/detail/win_fd_set_adapter.hpp diff --git a/thirdparty/asio/asio/detail/win_fenced_block.hpp b/include/ylt/thirdparty/asio/detail/win_fenced_block.hpp similarity index 100% rename from thirdparty/asio/asio/detail/win_fenced_block.hpp rename to include/ylt/thirdparty/asio/detail/win_fenced_block.hpp diff --git a/thirdparty/asio/asio/detail/win_global.hpp b/include/ylt/thirdparty/asio/detail/win_global.hpp similarity index 100% rename from thirdparty/asio/asio/detail/win_global.hpp rename to include/ylt/thirdparty/asio/detail/win_global.hpp diff --git a/thirdparty/asio/asio/detail/win_iocp_file_service.hpp b/include/ylt/thirdparty/asio/detail/win_iocp_file_service.hpp similarity index 100% rename from thirdparty/asio/asio/detail/win_iocp_file_service.hpp rename to include/ylt/thirdparty/asio/detail/win_iocp_file_service.hpp diff --git a/thirdparty/asio/asio/detail/win_iocp_handle_read_op.hpp b/include/ylt/thirdparty/asio/detail/win_iocp_handle_read_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/win_iocp_handle_read_op.hpp rename to include/ylt/thirdparty/asio/detail/win_iocp_handle_read_op.hpp diff --git a/thirdparty/asio/asio/detail/win_iocp_handle_service.hpp b/include/ylt/thirdparty/asio/detail/win_iocp_handle_service.hpp similarity index 100% rename from thirdparty/asio/asio/detail/win_iocp_handle_service.hpp rename to include/ylt/thirdparty/asio/detail/win_iocp_handle_service.hpp diff --git a/thirdparty/asio/asio/detail/win_iocp_handle_write_op.hpp b/include/ylt/thirdparty/asio/detail/win_iocp_handle_write_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/win_iocp_handle_write_op.hpp rename to include/ylt/thirdparty/asio/detail/win_iocp_handle_write_op.hpp diff --git a/thirdparty/asio/asio/detail/win_iocp_io_context.hpp b/include/ylt/thirdparty/asio/detail/win_iocp_io_context.hpp similarity index 100% rename from thirdparty/asio/asio/detail/win_iocp_io_context.hpp rename to include/ylt/thirdparty/asio/detail/win_iocp_io_context.hpp diff --git a/thirdparty/asio/asio/detail/win_iocp_null_buffers_op.hpp b/include/ylt/thirdparty/asio/detail/win_iocp_null_buffers_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/win_iocp_null_buffers_op.hpp rename to include/ylt/thirdparty/asio/detail/win_iocp_null_buffers_op.hpp diff --git a/thirdparty/asio/asio/detail/win_iocp_operation.hpp b/include/ylt/thirdparty/asio/detail/win_iocp_operation.hpp similarity index 100% rename from thirdparty/asio/asio/detail/win_iocp_operation.hpp rename to include/ylt/thirdparty/asio/detail/win_iocp_operation.hpp diff --git a/thirdparty/asio/asio/detail/win_iocp_overlapped_op.hpp b/include/ylt/thirdparty/asio/detail/win_iocp_overlapped_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/win_iocp_overlapped_op.hpp rename to include/ylt/thirdparty/asio/detail/win_iocp_overlapped_op.hpp diff --git a/thirdparty/asio/asio/detail/win_iocp_overlapped_ptr.hpp b/include/ylt/thirdparty/asio/detail/win_iocp_overlapped_ptr.hpp similarity index 100% rename from thirdparty/asio/asio/detail/win_iocp_overlapped_ptr.hpp rename to include/ylt/thirdparty/asio/detail/win_iocp_overlapped_ptr.hpp diff --git a/thirdparty/asio/asio/detail/win_iocp_serial_port_service.hpp b/include/ylt/thirdparty/asio/detail/win_iocp_serial_port_service.hpp similarity index 100% rename from thirdparty/asio/asio/detail/win_iocp_serial_port_service.hpp rename to include/ylt/thirdparty/asio/detail/win_iocp_serial_port_service.hpp diff --git a/thirdparty/asio/asio/detail/win_iocp_socket_accept_op.hpp b/include/ylt/thirdparty/asio/detail/win_iocp_socket_accept_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/win_iocp_socket_accept_op.hpp rename to include/ylt/thirdparty/asio/detail/win_iocp_socket_accept_op.hpp diff --git a/thirdparty/asio/asio/detail/win_iocp_socket_connect_op.hpp b/include/ylt/thirdparty/asio/detail/win_iocp_socket_connect_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/win_iocp_socket_connect_op.hpp rename to include/ylt/thirdparty/asio/detail/win_iocp_socket_connect_op.hpp diff --git a/thirdparty/asio/asio/detail/win_iocp_socket_recv_op.hpp b/include/ylt/thirdparty/asio/detail/win_iocp_socket_recv_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/win_iocp_socket_recv_op.hpp rename to include/ylt/thirdparty/asio/detail/win_iocp_socket_recv_op.hpp diff --git a/thirdparty/asio/asio/detail/win_iocp_socket_recvfrom_op.hpp b/include/ylt/thirdparty/asio/detail/win_iocp_socket_recvfrom_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/win_iocp_socket_recvfrom_op.hpp rename to include/ylt/thirdparty/asio/detail/win_iocp_socket_recvfrom_op.hpp diff --git a/thirdparty/asio/asio/detail/win_iocp_socket_recvmsg_op.hpp b/include/ylt/thirdparty/asio/detail/win_iocp_socket_recvmsg_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/win_iocp_socket_recvmsg_op.hpp rename to include/ylt/thirdparty/asio/detail/win_iocp_socket_recvmsg_op.hpp diff --git a/thirdparty/asio/asio/detail/win_iocp_socket_send_op.hpp b/include/ylt/thirdparty/asio/detail/win_iocp_socket_send_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/win_iocp_socket_send_op.hpp rename to include/ylt/thirdparty/asio/detail/win_iocp_socket_send_op.hpp diff --git a/thirdparty/asio/asio/detail/win_iocp_socket_service.hpp b/include/ylt/thirdparty/asio/detail/win_iocp_socket_service.hpp similarity index 100% rename from thirdparty/asio/asio/detail/win_iocp_socket_service.hpp rename to include/ylt/thirdparty/asio/detail/win_iocp_socket_service.hpp diff --git a/thirdparty/asio/asio/detail/win_iocp_socket_service_base.hpp b/include/ylt/thirdparty/asio/detail/win_iocp_socket_service_base.hpp similarity index 100% rename from thirdparty/asio/asio/detail/win_iocp_socket_service_base.hpp rename to include/ylt/thirdparty/asio/detail/win_iocp_socket_service_base.hpp diff --git a/thirdparty/asio/asio/detail/win_iocp_thread_info.hpp b/include/ylt/thirdparty/asio/detail/win_iocp_thread_info.hpp similarity index 100% rename from thirdparty/asio/asio/detail/win_iocp_thread_info.hpp rename to include/ylt/thirdparty/asio/detail/win_iocp_thread_info.hpp diff --git a/thirdparty/asio/asio/detail/win_iocp_wait_op.hpp b/include/ylt/thirdparty/asio/detail/win_iocp_wait_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/win_iocp_wait_op.hpp rename to include/ylt/thirdparty/asio/detail/win_iocp_wait_op.hpp diff --git a/thirdparty/asio/asio/detail/win_mutex.hpp b/include/ylt/thirdparty/asio/detail/win_mutex.hpp similarity index 100% rename from thirdparty/asio/asio/detail/win_mutex.hpp rename to include/ylt/thirdparty/asio/detail/win_mutex.hpp diff --git a/thirdparty/asio/asio/detail/win_object_handle_service.hpp b/include/ylt/thirdparty/asio/detail/win_object_handle_service.hpp similarity index 100% rename from thirdparty/asio/asio/detail/win_object_handle_service.hpp rename to include/ylt/thirdparty/asio/detail/win_object_handle_service.hpp diff --git a/thirdparty/asio/asio/detail/win_static_mutex.hpp b/include/ylt/thirdparty/asio/detail/win_static_mutex.hpp similarity index 100% rename from thirdparty/asio/asio/detail/win_static_mutex.hpp rename to include/ylt/thirdparty/asio/detail/win_static_mutex.hpp diff --git a/thirdparty/asio/asio/detail/win_thread.hpp b/include/ylt/thirdparty/asio/detail/win_thread.hpp similarity index 100% rename from thirdparty/asio/asio/detail/win_thread.hpp rename to include/ylt/thirdparty/asio/detail/win_thread.hpp diff --git a/thirdparty/asio/asio/detail/win_tss_ptr.hpp b/include/ylt/thirdparty/asio/detail/win_tss_ptr.hpp similarity index 100% rename from thirdparty/asio/asio/detail/win_tss_ptr.hpp rename to include/ylt/thirdparty/asio/detail/win_tss_ptr.hpp diff --git a/thirdparty/asio/asio/detail/winapp_thread.hpp b/include/ylt/thirdparty/asio/detail/winapp_thread.hpp similarity index 100% rename from thirdparty/asio/asio/detail/winapp_thread.hpp rename to include/ylt/thirdparty/asio/detail/winapp_thread.hpp diff --git a/thirdparty/asio/asio/detail/wince_thread.hpp b/include/ylt/thirdparty/asio/detail/wince_thread.hpp similarity index 100% rename from thirdparty/asio/asio/detail/wince_thread.hpp rename to include/ylt/thirdparty/asio/detail/wince_thread.hpp diff --git a/thirdparty/asio/asio/detail/winrt_async_manager.hpp b/include/ylt/thirdparty/asio/detail/winrt_async_manager.hpp similarity index 100% rename from thirdparty/asio/asio/detail/winrt_async_manager.hpp rename to include/ylt/thirdparty/asio/detail/winrt_async_manager.hpp diff --git a/thirdparty/asio/asio/detail/winrt_async_op.hpp b/include/ylt/thirdparty/asio/detail/winrt_async_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/winrt_async_op.hpp rename to include/ylt/thirdparty/asio/detail/winrt_async_op.hpp diff --git a/thirdparty/asio/asio/detail/winrt_resolve_op.hpp b/include/ylt/thirdparty/asio/detail/winrt_resolve_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/winrt_resolve_op.hpp rename to include/ylt/thirdparty/asio/detail/winrt_resolve_op.hpp diff --git a/thirdparty/asio/asio/detail/winrt_resolver_service.hpp b/include/ylt/thirdparty/asio/detail/winrt_resolver_service.hpp similarity index 100% rename from thirdparty/asio/asio/detail/winrt_resolver_service.hpp rename to include/ylt/thirdparty/asio/detail/winrt_resolver_service.hpp diff --git a/thirdparty/asio/asio/detail/winrt_socket_connect_op.hpp b/include/ylt/thirdparty/asio/detail/winrt_socket_connect_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/winrt_socket_connect_op.hpp rename to include/ylt/thirdparty/asio/detail/winrt_socket_connect_op.hpp diff --git a/thirdparty/asio/asio/detail/winrt_socket_recv_op.hpp b/include/ylt/thirdparty/asio/detail/winrt_socket_recv_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/winrt_socket_recv_op.hpp rename to include/ylt/thirdparty/asio/detail/winrt_socket_recv_op.hpp diff --git a/thirdparty/asio/asio/detail/winrt_socket_send_op.hpp b/include/ylt/thirdparty/asio/detail/winrt_socket_send_op.hpp similarity index 100% rename from thirdparty/asio/asio/detail/winrt_socket_send_op.hpp rename to include/ylt/thirdparty/asio/detail/winrt_socket_send_op.hpp diff --git a/thirdparty/asio/asio/detail/winrt_ssocket_service.hpp b/include/ylt/thirdparty/asio/detail/winrt_ssocket_service.hpp similarity index 100% rename from thirdparty/asio/asio/detail/winrt_ssocket_service.hpp rename to include/ylt/thirdparty/asio/detail/winrt_ssocket_service.hpp diff --git a/thirdparty/asio/asio/detail/winrt_ssocket_service_base.hpp b/include/ylt/thirdparty/asio/detail/winrt_ssocket_service_base.hpp similarity index 100% rename from thirdparty/asio/asio/detail/winrt_ssocket_service_base.hpp rename to include/ylt/thirdparty/asio/detail/winrt_ssocket_service_base.hpp diff --git a/thirdparty/asio/asio/detail/winrt_timer_scheduler.hpp b/include/ylt/thirdparty/asio/detail/winrt_timer_scheduler.hpp similarity index 100% rename from thirdparty/asio/asio/detail/winrt_timer_scheduler.hpp rename to include/ylt/thirdparty/asio/detail/winrt_timer_scheduler.hpp diff --git a/thirdparty/asio/asio/detail/winrt_utils.hpp b/include/ylt/thirdparty/asio/detail/winrt_utils.hpp similarity index 100% rename from thirdparty/asio/asio/detail/winrt_utils.hpp rename to include/ylt/thirdparty/asio/detail/winrt_utils.hpp diff --git a/thirdparty/asio/asio/detail/winsock_init.hpp b/include/ylt/thirdparty/asio/detail/winsock_init.hpp similarity index 100% rename from thirdparty/asio/asio/detail/winsock_init.hpp rename to include/ylt/thirdparty/asio/detail/winsock_init.hpp diff --git a/thirdparty/asio/asio/detail/work_dispatcher.hpp b/include/ylt/thirdparty/asio/detail/work_dispatcher.hpp similarity index 100% rename from thirdparty/asio/asio/detail/work_dispatcher.hpp rename to include/ylt/thirdparty/asio/detail/work_dispatcher.hpp diff --git a/thirdparty/asio/asio/detail/wrapped_handler.hpp b/include/ylt/thirdparty/asio/detail/wrapped_handler.hpp similarity index 100% rename from thirdparty/asio/asio/detail/wrapped_handler.hpp rename to include/ylt/thirdparty/asio/detail/wrapped_handler.hpp diff --git a/thirdparty/asio/asio/dispatch.hpp b/include/ylt/thirdparty/asio/dispatch.hpp similarity index 100% rename from thirdparty/asio/asio/dispatch.hpp rename to include/ylt/thirdparty/asio/dispatch.hpp diff --git a/thirdparty/asio/asio/error.hpp b/include/ylt/thirdparty/asio/error.hpp similarity index 100% rename from thirdparty/asio/asio/error.hpp rename to include/ylt/thirdparty/asio/error.hpp diff --git a/thirdparty/asio/asio/error_code.hpp b/include/ylt/thirdparty/asio/error_code.hpp similarity index 100% rename from thirdparty/asio/asio/error_code.hpp rename to include/ylt/thirdparty/asio/error_code.hpp diff --git a/thirdparty/asio/asio/execution.hpp b/include/ylt/thirdparty/asio/execution.hpp similarity index 100% rename from thirdparty/asio/asio/execution.hpp rename to include/ylt/thirdparty/asio/execution.hpp diff --git a/thirdparty/asio/asio/execution/allocator.hpp b/include/ylt/thirdparty/asio/execution/allocator.hpp similarity index 100% rename from thirdparty/asio/asio/execution/allocator.hpp rename to include/ylt/thirdparty/asio/execution/allocator.hpp diff --git a/thirdparty/asio/asio/execution/any_executor.hpp b/include/ylt/thirdparty/asio/execution/any_executor.hpp similarity index 100% rename from thirdparty/asio/asio/execution/any_executor.hpp rename to include/ylt/thirdparty/asio/execution/any_executor.hpp diff --git a/thirdparty/asio/asio/execution/bad_executor.hpp b/include/ylt/thirdparty/asio/execution/bad_executor.hpp similarity index 100% rename from thirdparty/asio/asio/execution/bad_executor.hpp rename to include/ylt/thirdparty/asio/execution/bad_executor.hpp diff --git a/thirdparty/asio/asio/execution/blocking.hpp b/include/ylt/thirdparty/asio/execution/blocking.hpp similarity index 100% rename from thirdparty/asio/asio/execution/blocking.hpp rename to include/ylt/thirdparty/asio/execution/blocking.hpp diff --git a/thirdparty/asio/asio/execution/blocking_adaptation.hpp b/include/ylt/thirdparty/asio/execution/blocking_adaptation.hpp similarity index 100% rename from thirdparty/asio/asio/execution/blocking_adaptation.hpp rename to include/ylt/thirdparty/asio/execution/blocking_adaptation.hpp diff --git a/thirdparty/asio/asio/execution/bulk_execute.hpp b/include/ylt/thirdparty/asio/execution/bulk_execute.hpp similarity index 100% rename from thirdparty/asio/asio/execution/bulk_execute.hpp rename to include/ylt/thirdparty/asio/execution/bulk_execute.hpp diff --git a/thirdparty/asio/asio/execution/bulk_guarantee.hpp b/include/ylt/thirdparty/asio/execution/bulk_guarantee.hpp similarity index 100% rename from thirdparty/asio/asio/execution/bulk_guarantee.hpp rename to include/ylt/thirdparty/asio/execution/bulk_guarantee.hpp diff --git a/thirdparty/asio/asio/execution/connect.hpp b/include/ylt/thirdparty/asio/execution/connect.hpp similarity index 100% rename from thirdparty/asio/asio/execution/connect.hpp rename to include/ylt/thirdparty/asio/execution/connect.hpp diff --git a/thirdparty/asio/asio/execution/context.hpp b/include/ylt/thirdparty/asio/execution/context.hpp similarity index 100% rename from thirdparty/asio/asio/execution/context.hpp rename to include/ylt/thirdparty/asio/execution/context.hpp diff --git a/thirdparty/asio/asio/execution/context_as.hpp b/include/ylt/thirdparty/asio/execution/context_as.hpp similarity index 100% rename from thirdparty/asio/asio/execution/context_as.hpp rename to include/ylt/thirdparty/asio/execution/context_as.hpp diff --git a/thirdparty/asio/asio/execution/detail/as_invocable.hpp b/include/ylt/thirdparty/asio/execution/detail/as_invocable.hpp similarity index 100% rename from thirdparty/asio/asio/execution/detail/as_invocable.hpp rename to include/ylt/thirdparty/asio/execution/detail/as_invocable.hpp diff --git a/thirdparty/asio/asio/execution/detail/as_operation.hpp b/include/ylt/thirdparty/asio/execution/detail/as_operation.hpp similarity index 100% rename from thirdparty/asio/asio/execution/detail/as_operation.hpp rename to include/ylt/thirdparty/asio/execution/detail/as_operation.hpp diff --git a/thirdparty/asio/asio/execution/detail/as_receiver.hpp b/include/ylt/thirdparty/asio/execution/detail/as_receiver.hpp similarity index 100% rename from thirdparty/asio/asio/execution/detail/as_receiver.hpp rename to include/ylt/thirdparty/asio/execution/detail/as_receiver.hpp diff --git a/thirdparty/asio/asio/execution/detail/bulk_sender.hpp b/include/ylt/thirdparty/asio/execution/detail/bulk_sender.hpp similarity index 100% rename from thirdparty/asio/asio/execution/detail/bulk_sender.hpp rename to include/ylt/thirdparty/asio/execution/detail/bulk_sender.hpp diff --git a/thirdparty/asio/asio/execution/detail/submit_receiver.hpp b/include/ylt/thirdparty/asio/execution/detail/submit_receiver.hpp similarity index 100% rename from thirdparty/asio/asio/execution/detail/submit_receiver.hpp rename to include/ylt/thirdparty/asio/execution/detail/submit_receiver.hpp diff --git a/thirdparty/asio/asio/execution/detail/void_receiver.hpp b/include/ylt/thirdparty/asio/execution/detail/void_receiver.hpp similarity index 100% rename from thirdparty/asio/asio/execution/detail/void_receiver.hpp rename to include/ylt/thirdparty/asio/execution/detail/void_receiver.hpp diff --git a/thirdparty/asio/asio/execution/execute.hpp b/include/ylt/thirdparty/asio/execution/execute.hpp similarity index 100% rename from thirdparty/asio/asio/execution/execute.hpp rename to include/ylt/thirdparty/asio/execution/execute.hpp diff --git a/thirdparty/asio/asio/execution/executor.hpp b/include/ylt/thirdparty/asio/execution/executor.hpp similarity index 100% rename from thirdparty/asio/asio/execution/executor.hpp rename to include/ylt/thirdparty/asio/execution/executor.hpp diff --git a/thirdparty/asio/asio/execution/impl/bad_executor.ipp b/include/ylt/thirdparty/asio/execution/impl/bad_executor.ipp similarity index 100% rename from thirdparty/asio/asio/execution/impl/bad_executor.ipp rename to include/ylt/thirdparty/asio/execution/impl/bad_executor.ipp diff --git a/thirdparty/asio/asio/execution/impl/receiver_invocation_error.ipp b/include/ylt/thirdparty/asio/execution/impl/receiver_invocation_error.ipp similarity index 100% rename from thirdparty/asio/asio/execution/impl/receiver_invocation_error.ipp rename to include/ylt/thirdparty/asio/execution/impl/receiver_invocation_error.ipp diff --git a/thirdparty/asio/asio/execution/invocable_archetype.hpp b/include/ylt/thirdparty/asio/execution/invocable_archetype.hpp similarity index 100% rename from thirdparty/asio/asio/execution/invocable_archetype.hpp rename to include/ylt/thirdparty/asio/execution/invocable_archetype.hpp diff --git a/thirdparty/asio/asio/execution/mapping.hpp b/include/ylt/thirdparty/asio/execution/mapping.hpp similarity index 100% rename from thirdparty/asio/asio/execution/mapping.hpp rename to include/ylt/thirdparty/asio/execution/mapping.hpp diff --git a/thirdparty/asio/asio/execution/occupancy.hpp b/include/ylt/thirdparty/asio/execution/occupancy.hpp similarity index 100% rename from thirdparty/asio/asio/execution/occupancy.hpp rename to include/ylt/thirdparty/asio/execution/occupancy.hpp diff --git a/thirdparty/asio/asio/execution/operation_state.hpp b/include/ylt/thirdparty/asio/execution/operation_state.hpp similarity index 100% rename from thirdparty/asio/asio/execution/operation_state.hpp rename to include/ylt/thirdparty/asio/execution/operation_state.hpp diff --git a/thirdparty/asio/asio/execution/outstanding_work.hpp b/include/ylt/thirdparty/asio/execution/outstanding_work.hpp similarity index 100% rename from thirdparty/asio/asio/execution/outstanding_work.hpp rename to include/ylt/thirdparty/asio/execution/outstanding_work.hpp diff --git a/thirdparty/asio/asio/execution/prefer_only.hpp b/include/ylt/thirdparty/asio/execution/prefer_only.hpp similarity index 100% rename from thirdparty/asio/asio/execution/prefer_only.hpp rename to include/ylt/thirdparty/asio/execution/prefer_only.hpp diff --git a/thirdparty/asio/asio/execution/receiver.hpp b/include/ylt/thirdparty/asio/execution/receiver.hpp similarity index 100% rename from thirdparty/asio/asio/execution/receiver.hpp rename to include/ylt/thirdparty/asio/execution/receiver.hpp diff --git a/thirdparty/asio/asio/execution/receiver_invocation_error.hpp b/include/ylt/thirdparty/asio/execution/receiver_invocation_error.hpp similarity index 100% rename from thirdparty/asio/asio/execution/receiver_invocation_error.hpp rename to include/ylt/thirdparty/asio/execution/receiver_invocation_error.hpp diff --git a/thirdparty/asio/asio/execution/relationship.hpp b/include/ylt/thirdparty/asio/execution/relationship.hpp similarity index 100% rename from thirdparty/asio/asio/execution/relationship.hpp rename to include/ylt/thirdparty/asio/execution/relationship.hpp diff --git a/thirdparty/asio/asio/execution/schedule.hpp b/include/ylt/thirdparty/asio/execution/schedule.hpp similarity index 100% rename from thirdparty/asio/asio/execution/schedule.hpp rename to include/ylt/thirdparty/asio/execution/schedule.hpp diff --git a/thirdparty/asio/asio/execution/scheduler.hpp b/include/ylt/thirdparty/asio/execution/scheduler.hpp similarity index 100% rename from thirdparty/asio/asio/execution/scheduler.hpp rename to include/ylt/thirdparty/asio/execution/scheduler.hpp diff --git a/thirdparty/asio/asio/execution/sender.hpp b/include/ylt/thirdparty/asio/execution/sender.hpp similarity index 100% rename from thirdparty/asio/asio/execution/sender.hpp rename to include/ylt/thirdparty/asio/execution/sender.hpp diff --git a/thirdparty/asio/asio/execution/set_done.hpp b/include/ylt/thirdparty/asio/execution/set_done.hpp similarity index 100% rename from thirdparty/asio/asio/execution/set_done.hpp rename to include/ylt/thirdparty/asio/execution/set_done.hpp diff --git a/thirdparty/asio/asio/execution/set_error.hpp b/include/ylt/thirdparty/asio/execution/set_error.hpp similarity index 100% rename from thirdparty/asio/asio/execution/set_error.hpp rename to include/ylt/thirdparty/asio/execution/set_error.hpp diff --git a/thirdparty/asio/asio/execution/set_value.hpp b/include/ylt/thirdparty/asio/execution/set_value.hpp similarity index 100% rename from thirdparty/asio/asio/execution/set_value.hpp rename to include/ylt/thirdparty/asio/execution/set_value.hpp diff --git a/thirdparty/asio/asio/execution/start.hpp b/include/ylt/thirdparty/asio/execution/start.hpp similarity index 100% rename from thirdparty/asio/asio/execution/start.hpp rename to include/ylt/thirdparty/asio/execution/start.hpp diff --git a/thirdparty/asio/asio/execution/submit.hpp b/include/ylt/thirdparty/asio/execution/submit.hpp similarity index 100% rename from thirdparty/asio/asio/execution/submit.hpp rename to include/ylt/thirdparty/asio/execution/submit.hpp diff --git a/thirdparty/asio/asio/execution_context.hpp b/include/ylt/thirdparty/asio/execution_context.hpp similarity index 100% rename from thirdparty/asio/asio/execution_context.hpp rename to include/ylt/thirdparty/asio/execution_context.hpp diff --git a/thirdparty/asio/asio/executor.hpp b/include/ylt/thirdparty/asio/executor.hpp similarity index 100% rename from thirdparty/asio/asio/executor.hpp rename to include/ylt/thirdparty/asio/executor.hpp diff --git a/thirdparty/asio/asio/executor_work_guard.hpp b/include/ylt/thirdparty/asio/executor_work_guard.hpp similarity index 100% rename from thirdparty/asio/asio/executor_work_guard.hpp rename to include/ylt/thirdparty/asio/executor_work_guard.hpp diff --git a/thirdparty/asio/asio/experimental/append.hpp b/include/ylt/thirdparty/asio/experimental/append.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/append.hpp rename to include/ylt/thirdparty/asio/experimental/append.hpp diff --git a/thirdparty/asio/asio/experimental/as_single.hpp b/include/ylt/thirdparty/asio/experimental/as_single.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/as_single.hpp rename to include/ylt/thirdparty/asio/experimental/as_single.hpp diff --git a/thirdparty/asio/asio/experimental/as_tuple.hpp b/include/ylt/thirdparty/asio/experimental/as_tuple.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/as_tuple.hpp rename to include/ylt/thirdparty/asio/experimental/as_tuple.hpp diff --git a/thirdparty/asio/asio/experimental/awaitable_operators.hpp b/include/ylt/thirdparty/asio/experimental/awaitable_operators.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/awaitable_operators.hpp rename to include/ylt/thirdparty/asio/experimental/awaitable_operators.hpp diff --git a/thirdparty/asio/asio/experimental/basic_channel.hpp b/include/ylt/thirdparty/asio/experimental/basic_channel.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/basic_channel.hpp rename to include/ylt/thirdparty/asio/experimental/basic_channel.hpp diff --git a/thirdparty/asio/asio/experimental/basic_concurrent_channel.hpp b/include/ylt/thirdparty/asio/experimental/basic_concurrent_channel.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/basic_concurrent_channel.hpp rename to include/ylt/thirdparty/asio/experimental/basic_concurrent_channel.hpp diff --git a/thirdparty/asio/asio/experimental/cancellation_condition.hpp b/include/ylt/thirdparty/asio/experimental/cancellation_condition.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/cancellation_condition.hpp rename to include/ylt/thirdparty/asio/experimental/cancellation_condition.hpp diff --git a/thirdparty/asio/asio/experimental/channel.hpp b/include/ylt/thirdparty/asio/experimental/channel.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/channel.hpp rename to include/ylt/thirdparty/asio/experimental/channel.hpp diff --git a/thirdparty/asio/asio/experimental/channel_error.hpp b/include/ylt/thirdparty/asio/experimental/channel_error.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/channel_error.hpp rename to include/ylt/thirdparty/asio/experimental/channel_error.hpp diff --git a/thirdparty/asio/asio/experimental/channel_traits.hpp b/include/ylt/thirdparty/asio/experimental/channel_traits.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/channel_traits.hpp rename to include/ylt/thirdparty/asio/experimental/channel_traits.hpp diff --git a/thirdparty/asio/asio/experimental/co_spawn.hpp b/include/ylt/thirdparty/asio/experimental/co_spawn.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/co_spawn.hpp rename to include/ylt/thirdparty/asio/experimental/co_spawn.hpp diff --git a/thirdparty/asio/asio/experimental/concurrent_channel.hpp b/include/ylt/thirdparty/asio/experimental/concurrent_channel.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/concurrent_channel.hpp rename to include/ylt/thirdparty/asio/experimental/concurrent_channel.hpp diff --git a/thirdparty/asio/asio/experimental/coro.hpp b/include/ylt/thirdparty/asio/experimental/coro.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/coro.hpp rename to include/ylt/thirdparty/asio/experimental/coro.hpp diff --git a/thirdparty/asio/asio/experimental/coro_traits.hpp b/include/ylt/thirdparty/asio/experimental/coro_traits.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/coro_traits.hpp rename to include/ylt/thirdparty/asio/experimental/coro_traits.hpp diff --git a/thirdparty/asio/asio/experimental/deferred.hpp b/include/ylt/thirdparty/asio/experimental/deferred.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/deferred.hpp rename to include/ylt/thirdparty/asio/experimental/deferred.hpp diff --git a/thirdparty/asio/asio/experimental/detail/channel_handler.hpp b/include/ylt/thirdparty/asio/experimental/detail/channel_handler.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/detail/channel_handler.hpp rename to include/ylt/thirdparty/asio/experimental/detail/channel_handler.hpp diff --git a/thirdparty/asio/asio/experimental/detail/channel_message.hpp b/include/ylt/thirdparty/asio/experimental/detail/channel_message.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/detail/channel_message.hpp rename to include/ylt/thirdparty/asio/experimental/detail/channel_message.hpp diff --git a/thirdparty/asio/asio/experimental/detail/channel_operation.hpp b/include/ylt/thirdparty/asio/experimental/detail/channel_operation.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/detail/channel_operation.hpp rename to include/ylt/thirdparty/asio/experimental/detail/channel_operation.hpp diff --git a/thirdparty/asio/asio/experimental/detail/channel_payload.hpp b/include/ylt/thirdparty/asio/experimental/detail/channel_payload.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/detail/channel_payload.hpp rename to include/ylt/thirdparty/asio/experimental/detail/channel_payload.hpp diff --git a/thirdparty/asio/asio/experimental/detail/channel_receive_op.hpp b/include/ylt/thirdparty/asio/experimental/detail/channel_receive_op.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/detail/channel_receive_op.hpp rename to include/ylt/thirdparty/asio/experimental/detail/channel_receive_op.hpp diff --git a/thirdparty/asio/asio/experimental/detail/channel_send_functions.hpp b/include/ylt/thirdparty/asio/experimental/detail/channel_send_functions.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/detail/channel_send_functions.hpp rename to include/ylt/thirdparty/asio/experimental/detail/channel_send_functions.hpp diff --git a/thirdparty/asio/asio/experimental/detail/channel_send_op.hpp b/include/ylt/thirdparty/asio/experimental/detail/channel_send_op.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/detail/channel_send_op.hpp rename to include/ylt/thirdparty/asio/experimental/detail/channel_send_op.hpp diff --git a/thirdparty/asio/asio/experimental/detail/channel_service.hpp b/include/ylt/thirdparty/asio/experimental/detail/channel_service.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/detail/channel_service.hpp rename to include/ylt/thirdparty/asio/experimental/detail/channel_service.hpp diff --git a/thirdparty/asio/asio/experimental/detail/completion_handler_erasure.hpp b/include/ylt/thirdparty/asio/experimental/detail/completion_handler_erasure.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/detail/completion_handler_erasure.hpp rename to include/ylt/thirdparty/asio/experimental/detail/completion_handler_erasure.hpp diff --git a/thirdparty/asio/asio/experimental/detail/coro_promise_allocator.hpp b/include/ylt/thirdparty/asio/experimental/detail/coro_promise_allocator.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/detail/coro_promise_allocator.hpp rename to include/ylt/thirdparty/asio/experimental/detail/coro_promise_allocator.hpp diff --git a/thirdparty/asio/asio/experimental/detail/has_signature.hpp b/include/ylt/thirdparty/asio/experimental/detail/has_signature.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/detail/has_signature.hpp rename to include/ylt/thirdparty/asio/experimental/detail/has_signature.hpp diff --git a/thirdparty/asio/asio/experimental/detail/impl/channel_service.hpp b/include/ylt/thirdparty/asio/experimental/detail/impl/channel_service.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/detail/impl/channel_service.hpp rename to include/ylt/thirdparty/asio/experimental/detail/impl/channel_service.hpp diff --git a/thirdparty/asio/asio/experimental/detail/partial_promise.hpp b/include/ylt/thirdparty/asio/experimental/detail/partial_promise.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/detail/partial_promise.hpp rename to include/ylt/thirdparty/asio/experimental/detail/partial_promise.hpp diff --git a/thirdparty/asio/asio/experimental/impl/as_single.hpp b/include/ylt/thirdparty/asio/experimental/impl/as_single.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/impl/as_single.hpp rename to include/ylt/thirdparty/asio/experimental/impl/as_single.hpp diff --git a/thirdparty/asio/asio/experimental/impl/channel_error.ipp b/include/ylt/thirdparty/asio/experimental/impl/channel_error.ipp similarity index 100% rename from thirdparty/asio/asio/experimental/impl/channel_error.ipp rename to include/ylt/thirdparty/asio/experimental/impl/channel_error.ipp diff --git a/thirdparty/asio/asio/experimental/impl/coro.hpp b/include/ylt/thirdparty/asio/experimental/impl/coro.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/impl/coro.hpp rename to include/ylt/thirdparty/asio/experimental/impl/coro.hpp diff --git a/thirdparty/asio/asio/experimental/impl/parallel_group.hpp b/include/ylt/thirdparty/asio/experimental/impl/parallel_group.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/impl/parallel_group.hpp rename to include/ylt/thirdparty/asio/experimental/impl/parallel_group.hpp diff --git a/thirdparty/asio/asio/experimental/impl/promise.hpp b/include/ylt/thirdparty/asio/experimental/impl/promise.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/impl/promise.hpp rename to include/ylt/thirdparty/asio/experimental/impl/promise.hpp diff --git a/thirdparty/asio/asio/experimental/impl/use_coro.hpp b/include/ylt/thirdparty/asio/experimental/impl/use_coro.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/impl/use_coro.hpp rename to include/ylt/thirdparty/asio/experimental/impl/use_coro.hpp diff --git a/thirdparty/asio/asio/experimental/parallel_group.hpp b/include/ylt/thirdparty/asio/experimental/parallel_group.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/parallel_group.hpp rename to include/ylt/thirdparty/asio/experimental/parallel_group.hpp diff --git a/thirdparty/asio/asio/experimental/prepend.hpp b/include/ylt/thirdparty/asio/experimental/prepend.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/prepend.hpp rename to include/ylt/thirdparty/asio/experimental/prepend.hpp diff --git a/thirdparty/asio/asio/experimental/promise.hpp b/include/ylt/thirdparty/asio/experimental/promise.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/promise.hpp rename to include/ylt/thirdparty/asio/experimental/promise.hpp diff --git a/thirdparty/asio/asio/experimental/use_coro.hpp b/include/ylt/thirdparty/asio/experimental/use_coro.hpp similarity index 100% rename from thirdparty/asio/asio/experimental/use_coro.hpp rename to include/ylt/thirdparty/asio/experimental/use_coro.hpp diff --git a/thirdparty/asio/asio/file_base.hpp b/include/ylt/thirdparty/asio/file_base.hpp similarity index 100% rename from thirdparty/asio/asio/file_base.hpp rename to include/ylt/thirdparty/asio/file_base.hpp diff --git a/thirdparty/asio/asio/generic/basic_endpoint.hpp b/include/ylt/thirdparty/asio/generic/basic_endpoint.hpp similarity index 100% rename from thirdparty/asio/asio/generic/basic_endpoint.hpp rename to include/ylt/thirdparty/asio/generic/basic_endpoint.hpp diff --git a/thirdparty/asio/asio/generic/datagram_protocol.hpp b/include/ylt/thirdparty/asio/generic/datagram_protocol.hpp similarity index 100% rename from thirdparty/asio/asio/generic/datagram_protocol.hpp rename to include/ylt/thirdparty/asio/generic/datagram_protocol.hpp diff --git a/thirdparty/asio/asio/generic/detail/endpoint.hpp b/include/ylt/thirdparty/asio/generic/detail/endpoint.hpp similarity index 100% rename from thirdparty/asio/asio/generic/detail/endpoint.hpp rename to include/ylt/thirdparty/asio/generic/detail/endpoint.hpp diff --git a/thirdparty/asio/asio/generic/detail/impl/endpoint.ipp b/include/ylt/thirdparty/asio/generic/detail/impl/endpoint.ipp similarity index 100% rename from thirdparty/asio/asio/generic/detail/impl/endpoint.ipp rename to include/ylt/thirdparty/asio/generic/detail/impl/endpoint.ipp diff --git a/thirdparty/asio/asio/generic/raw_protocol.hpp b/include/ylt/thirdparty/asio/generic/raw_protocol.hpp similarity index 100% rename from thirdparty/asio/asio/generic/raw_protocol.hpp rename to include/ylt/thirdparty/asio/generic/raw_protocol.hpp diff --git a/thirdparty/asio/asio/generic/seq_packet_protocol.hpp b/include/ylt/thirdparty/asio/generic/seq_packet_protocol.hpp similarity index 100% rename from thirdparty/asio/asio/generic/seq_packet_protocol.hpp rename to include/ylt/thirdparty/asio/generic/seq_packet_protocol.hpp diff --git a/thirdparty/asio/asio/generic/stream_protocol.hpp b/include/ylt/thirdparty/asio/generic/stream_protocol.hpp similarity index 100% rename from thirdparty/asio/asio/generic/stream_protocol.hpp rename to include/ylt/thirdparty/asio/generic/stream_protocol.hpp diff --git a/thirdparty/asio/asio/handler_alloc_hook.hpp b/include/ylt/thirdparty/asio/handler_alloc_hook.hpp similarity index 100% rename from thirdparty/asio/asio/handler_alloc_hook.hpp rename to include/ylt/thirdparty/asio/handler_alloc_hook.hpp diff --git a/thirdparty/asio/asio/handler_continuation_hook.hpp b/include/ylt/thirdparty/asio/handler_continuation_hook.hpp similarity index 100% rename from thirdparty/asio/asio/handler_continuation_hook.hpp rename to include/ylt/thirdparty/asio/handler_continuation_hook.hpp diff --git a/thirdparty/asio/asio/handler_invoke_hook.hpp b/include/ylt/thirdparty/asio/handler_invoke_hook.hpp similarity index 100% rename from thirdparty/asio/asio/handler_invoke_hook.hpp rename to include/ylt/thirdparty/asio/handler_invoke_hook.hpp diff --git a/thirdparty/asio/asio/high_resolution_timer.hpp b/include/ylt/thirdparty/asio/high_resolution_timer.hpp similarity index 100% rename from thirdparty/asio/asio/high_resolution_timer.hpp rename to include/ylt/thirdparty/asio/high_resolution_timer.hpp diff --git a/thirdparty/asio/asio/impl/any_io_executor.ipp b/include/ylt/thirdparty/asio/impl/any_io_executor.ipp similarity index 100% rename from thirdparty/asio/asio/impl/any_io_executor.ipp rename to include/ylt/thirdparty/asio/impl/any_io_executor.ipp diff --git a/thirdparty/asio/asio/impl/append.hpp b/include/ylt/thirdparty/asio/impl/append.hpp similarity index 100% rename from thirdparty/asio/asio/impl/append.hpp rename to include/ylt/thirdparty/asio/impl/append.hpp diff --git a/thirdparty/asio/asio/impl/as_tuple.hpp b/include/ylt/thirdparty/asio/impl/as_tuple.hpp similarity index 100% rename from thirdparty/asio/asio/impl/as_tuple.hpp rename to include/ylt/thirdparty/asio/impl/as_tuple.hpp diff --git a/thirdparty/asio/asio/impl/awaitable.hpp b/include/ylt/thirdparty/asio/impl/awaitable.hpp similarity index 100% rename from thirdparty/asio/asio/impl/awaitable.hpp rename to include/ylt/thirdparty/asio/impl/awaitable.hpp diff --git a/thirdparty/asio/asio/impl/buffered_read_stream.hpp b/include/ylt/thirdparty/asio/impl/buffered_read_stream.hpp similarity index 100% rename from thirdparty/asio/asio/impl/buffered_read_stream.hpp rename to include/ylt/thirdparty/asio/impl/buffered_read_stream.hpp diff --git a/thirdparty/asio/asio/impl/buffered_write_stream.hpp b/include/ylt/thirdparty/asio/impl/buffered_write_stream.hpp similarity index 100% rename from thirdparty/asio/asio/impl/buffered_write_stream.hpp rename to include/ylt/thirdparty/asio/impl/buffered_write_stream.hpp diff --git a/thirdparty/asio/asio/impl/cancellation_signal.ipp b/include/ylt/thirdparty/asio/impl/cancellation_signal.ipp similarity index 100% rename from thirdparty/asio/asio/impl/cancellation_signal.ipp rename to include/ylt/thirdparty/asio/impl/cancellation_signal.ipp diff --git a/thirdparty/asio/asio/impl/co_spawn.hpp b/include/ylt/thirdparty/asio/impl/co_spawn.hpp similarity index 100% rename from thirdparty/asio/asio/impl/co_spawn.hpp rename to include/ylt/thirdparty/asio/impl/co_spawn.hpp diff --git a/thirdparty/asio/asio/impl/connect.hpp b/include/ylt/thirdparty/asio/impl/connect.hpp similarity index 100% rename from thirdparty/asio/asio/impl/connect.hpp rename to include/ylt/thirdparty/asio/impl/connect.hpp diff --git a/thirdparty/asio/asio/impl/connect_pipe.hpp b/include/ylt/thirdparty/asio/impl/connect_pipe.hpp similarity index 100% rename from thirdparty/asio/asio/impl/connect_pipe.hpp rename to include/ylt/thirdparty/asio/impl/connect_pipe.hpp diff --git a/thirdparty/asio/asio/impl/connect_pipe.ipp b/include/ylt/thirdparty/asio/impl/connect_pipe.ipp similarity index 100% rename from thirdparty/asio/asio/impl/connect_pipe.ipp rename to include/ylt/thirdparty/asio/impl/connect_pipe.ipp diff --git a/thirdparty/asio/asio/impl/defer.hpp b/include/ylt/thirdparty/asio/impl/defer.hpp similarity index 100% rename from thirdparty/asio/asio/impl/defer.hpp rename to include/ylt/thirdparty/asio/impl/defer.hpp diff --git a/thirdparty/asio/asio/impl/deferred.hpp b/include/ylt/thirdparty/asio/impl/deferred.hpp similarity index 100% rename from thirdparty/asio/asio/impl/deferred.hpp rename to include/ylt/thirdparty/asio/impl/deferred.hpp diff --git a/thirdparty/asio/asio/impl/detached.hpp b/include/ylt/thirdparty/asio/impl/detached.hpp similarity index 100% rename from thirdparty/asio/asio/impl/detached.hpp rename to include/ylt/thirdparty/asio/impl/detached.hpp diff --git a/thirdparty/asio/asio/impl/dispatch.hpp b/include/ylt/thirdparty/asio/impl/dispatch.hpp similarity index 100% rename from thirdparty/asio/asio/impl/dispatch.hpp rename to include/ylt/thirdparty/asio/impl/dispatch.hpp diff --git a/thirdparty/asio/asio/impl/error.ipp b/include/ylt/thirdparty/asio/impl/error.ipp similarity index 100% rename from thirdparty/asio/asio/impl/error.ipp rename to include/ylt/thirdparty/asio/impl/error.ipp diff --git a/thirdparty/asio/asio/impl/error_code.ipp b/include/ylt/thirdparty/asio/impl/error_code.ipp similarity index 100% rename from thirdparty/asio/asio/impl/error_code.ipp rename to include/ylt/thirdparty/asio/impl/error_code.ipp diff --git a/thirdparty/asio/asio/impl/execution_context.hpp b/include/ylt/thirdparty/asio/impl/execution_context.hpp similarity index 100% rename from thirdparty/asio/asio/impl/execution_context.hpp rename to include/ylt/thirdparty/asio/impl/execution_context.hpp diff --git a/thirdparty/asio/asio/impl/execution_context.ipp b/include/ylt/thirdparty/asio/impl/execution_context.ipp similarity index 100% rename from thirdparty/asio/asio/impl/execution_context.ipp rename to include/ylt/thirdparty/asio/impl/execution_context.ipp diff --git a/thirdparty/asio/asio/impl/executor.hpp b/include/ylt/thirdparty/asio/impl/executor.hpp similarity index 100% rename from thirdparty/asio/asio/impl/executor.hpp rename to include/ylt/thirdparty/asio/impl/executor.hpp diff --git a/thirdparty/asio/asio/impl/executor.ipp b/include/ylt/thirdparty/asio/impl/executor.ipp similarity index 100% rename from thirdparty/asio/asio/impl/executor.ipp rename to include/ylt/thirdparty/asio/impl/executor.ipp diff --git a/thirdparty/asio/asio/impl/handler_alloc_hook.ipp b/include/ylt/thirdparty/asio/impl/handler_alloc_hook.ipp similarity index 100% rename from thirdparty/asio/asio/impl/handler_alloc_hook.ipp rename to include/ylt/thirdparty/asio/impl/handler_alloc_hook.ipp diff --git a/thirdparty/asio/asio/impl/io_context.hpp b/include/ylt/thirdparty/asio/impl/io_context.hpp similarity index 100% rename from thirdparty/asio/asio/impl/io_context.hpp rename to include/ylt/thirdparty/asio/impl/io_context.hpp diff --git a/thirdparty/asio/asio/impl/io_context.ipp b/include/ylt/thirdparty/asio/impl/io_context.ipp similarity index 100% rename from thirdparty/asio/asio/impl/io_context.ipp rename to include/ylt/thirdparty/asio/impl/io_context.ipp diff --git a/thirdparty/asio/asio/impl/multiple_exceptions.ipp b/include/ylt/thirdparty/asio/impl/multiple_exceptions.ipp similarity index 100% rename from thirdparty/asio/asio/impl/multiple_exceptions.ipp rename to include/ylt/thirdparty/asio/impl/multiple_exceptions.ipp diff --git a/thirdparty/asio/asio/impl/post.hpp b/include/ylt/thirdparty/asio/impl/post.hpp similarity index 100% rename from thirdparty/asio/asio/impl/post.hpp rename to include/ylt/thirdparty/asio/impl/post.hpp diff --git a/thirdparty/asio/asio/impl/prepend.hpp b/include/ylt/thirdparty/asio/impl/prepend.hpp similarity index 100% rename from thirdparty/asio/asio/impl/prepend.hpp rename to include/ylt/thirdparty/asio/impl/prepend.hpp diff --git a/thirdparty/asio/asio/impl/read.hpp b/include/ylt/thirdparty/asio/impl/read.hpp similarity index 100% rename from thirdparty/asio/asio/impl/read.hpp rename to include/ylt/thirdparty/asio/impl/read.hpp diff --git a/thirdparty/asio/asio/impl/read_at.hpp b/include/ylt/thirdparty/asio/impl/read_at.hpp similarity index 100% rename from thirdparty/asio/asio/impl/read_at.hpp rename to include/ylt/thirdparty/asio/impl/read_at.hpp diff --git a/thirdparty/asio/asio/impl/read_until.hpp b/include/ylt/thirdparty/asio/impl/read_until.hpp similarity index 100% rename from thirdparty/asio/asio/impl/read_until.hpp rename to include/ylt/thirdparty/asio/impl/read_until.hpp diff --git a/thirdparty/asio/asio/impl/redirect_error.hpp b/include/ylt/thirdparty/asio/impl/redirect_error.hpp similarity index 100% rename from thirdparty/asio/asio/impl/redirect_error.hpp rename to include/ylt/thirdparty/asio/impl/redirect_error.hpp diff --git a/thirdparty/asio/asio/impl/serial_port_base.hpp b/include/ylt/thirdparty/asio/impl/serial_port_base.hpp similarity index 100% rename from thirdparty/asio/asio/impl/serial_port_base.hpp rename to include/ylt/thirdparty/asio/impl/serial_port_base.hpp diff --git a/thirdparty/asio/asio/impl/serial_port_base.ipp b/include/ylt/thirdparty/asio/impl/serial_port_base.ipp similarity index 100% rename from thirdparty/asio/asio/impl/serial_port_base.ipp rename to include/ylt/thirdparty/asio/impl/serial_port_base.ipp diff --git a/thirdparty/asio/asio/impl/spawn.hpp b/include/ylt/thirdparty/asio/impl/spawn.hpp similarity index 100% rename from thirdparty/asio/asio/impl/spawn.hpp rename to include/ylt/thirdparty/asio/impl/spawn.hpp diff --git a/thirdparty/asio/asio/impl/src.hpp b/include/ylt/thirdparty/asio/impl/src.hpp similarity index 100% rename from thirdparty/asio/asio/impl/src.hpp rename to include/ylt/thirdparty/asio/impl/src.hpp diff --git a/thirdparty/asio/asio/impl/system_context.hpp b/include/ylt/thirdparty/asio/impl/system_context.hpp similarity index 100% rename from thirdparty/asio/asio/impl/system_context.hpp rename to include/ylt/thirdparty/asio/impl/system_context.hpp diff --git a/thirdparty/asio/asio/impl/system_context.ipp b/include/ylt/thirdparty/asio/impl/system_context.ipp similarity index 100% rename from thirdparty/asio/asio/impl/system_context.ipp rename to include/ylt/thirdparty/asio/impl/system_context.ipp diff --git a/thirdparty/asio/asio/impl/system_executor.hpp b/include/ylt/thirdparty/asio/impl/system_executor.hpp similarity index 100% rename from thirdparty/asio/asio/impl/system_executor.hpp rename to include/ylt/thirdparty/asio/impl/system_executor.hpp diff --git a/thirdparty/asio/asio/impl/thread_pool.hpp b/include/ylt/thirdparty/asio/impl/thread_pool.hpp similarity index 100% rename from thirdparty/asio/asio/impl/thread_pool.hpp rename to include/ylt/thirdparty/asio/impl/thread_pool.hpp diff --git a/thirdparty/asio/asio/impl/thread_pool.ipp b/include/ylt/thirdparty/asio/impl/thread_pool.ipp similarity index 100% rename from thirdparty/asio/asio/impl/thread_pool.ipp rename to include/ylt/thirdparty/asio/impl/thread_pool.ipp diff --git a/thirdparty/asio/asio/impl/use_awaitable.hpp b/include/ylt/thirdparty/asio/impl/use_awaitable.hpp similarity index 100% rename from thirdparty/asio/asio/impl/use_awaitable.hpp rename to include/ylt/thirdparty/asio/impl/use_awaitable.hpp diff --git a/thirdparty/asio/asio/impl/use_future.hpp b/include/ylt/thirdparty/asio/impl/use_future.hpp similarity index 100% rename from thirdparty/asio/asio/impl/use_future.hpp rename to include/ylt/thirdparty/asio/impl/use_future.hpp diff --git a/thirdparty/asio/asio/impl/write.hpp b/include/ylt/thirdparty/asio/impl/write.hpp similarity index 100% rename from thirdparty/asio/asio/impl/write.hpp rename to include/ylt/thirdparty/asio/impl/write.hpp diff --git a/thirdparty/asio/asio/impl/write_at.hpp b/include/ylt/thirdparty/asio/impl/write_at.hpp similarity index 100% rename from thirdparty/asio/asio/impl/write_at.hpp rename to include/ylt/thirdparty/asio/impl/write_at.hpp diff --git a/thirdparty/asio/asio/io_context.hpp b/include/ylt/thirdparty/asio/io_context.hpp similarity index 100% rename from thirdparty/asio/asio/io_context.hpp rename to include/ylt/thirdparty/asio/io_context.hpp diff --git a/thirdparty/asio/asio/io_context_strand.hpp b/include/ylt/thirdparty/asio/io_context_strand.hpp similarity index 100% rename from thirdparty/asio/asio/io_context_strand.hpp rename to include/ylt/thirdparty/asio/io_context_strand.hpp diff --git a/thirdparty/asio/asio/io_service.hpp b/include/ylt/thirdparty/asio/io_service.hpp similarity index 100% rename from thirdparty/asio/asio/io_service.hpp rename to include/ylt/thirdparty/asio/io_service.hpp diff --git a/thirdparty/asio/asio/io_service_strand.hpp b/include/ylt/thirdparty/asio/io_service_strand.hpp similarity index 100% rename from thirdparty/asio/asio/io_service_strand.hpp rename to include/ylt/thirdparty/asio/io_service_strand.hpp diff --git a/thirdparty/asio/asio/ip/address.hpp b/include/ylt/thirdparty/asio/ip/address.hpp similarity index 100% rename from thirdparty/asio/asio/ip/address.hpp rename to include/ylt/thirdparty/asio/ip/address.hpp diff --git a/thirdparty/asio/asio/ip/address_v4.hpp b/include/ylt/thirdparty/asio/ip/address_v4.hpp similarity index 100% rename from thirdparty/asio/asio/ip/address_v4.hpp rename to include/ylt/thirdparty/asio/ip/address_v4.hpp diff --git a/thirdparty/asio/asio/ip/address_v4_iterator.hpp b/include/ylt/thirdparty/asio/ip/address_v4_iterator.hpp similarity index 100% rename from thirdparty/asio/asio/ip/address_v4_iterator.hpp rename to include/ylt/thirdparty/asio/ip/address_v4_iterator.hpp diff --git a/thirdparty/asio/asio/ip/address_v4_range.hpp b/include/ylt/thirdparty/asio/ip/address_v4_range.hpp similarity index 100% rename from thirdparty/asio/asio/ip/address_v4_range.hpp rename to include/ylt/thirdparty/asio/ip/address_v4_range.hpp diff --git a/thirdparty/asio/asio/ip/address_v6.hpp b/include/ylt/thirdparty/asio/ip/address_v6.hpp similarity index 100% rename from thirdparty/asio/asio/ip/address_v6.hpp rename to include/ylt/thirdparty/asio/ip/address_v6.hpp diff --git a/thirdparty/asio/asio/ip/address_v6_iterator.hpp b/include/ylt/thirdparty/asio/ip/address_v6_iterator.hpp similarity index 100% rename from thirdparty/asio/asio/ip/address_v6_iterator.hpp rename to include/ylt/thirdparty/asio/ip/address_v6_iterator.hpp diff --git a/thirdparty/asio/asio/ip/address_v6_range.hpp b/include/ylt/thirdparty/asio/ip/address_v6_range.hpp similarity index 100% rename from thirdparty/asio/asio/ip/address_v6_range.hpp rename to include/ylt/thirdparty/asio/ip/address_v6_range.hpp diff --git a/thirdparty/asio/asio/ip/bad_address_cast.hpp b/include/ylt/thirdparty/asio/ip/bad_address_cast.hpp similarity index 100% rename from thirdparty/asio/asio/ip/bad_address_cast.hpp rename to include/ylt/thirdparty/asio/ip/bad_address_cast.hpp diff --git a/thirdparty/asio/asio/ip/basic_endpoint.hpp b/include/ylt/thirdparty/asio/ip/basic_endpoint.hpp similarity index 100% rename from thirdparty/asio/asio/ip/basic_endpoint.hpp rename to include/ylt/thirdparty/asio/ip/basic_endpoint.hpp diff --git a/thirdparty/asio/asio/ip/basic_resolver.hpp b/include/ylt/thirdparty/asio/ip/basic_resolver.hpp similarity index 100% rename from thirdparty/asio/asio/ip/basic_resolver.hpp rename to include/ylt/thirdparty/asio/ip/basic_resolver.hpp diff --git a/thirdparty/asio/asio/ip/basic_resolver_entry.hpp b/include/ylt/thirdparty/asio/ip/basic_resolver_entry.hpp similarity index 100% rename from thirdparty/asio/asio/ip/basic_resolver_entry.hpp rename to include/ylt/thirdparty/asio/ip/basic_resolver_entry.hpp diff --git a/thirdparty/asio/asio/ip/basic_resolver_iterator.hpp b/include/ylt/thirdparty/asio/ip/basic_resolver_iterator.hpp similarity index 100% rename from thirdparty/asio/asio/ip/basic_resolver_iterator.hpp rename to include/ylt/thirdparty/asio/ip/basic_resolver_iterator.hpp diff --git a/thirdparty/asio/asio/ip/basic_resolver_query.hpp b/include/ylt/thirdparty/asio/ip/basic_resolver_query.hpp similarity index 100% rename from thirdparty/asio/asio/ip/basic_resolver_query.hpp rename to include/ylt/thirdparty/asio/ip/basic_resolver_query.hpp diff --git a/thirdparty/asio/asio/ip/basic_resolver_results.hpp b/include/ylt/thirdparty/asio/ip/basic_resolver_results.hpp similarity index 100% rename from thirdparty/asio/asio/ip/basic_resolver_results.hpp rename to include/ylt/thirdparty/asio/ip/basic_resolver_results.hpp diff --git a/thirdparty/asio/asio/ip/detail/endpoint.hpp b/include/ylt/thirdparty/asio/ip/detail/endpoint.hpp similarity index 100% rename from thirdparty/asio/asio/ip/detail/endpoint.hpp rename to include/ylt/thirdparty/asio/ip/detail/endpoint.hpp diff --git a/thirdparty/asio/asio/ip/detail/impl/endpoint.ipp b/include/ylt/thirdparty/asio/ip/detail/impl/endpoint.ipp similarity index 100% rename from thirdparty/asio/asio/ip/detail/impl/endpoint.ipp rename to include/ylt/thirdparty/asio/ip/detail/impl/endpoint.ipp diff --git a/thirdparty/asio/asio/ip/detail/socket_option.hpp b/include/ylt/thirdparty/asio/ip/detail/socket_option.hpp similarity index 100% rename from thirdparty/asio/asio/ip/detail/socket_option.hpp rename to include/ylt/thirdparty/asio/ip/detail/socket_option.hpp diff --git a/thirdparty/asio/asio/ip/host_name.hpp b/include/ylt/thirdparty/asio/ip/host_name.hpp similarity index 100% rename from thirdparty/asio/asio/ip/host_name.hpp rename to include/ylt/thirdparty/asio/ip/host_name.hpp diff --git a/thirdparty/asio/asio/ip/icmp.hpp b/include/ylt/thirdparty/asio/ip/icmp.hpp similarity index 100% rename from thirdparty/asio/asio/ip/icmp.hpp rename to include/ylt/thirdparty/asio/ip/icmp.hpp diff --git a/thirdparty/asio/asio/ip/impl/address.hpp b/include/ylt/thirdparty/asio/ip/impl/address.hpp similarity index 100% rename from thirdparty/asio/asio/ip/impl/address.hpp rename to include/ylt/thirdparty/asio/ip/impl/address.hpp diff --git a/thirdparty/asio/asio/ip/impl/address.ipp b/include/ylt/thirdparty/asio/ip/impl/address.ipp similarity index 100% rename from thirdparty/asio/asio/ip/impl/address.ipp rename to include/ylt/thirdparty/asio/ip/impl/address.ipp diff --git a/thirdparty/asio/asio/ip/impl/address_v4.hpp b/include/ylt/thirdparty/asio/ip/impl/address_v4.hpp similarity index 100% rename from thirdparty/asio/asio/ip/impl/address_v4.hpp rename to include/ylt/thirdparty/asio/ip/impl/address_v4.hpp diff --git a/thirdparty/asio/asio/ip/impl/address_v4.ipp b/include/ylt/thirdparty/asio/ip/impl/address_v4.ipp similarity index 100% rename from thirdparty/asio/asio/ip/impl/address_v4.ipp rename to include/ylt/thirdparty/asio/ip/impl/address_v4.ipp diff --git a/thirdparty/asio/asio/ip/impl/address_v6.hpp b/include/ylt/thirdparty/asio/ip/impl/address_v6.hpp similarity index 100% rename from thirdparty/asio/asio/ip/impl/address_v6.hpp rename to include/ylt/thirdparty/asio/ip/impl/address_v6.hpp diff --git a/thirdparty/asio/asio/ip/impl/address_v6.ipp b/include/ylt/thirdparty/asio/ip/impl/address_v6.ipp similarity index 100% rename from thirdparty/asio/asio/ip/impl/address_v6.ipp rename to include/ylt/thirdparty/asio/ip/impl/address_v6.ipp diff --git a/thirdparty/asio/asio/ip/impl/basic_endpoint.hpp b/include/ylt/thirdparty/asio/ip/impl/basic_endpoint.hpp similarity index 100% rename from thirdparty/asio/asio/ip/impl/basic_endpoint.hpp rename to include/ylt/thirdparty/asio/ip/impl/basic_endpoint.hpp diff --git a/thirdparty/asio/asio/ip/impl/host_name.ipp b/include/ylt/thirdparty/asio/ip/impl/host_name.ipp similarity index 100% rename from thirdparty/asio/asio/ip/impl/host_name.ipp rename to include/ylt/thirdparty/asio/ip/impl/host_name.ipp diff --git a/thirdparty/asio/asio/ip/impl/network_v4.hpp b/include/ylt/thirdparty/asio/ip/impl/network_v4.hpp similarity index 100% rename from thirdparty/asio/asio/ip/impl/network_v4.hpp rename to include/ylt/thirdparty/asio/ip/impl/network_v4.hpp diff --git a/thirdparty/asio/asio/ip/impl/network_v4.ipp b/include/ylt/thirdparty/asio/ip/impl/network_v4.ipp similarity index 100% rename from thirdparty/asio/asio/ip/impl/network_v4.ipp rename to include/ylt/thirdparty/asio/ip/impl/network_v4.ipp diff --git a/thirdparty/asio/asio/ip/impl/network_v6.hpp b/include/ylt/thirdparty/asio/ip/impl/network_v6.hpp similarity index 100% rename from thirdparty/asio/asio/ip/impl/network_v6.hpp rename to include/ylt/thirdparty/asio/ip/impl/network_v6.hpp diff --git a/thirdparty/asio/asio/ip/impl/network_v6.ipp b/include/ylt/thirdparty/asio/ip/impl/network_v6.ipp similarity index 100% rename from thirdparty/asio/asio/ip/impl/network_v6.ipp rename to include/ylt/thirdparty/asio/ip/impl/network_v6.ipp diff --git a/thirdparty/asio/asio/ip/multicast.hpp b/include/ylt/thirdparty/asio/ip/multicast.hpp similarity index 100% rename from thirdparty/asio/asio/ip/multicast.hpp rename to include/ylt/thirdparty/asio/ip/multicast.hpp diff --git a/thirdparty/asio/asio/ip/network_v4.hpp b/include/ylt/thirdparty/asio/ip/network_v4.hpp similarity index 100% rename from thirdparty/asio/asio/ip/network_v4.hpp rename to include/ylt/thirdparty/asio/ip/network_v4.hpp diff --git a/thirdparty/asio/asio/ip/network_v6.hpp b/include/ylt/thirdparty/asio/ip/network_v6.hpp similarity index 100% rename from thirdparty/asio/asio/ip/network_v6.hpp rename to include/ylt/thirdparty/asio/ip/network_v6.hpp diff --git a/thirdparty/asio/asio/ip/resolver_base.hpp b/include/ylt/thirdparty/asio/ip/resolver_base.hpp similarity index 100% rename from thirdparty/asio/asio/ip/resolver_base.hpp rename to include/ylt/thirdparty/asio/ip/resolver_base.hpp diff --git a/thirdparty/asio/asio/ip/resolver_query_base.hpp b/include/ylt/thirdparty/asio/ip/resolver_query_base.hpp similarity index 100% rename from thirdparty/asio/asio/ip/resolver_query_base.hpp rename to include/ylt/thirdparty/asio/ip/resolver_query_base.hpp diff --git a/thirdparty/asio/asio/ip/tcp.hpp b/include/ylt/thirdparty/asio/ip/tcp.hpp similarity index 100% rename from thirdparty/asio/asio/ip/tcp.hpp rename to include/ylt/thirdparty/asio/ip/tcp.hpp diff --git a/thirdparty/asio/asio/ip/udp.hpp b/include/ylt/thirdparty/asio/ip/udp.hpp similarity index 100% rename from thirdparty/asio/asio/ip/udp.hpp rename to include/ylt/thirdparty/asio/ip/udp.hpp diff --git a/thirdparty/asio/asio/ip/unicast.hpp b/include/ylt/thirdparty/asio/ip/unicast.hpp similarity index 100% rename from thirdparty/asio/asio/ip/unicast.hpp rename to include/ylt/thirdparty/asio/ip/unicast.hpp diff --git a/thirdparty/asio/asio/ip/v6_only.hpp b/include/ylt/thirdparty/asio/ip/v6_only.hpp similarity index 100% rename from thirdparty/asio/asio/ip/v6_only.hpp rename to include/ylt/thirdparty/asio/ip/v6_only.hpp diff --git a/thirdparty/asio/asio/is_applicable_property.hpp b/include/ylt/thirdparty/asio/is_applicable_property.hpp similarity index 100% rename from thirdparty/asio/asio/is_applicable_property.hpp rename to include/ylt/thirdparty/asio/is_applicable_property.hpp diff --git a/thirdparty/asio/asio/is_contiguous_iterator.hpp b/include/ylt/thirdparty/asio/is_contiguous_iterator.hpp similarity index 100% rename from thirdparty/asio/asio/is_contiguous_iterator.hpp rename to include/ylt/thirdparty/asio/is_contiguous_iterator.hpp diff --git a/thirdparty/asio/asio/is_executor.hpp b/include/ylt/thirdparty/asio/is_executor.hpp similarity index 100% rename from thirdparty/asio/asio/is_executor.hpp rename to include/ylt/thirdparty/asio/is_executor.hpp diff --git a/thirdparty/asio/asio/is_read_buffered.hpp b/include/ylt/thirdparty/asio/is_read_buffered.hpp similarity index 100% rename from thirdparty/asio/asio/is_read_buffered.hpp rename to include/ylt/thirdparty/asio/is_read_buffered.hpp diff --git a/thirdparty/asio/asio/is_write_buffered.hpp b/include/ylt/thirdparty/asio/is_write_buffered.hpp similarity index 100% rename from thirdparty/asio/asio/is_write_buffered.hpp rename to include/ylt/thirdparty/asio/is_write_buffered.hpp diff --git a/thirdparty/asio/asio/local/basic_endpoint.hpp b/include/ylt/thirdparty/asio/local/basic_endpoint.hpp similarity index 100% rename from thirdparty/asio/asio/local/basic_endpoint.hpp rename to include/ylt/thirdparty/asio/local/basic_endpoint.hpp diff --git a/thirdparty/asio/asio/local/connect_pair.hpp b/include/ylt/thirdparty/asio/local/connect_pair.hpp similarity index 100% rename from thirdparty/asio/asio/local/connect_pair.hpp rename to include/ylt/thirdparty/asio/local/connect_pair.hpp diff --git a/thirdparty/asio/asio/local/datagram_protocol.hpp b/include/ylt/thirdparty/asio/local/datagram_protocol.hpp similarity index 100% rename from thirdparty/asio/asio/local/datagram_protocol.hpp rename to include/ylt/thirdparty/asio/local/datagram_protocol.hpp diff --git a/thirdparty/asio/asio/local/detail/endpoint.hpp b/include/ylt/thirdparty/asio/local/detail/endpoint.hpp similarity index 100% rename from thirdparty/asio/asio/local/detail/endpoint.hpp rename to include/ylt/thirdparty/asio/local/detail/endpoint.hpp diff --git a/thirdparty/asio/asio/local/detail/impl/endpoint.ipp b/include/ylt/thirdparty/asio/local/detail/impl/endpoint.ipp similarity index 100% rename from thirdparty/asio/asio/local/detail/impl/endpoint.ipp rename to include/ylt/thirdparty/asio/local/detail/impl/endpoint.ipp diff --git a/thirdparty/asio/asio/local/stream_protocol.hpp b/include/ylt/thirdparty/asio/local/stream_protocol.hpp similarity index 100% rename from thirdparty/asio/asio/local/stream_protocol.hpp rename to include/ylt/thirdparty/asio/local/stream_protocol.hpp diff --git a/thirdparty/asio/asio/multiple_exceptions.hpp b/include/ylt/thirdparty/asio/multiple_exceptions.hpp similarity index 100% rename from thirdparty/asio/asio/multiple_exceptions.hpp rename to include/ylt/thirdparty/asio/multiple_exceptions.hpp diff --git a/thirdparty/asio/asio/packaged_task.hpp b/include/ylt/thirdparty/asio/packaged_task.hpp similarity index 100% rename from thirdparty/asio/asio/packaged_task.hpp rename to include/ylt/thirdparty/asio/packaged_task.hpp diff --git a/thirdparty/asio/asio/placeholders.hpp b/include/ylt/thirdparty/asio/placeholders.hpp similarity index 100% rename from thirdparty/asio/asio/placeholders.hpp rename to include/ylt/thirdparty/asio/placeholders.hpp diff --git a/thirdparty/asio/asio/posix/basic_descriptor.hpp b/include/ylt/thirdparty/asio/posix/basic_descriptor.hpp similarity index 100% rename from thirdparty/asio/asio/posix/basic_descriptor.hpp rename to include/ylt/thirdparty/asio/posix/basic_descriptor.hpp diff --git a/thirdparty/asio/asio/posix/basic_stream_descriptor.hpp b/include/ylt/thirdparty/asio/posix/basic_stream_descriptor.hpp similarity index 100% rename from thirdparty/asio/asio/posix/basic_stream_descriptor.hpp rename to include/ylt/thirdparty/asio/posix/basic_stream_descriptor.hpp diff --git a/thirdparty/asio/asio/posix/descriptor.hpp b/include/ylt/thirdparty/asio/posix/descriptor.hpp similarity index 100% rename from thirdparty/asio/asio/posix/descriptor.hpp rename to include/ylt/thirdparty/asio/posix/descriptor.hpp diff --git a/thirdparty/asio/asio/posix/descriptor_base.hpp b/include/ylt/thirdparty/asio/posix/descriptor_base.hpp similarity index 100% rename from thirdparty/asio/asio/posix/descriptor_base.hpp rename to include/ylt/thirdparty/asio/posix/descriptor_base.hpp diff --git a/thirdparty/asio/asio/posix/stream_descriptor.hpp b/include/ylt/thirdparty/asio/posix/stream_descriptor.hpp similarity index 100% rename from thirdparty/asio/asio/posix/stream_descriptor.hpp rename to include/ylt/thirdparty/asio/posix/stream_descriptor.hpp diff --git a/thirdparty/asio/asio/post.hpp b/include/ylt/thirdparty/asio/post.hpp similarity index 100% rename from thirdparty/asio/asio/post.hpp rename to include/ylt/thirdparty/asio/post.hpp diff --git a/thirdparty/asio/asio/prefer.hpp b/include/ylt/thirdparty/asio/prefer.hpp similarity index 100% rename from thirdparty/asio/asio/prefer.hpp rename to include/ylt/thirdparty/asio/prefer.hpp diff --git a/thirdparty/asio/asio/prepend.hpp b/include/ylt/thirdparty/asio/prepend.hpp similarity index 100% rename from thirdparty/asio/asio/prepend.hpp rename to include/ylt/thirdparty/asio/prepend.hpp diff --git a/thirdparty/asio/asio/query.hpp b/include/ylt/thirdparty/asio/query.hpp similarity index 100% rename from thirdparty/asio/asio/query.hpp rename to include/ylt/thirdparty/asio/query.hpp diff --git a/thirdparty/asio/asio/random_access_file.hpp b/include/ylt/thirdparty/asio/random_access_file.hpp similarity index 100% rename from thirdparty/asio/asio/random_access_file.hpp rename to include/ylt/thirdparty/asio/random_access_file.hpp diff --git a/thirdparty/asio/asio/read.hpp b/include/ylt/thirdparty/asio/read.hpp similarity index 100% rename from thirdparty/asio/asio/read.hpp rename to include/ylt/thirdparty/asio/read.hpp diff --git a/thirdparty/asio/asio/read_at.hpp b/include/ylt/thirdparty/asio/read_at.hpp similarity index 100% rename from thirdparty/asio/asio/read_at.hpp rename to include/ylt/thirdparty/asio/read_at.hpp diff --git a/thirdparty/asio/asio/read_until.hpp b/include/ylt/thirdparty/asio/read_until.hpp similarity index 100% rename from thirdparty/asio/asio/read_until.hpp rename to include/ylt/thirdparty/asio/read_until.hpp diff --git a/thirdparty/asio/asio/readable_pipe.hpp b/include/ylt/thirdparty/asio/readable_pipe.hpp similarity index 100% rename from thirdparty/asio/asio/readable_pipe.hpp rename to include/ylt/thirdparty/asio/readable_pipe.hpp diff --git a/thirdparty/asio/asio/recycling_allocator.hpp b/include/ylt/thirdparty/asio/recycling_allocator.hpp similarity index 100% rename from thirdparty/asio/asio/recycling_allocator.hpp rename to include/ylt/thirdparty/asio/recycling_allocator.hpp diff --git a/thirdparty/asio/asio/redirect_error.hpp b/include/ylt/thirdparty/asio/redirect_error.hpp similarity index 100% rename from thirdparty/asio/asio/redirect_error.hpp rename to include/ylt/thirdparty/asio/redirect_error.hpp diff --git a/thirdparty/asio/asio/registered_buffer.hpp b/include/ylt/thirdparty/asio/registered_buffer.hpp similarity index 100% rename from thirdparty/asio/asio/registered_buffer.hpp rename to include/ylt/thirdparty/asio/registered_buffer.hpp diff --git a/thirdparty/asio/asio/require.hpp b/include/ylt/thirdparty/asio/require.hpp similarity index 100% rename from thirdparty/asio/asio/require.hpp rename to include/ylt/thirdparty/asio/require.hpp diff --git a/thirdparty/asio/asio/require_concept.hpp b/include/ylt/thirdparty/asio/require_concept.hpp similarity index 100% rename from thirdparty/asio/asio/require_concept.hpp rename to include/ylt/thirdparty/asio/require_concept.hpp diff --git a/thirdparty/asio/asio/serial_port.hpp b/include/ylt/thirdparty/asio/serial_port.hpp similarity index 100% rename from thirdparty/asio/asio/serial_port.hpp rename to include/ylt/thirdparty/asio/serial_port.hpp diff --git a/thirdparty/asio/asio/serial_port_base.hpp b/include/ylt/thirdparty/asio/serial_port_base.hpp similarity index 100% rename from thirdparty/asio/asio/serial_port_base.hpp rename to include/ylt/thirdparty/asio/serial_port_base.hpp diff --git a/thirdparty/asio/asio/signal_set.hpp b/include/ylt/thirdparty/asio/signal_set.hpp similarity index 100% rename from thirdparty/asio/asio/signal_set.hpp rename to include/ylt/thirdparty/asio/signal_set.hpp diff --git a/thirdparty/asio/asio/socket_base.hpp b/include/ylt/thirdparty/asio/socket_base.hpp similarity index 100% rename from thirdparty/asio/asio/socket_base.hpp rename to include/ylt/thirdparty/asio/socket_base.hpp diff --git a/thirdparty/asio/asio/spawn.hpp b/include/ylt/thirdparty/asio/spawn.hpp similarity index 100% rename from thirdparty/asio/asio/spawn.hpp rename to include/ylt/thirdparty/asio/spawn.hpp diff --git a/thirdparty/asio/asio/ssl.hpp b/include/ylt/thirdparty/asio/ssl.hpp similarity index 100% rename from thirdparty/asio/asio/ssl.hpp rename to include/ylt/thirdparty/asio/ssl.hpp diff --git a/thirdparty/asio/asio/ssl/context.hpp b/include/ylt/thirdparty/asio/ssl/context.hpp similarity index 100% rename from thirdparty/asio/asio/ssl/context.hpp rename to include/ylt/thirdparty/asio/ssl/context.hpp diff --git a/thirdparty/asio/asio/ssl/context_base.hpp b/include/ylt/thirdparty/asio/ssl/context_base.hpp similarity index 100% rename from thirdparty/asio/asio/ssl/context_base.hpp rename to include/ylt/thirdparty/asio/ssl/context_base.hpp diff --git a/thirdparty/asio/asio/ssl/detail/buffered_handshake_op.hpp b/include/ylt/thirdparty/asio/ssl/detail/buffered_handshake_op.hpp similarity index 100% rename from thirdparty/asio/asio/ssl/detail/buffered_handshake_op.hpp rename to include/ylt/thirdparty/asio/ssl/detail/buffered_handshake_op.hpp diff --git a/thirdparty/asio/asio/ssl/detail/engine.hpp b/include/ylt/thirdparty/asio/ssl/detail/engine.hpp similarity index 100% rename from thirdparty/asio/asio/ssl/detail/engine.hpp rename to include/ylt/thirdparty/asio/ssl/detail/engine.hpp diff --git a/thirdparty/asio/asio/ssl/detail/handshake_op.hpp b/include/ylt/thirdparty/asio/ssl/detail/handshake_op.hpp similarity index 100% rename from thirdparty/asio/asio/ssl/detail/handshake_op.hpp rename to include/ylt/thirdparty/asio/ssl/detail/handshake_op.hpp diff --git a/thirdparty/asio/asio/ssl/detail/impl/engine.ipp b/include/ylt/thirdparty/asio/ssl/detail/impl/engine.ipp similarity index 100% rename from thirdparty/asio/asio/ssl/detail/impl/engine.ipp rename to include/ylt/thirdparty/asio/ssl/detail/impl/engine.ipp diff --git a/thirdparty/asio/asio/ssl/detail/impl/openssl_init.ipp b/include/ylt/thirdparty/asio/ssl/detail/impl/openssl_init.ipp similarity index 100% rename from thirdparty/asio/asio/ssl/detail/impl/openssl_init.ipp rename to include/ylt/thirdparty/asio/ssl/detail/impl/openssl_init.ipp diff --git a/thirdparty/asio/asio/ssl/detail/io.hpp b/include/ylt/thirdparty/asio/ssl/detail/io.hpp similarity index 100% rename from thirdparty/asio/asio/ssl/detail/io.hpp rename to include/ylt/thirdparty/asio/ssl/detail/io.hpp diff --git a/thirdparty/asio/asio/ssl/detail/openssl_init.hpp b/include/ylt/thirdparty/asio/ssl/detail/openssl_init.hpp similarity index 100% rename from thirdparty/asio/asio/ssl/detail/openssl_init.hpp rename to include/ylt/thirdparty/asio/ssl/detail/openssl_init.hpp diff --git a/thirdparty/asio/asio/ssl/detail/openssl_types.hpp b/include/ylt/thirdparty/asio/ssl/detail/openssl_types.hpp similarity index 100% rename from thirdparty/asio/asio/ssl/detail/openssl_types.hpp rename to include/ylt/thirdparty/asio/ssl/detail/openssl_types.hpp diff --git a/thirdparty/asio/asio/ssl/detail/password_callback.hpp b/include/ylt/thirdparty/asio/ssl/detail/password_callback.hpp similarity index 100% rename from thirdparty/asio/asio/ssl/detail/password_callback.hpp rename to include/ylt/thirdparty/asio/ssl/detail/password_callback.hpp diff --git a/thirdparty/asio/asio/ssl/detail/read_op.hpp b/include/ylt/thirdparty/asio/ssl/detail/read_op.hpp similarity index 100% rename from thirdparty/asio/asio/ssl/detail/read_op.hpp rename to include/ylt/thirdparty/asio/ssl/detail/read_op.hpp diff --git a/thirdparty/asio/asio/ssl/detail/shutdown_op.hpp b/include/ylt/thirdparty/asio/ssl/detail/shutdown_op.hpp similarity index 100% rename from thirdparty/asio/asio/ssl/detail/shutdown_op.hpp rename to include/ylt/thirdparty/asio/ssl/detail/shutdown_op.hpp diff --git a/thirdparty/asio/asio/ssl/detail/stream_core.hpp b/include/ylt/thirdparty/asio/ssl/detail/stream_core.hpp similarity index 100% rename from thirdparty/asio/asio/ssl/detail/stream_core.hpp rename to include/ylt/thirdparty/asio/ssl/detail/stream_core.hpp diff --git a/thirdparty/asio/asio/ssl/detail/verify_callback.hpp b/include/ylt/thirdparty/asio/ssl/detail/verify_callback.hpp similarity index 100% rename from thirdparty/asio/asio/ssl/detail/verify_callback.hpp rename to include/ylt/thirdparty/asio/ssl/detail/verify_callback.hpp diff --git a/thirdparty/asio/asio/ssl/detail/write_op.hpp b/include/ylt/thirdparty/asio/ssl/detail/write_op.hpp similarity index 100% rename from thirdparty/asio/asio/ssl/detail/write_op.hpp rename to include/ylt/thirdparty/asio/ssl/detail/write_op.hpp diff --git a/thirdparty/asio/asio/ssl/error.hpp b/include/ylt/thirdparty/asio/ssl/error.hpp similarity index 100% rename from thirdparty/asio/asio/ssl/error.hpp rename to include/ylt/thirdparty/asio/ssl/error.hpp diff --git a/thirdparty/asio/asio/ssl/host_name_verification.hpp b/include/ylt/thirdparty/asio/ssl/host_name_verification.hpp similarity index 100% rename from thirdparty/asio/asio/ssl/host_name_verification.hpp rename to include/ylt/thirdparty/asio/ssl/host_name_verification.hpp diff --git a/thirdparty/asio/asio/ssl/impl/context.hpp b/include/ylt/thirdparty/asio/ssl/impl/context.hpp similarity index 100% rename from thirdparty/asio/asio/ssl/impl/context.hpp rename to include/ylt/thirdparty/asio/ssl/impl/context.hpp diff --git a/thirdparty/asio/asio/ssl/impl/context.ipp b/include/ylt/thirdparty/asio/ssl/impl/context.ipp similarity index 100% rename from thirdparty/asio/asio/ssl/impl/context.ipp rename to include/ylt/thirdparty/asio/ssl/impl/context.ipp diff --git a/thirdparty/asio/asio/ssl/impl/error.ipp b/include/ylt/thirdparty/asio/ssl/impl/error.ipp similarity index 100% rename from thirdparty/asio/asio/ssl/impl/error.ipp rename to include/ylt/thirdparty/asio/ssl/impl/error.ipp diff --git a/thirdparty/asio/asio/ssl/impl/host_name_verification.ipp b/include/ylt/thirdparty/asio/ssl/impl/host_name_verification.ipp similarity index 100% rename from thirdparty/asio/asio/ssl/impl/host_name_verification.ipp rename to include/ylt/thirdparty/asio/ssl/impl/host_name_verification.ipp diff --git a/thirdparty/asio/asio/ssl/impl/rfc2818_verification.ipp b/include/ylt/thirdparty/asio/ssl/impl/rfc2818_verification.ipp similarity index 100% rename from thirdparty/asio/asio/ssl/impl/rfc2818_verification.ipp rename to include/ylt/thirdparty/asio/ssl/impl/rfc2818_verification.ipp diff --git a/thirdparty/asio/asio/ssl/impl/src.hpp b/include/ylt/thirdparty/asio/ssl/impl/src.hpp similarity index 100% rename from thirdparty/asio/asio/ssl/impl/src.hpp rename to include/ylt/thirdparty/asio/ssl/impl/src.hpp diff --git a/thirdparty/asio/asio/ssl/rfc2818_verification.hpp b/include/ylt/thirdparty/asio/ssl/rfc2818_verification.hpp similarity index 100% rename from thirdparty/asio/asio/ssl/rfc2818_verification.hpp rename to include/ylt/thirdparty/asio/ssl/rfc2818_verification.hpp diff --git a/thirdparty/asio/asio/ssl/stream.hpp b/include/ylt/thirdparty/asio/ssl/stream.hpp similarity index 100% rename from thirdparty/asio/asio/ssl/stream.hpp rename to include/ylt/thirdparty/asio/ssl/stream.hpp diff --git a/thirdparty/asio/asio/ssl/stream_base.hpp b/include/ylt/thirdparty/asio/ssl/stream_base.hpp similarity index 100% rename from thirdparty/asio/asio/ssl/stream_base.hpp rename to include/ylt/thirdparty/asio/ssl/stream_base.hpp diff --git a/thirdparty/asio/asio/ssl/verify_context.hpp b/include/ylt/thirdparty/asio/ssl/verify_context.hpp similarity index 100% rename from thirdparty/asio/asio/ssl/verify_context.hpp rename to include/ylt/thirdparty/asio/ssl/verify_context.hpp diff --git a/thirdparty/asio/asio/ssl/verify_mode.hpp b/include/ylt/thirdparty/asio/ssl/verify_mode.hpp similarity index 100% rename from thirdparty/asio/asio/ssl/verify_mode.hpp rename to include/ylt/thirdparty/asio/ssl/verify_mode.hpp diff --git a/thirdparty/asio/asio/static_thread_pool.hpp b/include/ylt/thirdparty/asio/static_thread_pool.hpp similarity index 100% rename from thirdparty/asio/asio/static_thread_pool.hpp rename to include/ylt/thirdparty/asio/static_thread_pool.hpp diff --git a/thirdparty/asio/asio/steady_timer.hpp b/include/ylt/thirdparty/asio/steady_timer.hpp similarity index 100% rename from thirdparty/asio/asio/steady_timer.hpp rename to include/ylt/thirdparty/asio/steady_timer.hpp diff --git a/thirdparty/asio/asio/strand.hpp b/include/ylt/thirdparty/asio/strand.hpp similarity index 100% rename from thirdparty/asio/asio/strand.hpp rename to include/ylt/thirdparty/asio/strand.hpp diff --git a/thirdparty/asio/asio/stream_file.hpp b/include/ylt/thirdparty/asio/stream_file.hpp similarity index 100% rename from thirdparty/asio/asio/stream_file.hpp rename to include/ylt/thirdparty/asio/stream_file.hpp diff --git a/thirdparty/asio/asio/streambuf.hpp b/include/ylt/thirdparty/asio/streambuf.hpp similarity index 100% rename from thirdparty/asio/asio/streambuf.hpp rename to include/ylt/thirdparty/asio/streambuf.hpp diff --git a/thirdparty/asio/asio/system_context.hpp b/include/ylt/thirdparty/asio/system_context.hpp similarity index 100% rename from thirdparty/asio/asio/system_context.hpp rename to include/ylt/thirdparty/asio/system_context.hpp diff --git a/thirdparty/asio/asio/system_error.hpp b/include/ylt/thirdparty/asio/system_error.hpp similarity index 100% rename from thirdparty/asio/asio/system_error.hpp rename to include/ylt/thirdparty/asio/system_error.hpp diff --git a/thirdparty/asio/asio/system_executor.hpp b/include/ylt/thirdparty/asio/system_executor.hpp similarity index 100% rename from thirdparty/asio/asio/system_executor.hpp rename to include/ylt/thirdparty/asio/system_executor.hpp diff --git a/thirdparty/asio/asio/system_timer.hpp b/include/ylt/thirdparty/asio/system_timer.hpp similarity index 100% rename from thirdparty/asio/asio/system_timer.hpp rename to include/ylt/thirdparty/asio/system_timer.hpp diff --git a/thirdparty/asio/asio/this_coro.hpp b/include/ylt/thirdparty/asio/this_coro.hpp similarity index 100% rename from thirdparty/asio/asio/this_coro.hpp rename to include/ylt/thirdparty/asio/this_coro.hpp diff --git a/thirdparty/asio/asio/thread.hpp b/include/ylt/thirdparty/asio/thread.hpp similarity index 100% rename from thirdparty/asio/asio/thread.hpp rename to include/ylt/thirdparty/asio/thread.hpp diff --git a/thirdparty/asio/asio/thread_pool.hpp b/include/ylt/thirdparty/asio/thread_pool.hpp similarity index 100% rename from thirdparty/asio/asio/thread_pool.hpp rename to include/ylt/thirdparty/asio/thread_pool.hpp diff --git a/thirdparty/asio/asio/time_traits.hpp b/include/ylt/thirdparty/asio/time_traits.hpp similarity index 100% rename from thirdparty/asio/asio/time_traits.hpp rename to include/ylt/thirdparty/asio/time_traits.hpp diff --git a/thirdparty/asio/asio/traits/bulk_execute_free.hpp b/include/ylt/thirdparty/asio/traits/bulk_execute_free.hpp similarity index 100% rename from thirdparty/asio/asio/traits/bulk_execute_free.hpp rename to include/ylt/thirdparty/asio/traits/bulk_execute_free.hpp diff --git a/thirdparty/asio/asio/traits/bulk_execute_member.hpp b/include/ylt/thirdparty/asio/traits/bulk_execute_member.hpp similarity index 100% rename from thirdparty/asio/asio/traits/bulk_execute_member.hpp rename to include/ylt/thirdparty/asio/traits/bulk_execute_member.hpp diff --git a/thirdparty/asio/asio/traits/connect_free.hpp b/include/ylt/thirdparty/asio/traits/connect_free.hpp similarity index 100% rename from thirdparty/asio/asio/traits/connect_free.hpp rename to include/ylt/thirdparty/asio/traits/connect_free.hpp diff --git a/thirdparty/asio/asio/traits/connect_member.hpp b/include/ylt/thirdparty/asio/traits/connect_member.hpp similarity index 100% rename from thirdparty/asio/asio/traits/connect_member.hpp rename to include/ylt/thirdparty/asio/traits/connect_member.hpp diff --git a/thirdparty/asio/asio/traits/equality_comparable.hpp b/include/ylt/thirdparty/asio/traits/equality_comparable.hpp similarity index 100% rename from thirdparty/asio/asio/traits/equality_comparable.hpp rename to include/ylt/thirdparty/asio/traits/equality_comparable.hpp diff --git a/thirdparty/asio/asio/traits/execute_free.hpp b/include/ylt/thirdparty/asio/traits/execute_free.hpp similarity index 100% rename from thirdparty/asio/asio/traits/execute_free.hpp rename to include/ylt/thirdparty/asio/traits/execute_free.hpp diff --git a/thirdparty/asio/asio/traits/execute_member.hpp b/include/ylt/thirdparty/asio/traits/execute_member.hpp similarity index 100% rename from thirdparty/asio/asio/traits/execute_member.hpp rename to include/ylt/thirdparty/asio/traits/execute_member.hpp diff --git a/thirdparty/asio/asio/traits/prefer_free.hpp b/include/ylt/thirdparty/asio/traits/prefer_free.hpp similarity index 100% rename from thirdparty/asio/asio/traits/prefer_free.hpp rename to include/ylt/thirdparty/asio/traits/prefer_free.hpp diff --git a/thirdparty/asio/asio/traits/prefer_member.hpp b/include/ylt/thirdparty/asio/traits/prefer_member.hpp similarity index 100% rename from thirdparty/asio/asio/traits/prefer_member.hpp rename to include/ylt/thirdparty/asio/traits/prefer_member.hpp diff --git a/thirdparty/asio/asio/traits/query_free.hpp b/include/ylt/thirdparty/asio/traits/query_free.hpp similarity index 100% rename from thirdparty/asio/asio/traits/query_free.hpp rename to include/ylt/thirdparty/asio/traits/query_free.hpp diff --git a/thirdparty/asio/asio/traits/query_member.hpp b/include/ylt/thirdparty/asio/traits/query_member.hpp similarity index 100% rename from thirdparty/asio/asio/traits/query_member.hpp rename to include/ylt/thirdparty/asio/traits/query_member.hpp diff --git a/thirdparty/asio/asio/traits/query_static_constexpr_member.hpp b/include/ylt/thirdparty/asio/traits/query_static_constexpr_member.hpp similarity index 100% rename from thirdparty/asio/asio/traits/query_static_constexpr_member.hpp rename to include/ylt/thirdparty/asio/traits/query_static_constexpr_member.hpp diff --git a/thirdparty/asio/asio/traits/require_concept_free.hpp b/include/ylt/thirdparty/asio/traits/require_concept_free.hpp similarity index 100% rename from thirdparty/asio/asio/traits/require_concept_free.hpp rename to include/ylt/thirdparty/asio/traits/require_concept_free.hpp diff --git a/thirdparty/asio/asio/traits/require_concept_member.hpp b/include/ylt/thirdparty/asio/traits/require_concept_member.hpp similarity index 100% rename from thirdparty/asio/asio/traits/require_concept_member.hpp rename to include/ylt/thirdparty/asio/traits/require_concept_member.hpp diff --git a/thirdparty/asio/asio/traits/require_free.hpp b/include/ylt/thirdparty/asio/traits/require_free.hpp similarity index 100% rename from thirdparty/asio/asio/traits/require_free.hpp rename to include/ylt/thirdparty/asio/traits/require_free.hpp diff --git a/thirdparty/asio/asio/traits/require_member.hpp b/include/ylt/thirdparty/asio/traits/require_member.hpp similarity index 100% rename from thirdparty/asio/asio/traits/require_member.hpp rename to include/ylt/thirdparty/asio/traits/require_member.hpp diff --git a/thirdparty/asio/asio/traits/schedule_free.hpp b/include/ylt/thirdparty/asio/traits/schedule_free.hpp similarity index 100% rename from thirdparty/asio/asio/traits/schedule_free.hpp rename to include/ylt/thirdparty/asio/traits/schedule_free.hpp diff --git a/thirdparty/asio/asio/traits/schedule_member.hpp b/include/ylt/thirdparty/asio/traits/schedule_member.hpp similarity index 100% rename from thirdparty/asio/asio/traits/schedule_member.hpp rename to include/ylt/thirdparty/asio/traits/schedule_member.hpp diff --git a/thirdparty/asio/asio/traits/set_done_free.hpp b/include/ylt/thirdparty/asio/traits/set_done_free.hpp similarity index 100% rename from thirdparty/asio/asio/traits/set_done_free.hpp rename to include/ylt/thirdparty/asio/traits/set_done_free.hpp diff --git a/thirdparty/asio/asio/traits/set_done_member.hpp b/include/ylt/thirdparty/asio/traits/set_done_member.hpp similarity index 100% rename from thirdparty/asio/asio/traits/set_done_member.hpp rename to include/ylt/thirdparty/asio/traits/set_done_member.hpp diff --git a/thirdparty/asio/asio/traits/set_error_free.hpp b/include/ylt/thirdparty/asio/traits/set_error_free.hpp similarity index 100% rename from thirdparty/asio/asio/traits/set_error_free.hpp rename to include/ylt/thirdparty/asio/traits/set_error_free.hpp diff --git a/thirdparty/asio/asio/traits/set_error_member.hpp b/include/ylt/thirdparty/asio/traits/set_error_member.hpp similarity index 100% rename from thirdparty/asio/asio/traits/set_error_member.hpp rename to include/ylt/thirdparty/asio/traits/set_error_member.hpp diff --git a/thirdparty/asio/asio/traits/set_value_free.hpp b/include/ylt/thirdparty/asio/traits/set_value_free.hpp similarity index 100% rename from thirdparty/asio/asio/traits/set_value_free.hpp rename to include/ylt/thirdparty/asio/traits/set_value_free.hpp diff --git a/thirdparty/asio/asio/traits/set_value_member.hpp b/include/ylt/thirdparty/asio/traits/set_value_member.hpp similarity index 100% rename from thirdparty/asio/asio/traits/set_value_member.hpp rename to include/ylt/thirdparty/asio/traits/set_value_member.hpp diff --git a/thirdparty/asio/asio/traits/start_free.hpp b/include/ylt/thirdparty/asio/traits/start_free.hpp similarity index 100% rename from thirdparty/asio/asio/traits/start_free.hpp rename to include/ylt/thirdparty/asio/traits/start_free.hpp diff --git a/thirdparty/asio/asio/traits/start_member.hpp b/include/ylt/thirdparty/asio/traits/start_member.hpp similarity index 100% rename from thirdparty/asio/asio/traits/start_member.hpp rename to include/ylt/thirdparty/asio/traits/start_member.hpp diff --git a/thirdparty/asio/asio/traits/static_query.hpp b/include/ylt/thirdparty/asio/traits/static_query.hpp similarity index 100% rename from thirdparty/asio/asio/traits/static_query.hpp rename to include/ylt/thirdparty/asio/traits/static_query.hpp diff --git a/thirdparty/asio/asio/traits/static_require.hpp b/include/ylt/thirdparty/asio/traits/static_require.hpp similarity index 100% rename from thirdparty/asio/asio/traits/static_require.hpp rename to include/ylt/thirdparty/asio/traits/static_require.hpp diff --git a/thirdparty/asio/asio/traits/static_require_concept.hpp b/include/ylt/thirdparty/asio/traits/static_require_concept.hpp similarity index 100% rename from thirdparty/asio/asio/traits/static_require_concept.hpp rename to include/ylt/thirdparty/asio/traits/static_require_concept.hpp diff --git a/thirdparty/asio/asio/traits/submit_free.hpp b/include/ylt/thirdparty/asio/traits/submit_free.hpp similarity index 100% rename from thirdparty/asio/asio/traits/submit_free.hpp rename to include/ylt/thirdparty/asio/traits/submit_free.hpp diff --git a/thirdparty/asio/asio/traits/submit_member.hpp b/include/ylt/thirdparty/asio/traits/submit_member.hpp similarity index 100% rename from thirdparty/asio/asio/traits/submit_member.hpp rename to include/ylt/thirdparty/asio/traits/submit_member.hpp diff --git a/thirdparty/asio/asio/ts/buffer.hpp b/include/ylt/thirdparty/asio/ts/buffer.hpp similarity index 100% rename from thirdparty/asio/asio/ts/buffer.hpp rename to include/ylt/thirdparty/asio/ts/buffer.hpp diff --git a/thirdparty/asio/asio/ts/executor.hpp b/include/ylt/thirdparty/asio/ts/executor.hpp similarity index 100% rename from thirdparty/asio/asio/ts/executor.hpp rename to include/ylt/thirdparty/asio/ts/executor.hpp diff --git a/thirdparty/asio/asio/ts/internet.hpp b/include/ylt/thirdparty/asio/ts/internet.hpp similarity index 100% rename from thirdparty/asio/asio/ts/internet.hpp rename to include/ylt/thirdparty/asio/ts/internet.hpp diff --git a/thirdparty/asio/asio/ts/io_context.hpp b/include/ylt/thirdparty/asio/ts/io_context.hpp similarity index 100% rename from thirdparty/asio/asio/ts/io_context.hpp rename to include/ylt/thirdparty/asio/ts/io_context.hpp diff --git a/thirdparty/asio/asio/ts/net.hpp b/include/ylt/thirdparty/asio/ts/net.hpp similarity index 100% rename from thirdparty/asio/asio/ts/net.hpp rename to include/ylt/thirdparty/asio/ts/net.hpp diff --git a/thirdparty/asio/asio/ts/netfwd.hpp b/include/ylt/thirdparty/asio/ts/netfwd.hpp similarity index 100% rename from thirdparty/asio/asio/ts/netfwd.hpp rename to include/ylt/thirdparty/asio/ts/netfwd.hpp diff --git a/thirdparty/asio/asio/ts/socket.hpp b/include/ylt/thirdparty/asio/ts/socket.hpp similarity index 100% rename from thirdparty/asio/asio/ts/socket.hpp rename to include/ylt/thirdparty/asio/ts/socket.hpp diff --git a/thirdparty/asio/asio/ts/timer.hpp b/include/ylt/thirdparty/asio/ts/timer.hpp similarity index 100% rename from thirdparty/asio/asio/ts/timer.hpp rename to include/ylt/thirdparty/asio/ts/timer.hpp diff --git a/thirdparty/asio/asio/unyield.hpp b/include/ylt/thirdparty/asio/unyield.hpp similarity index 100% rename from thirdparty/asio/asio/unyield.hpp rename to include/ylt/thirdparty/asio/unyield.hpp diff --git a/thirdparty/asio/asio/use_awaitable.hpp b/include/ylt/thirdparty/asio/use_awaitable.hpp similarity index 100% rename from thirdparty/asio/asio/use_awaitable.hpp rename to include/ylt/thirdparty/asio/use_awaitable.hpp diff --git a/thirdparty/asio/asio/use_future.hpp b/include/ylt/thirdparty/asio/use_future.hpp similarity index 100% rename from thirdparty/asio/asio/use_future.hpp rename to include/ylt/thirdparty/asio/use_future.hpp diff --git a/thirdparty/asio/asio/uses_executor.hpp b/include/ylt/thirdparty/asio/uses_executor.hpp similarity index 100% rename from thirdparty/asio/asio/uses_executor.hpp rename to include/ylt/thirdparty/asio/uses_executor.hpp diff --git a/thirdparty/asio/asio/version.hpp b/include/ylt/thirdparty/asio/version.hpp similarity index 100% rename from thirdparty/asio/asio/version.hpp rename to include/ylt/thirdparty/asio/version.hpp diff --git a/thirdparty/asio/asio/wait_traits.hpp b/include/ylt/thirdparty/asio/wait_traits.hpp similarity index 100% rename from thirdparty/asio/asio/wait_traits.hpp rename to include/ylt/thirdparty/asio/wait_traits.hpp diff --git a/thirdparty/asio/asio/windows/basic_object_handle.hpp b/include/ylt/thirdparty/asio/windows/basic_object_handle.hpp similarity index 100% rename from thirdparty/asio/asio/windows/basic_object_handle.hpp rename to include/ylt/thirdparty/asio/windows/basic_object_handle.hpp diff --git a/thirdparty/asio/asio/windows/basic_overlapped_handle.hpp b/include/ylt/thirdparty/asio/windows/basic_overlapped_handle.hpp similarity index 100% rename from thirdparty/asio/asio/windows/basic_overlapped_handle.hpp rename to include/ylt/thirdparty/asio/windows/basic_overlapped_handle.hpp diff --git a/thirdparty/asio/asio/windows/basic_random_access_handle.hpp b/include/ylt/thirdparty/asio/windows/basic_random_access_handle.hpp similarity index 100% rename from thirdparty/asio/asio/windows/basic_random_access_handle.hpp rename to include/ylt/thirdparty/asio/windows/basic_random_access_handle.hpp diff --git a/thirdparty/asio/asio/windows/basic_stream_handle.hpp b/include/ylt/thirdparty/asio/windows/basic_stream_handle.hpp similarity index 100% rename from thirdparty/asio/asio/windows/basic_stream_handle.hpp rename to include/ylt/thirdparty/asio/windows/basic_stream_handle.hpp diff --git a/thirdparty/asio/asio/windows/object_handle.hpp b/include/ylt/thirdparty/asio/windows/object_handle.hpp similarity index 100% rename from thirdparty/asio/asio/windows/object_handle.hpp rename to include/ylt/thirdparty/asio/windows/object_handle.hpp diff --git a/thirdparty/asio/asio/windows/overlapped_handle.hpp b/include/ylt/thirdparty/asio/windows/overlapped_handle.hpp similarity index 100% rename from thirdparty/asio/asio/windows/overlapped_handle.hpp rename to include/ylt/thirdparty/asio/windows/overlapped_handle.hpp diff --git a/thirdparty/asio/asio/windows/overlapped_ptr.hpp b/include/ylt/thirdparty/asio/windows/overlapped_ptr.hpp similarity index 100% rename from thirdparty/asio/asio/windows/overlapped_ptr.hpp rename to include/ylt/thirdparty/asio/windows/overlapped_ptr.hpp diff --git a/thirdparty/asio/asio/windows/random_access_handle.hpp b/include/ylt/thirdparty/asio/windows/random_access_handle.hpp similarity index 100% rename from thirdparty/asio/asio/windows/random_access_handle.hpp rename to include/ylt/thirdparty/asio/windows/random_access_handle.hpp diff --git a/thirdparty/asio/asio/windows/stream_handle.hpp b/include/ylt/thirdparty/asio/windows/stream_handle.hpp similarity index 100% rename from thirdparty/asio/asio/windows/stream_handle.hpp rename to include/ylt/thirdparty/asio/windows/stream_handle.hpp diff --git a/thirdparty/asio/asio/writable_pipe.hpp b/include/ylt/thirdparty/asio/writable_pipe.hpp similarity index 100% rename from thirdparty/asio/asio/writable_pipe.hpp rename to include/ylt/thirdparty/asio/writable_pipe.hpp diff --git a/thirdparty/asio/asio/write.hpp b/include/ylt/thirdparty/asio/write.hpp similarity index 100% rename from thirdparty/asio/asio/write.hpp rename to include/ylt/thirdparty/asio/write.hpp diff --git a/thirdparty/asio/asio/write_at.hpp b/include/ylt/thirdparty/asio/write_at.hpp similarity index 100% rename from thirdparty/asio/asio/write_at.hpp rename to include/ylt/thirdparty/asio/write_at.hpp diff --git a/thirdparty/asio/asio/yield.hpp b/include/ylt/thirdparty/asio/yield.hpp similarity index 100% rename from thirdparty/asio/asio/yield.hpp rename to include/ylt/thirdparty/asio/yield.hpp diff --git a/thirdparty/async_simple/async_simple/CMakeLists.txt b/include/ylt/thirdparty/async_simple/CMakeLists.txt similarity index 100% rename from thirdparty/async_simple/async_simple/CMakeLists.txt rename to include/ylt/thirdparty/async_simple/CMakeLists.txt diff --git a/thirdparty/async_simple/async_simple/Collect.h b/include/ylt/thirdparty/async_simple/Collect.h similarity index 62% rename from thirdparty/async_simple/async_simple/Collect.h rename to include/ylt/thirdparty/async_simple/Collect.h index 937b8633..d14c332b 100644 --- a/thirdparty/async_simple/async_simple/Collect.h +++ b/include/ylt/thirdparty/async_simple/Collect.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Alibaba Group Holding Limited; + * Copyright (c) 2023, Alibaba Group Holding Limited; * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,14 +17,14 @@ #define ASYNC_SIMPLE_COLLECT_H #include +#include #include #include + #include "async_simple/Common.h" #include "async_simple/Future.h" #include "async_simple/Try.h" -#include - namespace async_simple { // collectAll - collect all the values for a range of futures. @@ -50,47 +50,48 @@ template inline Future::value_type::value_type>>> collectAll(Iterator begin, Iterator end) { - using T = typename std::iterator_traits::value_type::value_type; - size_t n = std::distance(begin, end); + using T = typename std::iterator_traits::value_type::value_type; + size_t n = std::distance(begin, end); - bool allReady = true; + bool allReady = true; + for (auto iter = begin; iter != end; ++iter) { + if (!iter->hasResult()) { + allReady = false; + break; + } + } + if (allReady) { + std::vector> results; + results.reserve(n); for (auto iter = begin; iter != end; ++iter) { - if (!iter->hasResult()) { - allReady = false; - break; - } + results.push_back(std::move(iter->result())); } - if (allReady) { - std::vector> results; - results.reserve(n); - for (auto iter = begin; iter != end; ++iter) { - results.push_back(std::move(iter->result())); - } - return Future>>(std::move(results)); + return Future>>(std::move(results)); + } + + Promise>> promise; + auto future = promise.getFuture(); + + struct Context { + Context(size_t n, Promise>> p_) + : results(n), p(std::move(p_)) {} + ~Context() { p.setValue(std::move(results)); } + std::vector> results; + Promise>> p; + }; + + auto ctx = std::make_shared(n, std::move(promise)); + for (size_t i = 0; i < n; ++i, ++begin) { + if (begin->hasResult()) { + ctx->results[i] = std::move(begin->result()); } - - Promise>> promise; - auto future = promise.getFuture(); - - struct Context { - Context(size_t n, Promise>> p_) - : results(n), p(std::move(p_)) {} - ~Context() { p.setValue(std::move(results)); } - std::vector> results; - Promise>> p; - }; - - auto ctx = std::make_shared(n, std::move(promise)); - for (size_t i = 0; i < n; ++i, ++begin) { - if (begin->hasResult()) { - ctx->results[i] = std::move(begin->result()); - } else { - begin->setContinuation([ctx, i](Try&& t) mutable { - ctx->results[i] = std::move(t); - }); - } + else { + begin->setContinuation([ctx, i](Try&& t) mutable { + ctx->results[i] = std::move(t); + }); } - return future; + } + return future; } } // namespace async_simple diff --git a/thirdparty/async_simple/async_simple/Common.h b/include/ylt/thirdparty/async_simple/Common.h similarity index 92% rename from thirdparty/async_simple/async_simple/Common.h rename to include/ylt/thirdparty/async_simple/Common.h index a82a40c3..2bd63beb 100644 --- a/thirdparty/async_simple/async_simple/Common.h +++ b/include/ylt/thirdparty/async_simple/Common.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Alibaba Group Holding Limited; + * Copyright (c) 2023, Alibaba Group Holding Limited; * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,9 +52,9 @@ namespace async_simple { // a bug in the library. If logicAssert fails, it means // there is a bug in the user code. inline void logicAssert(bool x, const char* errorMsg) { - if (x) - AS_LIKELY { return; } - throw std::logic_error(errorMsg); + if (x) + AS_LIKELY { return; } + throw std::logic_error(errorMsg); } } // namespace async_simple diff --git a/include/ylt/thirdparty/async_simple/Executor.h b/include/ylt/thirdparty/async_simple/Executor.h new file mode 100644 index 00000000..25f0e998 --- /dev/null +++ b/include/ylt/thirdparty/async_simple/Executor.h @@ -0,0 +1,177 @@ +/* + * Copyright (c) 2023, Alibaba Group Holding Limited; + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef ASYNC_SIMPLE_EXECUTOR_H +#define ASYNC_SIMPLE_EXECUTOR_H + +#include +#include +#include +#include + +#include "async_simple/experimental/coroutine.h" + +namespace async_simple { +// Stat information for an executor. +// It contains the number of pending task +// for the executor now. +struct ExecutorStat { + size_t pendingTaskCount = 0; + ExecutorStat() = default; +}; +// Options for a schedule. +// The option contains: +// - bool prompt. Whether or not this schedule +// should be prompted. +struct ScheduleOptions { + bool prompt = true; + ScheduleOptions() = default; +}; + +// Awaitable to get the current executor. +// For example: +// ``` +// auto current_executor = +// co_await CurrentExecutor{}; +// ``` +struct CurrentExecutor {}; + +// Executor is a scheduler for functions. +// +// Executor is a key component for scheduling coroutines. +// Considering that there should be already an executor +// in most production-level programs, Executor is designed +// to be able to fit the scheduling strategy in existing programs. +// +// User should derive from Executor and implement their scheduling +// strategy. + +class IOExecutor; + +class Executor { + public: + // Context is an identification for the context where an executor + // should run. See checkin/checkout for details. + using Context = void *; + static constexpr Context NULLCTX = nullptr; + + // A time duration in microseconds. + using Duration = std::chrono::duration; + + // The schedulable function. Func should accept no argument and + // return void. + using Func = std::function; + class TimeAwaitable; + class TimeAwaiter; + + Executor(std::string name = "default") : _name(std::move(name)) {} + virtual ~Executor() {} + + Executor(const Executor &) = delete; + Executor &operator=(const Executor &) = delete; + + // Schedule a function. + // `schedule` would return false if schedule failed, which means function + // func will not be executed. In case schedule return true, the executor + // should guarantee that the func would be executed. + virtual bool schedule(Func func) = 0; + // Return true if caller runs in the executor. + virtual bool currentThreadInExecutor() const { + throw std::logic_error("Not implemented"); + } + virtual ExecutorStat stat() const { + throw std::logic_error("Not implemented"); + } + + // checkout() return current "Context", which defined by executor + // implementation, then checkin(func, "Context") should schedule func to the + // same "Context" as before. + virtual size_t currentContextId() const { return 0; }; + virtual Context checkout() { return NULLCTX; } + virtual bool checkin(Func func, [[maybe_unused]] Context ctx, + [[maybe_unused]] ScheduleOptions opts) { + return schedule(std::move(func)); + } + virtual bool checkin(Func func, Context ctx) { + static ScheduleOptions opts; + return checkin(std::move(func), ctx, opts); + } + + const std::string &name() const { return _name; } + + // Use + // co_await executor.after(sometime) + // to schedule current execution after some time. + TimeAwaitable after(Duration dur); + + // IOExecutor accepts IO read/write requests. + // Return nullptr if the executor doesn't offer an IOExecutor. + virtual IOExecutor *getIOExecutor() { + throw std::logic_error("Not implemented"); + } + + protected: + virtual void schedule(Func func, Duration dur) { + std::thread([this, func = std::move(func), dur]() { + std::this_thread::sleep_for(dur); + schedule(std::move(func)); + }).detach(); + } + + private: + std::string _name; +}; + +// Awaiter to implement Executor::after. +class Executor::TimeAwaiter { + public: + TimeAwaiter(Executor *ex, Executor::Duration dur) : _ex(ex), _dur(dur) {} + + public: + bool await_ready() const noexcept { return false; } + + template + void await_suspend(std::coroutine_handle continuation) { + std::function func = [c = continuation]() mutable { + c.resume(); + }; + _ex->schedule(func, _dur); + } + void await_resume() const noexcept {} + + private: + Executor *_ex; + Executor::Duration _dur; +}; + +// Awaitable to implement Executor::after. +class Executor::TimeAwaitable { + public: + TimeAwaitable(Executor *ex, Executor::Duration dur) : _ex(ex), _dur(dur) {} + + auto coAwait(Executor *) { return Executor::TimeAwaiter(_ex, _dur); } + + private: + Executor *_ex; + Executor::Duration _dur; +}; + +Executor::TimeAwaitable inline Executor::after(Executor::Duration dur) { + return Executor::TimeAwaitable(this, dur); +}; + +} // namespace async_simple + +#endif diff --git a/include/ylt/thirdparty/async_simple/Future.h b/include/ylt/thirdparty/async_simple/Future.h new file mode 100644 index 00000000..c9afa7cf --- /dev/null +++ b/include/ylt/thirdparty/async_simple/Future.h @@ -0,0 +1,366 @@ +/* + * Copyright (c) 2023, Alibaba Group Holding Limited; + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef ASYNC_SIMPLE_FUTURE_H +#define ASYNC_SIMPLE_FUTURE_H + +#include + +#include "async_simple/Executor.h" +#include "async_simple/FutureState.h" +#include "async_simple/LocalState.h" +#include "async_simple/Promise.h" +#include "async_simple/Traits.h" + +namespace async_simple { + +template +class Promise; + +// The well-known Future/Promise pairs mimic a producer/consumer pair. +// The Future stands for the consumer-side. +// +// Future's implementation is thread-safe so that Future and Promise +// could be able to appear in different thread. +// +// To get the value of Future synchronously, user should use `get()` +// method. It would blocking the current thread by using condition variable. +// +// To get the value of Future asynchronously, user could use `thenValue(F)` +// or `thenTry(F)`. See the separate comments for details. +// +// User shouldn't access Future after Future called `get()`, `thenValue(F)`, +// or `thenTry(F)`. +// +// User should get a Future by calling `Promise::getFuture()` instead of +// constructing a Future directly. If the user want a ready future indeed, +// he should call makeReadyFuture(). +template +class Future { + private: + // If T is void, the inner_value_type is Unit. It will be used by + // `FutureState` and `LocalState`. Because `Try` cannot distinguish + // between `Nothing` state and `Value` state. + // It maybe remove Unit after next version, and then will change the + // `Try` to distinguish between `Nothing` state and `Value` state + using inner_value_type = std::conditional_t, Unit, T>; + + public: + using value_type = T; + Future(FutureState* fs) : _sharedState(fs) { + if (_sharedState) { + _sharedState->attachOne(); + } + } + Future(Try&& t) + : _sharedState(nullptr), _localState(std::move(t)) {} + + ~Future() { + if (_sharedState) { + _sharedState->detachOne(); + } + } + + Future(const Future&) = delete; + Future& operator=(const Future&) = delete; + + Future(Future&& other) + : _sharedState(other._sharedState), + _localState(std::move(other._localState)) { + other._sharedState = nullptr; + } + + Future& operator=(Future&& other) { + if (this != &other) { + std::swap(_sharedState, other._sharedState); + _localState = std::move(other._localState); + } + return *this; + } + + public: + bool valid() const { + return _sharedState != nullptr || _localState.hasResult(); + } + + bool hasResult() const { + return _localState.hasResult() || _sharedState->hasResult(); + } + + std::add_rvalue_reference_t value() && { + if constexpr (std::is_void_v) { + return result().value(); + } + else { + return std::move(result().value()); + } + } + std::add_lvalue_reference_t value() & { return result().value(); } + const std::add_lvalue_reference_t value() const& { + return result().value(); + } + + Try&& result() && requires(!std::is_void_v) { + return std::move(getTry(*this)); + } + Try& result() & requires(!std::is_void_v) { return getTry(*this); } + const Try& result() const& requires(!std::is_void_v) { + return getTry(*this); + } + + Try result() && requires(std::is_void_v) { return getTry(*this); } + Try result() & requires(std::is_void_v) { return getTry(*this); } + Try result() const& requires(std::is_void_v) { + return getTry(*this); + } + + // get is only allowed on rvalue, aka, Future is not valid after get + // invoked. + // + // Get value blocked thread when the future doesn't have a value. + // If future in uthread context, use await(future) to get value without + // thread blocked. + T get() && { + wait(); + return (std::move(*this)).value(); + } + // Implementation for get() to wait synchronously. + void wait() { + logicAssert(valid(), "Future is broken"); + + if (hasResult()) { + return; + } + + // wait in the same executor may cause deadlock + assert(!currentThreadInExecutor()); + + // The state is a shared state + Promise promise; + auto future = promise.getFuture(); + + _sharedState->setExecutor( + nullptr); // following continuation is simple, execute inplace + std::mutex mtx; + std::condition_variable cv; + std::atomic done{false}; + _sharedState->setContinuation( + [&mtx, &cv, &done, p = std::move(promise)](Try&& t) mutable { + std::unique_lock lock(mtx); + p.setValue(std::move(t)); + done.store(true, std::memory_order_relaxed); + cv.notify_one(); + }); + std::unique_lock lock(mtx); + cv.wait(lock, [&done]() { + return done.load(std::memory_order_relaxed); + }); + *this = std::move(future); + assert(_sharedState->hasResult()); + } + + // Set the executor for the future. This only works for rvalue. + // So the original future shouldn't be accessed after setting + // an executor. The user should use the returned future instead. + Future via(Executor* executor) && { + setExecutor(executor); + Future ret(std::move(*this)); + return ret; + } + + // thenTry() is only allowed on rvalues, do not access a future after + // thenTry() called. F is a callback function which takes Try&& as + // parameter. + // + template > + Future thenTry(F&& f) && { + return thenImpl(std::forward(f)); + } + + // Similar to thenTry, but F takes a T&&. If exception throws, F will not be + // called. + template > + Future thenValue(F&& f) && { + auto lambda = [func = std::forward(f)](Try&& t) mutable { + if constexpr (std::is_void_v) { + t.value(); + return std::forward(func)(); + } + else { + return std::forward(func)(std::move(t).value()); + }; + }; + using Func = decltype(lambda); + return thenImpl>(std::move(lambda)); + } + + template , + ValueCallableResult, TryCallableResult>> + Future then(F&& f) && { + if constexpr (std::is_invocable_v) { + return std::move(*this).thenValue(std::forward(f)); + } + else { + return std::move(*this).thenTry(std::forward(f)); + } + } + + public: + // This section is public because they may invoked by other type of Future. + // They are not suppose to be public. + // FIXME: mark the section as private. + void setExecutor(Executor* ex) { + if (_sharedState) { + _sharedState->setExecutor(ex); + } + else { + _localState.setExecutor(ex); + } + } + + Executor* getExecutor() { + if (_sharedState) { + return _sharedState->getExecutor(); + } + else { + return _localState.getExecutor(); + } + } + + template + void setContinuation(F&& func) { + assert(valid()); + if (_sharedState) { + _sharedState->setContinuation(std::forward(func)); + } + else { + _localState.setContinuation(std::forward(func)); + } + } + + bool currentThreadInExecutor() const { + assert(valid()); + if (_sharedState) { + return _sharedState->currentThreadInExecutor(); + } + else { + return _localState.currentThreadInExecutor(); + } + } + + bool TEST_hasLocalState() const { return _localState.hasResult(); } + + private: + template + static decltype(auto) getTry(Clazz& self) { + logicAssert(self.valid(), "Future is broken"); + logicAssert(self._localState.hasResult() || self._sharedState->hasResult(), + "Future is not ready"); + if (self._sharedState) { + return self._sharedState->getTry(); + } + else { + return self._localState.getTry(); + } + } + + // continuation returns a future + template + Future thenImpl(F&& func) { + logicAssert(valid(), "Future is broken"); + using T2 = typename R::ReturnsFuture::Inner; + + if (!_sharedState) { + if constexpr (R::ReturnsFuture::value) { + try { + auto newFuture = + std::forward(func)(std::move(_localState.getTry())); + if (!newFuture.getExecutor()) { + newFuture.setExecutor(_localState.getExecutor()); + } + return newFuture; + } catch (...) { + return Future(Try(std::current_exception())); + } + } + else { + Future newFuture(makeTryCall(std::forward(func), + std::move(_localState.getTry()))); + newFuture.setExecutor(_localState.getExecutor()); + return newFuture; + } + } + + Promise promise; + auto newFuture = promise.getFuture(); + newFuture.setExecutor(_sharedState->getExecutor()); + _sharedState->setContinuation( + [p = std::move(promise), + f = std::forward(func)](Try&& t) mutable { + if (!R::isTry && t.hasError()) { + p.setException(t.getException()); + } + else { + if constexpr (R::ReturnsFuture::value) { + try { + auto f2 = f(std::move(t)); + f2.setContinuation([pm = std::move(p)](Try&& t2) mutable { + pm.setValue(std::move(t2)); + }); + } catch (...) { + p.setException(std::current_exception()); + } + } + else { + p.setValue(makeTryCall(std::forward(f), + std::move(t))); // Try + } + } + }); + return newFuture; + } + + private: + FutureState* _sharedState; + + // Ready-Future does not have a Promise, an inline state is faster. + LocalState _localState; + + private: + template + friend Future::value_type::value_type>>> + collectAll(Iter begin, Iter end); +}; + +// Make a ready Future +template +Future makeReadyFuture(T&& v) { + return Future(Try(std::forward(v))); +} +template +Future makeReadyFuture(Try&& t) { + return Future(std::move(t)); +} +template +Future makeReadyFuture(std::exception_ptr ex) { + return Future(Try(ex)); +} +inline Future makeReadyFuture() { return Future(Try()); } + +} // namespace async_simple + +#endif // ASYNC_SIMPLE_FUTURE_H diff --git a/include/ylt/thirdparty/async_simple/FutureState.h b/include/ylt/thirdparty/async_simple/FutureState.h new file mode 100644 index 00000000..9df81f44 --- /dev/null +++ b/include/ylt/thirdparty/async_simple/FutureState.h @@ -0,0 +1,331 @@ +/* + * Copyright (c) 2023, Alibaba Group Holding Limited; + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef ASYNC_SIMPLE_FUTURESTATE_H +#define ASYNC_SIMPLE_FUTURESTATE_H + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "async_simple/Common.h" +#include "async_simple/Executor.h" +#include "async_simple/MoveWrapper.h" +#include "async_simple/Try.h" + +namespace async_simple { + +// Details about the State of Future/Promise, +// Users shouldn't care about it. +namespace detail { + +enum class State : uint8_t { + START = 0, + ONLY_RESULT = 1 << 0, + ONLY_CONTINUATION = 1 << 1, + DONE = 1 << 5, +}; + +constexpr State operator|(State lhs, State rhs) { + return State((uint8_t)lhs | (uint8_t)rhs); +} + +constexpr State operator&(State lhs, State rhs) { + return State((uint8_t)lhs & (uint8_t)rhs); +} + +} // namespace detail + +// FutureState is a shared state between Future and Promise. +// +// This is the key component for Future/Promise. It guarantees +// the thread safety and call executor to schedule when necessary. +// +// Users should **never** use FutureState directly. +template +class FutureState { + private: + using Continuation = std::function&& value)>; + + private: + // A helper to help FutureState to count the references to guarantee + // that the memory get released correctly. + class ContinuationReference { + public: + ContinuationReference() = default; + explicit ContinuationReference(FutureState* fs) : _fs(fs) { attach(); } + ~ContinuationReference() { detach(); } + + ContinuationReference(const ContinuationReference& other) : _fs(other._fs) { + attach(); + } + ContinuationReference& operator=(const ContinuationReference& other) = + delete; + + ContinuationReference(ContinuationReference&& other) : _fs(other._fs) { + other._fs = nullptr; + } + + ContinuationReference& operator=(ContinuationReference&& other) = delete; + + FutureState* getFutureState() const noexcept { return _fs; } + + private: + void attach() { + if (_fs) { + _fs->attachOne(); + _fs->refContinuation(); + } + } + void detach() { + if (_fs) { + _fs->derefContinuation(); + _fs->detachOne(); + } + } + + private: + FutureState* _fs = nullptr; + }; + + public: + FutureState() + : _state(detail::State::START), + _attached(0), + _continuationRef(0), + _executor(nullptr), + _context(Executor::NULLCTX), + _promiseRef(0), + _forceSched(false) {} + ~FutureState() {} + + FutureState(const FutureState&) = delete; + FutureState& operator=(const FutureState&) = delete; + + FutureState(FutureState&& other) = delete; + FutureState& operator=(FutureState&&) = delete; + + public: + bool hasResult() const noexcept { + constexpr auto allow = detail::State::DONE | detail::State::ONLY_RESULT; + auto state = _state.load(std::memory_order_acquire); + return (state & allow) != detail::State(); + } + + bool hasContinuation() const noexcept { + constexpr auto allow = + detail::State::DONE | detail::State::ONLY_CONTINUATION; + auto state = _state.load(std::memory_order_acquire); + return (state & allow) != detail::State(); + } + + AS_INLINE void attachOne() { + _attached.fetch_add(1, std::memory_order_relaxed); + } + AS_INLINE void detachOne() { + auto old = _attached.fetch_sub(1, std::memory_order_acq_rel); + assert(old >= 1u); + if (old == 1) { + delete this; + } + } + AS_INLINE void attachPromise() { + _promiseRef.fetch_add(1, std::memory_order_relaxed); + attachOne(); + } + AS_INLINE void detachPromise() { + auto old = _promiseRef.fetch_sub(1, std::memory_order_acq_rel); + assert(old >= 1u); + if (!hasResult() && old == 1) { + try { + throw std::runtime_error("Promise is broken"); + } catch (...) { + setResult(Try(std::current_exception())); + } + } + detachOne(); + } + + public: + Try& getTry() noexcept { return _try_value; } + const Try& getTry() const noexcept { return _try_value; } + + void setExecutor(Executor* ex) { _executor = ex; } + + Executor* getExecutor() { return _executor; } + + void checkout() { + if (_executor) { + _context = _executor->checkout(); + } + } + void setForceSched(bool force = true) { + if (!_executor && force) { + std::cerr << "executor is nullptr, can not set force schedule " + "continaution\n"; + return; + } + _forceSched = force; + } + + public: + // State Transfer: + // START: initial + // ONLY_RESULT: promise.setValue called + // ONLY_CONTINUATION: future.thenImpl called + void setResult(Try&& value) { +#if !defined(__GNUC__) || __GNUC__ < 12 + // GCC 12 issues a spurious uninitialized-var warning. + // See details: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109448 + logicAssert(!hasResult(), "FutureState already has a result"); +#endif + _try_value = std::move(value); + + auto state = _state.load(std::memory_order_acquire); + switch (state) { + case detail::State::START: + if (_state.compare_exchange_strong(state, detail::State::ONLY_RESULT, + std::memory_order_release)) { + return; + } + // state has already transfered, fallthrough + assert(_state.load(std::memory_order_relaxed) == + detail::State::ONLY_CONTINUATION); + case detail::State::ONLY_CONTINUATION: + if (_state.compare_exchange_strong(state, detail::State::DONE, + std::memory_order_release)) { + scheduleContinuation(false); + return; + } + default: + logicAssert(false, "State Transfer Error"); + } + } + + template + void setContinuation(F&& func) { + logicAssert(!hasContinuation(), "FutureState already has a continuation"); + MoveWrapper lambdaFunc(std::move(func)); + new (&_continuation) Continuation([lambdaFunc](Try&& v) mutable { + auto& lambda = lambdaFunc.get(); + lambda(std::forward>(v)); + }); + + auto state = _state.load(std::memory_order_acquire); + switch (state) { + case detail::State::START: + if (_state.compare_exchange_strong(state, + detail::State::ONLY_CONTINUATION, + std::memory_order_release)) { + return; + } + // state has already transferred, fallthrough + assert(_state.load(std::memory_order_relaxed) == + detail::State::ONLY_RESULT); + case detail::State::ONLY_RESULT: + if (_state.compare_exchange_strong(state, detail::State::DONE, + std::memory_order_release)) { + scheduleContinuation(true); + return; + } + default: + logicAssert(false, "State Transfer Error"); + } + } + + bool currentThreadInExecutor() const { + if (!_executor) { + return false; + } + return _executor->currentThreadInExecutor(); + } + + private: + void scheduleContinuation(bool triggerByContinuation) { + logicAssert(_state.load(std::memory_order_relaxed) == detail::State::DONE, + "FutureState is not DONE"); + if (!_forceSched && + (!_executor || triggerByContinuation || currentThreadInExecutor())) { + // execute inplace for better performance + ContinuationReference guard(this); + _continuation(std::move(_try_value)); + } + else { + ContinuationReference guard(this); + ContinuationReference guardForException(this); + try { + bool ret; + if (Executor::NULLCTX == _context) { + ret = _executor->schedule([fsRef = std::move(guard)]() mutable { + auto ref = std::move(fsRef); + auto fs = ref.getFutureState(); + fs->_continuation(std::move(fs->_try_value)); + }); + } + else { + ScheduleOptions opts; + opts.prompt = !_forceSched; + // schedule continuation in the same context before + // checkout() + ret = _executor->checkin( + [fsRef = std::move(guard)]() mutable { + auto ref = std::move(fsRef); + auto fs = ref.getFutureState(); + fs->_continuation(std::move(fs->_try_value)); + }, + _context, opts); + } + if (!ret) { + throw std::runtime_error("schedule continuation in executor failed"); + } + } catch (std::exception& e) { + // reschedule failed, execute inplace + _continuation(std::move(_try_value)); + } + } + } + + void refContinuation() { + _continuationRef.fetch_add(1, std::memory_order_relaxed); + } + void derefContinuation() { + auto old = _continuationRef.fetch_sub(1, std::memory_order_relaxed); + assert(old >= 1); + if (old == 1) { + _continuation.~Continuation(); + } + } + + private: + std::atomic _state; + std::atomic _attached; + std::atomic _continuationRef; + Try _try_value; + union { + Continuation _continuation; + }; + Executor* _executor; + Executor::Context _context; + std::atomic _promiseRef; + bool _forceSched; +}; +} // namespace async_simple + +#endif diff --git a/thirdparty/async_simple/async_simple/IOExecutor.h b/include/ylt/thirdparty/async_simple/IOExecutor.h similarity index 56% rename from thirdparty/async_simple/async_simple/IOExecutor.h rename to include/ylt/thirdparty/async_simple/IOExecutor.h index 4facbbce..cffdf32e 100644 --- a/thirdparty/async_simple/async_simple/IOExecutor.h +++ b/include/ylt/thirdparty/async_simple/IOExecutor.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Alibaba Group Holding Limited; + * Copyright (c) 2023, Alibaba Group Holding Limited; * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,29 +24,29 @@ namespace async_simple { // IOExecutor accepts and performs io requests, callers will be notified by // callback. IO type and arguments are similar to Linux AIO. enum iocb_cmd { - IOCB_CMD_PREAD = 0, - IOCB_CMD_PWRITE = 1, - IOCB_CMD_FSYNC = 2, - IOCB_CMD_FDSYNC = 3, - /* These two are experimental. - * IOCB_CMD_PREADX = 4, - * IOCB_CMD_POLL = 5, - */ - IOCB_CMD_NOOP = 6, - IOCB_CMD_PREADV = 7, - IOCB_CMD_PWRITEV = 8, + IOCB_CMD_PREAD = 0, + IOCB_CMD_PWRITE = 1, + IOCB_CMD_FSYNC = 2, + IOCB_CMD_FDSYNC = 3, + /* These two are experimental. + * IOCB_CMD_PREADX = 4, + * IOCB_CMD_POLL = 5, + */ + IOCB_CMD_NOOP = 6, + IOCB_CMD_PREADV = 7, + IOCB_CMD_PWRITEV = 8, }; struct io_event_t { - void* data; - void* obj; - uint64_t res; - uint64_t res2; + void* data; + void* obj; + uint64_t res; + uint64_t res2; }; struct iovec_t { - void* iov_base; - size_t iov_len; + void* iov_base; + size_t iov_len; }; using AIOCallback = std::function; @@ -55,20 +55,20 @@ using AIOCallback = std::function; // After the user implements an IOExecutor, he should associate // the IOExecutor with the corresponding Executor implementation. class IOExecutor { -public: - using Func = std::function; + public: + using Func = std::function; - IOExecutor() {} - virtual ~IOExecutor() {} + IOExecutor() {} + virtual ~IOExecutor() {} - IOExecutor(const IOExecutor&) = delete; - IOExecutor& operator=(const IOExecutor&) = delete; + IOExecutor(const IOExecutor&) = delete; + IOExecutor& operator=(const IOExecutor&) = delete; -public: - virtual void submitIO(int fd, iocb_cmd cmd, void* buffer, size_t length, - off_t offset, AIOCallback cbfn) = 0; - virtual void submitIOV(int fd, iocb_cmd cmd, const iovec_t* iov, - size_t count, off_t offset, AIOCallback cbfn) = 0; + public: + virtual void submitIO(int fd, iocb_cmd cmd, void* buffer, size_t length, + off_t offset, AIOCallback cbfn) = 0; + virtual void submitIOV(int fd, iocb_cmd cmd, const iovec_t* iov, size_t count, + off_t offset, AIOCallback cbfn) = 0; }; } // namespace async_simple diff --git a/include/ylt/thirdparty/async_simple/LocalState.h b/include/ylt/thirdparty/async_simple/LocalState.h new file mode 100644 index 00000000..be916e01 --- /dev/null +++ b/include/ylt/thirdparty/async_simple/LocalState.h @@ -0,0 +1,96 @@ + +/* + * Copyright (c) 2023, Alibaba Group Holding Limited; + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef ASYNC_SIMPLE_LOCALSTATE_H +#define ASYNC_SIMPLE_LOCALSTATE_H + +#include +#include +#include +#include +#include +#include +#include + +#include "async_simple/Common.h" +#include "async_simple/Executor.h" +#include "async_simple/MoveWrapper.h" +#include "async_simple/Try.h" + +namespace async_simple { + +// A component of Future/Promise. LocalState is owned by +// Future only. LocalState should be valid after +// Future and Promise disconnects. +// +// Users should never use LocalState directly. +template +class LocalState { + private: + using Continuation = std::function&& value)>; + + public: + LocalState() : _executor(nullptr) {} + LocalState(T&& v) : _try_value(std::forward(v)), _executor(nullptr) {} + LocalState(Try&& t) : _try_value(std::move(t)), _executor(nullptr) {} + + ~LocalState() {} + + LocalState(const LocalState&) = delete; + LocalState& operator=(const LocalState&) = delete; + + LocalState(LocalState&& other) + : _try_value(std::move(other._try_value)), + _executor(std::exchange(other._executor, nullptr)) {} + LocalState& operator=(LocalState&& other) { + if (this != &other) { + std::swap(_try_value, other._try_value); + std::swap(_executor, other._executor); + } + return *this; + } + + public: + bool hasResult() const noexcept { return _try_value.available(); } + + public: + Try& getTry() noexcept { return _try_value; } + const Try& getTry() const noexcept { return _try_value; } + + void setExecutor(Executor* ex) { _executor = ex; } + + Executor* getExecutor() { return _executor; } + + bool currentThreadInExecutor() const { + if (!_executor) { + return false; + } + return _executor->currentThreadInExecutor(); + } + + template + void setContinuation(F&& f) { + assert(_try_value.available()); + std::forward(f)(std::move(_try_value)); + } + + private: + Try _try_value; + Executor* _executor; +}; +} // namespace async_simple + +#endif diff --git a/thirdparty/async_simple/async_simple/MoveWrapper.h b/include/ylt/thirdparty/async_simple/MoveWrapper.h similarity index 100% rename from thirdparty/async_simple/async_simple/MoveWrapper.h rename to include/ylt/thirdparty/async_simple/MoveWrapper.h diff --git a/include/ylt/thirdparty/async_simple/Promise.h b/include/ylt/thirdparty/async_simple/Promise.h new file mode 100644 index 00000000..216eae55 --- /dev/null +++ b/include/ylt/thirdparty/async_simple/Promise.h @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2023, Alibaba Group Holding Limited; + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef ASYNC_SIMPLE_PROMISE_H +#define ASYNC_SIMPLE_PROMISE_H + +#include + +#include "async_simple/Common.h" +#include "async_simple/Future.h" + +namespace async_simple { + +template +class Future; + +// The well-known Future/Promise pair mimics a producer/consumer pair. +// The Promise stands for the producer-side. +// +// We could get a Future from the Promise by calling getFuture(). And +// set value by calling setValue(). In case we need to set exception, +// we could call setException(). +template +class Promise { + public: + using value_type = std::conditional_t, Unit, T>; + Promise() : _sharedState(new FutureState()), _hasFuture(false) { + _sharedState->attachPromise(); + } + ~Promise() { + if (_sharedState) { + _sharedState->detachPromise(); + } + } + + Promise(const Promise& other) { + _sharedState = other._sharedState; + _hasFuture = other._hasFuture; + _sharedState->attachPromise(); + } + Promise& operator=(const Promise& other) { + if (this == &other) { + return *this; + } + this->~Promise(); + _sharedState = other._sharedState; + _hasFuture = other._hasFuture; + _sharedState->attachPromise(); + return *this; + } + + Promise(Promise&& other) + : _sharedState(other._sharedState), _hasFuture(other._hasFuture) { + other._sharedState = nullptr; + other._hasFuture = false; + } + Promise& operator=(Promise&& other) { + std::swap(_sharedState, other._sharedState); + std::swap(_hasFuture, other._hasFuture); + return *this; + } + + public: + Future getFuture() { + logicAssert(valid(), "Promise is broken"); + logicAssert(!_hasFuture, "Promise already has a future"); + _hasFuture = true; + return Future(_sharedState); + } + bool valid() const { return _sharedState != nullptr; } + // make the continuation back to origin context + Promise& checkout() { + if (_sharedState) { + _sharedState->checkout(); + } + return *this; + } + Promise& forceSched() { + if (_sharedState) { + _sharedState->setForceSched(); + } + return *this; + } + + public: + void setException(std::exception_ptr error) { + logicAssert(valid(), "Promise is broken"); + _sharedState->setResult(Try(error)); + } + void setValue(value_type&& v) requires(!std::is_void_v) { + logicAssert(valid(), "Promise is broken"); + _sharedState->setResult(Try(std::forward(v))); + } + void setValue(Try&& t) { + logicAssert(valid(), "Promise is broken"); + _sharedState->setResult(std::move(t)); + } + + void setValue() requires(std::is_void_v) { + logicAssert(valid(), "Promise is broken"); + _sharedState->setResult(Try(Unit())); + } + + private : FutureState* _sharedState = nullptr; + bool _hasFuture = false; +}; + +} // namespace async_simple + +#endif // ASYNC_SIMPLE_PROMISE_H diff --git a/thirdparty/async_simple/async_simple/Traits.h b/include/ylt/thirdparty/async_simple/Traits.h similarity index 69% rename from thirdparty/async_simple/async_simple/Traits.h rename to include/ylt/thirdparty/async_simple/Traits.h index 60b32a09..15322fbf 100644 --- a/thirdparty/async_simple/async_simple/Traits.h +++ b/include/ylt/thirdparty/async_simple/Traits.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Alibaba Group Holding Limited; + * Copyright (c) 2023, Alibaba Group Holding Limited; * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ #define ASYNC_SIMPLE_TRAITS_H #include + #include "async_simple/Common.h" #include "async_simple/Try.h" #include "async_simple/Unit.h" @@ -28,40 +29,40 @@ class Future; template struct IsFuture : std::false_type { - using Inner = T; + using Inner = T; }; template struct IsFuture> : std::true_type { - using Inner = T; + using Inner = T; }; template struct TryCallableResult { - using Result = std::invoke_result_t&&>; - using ReturnsFuture = IsFuture; - static constexpr bool isTry = true; + using Result = std::invoke_result_t&&>; + using ReturnsFuture = IsFuture; + static constexpr bool isTry = true; }; template struct ValueCallableResult { - using Result = std::invoke_result_t; - using ReturnsFuture = IsFuture; - static constexpr bool isTry = false; + using Result = std::invoke_result_t; + using ReturnsFuture = IsFuture; + static constexpr bool isTry = false; }; template struct ValueCallableResult { - using Result = std::invoke_result_t; - using ReturnsFuture = IsFuture; - static constexpr bool isTry = false; + using Result = std::invoke_result_t; + using ReturnsFuture = IsFuture; + static constexpr bool isTry = false; }; namespace detail { template struct remove_cvref { - using type = - typename std::remove_cv::type>::type; + using type = + typename std::remove_cv::type>::type; }; template using remove_cvref_t = typename remove_cvref::type; diff --git a/thirdparty/async_simple/async_simple/Try.h b/include/ylt/thirdparty/async_simple/Try.h similarity index 100% rename from thirdparty/async_simple/async_simple/Try.h rename to include/ylt/thirdparty/async_simple/Try.h diff --git a/thirdparty/async_simple/async_simple/Unit.h b/include/ylt/thirdparty/async_simple/Unit.h similarity index 83% rename from thirdparty/async_simple/async_simple/Unit.h rename to include/ylt/thirdparty/async_simple/Unit.h index 4217282d..f623c9ee 100644 --- a/thirdparty/async_simple/async_simple/Unit.h +++ b/include/ylt/thirdparty/async_simple/Unit.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Alibaba Group Holding Limited; + * Copyright (c) 2023, Alibaba Group Holding Limited; * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ #define ASYNC_SIMPLE_UNIT_H #include + #include "async_simple/Common.h" #include "async_simple/Try.h" @@ -27,8 +28,8 @@ namespace async_simple { // // User shouldn't use this directly. struct Unit { - constexpr bool operator==(const Unit&) const { return true; } - constexpr bool operator!=(const Unit&) const { return false; } + constexpr bool operator==(const Unit&) const { return true; } + constexpr bool operator!=(const Unit&) const { return false; } }; } // namespace async_simple diff --git a/include/ylt/thirdparty/async_simple/coro/Collect.h b/include/ylt/thirdparty/async_simple/coro/Collect.h new file mode 100644 index 00000000..fb42de3d --- /dev/null +++ b/include/ylt/thirdparty/async_simple/coro/Collect.h @@ -0,0 +1,589 @@ +/* + * Copyright (c) 2023, Alibaba Group Holding Limited; + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef ASYNC_SIMPLE_CORO_COLLECT_H +#define ASYNC_SIMPLE_CORO_COLLECT_H + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "async_simple/Common.h" +#include "async_simple/Try.h" +#include "async_simple/coro/CountEvent.h" +#include "async_simple/coro/Lazy.h" +#include "async_simple/experimental/coroutine.h" + +namespace async_simple { +namespace coro { + +// collectAll types +// auto [x, y] = co_await collectAll(IntLazy, FloatLazy); +// auto [x, y] = co_await collectAllPara(IntLazy, FloatLazy); +// std::vector> = co_await collectAll(std::vector); +// std::vector> = co_await collectAllPara(std::vector); +// std::vector> = co_await collectAllWindowed(maxConcurrency, yield, +// std::vector); std::vector> = co_await +// collectAllWindowedPara(maxConcurrency, yield, std::vector); + +namespace detail { + +template +struct CollectAnyResult { + CollectAnyResult() : _idx(static_cast(-1)), _value() {} + CollectAnyResult(size_t idx, std::add_rvalue_reference_t value) requires( + !std::is_void_v) + : _idx(idx), _value(std::move(value)) {} + + CollectAnyResult(const CollectAnyResult&) = delete; + CollectAnyResult& operator=(const CollectAnyResult&) = delete; + CollectAnyResult(CollectAnyResult&& other) + : _idx(std::move(other._idx)), _value(std::move(other._value)) { + other._idx = static_cast(-1); + } + + size_t _idx; + Try _value; + + size_t index() const { return _idx; } + + bool hasError() const { return _value.hasError(); } + // Require hasError() == true. Otherwise it is UB to call + // this method. + std::exception_ptr getException() const { return _value.getException(); } + + // Require hasError() == false. Otherwise it is UB to call + // value() method. +#if __cpp_explicit_this_parameter >= 202110L + template + auto&& value(this Self&& self) { + return std::forward(self)._value.value(); + } +#else + const T& value() const& { return _value.value(); } + T& value() & { return _value.value(); } + T&& value() && { return std::move(_value).value(); } + const T&& value() const&& { return std::move(_value).value(); } +#endif +}; + +template +struct CollectAnyAwaiter { + using ValueType = typename LazyType::ValueType; + using ResultType = CollectAnyResult; + + CollectAnyAwaiter(std::vector&& input) + : _input(std::move(input)), _result(nullptr) {} + + CollectAnyAwaiter(const CollectAnyAwaiter&) = delete; + CollectAnyAwaiter& operator=(const CollectAnyAwaiter&) = delete; + CollectAnyAwaiter(CollectAnyAwaiter&& other) + : _input(std::move(other._input)), _result(std::move(other._result)) {} + + bool await_ready() const noexcept { + return _input.empty() || + (_result && _result->_idx != static_cast(-1)); + } + + void await_suspend(std::coroutine_handle<> continuation) { + auto promise_type = std::coroutine_handle::from_address( + continuation.address()) + .promise(); + auto executor = promise_type._executor; + // we should take care of input's life-time after resume. + std::vector input(std::move(_input)); + // Make local copies to shared_ptr to avoid deleting objects too early + // if any coroutine finishes before this function. + auto result = std::make_shared(); + auto event = std::make_shared(input.size()); + + _result = result; + for (size_t i = 0; + i < input.size() && (result->_idx == static_cast(-1)); ++i) { + if (!input[i]._coro.promise()._executor) { + input[i]._coro.promise()._executor = executor; + } + + input[i].start([i = i, size = input.size(), r = result, c = continuation, + e = event](Try&& result) mutable { + assert(e != nullptr); + auto count = e->downCount(); + if (count == size + 1) { + r->_idx = i; + r->_value = std::move(result); + c.resume(); + } + }); + } // end for + } + auto await_resume() { + assert(_result != nullptr); + return std::move(*_result); + } + + std::vector _input; + std::shared_ptr _result; +}; + +template