diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 1538acd..4df7510 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,3 +1,5 @@ +# TODO: update devcontainer with vcpkg manifest + # ubuntu-22.04 by default ARG VARIANT="jammy" FROM mcr.microsoft.com/vscode/devcontainers/cpp:0-${VARIANT} diff --git a/.devcontainer/README.md b/.devcontainer/README.md new file mode 100644 index 0000000..b44ff99 --- /dev/null +++ b/.devcontainer/README.md @@ -0,0 +1 @@ +# todo: write readme on using devcontainer with dev-release \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 1521ca6..53d56ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,31 +2,34 @@ cmake_minimum_required(VERSION 3.8) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) - + project(blah2) include(CMakePrintHelpers) include(CTest) find_package(Threads REQUIRED) find_package(asio CONFIG REQUIRED) -find_package(RapidJSON REQUIRED) +find_path(RAPIDJSON_INCLUDE_DIRS "rapidjson/allocators.h") find_package(ryml CONFIG REQUIRED) -find_package(httplib REQUIRED) -find_package(Armadillo REQUIRED) +find_package(httplib CONFIG REQUIRED) +find_package(Armadillo CONFIG REQUIRED) find_package(Catch2 CONFIG REQUIRED) -# TODO: When release CI is finished, don't use these dirs, install target should go to prod +# TODO: when release CI is finished, don't use these dirs, install target should go to prod SET (PROJECT_ROOT "${PROJECT_SOURCE_DIR}") SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_ROOT}/bin") SET (PROJECT_BINARY_TEST_DIR "${PROJECT_ROOT}/bin/test") +SET (PROJECT_BINARY_TEST_UNIT_DIR "${PROJECT_BINARY_TEST_DIR}/unit") +SET (PROJECT_BINARY_TEST_UNIT_DIR "${PROJECT_BINARY_TEST_DIR}/functional") +SET (PROJECT_BINARY_TEST_UNIT_DIR "${PROJECT_BINARY_TEST_DIR}/comparison") MESSAGE ("Binary path: ${PROJECT_BINARY_DIR}") MESSAGE ("Binary test path: ${PROJECT_BINARY_TEST_DIR}") -# Include from top-level src dir +# include from top-level src dir include_directories(src) -# TODO: Create FindSdrplay.cmake for this +# TODO: create FindSdrplay.cmake for this add_library(sdrplay /usr/local/include/sdrplay_api.h) set_target_properties(sdrplay PROPERTIES LINKER_LANGUAGE C) target_link_libraries(sdrplay PUBLIC /usr/local/lib/libsdrplay_api.so.3.07) @@ -52,7 +55,6 @@ add_executable(blah2 target_link_libraries(blah2 PRIVATE Threads::Threads - rapidjson asio::asio ryml::ryml httplib::httplib @@ -61,6 +63,7 @@ target_link_libraries(blah2 PRIVATE fftw3_threads sdrplay ) +target_include_directories(blah2 PRIVATE RAPIDJSON_INCLUDE_DIRS "rapidjson/allocators.h") # unit tests add_executable(testAmbiguity diff --git a/CMakePresets.json b/CMakePresets.json index b4dabe9..38e2808 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -1,145 +1,145 @@ { - "version": 3, - "cmakeMinimumRequired": { - "major": 3, - "minor": 21, - "patch": 0 - }, - "configurePresets": [ - { - "name": "cmake-pedantic", - "hidden": true, - "warnings": { - "dev": true, - "deprecated": true, - "unusedCli": true, - "systemVars": false - }, - "errors": { - "dev": true, - "deprecated": true - } - }, - { - "name": "cppcheck", - "hidden": true, - "cacheVariables": { - "CMAKE_CXX_CPPCHECK": "cppcheck;--inline-suppr" - } - }, - { - "name": "clang-tidy", - "hidden": true, - "cacheVariables": { - "CMAKE_CXX_CLANG_TIDY": "clang-tidy", - "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" - } - }, - { - "name": "ci-std", - "description": "This preset makes sure the project actually builds with at least the specified standard", - "hidden": true, - "cacheVariables": { - "CMAKE_CXX_EXTENSIONS": "OFF", - "CMAKE_CXX_STANDARD": "20", - "CMAKE_CXX_STANDARD_REQUIRED": "ON" - } - }, - { - "name": "ci-vcpkg", - "hidden": true, - "description": "Bootstrap the toolchain with vcpkg installed paths", - "toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" - }, - { - "name": "ci-build", - "binaryDir": "${sourceDir}/build/${presetName}", - "inherits": ["cmake-pedantic"], - "hidden": true - }, - { - "name": "ci-unix", - "generator": "Unix Makefiles", - "hidden": true, - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Linux" - }, - "inherits": [ - "ci-std", - "ci-build", - "ci-vcpkg" - ] - }, - { - "name": "ci-release", - "hidden": true, - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Release" - } - }, - { - "name": "ci-debug", - "hidden": true, - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug" - } - }, - { - "name": "dev-unix-release", - "installDir": "$env{HOME}/.local", - "inherits": [ - "ci-unix", - "ci-release" - ] - }, - { - "name": "dev-unix-debug", - "inherits": [ - "ci-unix", - "ci-debug" - ] - }, - { - "name": "dev-unix-release-sa", - "inherits": [ - "ci-unix", - "ci-release", - "clang-tidy" - ] - } - ], - "buildPresets": [ - { - "name": "dev-unix-debug", - "configurePreset": "dev-unix-debug", - "configuration": "Debug", - "jobs": 4 - }, - { - "name": "dev-unix-release", - "configurePreset": "dev-unix-release", - "configuration": "Release", - "jobs": 4 - }, - { - "name": "dev-unix-release-sa", - "configurePreset": "dev-unix-release-sa", - "configuration": "Release", - "jobs": 4 - } - ], - "testPresets": [ - { - "name": "test-all-unix-release", - "configurePreset": "dev-unix-release", - "output": { - "outputOnFailure": true - }, - "execution": { - "jobs": 1 - } - } - ] -} + "version": 3, + "cmakeMinimumRequired": { + "major": 3, + "minor": 21, + "patch": 0 + }, + "configurePresets": [ + { + "name": "cmake-pedantic", + "hidden": true, + "warnings": { + "dev": true, + "deprecated": true, + "unusedCli": true, + "systemVars": false + }, + "errors": { + "dev": true, + "deprecated": true + } + }, + { + "name": "cppcheck", + "hidden": true, + "cacheVariables": { + "CMAKE_CXX_CPPCHECK": "cppcheck;--inline-suppr" + } + }, + { + "name": "clang-tidy", + "hidden": true, + "cacheVariables": { + "CMAKE_CXX_CLANG_TIDY": "clang-tidy", + "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" + } + }, + { + "name": "ci-std", + "description": "This preset makes sure the project actually builds with at least the specified standard", + "hidden": true, + "cacheVariables": { + "CMAKE_CXX_EXTENSIONS": "OFF", + "CMAKE_CXX_STANDARD": "20", + "CMAKE_CXX_STANDARD_REQUIRED": "ON" + } + }, + { + "name": "ci-vcpkg", + "hidden": true, + "description": "Bootstrap the toolchain with vcpkg installed paths", + "toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" + }, + { + "name": "ci-build", + "binaryDir": "${sourceDir}/build/${presetName}", + "inherits": ["cmake-pedantic"], + "hidden": true + }, + { + "name": "ci-unix", + "generator": "Unix Makefiles", + "hidden": true, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" + }, + "inherits": [ + "ci-std", + "ci-build", + "ci-vcpkg" + ] + }, + { + "name": "ci-release", + "hidden": true, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + }, + { + "name": "ci-debug", + "hidden": true, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "dev-debug", + "inherits": [ + "ci-unix", + "ci-debug" + ] + }, + { + "name": "dev-release", + "inherits": [ + "ci-unix", + "ci-release", + "clang-tidy" + ] + }, + { + "name": "prod-release", + "installDir": "$env{HOME}/.local", + "inherits": [ + "ci-unix", + "ci-release" + ] + } + ], + "buildPresets": [ + { + "name": "dev-debug", + "configurePreset": "dev-debug", + "configuration": "Debug", + "jobs": 4 + }, + { + "name": "dev-release", + "configurePreset": "dev-release", + "configuration": "Release", + "jobs": 4 + }, + { + "name": "prod-release", + "configurePreset": "prod-release", + "configuration": "Release", + "jobs": 4 + } + ], + "testPresets": [ + { + "name": "test-all-unix-release", + "configurePreset": "prod-release", + "output": { + "outputOnFailure": true + }, + "execution": { + "jobs": 1 + } + } + ] +} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 4631ef5..0a8e395 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,23 @@ FROM ubuntu:22.04 as blah2_env -MAINTAINER 30hours +LABEL maintainer="30hours " -WORKDIR blah2 +WORKDIR /blah2 ADD lib lib -RUN ls -lah && pwd -RUN apt-get update -RUN apt-get install -y g++ make cmake libfftw3-dev liblapack-dev libopenblas-dev xz-utils libudev-dev libusb-1.0.0-dev sudo systemd doxygen graphviz -RUN cd lib && tar xf armadillo-12.0.1.tar.xz && cd armadillo-12.0.1 && cmake . && make install +RUN apt-get update \ + && apt-get install -y g++ make cmake git curl zip unzip doxygen graphviz \ + libfftw3-dev pkg-config gfortran \ + && apt-get autoremove -y \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* +# install dependencies from vcpkg +RUN git clone https://github.com/microsoft/vcpkg /opt/vcpkg \ + && /opt/vcpkg/bootstrap-vcpkg.sh +ENV PATH="/opt/vcpkg:${PATH}" VCPKG_ROOT=/opt/vcpkg +RUN cd /blah2/lib && vcpkg integrate install \ + && vcpkg install --clean-after-build + +# install SDRplay API RUN chmod +x /blah2/lib/sdrplay-3.0.7/SDRplay_RSP_API-Linux-3.07.1.run \ && /blah2/lib/sdrplay-3.0.7/SDRplay_RSP_API-Linux-3.07.1.run --tar -xvf -C /blah2/lib/sdrplay-3.0.7 \ && cp /blah2/lib/sdrplay-3.0.7/x86_64/libsdrplay_api.so.3.07 /usr/local/lib/libsdrplay_api.so \ @@ -17,9 +27,12 @@ RUN chmod +x /blah2/lib/sdrplay-3.0.7/SDRplay_RSP_API-Linux-3.07.1.run \ && ldconfig FROM blah2_env as blah2 -MAINTAINER 30hours +LABEL maintainer="30hours " -ADD . . -RUN ls -lah /usr/local/include -RUN rm -rf build && mkdir -p build && cd build && cmake .. && make +ADD src src +ADD test test +ADD CMakeLists.txt CMakePresets.json Doxyfile /blah2/ +RUN mkdir -p build && cd build && cmake -S . --preset prod-release \ + -DCMAKE_PREFIX_PATH=/blah2/lib/vcpkg_installed/x64-linux/share .. \ + && cd prod-release && make RUN chmod +x bin/blah2 diff --git a/api/server.js b/api/server.js index 5cc4a66..eae752d 100644 --- a/api/server.js +++ b/api/server.js @@ -2,10 +2,10 @@ const express = require('express'); const dgram = require('dgram'); const net = require("net"); -var data_map = require('./stash/maxhold.js'); -var data_detection = require('./stash/detection.js'); -var data_iqdata = require('./stash/iqdata.js'); -var data_timing = require('./stash/timing.js'); +var stash_map = require('./stash/maxhold.js'); +var stash_detection = require('./stash/detection.js'); +var stash_iqdata = require('./stash/iqdata.js'); +var stash_timing = require('./stash/timing.js'); // constants const PORT = 3000; @@ -17,6 +17,12 @@ var timestamp = ''; var timing = ''; var iqdata = ''; var data = ''; +var data_map; +var data_detection; +var data_tracker; +var data_timestamp; +var data_timing; +var data_iqdata; var capture = false; // api server @@ -53,16 +59,16 @@ app.get('/api/iqdata', (req, res) => { // stash API app.get('/stash/map', (req, res) => { - res.send(data_map.get_data_map()); + res.send(stash_map.get_data_map()); }); app.get('/stash/detection', (req, res) => { - res.send(data_detection.get_data_detection()); + res.send(stash_detection.get_data_detection()); }); app.get('/stash/iqdata', (req, res) => { - res.send(data_iqdata.get_data_iqdata()); + res.send(stash_iqdata.get_data_iqdata()); }); app.get('/stash/timing', (req, res) => { - res.send(data_timing.get_data_timing()); + res.send(stash_timing.get_data_timing()); }); // read state of capture @@ -82,11 +88,11 @@ app.listen(PORT, HOST, () => { const server_map = net.createServer((socket)=>{ socket.write("Hello From Server!") socket.on("data",(msg)=>{ - data = data + msg.toString(); - if (data.slice(-1) === "}") + data_map = data_map + msg.toString(); + if (data_map.slice(-1) === "}") { - map = data; - data = ''; + map = data_map; + data_map = ''; } }); socket.on("close",()=>{ @@ -99,11 +105,11 @@ server_map.listen(3001); const server_detection = net.createServer((socket)=>{ socket.write("Hello From Server!") socket.on("data",(msg)=>{ - data = data + msg.toString(); - if (data.slice(-1) === "}") + data_detection = data_detection + msg.toString(); + if (data_detection.slice(-1) === "}") { - detection = data; - data = ''; + detection = data_detection; + data_detection = ''; } }); socket.on("close",()=>{ @@ -116,11 +122,11 @@ server_detection.listen(3002); const server_tracker = net.createServer((socket)=>{ socket.write("Hello From Server!") socket.on("data",(msg)=>{ - data = data + msg.toString(); - if (data.slice(-1) === "}") + data_tracker = data_tracker + msg.toString(); + if (data_tracker.slice(-1) === "}") { - track = data; - data = ''; + track = data_tracker; + data_tracker = ''; } }); socket.on("close",()=>{ @@ -133,9 +139,9 @@ server_tracker.listen(3003); const server_timestamp = net.createServer((socket)=>{ socket.write("Hello From Server!") socket.on("data",(msg)=>{ - data = data + msg.toString(); - timestamp = data; - data = ''; + data_timestamp = data_timestamp + msg.toString(); + timestamp = data_timestamp; + data_timestamp = ''; }); socket.on("close",()=>{ console.log("Connection closed."); @@ -147,11 +153,11 @@ server_timestamp.listen(4000); const server_timing = net.createServer((socket)=>{ socket.write("Hello From Server!") socket.on("data",(msg)=>{ - data = data + msg.toString(); - if (data.slice(-1) === "}") + data_timing = data_timing + msg.toString(); + if (data_timing.slice(-1) === "}") { - timing = data; - data = ''; + timing = data_timing; + data_timing = ''; } }); socket.on("close",()=>{ @@ -164,11 +170,11 @@ server_timing.listen(4001); const server_iqdata = net.createServer((socket)=>{ socket.write("Hello From Server!") socket.on("data",(msg)=>{ - data = data + msg.toString(); - if (data.slice(-1) === "}") + data_iqdata = data_iqdata + msg.toString(); + if (data_iqdata.slice(-1) === "}") { - iqdata = data; - data = ''; + iqdata = data_iqdata; + data_iqdata = ''; } }); socket.on("close",()=>{ diff --git a/api/stash/detection.js b/api/stash/detection.js index 2d7d4a3..4d7846e 100644 --- a/api/stash/detection.js +++ b/api/stash/detection.js @@ -1,6 +1,6 @@ const http = require('http'); -var nCpi = 100; +var time = 300; var map = []; var timestamp = []; var delay = []; @@ -38,8 +38,17 @@ function update_data() { try { detection = JSON.parse(body_map); map.push(detection); - if (map.length > nCpi) { - map.shift(); + for (i = 0; i < map.length; i++) + { + console.log((ts - map[i].timestamp)/1000); + if ((ts - map[i].timestamp)/1000 > time) + { + map.shift(); + } + else + { + break; + } } delay = []; doppler = []; diff --git a/docker-compose.yml b/docker-compose.yml index 7d71957..f1fc340 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,11 +15,9 @@ services: depends_on: - blah2_api volumes: - - /dev/shm:/dev/shm - - /run/systemd/system:/run/systemd/system - - /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket - - ~/blah2/replay:/blah2/replay - ./config:/blah2/config + - /opt/blah2/save:/blah2/save + - /dev/shm:/dev/shm network_mode: host privileged: true command: > diff --git a/lib/armadillo-12.0.1.tar.xz b/lib/armadillo-12.0.1.tar.xz deleted file mode 100644 index 2ab75c6..0000000 Binary files a/lib/armadillo-12.0.1.tar.xz and /dev/null differ diff --git a/lib/asio-1.26.0/asio.hpp b/lib/asio-1.26.0/asio.hpp deleted file mode 100644 index 36fa9b2..0000000 --- a/lib/asio-1.26.0/asio.hpp +++ /dev/null @@ -1,212 +0,0 @@ -// -// asio.hpp -// ~~~~~~~~ -// -// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_HPP -#define ASIO_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/any_completion_executor.hpp" -#include "asio/any_completion_handler.hpp" -#include "asio/any_io_executor.hpp" -#include "asio/append.hpp" -#include "asio/as_tuple.hpp" -#include "asio/associated_allocator.hpp" -#include "asio/associated_executor.hpp" -#include "asio/associated_cancellation_slot.hpp" -#include "asio/associator.hpp" -#include "asio/async_result.hpp" -#include "asio/awaitable.hpp" -#include "asio/basic_datagram_socket.hpp" -#include "asio/basic_deadline_timer.hpp" -#include "asio/basic_file.hpp" -#include "asio/basic_io_object.hpp" -#include "asio/basic_random_access_file.hpp" -#include "asio/basic_raw_socket.hpp" -#include "asio/basic_readable_pipe.hpp" -#include "asio/basic_seq_packet_socket.hpp" -#include "asio/basic_serial_port.hpp" -#include "asio/basic_signal_set.hpp" -#include "asio/basic_socket.hpp" -#include "asio/basic_socket_acceptor.hpp" -#include "asio/basic_socket_iostream.hpp" -#include "asio/basic_socket_streambuf.hpp" -#include "asio/basic_stream_file.hpp" -#include "asio/basic_stream_socket.hpp" -#include "asio/basic_streambuf.hpp" -#include "asio/basic_waitable_timer.hpp" -#include "asio/basic_writable_pipe.hpp" -#include "asio/bind_allocator.hpp" -#include "asio/bind_cancellation_slot.hpp" -#include "asio/bind_executor.hpp" -#include "asio/buffer.hpp" -#include "asio/buffer_registration.hpp" -#include "asio/buffered_read_stream_fwd.hpp" -#include "asio/buffered_read_stream.hpp" -#include "asio/buffered_stream_fwd.hpp" -#include "asio/buffered_stream.hpp" -#include "asio/buffered_write_stream_fwd.hpp" -#include "asio/buffered_write_stream.hpp" -#include "asio/buffers_iterator.hpp" -#include "asio/cancellation_signal.hpp" -#include "asio/cancellation_state.hpp" -#include "asio/cancellation_type.hpp" -#include "asio/co_spawn.hpp" -#include "asio/completion_condition.hpp" -#include "asio/compose.hpp" -#include "asio/connect.hpp" -#include "asio/connect_pipe.hpp" -#include "asio/consign.hpp" -#include "asio/coroutine.hpp" -#include "asio/deadline_timer.hpp" -#include "asio/defer.hpp" -#include "asio/deferred.hpp" -#include "asio/detached.hpp" -#include "asio/dispatch.hpp" -#include "asio/error.hpp" -#include "asio/error_code.hpp" -#include "asio/execution.hpp" -#include "asio/execution/allocator.hpp" -#include "asio/execution/any_executor.hpp" -#include "asio/execution/blocking.hpp" -#include "asio/execution/blocking_adaptation.hpp" -#include "asio/execution/bulk_execute.hpp" -#include "asio/execution/bulk_guarantee.hpp" -#include "asio/execution/connect.hpp" -#include "asio/execution/context.hpp" -#include "asio/execution/context_as.hpp" -#include "asio/execution/execute.hpp" -#include "asio/execution/executor.hpp" -#include "asio/execution/invocable_archetype.hpp" -#include "asio/execution/mapping.hpp" -#include "asio/execution/occupancy.hpp" -#include "asio/execution/operation_state.hpp" -#include "asio/execution/outstanding_work.hpp" -#include "asio/execution/prefer_only.hpp" -#include "asio/execution/receiver.hpp" -#include "asio/execution/receiver_invocation_error.hpp" -#include "asio/execution/relationship.hpp" -#include "asio/execution/schedule.hpp" -#include "asio/execution/scheduler.hpp" -#include "asio/execution/sender.hpp" -#include "asio/execution/set_done.hpp" -#include "asio/execution/set_error.hpp" -#include "asio/execution/set_value.hpp" -#include "asio/execution/start.hpp" -#include "asio/execution_context.hpp" -#include "asio/executor.hpp" -#include "asio/executor_work_guard.hpp" -#include "asio/file_base.hpp" -#include "asio/generic/basic_endpoint.hpp" -#include "asio/generic/datagram_protocol.hpp" -#include "asio/generic/raw_protocol.hpp" -#include "asio/generic/seq_packet_protocol.hpp" -#include "asio/generic/stream_protocol.hpp" -#include "asio/handler_alloc_hook.hpp" -#include "asio/handler_continuation_hook.hpp" -#include "asio/handler_invoke_hook.hpp" -#include "asio/high_resolution_timer.hpp" -#include "asio/io_context.hpp" -#include "asio/io_context_strand.hpp" -#include "asio/io_service.hpp" -#include "asio/io_service_strand.hpp" -#include "asio/ip/address.hpp" -#include "asio/ip/address_v4.hpp" -#include "asio/ip/address_v4_iterator.hpp" -#include "asio/ip/address_v4_range.hpp" -#include "asio/ip/address_v6.hpp" -#include "asio/ip/address_v6_iterator.hpp" -#include "asio/ip/address_v6_range.hpp" -#include "asio/ip/network_v4.hpp" -#include "asio/ip/network_v6.hpp" -#include "asio/ip/bad_address_cast.hpp" -#include "asio/ip/basic_endpoint.hpp" -#include "asio/ip/basic_resolver.hpp" -#include "asio/ip/basic_resolver_entry.hpp" -#include "asio/ip/basic_resolver_iterator.hpp" -#include "asio/ip/basic_resolver_query.hpp" -#include "asio/ip/host_name.hpp" -#include "asio/ip/icmp.hpp" -#include "asio/ip/multicast.hpp" -#include "asio/ip/resolver_base.hpp" -#include "asio/ip/resolver_query_base.hpp" -#include "asio/ip/tcp.hpp" -#include "asio/ip/udp.hpp" -#include "asio/ip/unicast.hpp" -#include "asio/ip/v6_only.hpp" -#include "asio/is_applicable_property.hpp" -#include "asio/is_contiguous_iterator.hpp" -#include "asio/is_executor.hpp" -#include "asio/is_read_buffered.hpp" -#include "asio/is_write_buffered.hpp" -#include "asio/local/basic_endpoint.hpp" -#include "asio/local/connect_pair.hpp" -#include "asio/local/datagram_protocol.hpp" -#include "asio/local/stream_protocol.hpp" -#include "asio/multiple_exceptions.hpp" -#include "asio/packaged_task.hpp" -#include "asio/placeholders.hpp" -#include "asio/posix/basic_descriptor.hpp" -#include "asio/posix/basic_stream_descriptor.hpp" -#include "asio/posix/descriptor.hpp" -#include "asio/posix/descriptor_base.hpp" -#include "asio/posix/stream_descriptor.hpp" -#include "asio/post.hpp" -#include "asio/prefer.hpp" -#include "asio/prepend.hpp" -#include "asio/query.hpp" -#include "asio/random_access_file.hpp" -#include "asio/read.hpp" -#include "asio/read_at.hpp" -#include "asio/read_until.hpp" -#include "asio/readable_pipe.hpp" -#include "asio/recycling_allocator.hpp" -#include "asio/redirect_error.hpp" -#include "asio/registered_buffer.hpp" -#include "asio/require.hpp" -#include "asio/require_concept.hpp" -#include "asio/serial_port.hpp" -#include "asio/serial_port_base.hpp" -#include "asio/signal_set.hpp" -#include "asio/socket_base.hpp" -#include "asio/static_thread_pool.hpp" -#include "asio/steady_timer.hpp" -#include "asio/strand.hpp" -#include "asio/stream_file.hpp" -#include "asio/streambuf.hpp" -#include "asio/system_context.hpp" -#include "asio/system_error.hpp" -#include "asio/system_executor.hpp" -#include "asio/system_timer.hpp" -#include "asio/this_coro.hpp" -#include "asio/thread.hpp" -#include "asio/thread_pool.hpp" -#include "asio/time_traits.hpp" -#include "asio/use_awaitable.hpp" -#include "asio/use_future.hpp" -#include "asio/uses_executor.hpp" -#include "asio/version.hpp" -#include "asio/wait_traits.hpp" -#include "asio/windows/basic_object_handle.hpp" -#include "asio/windows/basic_overlapped_handle.hpp" -#include "asio/windows/basic_random_access_handle.hpp" -#include "asio/windows/basic_stream_handle.hpp" -#include "asio/windows/object_handle.hpp" -#include "asio/windows/overlapped_handle.hpp" -#include "asio/windows/overlapped_ptr.hpp" -#include "asio/windows/random_access_handle.hpp" -#include "asio/windows/stream_handle.hpp" -#include "asio/writable_pipe.hpp" -#include "asio/write.hpp" -#include "asio/write_at.hpp" - -#endif // ASIO_HPP diff --git a/lib/asio-1.26.0/asio/any_completion_executor.hpp b/lib/asio-1.26.0/asio/any_completion_executor.hpp deleted file mode 100644 index 5fdb691..0000000 --- a/lib/asio-1.26.0/asio/any_completion_executor.hpp +++ /dev/null @@ -1,342 +0,0 @@ -// -// any_completion_executor.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_ANY_COMPLETION_EXECUTOR_HPP -#define ASIO_ANY_COMPLETION_EXECUTOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#if defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT) -# include "asio/executor.hpp" -#else // defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT) -# include "asio/execution.hpp" -#endif // defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT) - -#include "asio/detail/push_options.hpp" - -namespace asio { - -#if defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT) - -typedef executor any_completion_executor; - -#else // defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT) - -/// Polymorphic executor type for use with I/O objects. -/** - * The @c any_completion_executor type is a polymorphic executor that supports - * the set of properties required for the execution of completion handlers. It - * is defined as the execution::any_executor class template parameterised as - * follows: - * @code execution::any_executor< - * execution::prefer_only, - * execution::prefer_only - * execution::prefer_only, - * execution::prefer_only - * > @endcode - */ -class any_completion_executor : -#if defined(GENERATING_DOCUMENTATION) - public execution::any_executor<...> -#else // defined(GENERATING_DOCUMENTATION) - public execution::any_executor< - execution::prefer_only, - execution::prefer_only, - execution::prefer_only, - execution::prefer_only - > -#endif // defined(GENERATING_DOCUMENTATION) -{ -public: -#if !defined(GENERATING_DOCUMENTATION) - typedef execution::any_executor< - execution::prefer_only, - execution::prefer_only, - execution::prefer_only, - execution::prefer_only - > base_type; - - typedef void supportable_properties_type( - execution::prefer_only, - execution::prefer_only, - execution::prefer_only, - execution::prefer_only - ); -#endif // !defined(GENERATING_DOCUMENTATION) - - /// Default constructor. - ASIO_DECL any_completion_executor() ASIO_NOEXCEPT; - - /// Construct in an empty state. Equivalent effects to default constructor. - ASIO_DECL any_completion_executor(nullptr_t) ASIO_NOEXCEPT; - - /// Copy constructor. - ASIO_DECL any_completion_executor( - const any_completion_executor& e) ASIO_NOEXCEPT; - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move constructor. - ASIO_DECL any_completion_executor( - any_completion_executor&& e) ASIO_NOEXCEPT; -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Construct to point to the same target as another any_executor. -#if defined(GENERATING_DOCUMENTATION) - template - any_completion_executor( - execution::any_executor e); -#else // defined(GENERATING_DOCUMENTATION) - template - any_completion_executor(OtherAnyExecutor e, - typename constraint< - conditional< - !is_same::value - && is_base_of::value, - typename execution::detail::supportable_properties< - 0, supportable_properties_type>::template - is_valid_target, - false_type - >::type::value - >::type = 0) - : base_type(ASIO_MOVE_CAST(OtherAnyExecutor)(e)) - { - } -#endif // defined(GENERATING_DOCUMENTATION) - - /// Construct to point to the same target as another any_executor. -#if defined(GENERATING_DOCUMENTATION) - template - any_completion_executor(std::nothrow_t, - execution::any_executor e); -#else // defined(GENERATING_DOCUMENTATION) - template - any_completion_executor(std::nothrow_t, OtherAnyExecutor e, - typename constraint< - conditional< - !is_same::value - && is_base_of::value, - typename execution::detail::supportable_properties< - 0, supportable_properties_type>::template - is_valid_target, - false_type - >::type::value - >::type = 0) ASIO_NOEXCEPT - : base_type(std::nothrow, ASIO_MOVE_CAST(OtherAnyExecutor)(e)) - { - } -#endif // defined(GENERATING_DOCUMENTATION) - - /// Construct to point to the same target as another any_executor. - ASIO_DECL any_completion_executor(std::nothrow_t, - const any_completion_executor& e) ASIO_NOEXCEPT; - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Construct to point to the same target as another any_executor. - ASIO_DECL any_completion_executor(std::nothrow_t, - any_completion_executor&& e) ASIO_NOEXCEPT; -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Construct a polymorphic wrapper for the specified executor. -#if defined(GENERATING_DOCUMENTATION) - template - any_completion_executor(Executor e); -#else // defined(GENERATING_DOCUMENTATION) - template - any_completion_executor(Executor e, - typename constraint< - conditional< - !is_same::value - && !is_base_of::value, - execution::detail::is_valid_target_executor< - Executor, supportable_properties_type>, - false_type - >::type::value - >::type = 0) - : base_type(ASIO_MOVE_CAST(Executor)(e)) - { - } -#endif // defined(GENERATING_DOCUMENTATION) - - /// Construct a polymorphic wrapper for the specified executor. -#if defined(GENERATING_DOCUMENTATION) - template - any_completion_executor(std::nothrow_t, Executor e); -#else // defined(GENERATING_DOCUMENTATION) - template - any_completion_executor(std::nothrow_t, Executor e, - typename constraint< - conditional< - !is_same::value - && !is_base_of::value, - execution::detail::is_valid_target_executor< - Executor, supportable_properties_type>, - false_type - >::type::value - >::type = 0) ASIO_NOEXCEPT - : base_type(std::nothrow, ASIO_MOVE_CAST(Executor)(e)) - { - } -#endif // defined(GENERATING_DOCUMENTATION) - - /// Assignment operator. - ASIO_DECL any_completion_executor& operator=( - const any_completion_executor& e) ASIO_NOEXCEPT; - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move assignment operator. - ASIO_DECL any_completion_executor& operator=( - any_completion_executor&& e) ASIO_NOEXCEPT; -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Assignment operator that sets the polymorphic wrapper to the empty state. - ASIO_DECL any_completion_executor& operator=(nullptr_t); - - /// Destructor. - ASIO_DECL ~any_completion_executor(); - - /// Swap targets with another polymorphic wrapper. - ASIO_DECL void swap(any_completion_executor& other) ASIO_NOEXCEPT; - - /// Obtain a polymorphic wrapper with the specified property. - /** - * Do not call this function directly. It is intended for use with the - * asio::require and asio::prefer customisation points. - * - * For example: - * @code any_completion_executor ex = ...; - * auto ex2 = asio::require(ex, execution::relationship.fork); @endcode - */ - template - any_completion_executor require(const Property& p, - typename constraint< - traits::require_member::is_valid - >::type = 0) const - { - return static_cast(*this).require(p); - } - - /// Obtain a polymorphic wrapper with the specified property. - /** - * Do not call this function directly. It is intended for use with the - * asio::prefer customisation point. - * - * For example: - * @code any_completion_executor ex = ...; - * auto ex2 = asio::prefer(ex, execution::relationship.fork); @endcode - */ - template - any_completion_executor prefer(const Property& p, - typename constraint< - traits::prefer_member::is_valid - >::type = 0) const - { - return static_cast(*this).prefer(p); - } -}; - -#if !defined(GENERATING_DOCUMENTATION) - -template <> -ASIO_DECL any_completion_executor any_completion_executor::prefer( - const execution::outstanding_work_t::tracked_t&, int) const; - -template <> -ASIO_DECL any_completion_executor any_completion_executor::prefer( - const execution::outstanding_work_t::untracked_t&, int) const; - -template <> -ASIO_DECL any_completion_executor any_completion_executor::prefer( - const execution::relationship_t::fork_t&, int) const; - -template <> -ASIO_DECL any_completion_executor any_completion_executor::prefer( - const execution::relationship_t::continuation_t&, int) const; - -namespace traits { - -#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT) - -template <> -struct equality_comparable -{ - static const bool is_valid = true; - static const bool is_noexcept = true; -}; - -#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT) - -#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT) - -template -struct execute_member -{ - static const bool is_valid = true; - static const bool is_noexcept = false; - typedef void result_type; -}; - -#endif // !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT) - -#if !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) - -template -struct query_member : - query_member -{ -}; - -#endif // !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) - -#if !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT) - -template -struct require_member : - require_member -{ - typedef any_completion_executor result_type; -}; - -#endif // !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT) - -#if !defined(ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT) - -template -struct prefer_member : - prefer_member -{ - typedef any_completion_executor result_type; -}; - -#endif // !defined(ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT) - -} // namespace traits - -#endif // !defined(GENERATING_DOCUMENTATION) - -#endif // defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT) - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) \ - && !defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT) -# include "asio/impl/any_completion_executor.ipp" -#endif // defined(ASIO_HEADER_ONLY) - // && !defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT) - -#endif // ASIO_ANY_COMPLETION_EXECUTOR_HPP diff --git a/lib/asio-1.26.0/asio/any_completion_handler.hpp b/lib/asio-1.26.0/asio/any_completion_handler.hpp deleted file mode 100644 index d7522bd..0000000 --- a/lib/asio-1.26.0/asio/any_completion_handler.hpp +++ /dev/null @@ -1,684 +0,0 @@ -// -// any_completion_handler.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_ANY_COMPLETION_HANDLER_HPP -#define ASIO_ANY_COMPLETION_HANDLER_HPP - -#include "asio/detail/config.hpp" - -#if (defined(ASIO_HAS_STD_TUPLE) \ - && defined(ASIO_HAS_MOVE) \ - && defined(ASIO_HAS_VARIADIC_TEMPLATES)) \ - || defined(GENERATING_DOCUMENTATION) - -#include -#include -#include -#include -#include "asio/any_completion_executor.hpp" -#include "asio/associated_allocator.hpp" -#include "asio/associated_cancellation_slot.hpp" -#include "asio/associated_executor.hpp" -#include "asio/cancellation_state.hpp" -#include "asio/recycling_allocator.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { -namespace detail { - -class any_completion_handler_impl_base -{ -public: - template - explicit any_completion_handler_impl_base(S&& slot) - : cancel_state_(ASIO_MOVE_CAST(S)(slot), enable_total_cancellation()) - { - } - - cancellation_slot get_cancellation_slot() const ASIO_NOEXCEPT - { - return cancel_state_.slot(); - } - -private: - cancellation_state cancel_state_; -}; - -template -class any_completion_handler_impl : - public any_completion_handler_impl_base -{ -public: - template - any_completion_handler_impl(S&& slot, H&& h) - : any_completion_handler_impl_base(ASIO_MOVE_CAST(S)(slot)), - handler_(ASIO_MOVE_CAST(H)(h)) - { - } - - struct uninit_deleter - { - typename std::allocator_traits< - associated_allocator_t>>::template - rebind_alloc alloc; - - void operator()(any_completion_handler_impl* ptr) - { - std::allocator_traits::deallocate(alloc, ptr, 1); - } - }; - - struct deleter - { - typename std::allocator_traits< - associated_allocator_t>>::template - rebind_alloc alloc; - - void operator()(any_completion_handler_impl* ptr) - { - std::allocator_traits::destroy(alloc, ptr); - std::allocator_traits::deallocate(alloc, ptr, 1); - } - }; - - template - static any_completion_handler_impl* create(S&& slot, H&& h) - { - uninit_deleter d{ - (get_associated_allocator)(h, - asio::recycling_allocator())}; - - std::unique_ptr uninit_ptr( - std::allocator_traits::allocate(d.alloc, 1), d); - - any_completion_handler_impl* ptr = - new (uninit_ptr.get()) any_completion_handler_impl( - ASIO_MOVE_CAST(S)(slot), ASIO_MOVE_CAST(H)(h)); - - uninit_ptr.release(); - return ptr; - } - - void destroy() - { - deleter d{ - (get_associated_allocator)(handler_, - asio::recycling_allocator())}; - - d(this); - } - - any_completion_executor executor( - const any_completion_executor& candidate) const ASIO_NOEXCEPT - { - return any_completion_executor(std::nothrow, - (get_associated_executor)(handler_, candidate)); - } - - void* allocate(std::size_t size, std::size_t align) const - { - typename std::allocator_traits< - associated_allocator_t>>::template - rebind_alloc alloc( - (get_associated_allocator)(handler_, - asio::recycling_allocator())); - - std::size_t space = size + align - 1; - unsigned char* base = - std::allocator_traits::allocate( - alloc, space + sizeof(std::ptrdiff_t)); - - void* p = base; - if (detail::align(align, size, p, space)) - { - std::ptrdiff_t off = static_cast(p) - base; - std::memcpy(static_cast(p) + size, &off, sizeof(off)); - return p; - } - - std::bad_alloc ex; - asio::detail::throw_exception(ex); - return nullptr; - } - - void deallocate(void* p, std::size_t size, std::size_t align) const - { - if (p) - { - typename std::allocator_traits< - associated_allocator_t>>::template - rebind_alloc alloc( - (get_associated_allocator)(handler_, - asio::recycling_allocator())); - - std::ptrdiff_t off; - std::memcpy(&off, static_cast(p) + size, sizeof(off)); - unsigned char* base = static_cast(p) - off; - - std::allocator_traits::deallocate( - alloc, base, size + align -1 + sizeof(std::ptrdiff_t)); - } - } - - template - void call(Args&&... args) - { - deleter d{ - (get_associated_allocator)(handler_, - asio::recycling_allocator())}; - - std::unique_ptr ptr(this, d); - Handler handler(ASIO_MOVE_CAST(Handler)(handler_)); - ptr.reset(); - - ASIO_MOVE_CAST(Handler)(handler)( - ASIO_MOVE_CAST(Args)(args)...); - } - -private: - Handler handler_; -}; - -template -class any_completion_handler_call_fn; - -template -class any_completion_handler_call_fn -{ -public: - using type = void(*)(any_completion_handler_impl_base*, Args...); - - constexpr any_completion_handler_call_fn(type fn) - : call_fn_(fn) - { - } - - void call(any_completion_handler_impl_base* impl, Args... args) const - { - call_fn_(impl, ASIO_MOVE_CAST(Args)(args)...); - } - - template - static void impl(any_completion_handler_impl_base* impl, Args... args) - { - static_cast*>(impl)->call( - ASIO_MOVE_CAST(Args)(args)...); - } - -private: - type call_fn_; -}; - -template -class any_completion_handler_call_fns; - -template -class any_completion_handler_call_fns : - public any_completion_handler_call_fn -{ -public: - using any_completion_handler_call_fn< - Signature>::any_completion_handler_call_fn; - using any_completion_handler_call_fn::call; -}; - -template -class any_completion_handler_call_fns : - public any_completion_handler_call_fn, - public any_completion_handler_call_fns -{ -public: - template - constexpr any_completion_handler_call_fns(CallFn fn, CallFns... fns) - : any_completion_handler_call_fn(fn), - any_completion_handler_call_fns(fns...) - { - } - - using any_completion_handler_call_fn::call; - using any_completion_handler_call_fns::call; -}; - -class any_completion_handler_destroy_fn -{ -public: - using type = void(*)(any_completion_handler_impl_base*); - - constexpr any_completion_handler_destroy_fn(type fn) - : destroy_fn_(fn) - { - } - - void destroy(any_completion_handler_impl_base* impl) const - { - destroy_fn_(impl); - } - - template - static void impl(any_completion_handler_impl_base* impl) - { - static_cast*>(impl)->destroy(); - } - -private: - type destroy_fn_; -}; - -class any_completion_handler_executor_fn -{ -public: - using type = any_completion_executor(*)( - any_completion_handler_impl_base*, const any_completion_executor&); - - constexpr any_completion_handler_executor_fn(type fn) - : executor_fn_(fn) - { - } - - any_completion_executor executor(any_completion_handler_impl_base* impl, - const any_completion_executor& candidate) const - { - return executor_fn_(impl, candidate); - } - - template - static any_completion_executor impl(any_completion_handler_impl_base* impl, - const any_completion_executor& candidate) - { - return static_cast*>(impl)->executor( - candidate); - } - -private: - type executor_fn_; -}; - -class any_completion_handler_allocate_fn -{ -public: - using type = void*(*)(any_completion_handler_impl_base*, - std::size_t, std::size_t); - - constexpr any_completion_handler_allocate_fn(type fn) - : allocate_fn_(fn) - { - } - - void* allocate(any_completion_handler_impl_base* impl, - std::size_t size, std::size_t align) const - { - return allocate_fn_(impl, size, align); - } - - template - static void* impl(any_completion_handler_impl_base* impl, - std::size_t size, std::size_t align) - { - return static_cast*>(impl)->allocate( - size, align); - } - -private: - type allocate_fn_; -}; - -class any_completion_handler_deallocate_fn -{ -public: - using type = void(*)(any_completion_handler_impl_base*, - void*, std::size_t, std::size_t); - - constexpr any_completion_handler_deallocate_fn(type fn) - : deallocate_fn_(fn) - { - } - - void deallocate(any_completion_handler_impl_base* impl, - void* p, std::size_t size, std::size_t align) const - { - deallocate_fn_(impl, p, size, align); - } - - template - static void impl(any_completion_handler_impl_base* impl, - void* p, std::size_t size, std::size_t align) - { - static_cast*>(impl)->deallocate( - p, size, align); - } - -private: - type deallocate_fn_; -}; - -template -class any_completion_handler_fn_table - : private any_completion_handler_destroy_fn, - private any_completion_handler_executor_fn, - private any_completion_handler_allocate_fn, - private any_completion_handler_deallocate_fn, - private any_completion_handler_call_fns -{ -public: - template - constexpr any_completion_handler_fn_table( - any_completion_handler_destroy_fn::type destroy_fn, - any_completion_handler_executor_fn::type executor_fn, - any_completion_handler_allocate_fn::type allocate_fn, - any_completion_handler_deallocate_fn::type deallocate_fn, - CallFns... call_fns) - : any_completion_handler_destroy_fn(destroy_fn), - any_completion_handler_executor_fn(executor_fn), - any_completion_handler_allocate_fn(allocate_fn), - any_completion_handler_deallocate_fn(deallocate_fn), - any_completion_handler_call_fns(call_fns...) - { - } - - using any_completion_handler_destroy_fn::destroy; - using any_completion_handler_executor_fn::executor; - using any_completion_handler_allocate_fn::allocate; - using any_completion_handler_deallocate_fn::deallocate; - using any_completion_handler_call_fns::call; -}; - -template -struct any_completion_handler_fn_table_instance -{ - static constexpr any_completion_handler_fn_table - value = any_completion_handler_fn_table( - &any_completion_handler_destroy_fn::impl, - &any_completion_handler_executor_fn::impl, - &any_completion_handler_allocate_fn::impl, - &any_completion_handler_deallocate_fn::impl, - &any_completion_handler_call_fn::template impl...); -}; - -template -constexpr any_completion_handler_fn_table -any_completion_handler_fn_table_instance::value; - -} // namespace detail - -template -class any_completion_handler; - -template -class any_completion_handler_allocator -{ -private: - template - friend class any_completion_handler; - - template - friend class any_completion_handler_allocator; - - const detail::any_completion_handler_fn_table* fn_table_; - detail::any_completion_handler_impl_base* impl_; - - constexpr any_completion_handler_allocator(int, - const any_completion_handler& h) ASIO_NOEXCEPT - : fn_table_(h.fn_table_), - impl_(h.impl_) - { - } - -public: - typedef T value_type; - - template - struct rebind - { - typedef any_completion_handler_allocator other; - }; - - template - constexpr any_completion_handler_allocator( - const any_completion_handler_allocator& a) - ASIO_NOEXCEPT - : fn_table_(a.fn_table_), - impl_(a.impl_) - { - } - - constexpr bool operator==( - const any_completion_handler_allocator& other) const ASIO_NOEXCEPT - { - return fn_table_ == other.fn_table_ && impl_ == other.impl_; - } - - constexpr bool operator!=( - const any_completion_handler_allocator& other) const ASIO_NOEXCEPT - { - return fn_table_ != other.fn_table_ || impl_ != other.impl_; - } - - T* allocate(std::size_t n) const - { - return static_cast( - fn_table_->allocate( - impl_, sizeof(T) * n, alignof(T))); - } - - void deallocate(T* p, std::size_t n) const - { - fn_table_->deallocate(impl_, p, sizeof(T) * n, alignof(T)); - } -}; - -template -class any_completion_handler_allocator -{ -private: - template - friend class any_completion_handler; - - template - friend class any_completion_handler_allocator; - - const detail::any_completion_handler_fn_table* fn_table_; - detail::any_completion_handler_impl_base* impl_; - - constexpr any_completion_handler_allocator(int, - const any_completion_handler& h) ASIO_NOEXCEPT - : fn_table_(h.fn_table_), - impl_(h.impl_) - { - } - -public: - typedef void value_type; - - template - struct rebind - { - typedef any_completion_handler_allocator other; - }; - - template - constexpr any_completion_handler_allocator( - const any_completion_handler_allocator& a) - ASIO_NOEXCEPT - : fn_table_(a.fn_table_), - impl_(a.impl_) - { - } - - constexpr bool operator==( - const any_completion_handler_allocator& other) const ASIO_NOEXCEPT - { - return fn_table_ == other.fn_table_ && impl_ == other.impl_; - } - - constexpr bool operator!=( - const any_completion_handler_allocator& other) const ASIO_NOEXCEPT - { - return fn_table_ != other.fn_table_ || impl_ != other.impl_; - } -}; - -template -class any_completion_handler -{ -private: - template - friend class any_completion_handler_allocator; - - template - friend struct associated_executor; - - const detail::any_completion_handler_fn_table* fn_table_; - detail::any_completion_handler_impl_base* impl_; - -public: - using allocator_type = any_completion_handler_allocator; - using cancellation_slot_type = cancellation_slot; - - constexpr any_completion_handler() - : fn_table_(nullptr), - impl_(nullptr) - { - } - - constexpr any_completion_handler(nullptr_t) - : fn_table_(nullptr), - impl_(nullptr) - { - } - - template ::type> - any_completion_handler(H&& h) - : fn_table_( - &detail::any_completion_handler_fn_table_instance< - Handler, Signatures...>::value), - impl_(detail::any_completion_handler_impl::create( - (get_associated_cancellation_slot)(h), ASIO_MOVE_CAST(H)(h))) - { - } - - any_completion_handler(any_completion_handler&& other) ASIO_NOEXCEPT - : fn_table_(other.fn_table_), - impl_(other.impl_) - { - other.fn_table_ = nullptr; - other.impl_ = nullptr; - } - - any_completion_handler& operator=( - any_completion_handler&& other) ASIO_NOEXCEPT - { - any_completion_handler(other).swap(*this); - return *this; - } - - any_completion_handler& operator=(nullptr_t) ASIO_NOEXCEPT - { - any_completion_handler().swap(*this); - return *this; - } - - ~any_completion_handler() - { - if (impl_) - fn_table_->destroy(impl_); - } - - constexpr explicit operator bool() const ASIO_NOEXCEPT - { - return impl_ != nullptr; - } - - constexpr bool operator!() const ASIO_NOEXCEPT - { - return impl_ == nullptr; - } - - void swap(any_completion_handler& other) ASIO_NOEXCEPT - { - std::swap(fn_table_, other.fn_table_); - std::swap(impl_, other.impl_); - } - - allocator_type get_allocator() const ASIO_NOEXCEPT - { - return allocator_type(0, *this); - } - - cancellation_slot_type get_cancellation_slot() const ASIO_NOEXCEPT - { - return impl_->get_cancellation_slot(); - } - - template - auto operator()(Args&&... args) - -> decltype(fn_table_->call(impl_, ASIO_MOVE_CAST(Args)(args)...)) - { - if (detail::any_completion_handler_impl_base* impl = impl_) - { - impl_ = nullptr; - return fn_table_->call(impl, ASIO_MOVE_CAST(Args)(args)...); - } - std::bad_function_call ex; - asio::detail::throw_exception(ex); - } - - friend constexpr bool operator==( - const any_completion_handler& a, nullptr_t) ASIO_NOEXCEPT - { - return a.impl_ == nullptr; - } - - friend constexpr bool operator==( - nullptr_t, const any_completion_handler& b) ASIO_NOEXCEPT - { - return nullptr == b.impl_; - } - - friend constexpr bool operator!=( - const any_completion_handler& a, nullptr_t) ASIO_NOEXCEPT - { - return a.impl_ != nullptr; - } - - friend constexpr bool operator!=( - nullptr_t, const any_completion_handler& b) ASIO_NOEXCEPT - { - return nullptr != b.impl_; - } -}; - -template -struct associated_executor, Candidate> -{ - using type = any_completion_executor; - - static type get(const any_completion_handler& handler, - const Candidate& candidate = Candidate()) ASIO_NOEXCEPT - { - return handler.fn_table_->executor(handler.impl_, - any_completion_executor(std::nothrow, candidate)); - } -}; - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // (defined(ASIO_HAS_STD_TUPLE) - // && defined(ASIO_HAS_MOVE) - // && defined(ASIO_HAS_VARIADIC_TEMPLATES)) - // || defined(GENERATING_DOCUMENTATION) - -#endif // ASIO_ANY_COMPLETION_HANDLER_HPP diff --git a/lib/asio-1.26.0/asio/any_io_executor.hpp b/lib/asio-1.26.0/asio/any_io_executor.hpp deleted file mode 100644 index 829b968..0000000 --- a/lib/asio-1.26.0/asio/any_io_executor.hpp +++ /dev/null @@ -1,359 +0,0 @@ -// -// any_io_executor.hpp -// ~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_ANY_IO_EXECUTOR_HPP -#define ASIO_ANY_IO_EXECUTOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#if defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT) -# include "asio/executor.hpp" -#else // defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT) -# include "asio/execution.hpp" -# include "asio/execution_context.hpp" -#endif // defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT) - -#include "asio/detail/push_options.hpp" - -namespace asio { - -#if defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT) - -typedef executor any_io_executor; - -#else // defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT) - -/// Polymorphic executor type for use with I/O objects. -/** - * The @c any_io_executor type is a polymorphic executor that supports the set - * of properties required by I/O objects. It is defined as the - * execution::any_executor class template parameterised as follows: - * @code execution::any_executor< - * execution::context_as_t, - * execution::blocking_t::never_t, - * execution::prefer_only, - * execution::prefer_only, - * execution::prefer_only, - * execution::prefer_only, - * execution::prefer_only - * > @endcode - */ -class any_io_executor : -#if defined(GENERATING_DOCUMENTATION) - public execution::any_executor<...> -#else // defined(GENERATING_DOCUMENTATION) - public execution::any_executor< - execution::context_as_t, - execution::blocking_t::never_t, - execution::prefer_only, - execution::prefer_only, - execution::prefer_only, - execution::prefer_only, - execution::prefer_only - > -#endif // defined(GENERATING_DOCUMENTATION) -{ -public: -#if !defined(GENERATING_DOCUMENTATION) - typedef execution::any_executor< - execution::context_as_t, - execution::blocking_t::never_t, - execution::prefer_only, - execution::prefer_only, - execution::prefer_only, - execution::prefer_only, - execution::prefer_only - > base_type; - - typedef void supportable_properties_type( - execution::context_as_t, - execution::blocking_t::never_t, - execution::prefer_only, - execution::prefer_only, - execution::prefer_only, - execution::prefer_only, - execution::prefer_only - ); -#endif // !defined(GENERATING_DOCUMENTATION) - - /// Default constructor. - ASIO_DECL any_io_executor() ASIO_NOEXCEPT; - - /// Construct in an empty state. Equivalent effects to default constructor. - ASIO_DECL any_io_executor(nullptr_t) ASIO_NOEXCEPT; - - /// Copy constructor. - ASIO_DECL any_io_executor(const any_io_executor& e) ASIO_NOEXCEPT; - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move constructor. - ASIO_DECL any_io_executor(any_io_executor&& e) ASIO_NOEXCEPT; -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Construct to point to the same target as another any_executor. -#if defined(GENERATING_DOCUMENTATION) - template - any_io_executor(execution::any_executor e); -#else // defined(GENERATING_DOCUMENTATION) - template - any_io_executor(OtherAnyExecutor e, - typename constraint< - conditional< - !is_same::value - && is_base_of::value, - typename execution::detail::supportable_properties< - 0, supportable_properties_type>::template - is_valid_target, - false_type - >::type::value - >::type = 0) - : base_type(ASIO_MOVE_CAST(OtherAnyExecutor)(e)) - { - } -#endif // defined(GENERATING_DOCUMENTATION) - - /// Construct to point to the same target as another any_executor. -#if defined(GENERATING_DOCUMENTATION) - template - any_io_executor(std::nothrow_t, - execution::any_executor e); -#else // defined(GENERATING_DOCUMENTATION) - template - any_io_executor(std::nothrow_t, OtherAnyExecutor e, - typename constraint< - conditional< - !is_same::value - && is_base_of::value, - typename execution::detail::supportable_properties< - 0, supportable_properties_type>::template - is_valid_target, - false_type - >::type::value - >::type = 0) ASIO_NOEXCEPT - : base_type(std::nothrow, ASIO_MOVE_CAST(OtherAnyExecutor)(e)) - { - } -#endif // defined(GENERATING_DOCUMENTATION) - - /// Construct to point to the same target as another any_executor. - ASIO_DECL any_io_executor(std::nothrow_t, - const any_io_executor& e) ASIO_NOEXCEPT; - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Construct to point to the same target as another any_executor. - ASIO_DECL any_io_executor(std::nothrow_t, - any_io_executor&& e) ASIO_NOEXCEPT; -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Construct a polymorphic wrapper for the specified executor. -#if defined(GENERATING_DOCUMENTATION) - template - any_io_executor(Executor e); -#else // defined(GENERATING_DOCUMENTATION) - template - any_io_executor(Executor e, - typename constraint< - conditional< - !is_same::value - && !is_base_of::value, - execution::detail::is_valid_target_executor< - Executor, supportable_properties_type>, - false_type - >::type::value - >::type = 0) - : base_type(ASIO_MOVE_CAST(Executor)(e)) - { - } -#endif // defined(GENERATING_DOCUMENTATION) - - /// Construct a polymorphic wrapper for the specified executor. -#if defined(GENERATING_DOCUMENTATION) - template - any_io_executor(std::nothrow_t, Executor e); -#else // defined(GENERATING_DOCUMENTATION) - template - any_io_executor(std::nothrow_t, Executor e, - typename constraint< - conditional< - !is_same::value - && !is_base_of::value, - execution::detail::is_valid_target_executor< - Executor, supportable_properties_type>, - false_type - >::type::value - >::type = 0) ASIO_NOEXCEPT - : base_type(std::nothrow, ASIO_MOVE_CAST(Executor)(e)) - { - } -#endif // defined(GENERATING_DOCUMENTATION) - - /// Assignment operator. - ASIO_DECL any_io_executor& operator=( - const any_io_executor& e) ASIO_NOEXCEPT; - -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// Move assignment operator. - ASIO_DECL any_io_executor& operator=( - any_io_executor&& e) ASIO_NOEXCEPT; -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - - /// Assignment operator that sets the polymorphic wrapper to the empty state. - ASIO_DECL any_io_executor& operator=(nullptr_t); - - /// Destructor. - ASIO_DECL ~any_io_executor(); - - /// Swap targets with another polymorphic wrapper. - ASIO_DECL void swap(any_io_executor& other) ASIO_NOEXCEPT; - - /// Obtain a polymorphic wrapper with the specified property. - /** - * Do not call this function directly. It is intended for use with the - * asio::require and asio::prefer customisation points. - * - * For example: - * @code any_io_executor ex = ...; - * auto ex2 = asio::require(ex, execution::blocking.possibly); @endcode - */ - template - any_io_executor require(const Property& p, - typename constraint< - traits::require_member::is_valid - >::type = 0) const - { - return static_cast(*this).require(p); - } - - /// Obtain a polymorphic wrapper with the specified property. - /** - * Do not call this function directly. It is intended for use with the - * asio::prefer customisation point. - * - * For example: - * @code any_io_executor ex = ...; - * auto ex2 = asio::prefer(ex, execution::blocking.possibly); @endcode - */ - template - any_io_executor prefer(const Property& p, - typename constraint< - traits::prefer_member::is_valid - >::type = 0) const - { - return static_cast(*this).prefer(p); - } -}; - -#if !defined(GENERATING_DOCUMENTATION) - -template <> -ASIO_DECL any_io_executor any_io_executor::require( - const execution::blocking_t::never_t&, int) const; - -template <> -ASIO_DECL any_io_executor any_io_executor::prefer( - const execution::blocking_t::possibly_t&, int) const; - -template <> -ASIO_DECL any_io_executor any_io_executor::prefer( - const execution::outstanding_work_t::tracked_t&, int) const; - -template <> -ASIO_DECL any_io_executor any_io_executor::prefer( - const execution::outstanding_work_t::untracked_t&, int) const; - -template <> -ASIO_DECL any_io_executor any_io_executor::prefer( - const execution::relationship_t::fork_t&, int) const; - -template <> -ASIO_DECL any_io_executor any_io_executor::prefer( - const execution::relationship_t::continuation_t&, int) const; - -namespace traits { - -#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT) - -template <> -struct equality_comparable -{ - static const bool is_valid = true; - static const bool is_noexcept = true; -}; - -#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT) - -#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT) - -template -struct execute_member -{ - static const bool is_valid = true; - static const bool is_noexcept = false; - typedef void result_type; -}; - -#endif // !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT) - -#if !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) - -template -struct query_member : - query_member -{ -}; - -#endif // !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) - -#if !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT) - -template -struct require_member : - require_member -{ - typedef any_io_executor result_type; -}; - -#endif // !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT) - -#if !defined(ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT) - -template -struct prefer_member : - prefer_member -{ - typedef any_io_executor result_type; -}; - -#endif // !defined(ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT) - -} // namespace traits - -#endif // !defined(GENERATING_DOCUMENTATION) - -#endif // defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT) - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#if defined(ASIO_HEADER_ONLY) \ - && !defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT) -# include "asio/impl/any_io_executor.ipp" -#endif // defined(ASIO_HEADER_ONLY) - // && !defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT) - -#endif // ASIO_ANY_IO_EXECUTOR_HPP diff --git a/lib/asio-1.26.0/asio/append.hpp b/lib/asio-1.26.0/asio/append.hpp deleted file mode 100644 index 227de90..0000000 --- a/lib/asio-1.26.0/asio/append.hpp +++ /dev/null @@ -1,78 +0,0 @@ -// -// append.hpp -// ~~~~~~~~~~ -// -// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_APPEND_HPP -#define ASIO_APPEND_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if (defined(ASIO_HAS_STD_TUPLE) \ - && defined(ASIO_HAS_VARIADIC_TEMPLATES)) \ - || defined(GENERATING_DOCUMENTATION) - -#include -#include "asio/detail/type_traits.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Completion token type used to specify that the completion handler -/// arguments should be passed additional values after the results of the -/// operation. -template -class append_t -{ -public: - /// Constructor. - template - ASIO_CONSTEXPR explicit append_t( - ASIO_MOVE_ARG(T) completion_token, - ASIO_MOVE_ARG(V)... values) - : token_(ASIO_MOVE_CAST(T)(completion_token)), - values_(ASIO_MOVE_CAST(V)(values)...) - { - } - -//private: - CompletionToken token_; - std::tuple values_; -}; - -/// Completion token type used to specify that the completion handler -/// arguments should be passed additional values after the results of the -/// operation. -template -ASIO_NODISCARD inline ASIO_CONSTEXPR append_t< - typename decay::type, typename decay::type...> -append(ASIO_MOVE_ARG(CompletionToken) completion_token, - ASIO_MOVE_ARG(Values)... values) -{ - return append_t< - typename decay::type, typename decay::type...>( - ASIO_MOVE_CAST(CompletionToken)(completion_token), - ASIO_MOVE_CAST(Values)(values)...); -} - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/impl/append.hpp" - -#endif // (defined(ASIO_HAS_STD_TUPLE) - // && defined(ASIO_HAS_VARIADIC_TEMPLATES)) - // || defined(GENERATING_DOCUMENTATION) - -#endif // ASIO_APPEND_HPP diff --git a/lib/asio-1.26.0/asio/as_tuple.hpp b/lib/asio-1.26.0/asio/as_tuple.hpp deleted file mode 100644 index 0629033..0000000 --- a/lib/asio-1.26.0/asio/as_tuple.hpp +++ /dev/null @@ -1,139 +0,0 @@ -// -// as_tuple.hpp -// ~~~~~~~~~~~~ -// -// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_AS_TUPLE_HPP -#define ASIO_AS_TUPLE_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#if (defined(ASIO_HAS_STD_TUPLE) \ - && defined(ASIO_HAS_VARIADIC_TEMPLATES)) \ - || defined(GENERATING_DOCUMENTATION) - -#include "asio/detail/type_traits.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// A @ref completion_token adapter used to specify that the completion handler -/// arguments should be combined into a single tuple argument. -/** - * The as_tuple_t class is used to indicate that any arguments to the - * completion handler should be combined and passed as a single tuple argument. - * The arguments are first moved into a @c std::tuple and that tuple is then - * passed to the completion handler. - */ -template -class as_tuple_t -{ -public: - /// Tag type used to prevent the "default" constructor from being used for - /// conversions. - struct default_constructor_tag {}; - - /// Default constructor. - /** - * This constructor is only valid if the underlying completion token is - * default constructible and move constructible. The underlying completion - * token is itself defaulted as an argument to allow it to capture a source - * location. - */ - ASIO_CONSTEXPR as_tuple_t( - default_constructor_tag = default_constructor_tag(), - CompletionToken token = CompletionToken()) - : token_(ASIO_MOVE_CAST(CompletionToken)(token)) - { - } - - /// Constructor. - template - ASIO_CONSTEXPR explicit as_tuple_t( - ASIO_MOVE_ARG(T) completion_token) - : token_(ASIO_MOVE_CAST(T)(completion_token)) - { - } - - /// Adapts an executor to add the @c as_tuple_t completion token as the - /// default. - template - struct executor_with_default : InnerExecutor - { - /// Specify @c as_tuple_t as the default completion token type. - typedef as_tuple_t default_completion_token_type; - - /// Construct the adapted executor from the inner executor type. - template - executor_with_default(const InnerExecutor1& ex, - typename constraint< - conditional< - !is_same::value, - is_convertible, - false_type - >::type::value - >::type = 0) ASIO_NOEXCEPT - : InnerExecutor(ex) - { - } - }; - - /// Type alias to adapt an I/O object to use @c as_tuple_t as its - /// default completion token type. -#if defined(ASIO_HAS_ALIAS_TEMPLATES) \ - || defined(GENERATING_DOCUMENTATION) - template - using as_default_on_t = typename T::template rebind_executor< - executor_with_default >::other; -#endif // defined(ASIO_HAS_ALIAS_TEMPLATES) - // || defined(GENERATING_DOCUMENTATION) - - /// Function helper to adapt an I/O object to use @c as_tuple_t as its - /// default completion token type. - template - static typename decay::type::template rebind_executor< - executor_with_default::type::executor_type> - >::other - as_default_on(ASIO_MOVE_ARG(T) object) - { - return typename decay::type::template rebind_executor< - executor_with_default::type::executor_type> - >::other(ASIO_MOVE_CAST(T)(object)); - } - -//private: - CompletionToken token_; -}; - -/// Adapt a @ref completion_token to specify that the completion handler -/// arguments should be combined into a single tuple argument. -template -ASIO_NODISCARD inline -ASIO_CONSTEXPR as_tuple_t::type> -as_tuple(ASIO_MOVE_ARG(CompletionToken) completion_token) -{ - return as_tuple_t::type>( - ASIO_MOVE_CAST(CompletionToken)(completion_token)); -} - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#include "asio/impl/as_tuple.hpp" - -#endif // (defined(ASIO_HAS_STD_TUPLE) - // && defined(ASIO_HAS_VARIADIC_TEMPLATES)) - // || defined(GENERATING_DOCUMENTATION) - -#endif // ASIO_AS_TUPLE_HPP diff --git a/lib/asio-1.26.0/asio/associated_allocator.hpp b/lib/asio-1.26.0/asio/associated_allocator.hpp deleted file mode 100644 index f4e9780..0000000 --- a/lib/asio-1.26.0/asio/associated_allocator.hpp +++ /dev/null @@ -1,233 +0,0 @@ -// -// associated_allocator.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_ASSOCIATED_ALLOCATOR_HPP -#define ASIO_ASSOCIATED_ALLOCATOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include -#include "asio/associator.hpp" -#include "asio/detail/functional.hpp" -#include "asio/detail/type_traits.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -template -struct associated_allocator; - -namespace detail { - -template -struct has_allocator_type : false_type -{ -}; - -template -struct has_allocator_type::type> - : true_type -{ -}; - -template -struct associated_allocator_impl -{ - typedef void asio_associated_allocator_is_unspecialised; - - typedef A type; - - static type get(const T&) ASIO_NOEXCEPT - { - return type(); - } - - static const type& get(const T&, const A& a) ASIO_NOEXCEPT - { - return a; - } -}; - -template -struct associated_allocator_impl::type> -{ - typedef typename T::allocator_type type; - - static ASIO_AUTO_RETURN_TYPE_PREFIX(type) get( - const T& t) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX((t.get_allocator())) - { - return t.get_allocator(); - } - - static ASIO_AUTO_RETURN_TYPE_PREFIX(type) get( - const T& t, const A&) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX((t.get_allocator())) - { - return t.get_allocator(); - } -}; - -template -struct associated_allocator_impl::value - >::type, - typename void_type< - typename associator::type - >::type> : associator -{ -}; - -} // namespace detail - -/// Traits type used to obtain the allocator associated with an object. -/** - * A program may specialise this traits type if the @c T template parameter in - * the specialisation is a user-defined type. The template parameter @c - * Allocator shall be a type meeting the Allocator requirements. - * - * Specialisations shall meet the following requirements, where @c t is a const - * reference to an object of type @c T, and @c a is an object of type @c - * Allocator. - * - * @li Provide a nested typedef @c type that identifies a type meeting the - * Allocator requirements. - * - * @li Provide a noexcept static member function named @c get, callable as @c - * get(t) and with return type @c type or a (possibly const) reference to @c - * type. - * - * @li Provide a noexcept static member function named @c get, callable as @c - * get(t,a) and with return type @c type or a (possibly const) reference to @c - * type. - */ -template > -struct associated_allocator -#if !defined(GENERATING_DOCUMENTATION) - : detail::associated_allocator_impl -#endif // !defined(GENERATING_DOCUMENTATION) -{ -#if defined(GENERATING_DOCUMENTATION) - /// If @c T has a nested type @c allocator_type, T::allocator_type. - /// Otherwise @c Allocator. - typedef see_below type; - - /// If @c T has a nested type @c allocator_type, returns - /// t.get_allocator(). Otherwise returns @c type(). - static decltype(auto) get(const T& t) ASIO_NOEXCEPT; - - /// If @c T has a nested type @c allocator_type, returns - /// t.get_allocator(). Otherwise returns @c a. - static decltype(auto) get(const T& t, const Allocator& a) ASIO_NOEXCEPT; -#endif // defined(GENERATING_DOCUMENTATION) -}; - -/// Helper function to obtain an object's associated allocator. -/** - * @returns associated_allocator::get(t) - */ -template -ASIO_NODISCARD inline typename associated_allocator::type -get_associated_allocator(const T& t) ASIO_NOEXCEPT -{ - return associated_allocator::get(t); -} - -/// Helper function to obtain an object's associated allocator. -/** - * @returns associated_allocator::get(t, a) - */ -template -ASIO_NODISCARD inline ASIO_AUTO_RETURN_TYPE_PREFIX2( - typename associated_allocator::type) -get_associated_allocator(const T& t, const Allocator& a) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX(( - associated_allocator::get(t, a))) -{ - return associated_allocator::get(t, a); -} - -#if defined(ASIO_HAS_ALIAS_TEMPLATES) - -template > -using associated_allocator_t - = typename associated_allocator::type; - -#endif // defined(ASIO_HAS_ALIAS_TEMPLATES) - -namespace detail { - -template -struct associated_allocator_forwarding_base -{ -}; - -template -struct associated_allocator_forwarding_base::asio_associated_allocator_is_unspecialised, - void - >::value - >::type> -{ - typedef void asio_associated_allocator_is_unspecialised; -}; - -} // namespace detail - -#if defined(ASIO_HAS_STD_REFERENCE_WRAPPER) \ - || defined(GENERATING_DOCUMENTATION) - -/// Specialisation of associated_allocator for @c std::reference_wrapper. -template -struct associated_allocator, Allocator> -#if !defined(GENERATING_DOCUMENTATION) - : detail::associated_allocator_forwarding_base -#endif // !defined(GENERATING_DOCUMENTATION) -{ - /// Forwards @c type to the associator specialisation for the unwrapped type - /// @c T. - typedef typename associated_allocator::type type; - - /// Forwards the request to get the allocator to the associator specialisation - /// for the unwrapped type @c T. - static type get(reference_wrapper t) ASIO_NOEXCEPT - { - return associated_allocator::get(t.get()); - } - - /// Forwards the request to get the allocator to the associator specialisation - /// for the unwrapped type @c T. - static ASIO_AUTO_RETURN_TYPE_PREFIX(type) get( - reference_wrapper t, const Allocator& a) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX(( - associated_allocator::get(t.get(), a))) - { - return associated_allocator::get(t.get(), a); - } -}; - -#endif // defined(ASIO_HAS_STD_REFERENCE_WRAPPER) - // || defined(GENERATING_DOCUMENTATION) - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_ASSOCIATED_ALLOCATOR_HPP diff --git a/lib/asio-1.26.0/asio/associated_cancellation_slot.hpp b/lib/asio-1.26.0/asio/associated_cancellation_slot.hpp deleted file mode 100644 index d5b802d..0000000 --- a/lib/asio-1.26.0/asio/associated_cancellation_slot.hpp +++ /dev/null @@ -1,238 +0,0 @@ -// -// associated_cancellation_slot.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_ASSOCIATED_CANCELLATION_SLOT_HPP -#define ASIO_ASSOCIATED_CANCELLATION_SLOT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/associator.hpp" -#include "asio/cancellation_signal.hpp" -#include "asio/detail/functional.hpp" -#include "asio/detail/type_traits.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -template -struct associated_cancellation_slot; - -namespace detail { - -template -struct has_cancellation_slot_type : false_type -{ -}; - -template -struct has_cancellation_slot_type::type> - : true_type -{ -}; - -template -struct associated_cancellation_slot_impl -{ - typedef void asio_associated_cancellation_slot_is_unspecialised; - - typedef S type; - - static type get(const T&) ASIO_NOEXCEPT - { - return type(); - } - - static const type& get(const T&, const S& s) ASIO_NOEXCEPT - { - return s; - } -}; - -template -struct associated_cancellation_slot_impl::type> -{ - typedef typename T::cancellation_slot_type type; - - static ASIO_AUTO_RETURN_TYPE_PREFIX(type) get( - const T& t) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX((t.get_cancellation_slot())) - { - return t.get_cancellation_slot(); - } - - static ASIO_AUTO_RETURN_TYPE_PREFIX(type) get( - const T& t, const S&) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX((t.get_cancellation_slot())) - { - return t.get_cancellation_slot(); - } -}; - -template -struct associated_cancellation_slot_impl::value - >::type, - typename void_type< - typename associator::type - >::type> : associator -{ -}; - -} // namespace detail - -/// Traits type used to obtain the cancellation_slot associated with an object. -/** - * A program may specialise this traits type if the @c T template parameter in - * the specialisation is a user-defined type. The template parameter @c - * CancellationSlot shall be a type meeting the CancellationSlot requirements. - * - * Specialisations shall meet the following requirements, where @c t is a const - * reference to an object of type @c T, and @c s is an object of type @c - * CancellationSlot. - * - * @li Provide a nested typedef @c type that identifies a type meeting the - * CancellationSlot requirements. - * - * @li Provide a noexcept static member function named @c get, callable as @c - * get(t) and with return type @c type or a (possibly const) reference to @c - * type. - * - * @li Provide a noexcept static member function named @c get, callable as @c - * get(t,s) and with return type @c type or a (possibly const) reference to @c - * type. - */ -template -struct associated_cancellation_slot -#if !defined(GENERATING_DOCUMENTATION) - : detail::associated_cancellation_slot_impl -#endif // !defined(GENERATING_DOCUMENTATION) -{ -#if defined(GENERATING_DOCUMENTATION) - /// If @c T has a nested type @c cancellation_slot_type, - /// T::cancellation_slot_type. Otherwise - /// @c CancellationSlot. - typedef see_below type; - - /// If @c T has a nested type @c cancellation_slot_type, returns - /// t.get_cancellation_slot(). Otherwise returns @c type(). - static decltype(auto) get(const T& t) ASIO_NOEXCEPT; - - /// If @c T has a nested type @c cancellation_slot_type, returns - /// t.get_cancellation_slot(). Otherwise returns @c s. - static decltype(auto) get(const T& t, - const CancellationSlot& s) ASIO_NOEXCEPT; -#endif // defined(GENERATING_DOCUMENTATION) -}; - -/// Helper function to obtain an object's associated cancellation_slot. -/** - * @returns associated_cancellation_slot::get(t) - */ -template -ASIO_NODISCARD inline typename associated_cancellation_slot::type -get_associated_cancellation_slot(const T& t) ASIO_NOEXCEPT -{ - return associated_cancellation_slot::get(t); -} - -/// Helper function to obtain an object's associated cancellation_slot. -/** - * @returns associated_cancellation_slot::get(t, st) - */ -template -ASIO_NODISCARD inline ASIO_AUTO_RETURN_TYPE_PREFIX2( - typename associated_cancellation_slot::type) -get_associated_cancellation_slot(const T& t, - const CancellationSlot& st) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX(( - associated_cancellation_slot::get(t, st))) -{ - return associated_cancellation_slot::get(t, st); -} - -#if defined(ASIO_HAS_ALIAS_TEMPLATES) - -template -using associated_cancellation_slot_t = - typename associated_cancellation_slot::type; - -#endif // defined(ASIO_HAS_ALIAS_TEMPLATES) - -namespace detail { - -template -struct associated_cancellation_slot_forwarding_base -{ -}; - -template -struct associated_cancellation_slot_forwarding_base::asio_associated_cancellation_slot_is_unspecialised, - void - >::value - >::type> -{ - typedef void asio_associated_cancellation_slot_is_unspecialised; -}; - -} // namespace detail - -#if defined(ASIO_HAS_STD_REFERENCE_WRAPPER) \ - || defined(GENERATING_DOCUMENTATION) - -/// Specialisation of associated_cancellation_slot for @c -/// std::reference_wrapper. -template -struct associated_cancellation_slot, CancellationSlot> -#if !defined(GENERATING_DOCUMENTATION) - : detail::associated_cancellation_slot_forwarding_base -#endif // !defined(GENERATING_DOCUMENTATION) -{ - /// Forwards @c type to the associator specialisation for the unwrapped type - /// @c T. - typedef typename associated_cancellation_slot::type type; - - /// Forwards the request to get the cancellation slot to the associator - /// specialisation for the unwrapped type @c T. - static type get(reference_wrapper t) ASIO_NOEXCEPT - { - return associated_cancellation_slot::get(t.get()); - } - - /// Forwards the request to get the cancellation slot to the associator - /// specialisation for the unwrapped type @c T. - static ASIO_AUTO_RETURN_TYPE_PREFIX(type) get(reference_wrapper t, - const CancellationSlot& s = CancellationSlot()) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX(( - associated_cancellation_slot::get(t.get(), s))) - { - return associated_cancellation_slot::get(t.get(), s); - } -}; - -#endif // defined(ASIO_HAS_STD_REFERENCE_WRAPPER) - // || defined(GENERATING_DOCUMENTATION) - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_ASSOCIATED_CANCELLATION_SLOT_HPP diff --git a/lib/asio-1.26.0/asio/associated_executor.hpp b/lib/asio-1.26.0/asio/associated_executor.hpp deleted file mode 100644 index b76c204..0000000 --- a/lib/asio-1.26.0/asio/associated_executor.hpp +++ /dev/null @@ -1,257 +0,0 @@ -// -// associated_executor.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_ASSOCIATED_EXECUTOR_HPP -#define ASIO_ASSOCIATED_EXECUTOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" -#include "asio/associator.hpp" -#include "asio/detail/functional.hpp" -#include "asio/detail/type_traits.hpp" -#include "asio/execution/executor.hpp" -#include "asio/is_executor.hpp" -#include "asio/system_executor.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -template -struct associated_executor; - -namespace detail { - -template -struct has_executor_type : false_type -{ -}; - -template -struct has_executor_type::type> - : true_type -{ -}; - -template -struct associated_executor_impl -{ - typedef void asio_associated_executor_is_unspecialised; - - typedef E type; - - static type get(const T&) ASIO_NOEXCEPT - { - return type(); - } - - static const type& get(const T&, const E& e) ASIO_NOEXCEPT - { - return e; - } -}; - -template -struct associated_executor_impl::type> -{ - typedef typename T::executor_type type; - - static ASIO_AUTO_RETURN_TYPE_PREFIX(type) get( - const T& t) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX((t.get_executor())) - { - return t.get_executor(); - } - - static ASIO_AUTO_RETURN_TYPE_PREFIX(type) get( - const T& t, const E&) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX((t.get_executor())) - { - return t.get_executor(); - } -}; - -template -struct associated_executor_impl::value - >::type, - typename void_type< - typename associator::type - >::type> : associator -{ -}; - -} // namespace detail - -/// Traits type used to obtain the executor associated with an object. -/** - * A program may specialise this traits type if the @c T template parameter in - * the specialisation is a user-defined type. The template parameter @c - * Executor shall be a type meeting the Executor requirements. - * - * Specialisations shall meet the following requirements, where @c t is a const - * reference to an object of type @c T, and @c e is an object of type @c - * Executor. - * - * @li Provide a nested typedef @c type that identifies a type meeting the - * Executor requirements. - * - * @li Provide a noexcept static member function named @c get, callable as @c - * get(t) and with return type @c type or a (possibly const) reference to @c - * type. - * - * @li Provide a noexcept static member function named @c get, callable as @c - * get(t,e) and with return type @c type or a (possibly const) reference to @c - * type. - */ -template -struct associated_executor -#if !defined(GENERATING_DOCUMENTATION) - : detail::associated_executor_impl -#endif // !defined(GENERATING_DOCUMENTATION) -{ -#if defined(GENERATING_DOCUMENTATION) - /// If @c T has a nested type @c executor_type, T::executor_type. - /// Otherwise @c Executor. - typedef see_below type; - - /// If @c T has a nested type @c executor_type, returns - /// t.get_executor(). Otherwise returns @c type(). - static decltype(auto) get(const T& t) ASIO_NOEXCEPT; - - /// If @c T has a nested type @c executor_type, returns - /// t.get_executor(). Otherwise returns @c ex. - static decltype(auto) get(const T& t, const Executor& ex) ASIO_NOEXCEPT; -#endif // defined(GENERATING_DOCUMENTATION) -}; - -/// Helper function to obtain an object's associated executor. -/** - * @returns associated_executor::get(t) - */ -template -ASIO_NODISCARD inline typename associated_executor::type -get_associated_executor(const T& t) ASIO_NOEXCEPT -{ - return associated_executor::get(t); -} - -/// Helper function to obtain an object's associated executor. -/** - * @returns associated_executor::get(t, ex) - */ -template -ASIO_NODISCARD inline ASIO_AUTO_RETURN_TYPE_PREFIX2( - typename associated_executor::type) -get_associated_executor(const T& t, const Executor& ex, - typename constraint< - is_executor::value || execution::is_executor::value - >::type = 0) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX(( - associated_executor::get(t, ex))) -{ - return associated_executor::get(t, ex); -} - -/// Helper function to obtain an object's associated executor. -/** - * @returns associated_executor::get(t, ctx.get_executor()) - */ -template -ASIO_NODISCARD inline ASIO_AUTO_RETURN_TYPE_PREFIX2( - typename associated_executor::type) -get_associated_executor(const T& t, ExecutionContext& ctx, - typename constraint::value>::type = 0) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX(( - associated_executor::get(t, ctx.get_executor()))) -{ - return associated_executor::get(t, ctx.get_executor()); -} - -#if defined(ASIO_HAS_ALIAS_TEMPLATES) - -template -using associated_executor_t = typename associated_executor::type; - -#endif // defined(ASIO_HAS_ALIAS_TEMPLATES) - -namespace detail { - -template -struct associated_executor_forwarding_base -{ -}; - -template -struct associated_executor_forwarding_base::asio_associated_executor_is_unspecialised, - void - >::value - >::type> -{ - typedef void asio_associated_executor_is_unspecialised; -}; - -} // namespace detail - -#if defined(ASIO_HAS_STD_REFERENCE_WRAPPER) \ - || defined(GENERATING_DOCUMENTATION) - -/// Specialisation of associated_executor for @c std::reference_wrapper. -template -struct associated_executor, Executor> -#if !defined(GENERATING_DOCUMENTATION) - : detail::associated_executor_forwarding_base -#endif // !defined(GENERATING_DOCUMENTATION) -{ - /// Forwards @c type to the associator specialisation for the unwrapped type - /// @c T. - typedef typename associated_executor::type type; - - /// Forwards the request to get the executor to the associator specialisation - /// for the unwrapped type @c T. - static type get(reference_wrapper t) ASIO_NOEXCEPT - { - return associated_executor::get(t.get()); - } - - /// Forwards the request to get the executor to the associator specialisation - /// for the unwrapped type @c T. - static ASIO_AUTO_RETURN_TYPE_PREFIX(type) get( - reference_wrapper t, const Executor& ex) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX(( - associated_executor::get(t.get(), ex))) - { - return associated_executor::get(t.get(), ex); - } -}; - -#endif // defined(ASIO_HAS_STD_REFERENCE_WRAPPER) - // || defined(GENERATING_DOCUMENTATION) - -} // namespace asio - -#include "asio/detail/pop_options.hpp" - -#endif // ASIO_ASSOCIATED_EXECUTOR_HPP diff --git a/lib/asio-1.26.0/asio/associator.hpp b/lib/asio-1.26.0/asio/associator.hpp deleted file mode 100644 index 1452de6..0000000 --- a/lib/asio-1.26.0/asio/associator.hpp +++ /dev/null @@ -1,35 +0,0 @@ -// -// associator.hpp -// ~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef ASIO_ASSOCIATOR_HPP -#define ASIO_ASSOCIATOR_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include "asio/detail/config.hpp" - -#include "asio/detail/push_options.hpp" - -namespace asio { - -/// Used to generically specialise associators for a type. -template