From 7c6d5ec9ca17988a0cdceb7ec7be920bc94700d2 Mon Sep 17 00:00:00 2001 From: BartolomeyKant Date: Thu, 18 Jun 2026 17:38:18 +0500 Subject: [PATCH 1/2] remove date and use new aether-miscpp lib --- CMakeLists.txt | 15 +- aether/actions/actions_queue.h | 2 +- aether/actions/repeatable_task.h | 4 +- .../check_access_for_send_message.h | 2 +- aether/ae_actions/get_servers.h | 2 +- aether/ae_actions/select_client.h | 2 +- aether/ae_actions/telemetry.cpp | 2 +- aether/ae_actions/time_sync.cpp | 2 +- aether/aether_app.h | 2 +- aether/all.h | 4 +- aether/api_protocol/api_class_impl.h | 2 +- aether/api_protocol/api_promise.h | 2 +- aether/api_protocol/protocol_context.h | 2 +- aether/api_protocol/request_id.h | 2 +- aether/api_protocol/sub_api.h | 8 +- aether/channels/channels_types.h | 2 +- aether/cloud_connections/cloud_callbacks.h | 2 +- aether/cloud_connections/cloud_request.cpp | 2 +- .../connection_manager/client_cloud_manager.h | 2 +- aether/crc.h | 216 -------- aether/crypto/crypto_nonce.h | 2 +- aether/crypto/key.h | 2 +- aether/crypto/sign.h | 2 +- aether/crypto/signed_key.h | 2 +- aether/dns/dns_c_ares.cpp | 7 +- .../registrar_domain_storage.cpp | 2 +- .../domain_storage/spifs_domain_storage.cpp | 2 +- aether/events/event_handler.h | 2 +- aether/events/event_list.h | 2 +- aether/events/events.h | 2 +- aether/executors/any_waiter.h | 4 +- aether/executors/async_waiter.h | 4 +- aether/executors/for_range.h | 2 +- aether/executors/sync_waiter.h | 2 +- aether/executors/waiter_traits.h | 4 +- aether/format/default_formatters.h | 177 ------- aether/format/format.h | 27 - aether/format/format_impl.h | 251 ---------- aether/format/format_time.h | 63 --- aether/format/formatter.h | 45 -- aether/gateway_api/server_endpoints.h | 4 +- aether/lora_modules/dx_smart_lr02_lm.cpp | 4 +- aether/lora_modules/ebyte_e22_lm.cpp | 4 +- .../lora_modules/lora_module_driver_types.h | 2 +- aether/meta/arg_at.h | 98 ---- aether/meta/as_type.h | 70 --- aether/meta/function_signature.h | 54 -- aether/meta/ignore_t.h | 41 -- aether/meta/index_sequence.h | 80 --- aether/meta/tag_invoke.h | 138 ------ aether/meta/time_traits.h | 41 -- aether/meta/type_list.h | 147 ------ aether/misc/defer.h | 69 --- aether/misc/from_chars.h | 41 -- aether/misc/override.h | 37 -- aether/modems/bg95_at_modem.cpp | 4 +- aether/modems/imodem_driver.h | 4 +- aether/modems/modem_driver_types.h | 2 +- aether/modems/sim7070_at_modem.cpp | 2 +- aether/modems/thingy91x_at_modem.cpp | 4 +- aether/mstream.h | 4 +- aether/obj/component_factory.h | 2 +- aether/obj/domain.h | 4 +- aether/obj/obj.h | 4 +- aether/obj/obj_ptr.h | 2 +- aether/obj/registrar.h | 2 +- aether/obj/registry.cpp | 2 +- aether/poller/freertos_poller.h | 2 +- aether/poller/poller_types.h | 2 +- aether/poller/unix_poller.h | 2 +- aether/poller/win_poller.h | 2 +- aether/ptr/ptr.h | 2 +- aether/ptr/ptr_management.h | 4 +- aether/ptr/rc_ptr.h | 2 +- aether/reflect/container_node_visitor.h | 138 ------ aether/reflect/cycle_detector.h | 67 --- aether/reflect/domain_visitor.h | 31 -- aether/reflect/domain_visitor_impl.h | 82 ---- aether/reflect/node_visitor.h | 92 ---- aether/reflect/override_func.h | 38 -- aether/reflect/ptr_like_node_visitor.h | 40 -- aether/reflect/reflect.h | 27 - aether/reflect/reflect_impl.h | 277 ----------- aether/reflect/reflect_node_visitor.h | 64 --- aether/reflect/type_index.h | 91 ---- .../registration/api/global_reg_server_api.h | 2 +- .../api/server_registration_api.h | 2 +- aether/registration/proof_of_work.cpp | 2 +- aether/registration/registration.cpp | 2 +- aether/registration/registration.h | 2 +- aether/safe_stream/details/circular_buffer.h | 2 +- .../details/receiving_chunk_list.h | 1 + aether/serial_ports/at_support/at_listener.h | 2 +- aether/serial_ports/at_support/at_support.h | 4 +- aether/serial_ports/esp32_serial_port.cpp | 2 +- aether/serial_ports/serial_port_types.h | 2 +- aether/serial_ports/unix_serial_port.cpp | 2 +- aether/serial_ports/win_serial_port.cpp | 2 +- .../server_connections/channel_connection.cpp | 2 +- .../server_connections/channel_connection.h | 2 +- aether/stream_api/gates_stream.h | 2 +- aether/tasks/details/task_manager.h | 2 +- aether/tele/collectors.h | 4 +- aether/tele/tags.h | 2 +- aether/tele/traps/io_stream_traps.cpp | 2 +- aether/tele/traps/statistics_trap.h | 2 +- aether/tele/traps/tele_statistics.h | 2 +- .../system_sockets/sockets/get_sock_addr.cpp | 2 +- .../system_sockets/sockets/isocket.h | 2 +- .../sockets/lwip_cb_tcp_socket.cpp | 2 + .../sockets/lwip_cb_udp_socket.cpp | 2 + .../system_sockets/sockets/lwip_get_addr.cpp | 2 +- .../sockets/lwip_tcp_socket.cpp | 2 +- .../sockets/lwip_udp_socket.cpp | 2 +- .../sockets/unix_tcp_socket.cpp | 2 +- .../sockets/unix_udp_socket.cpp | 2 +- .../system_sockets/sockets/win_socket.cpp | 2 + .../system_sockets/sockets/win_tcp_socket.cpp | 2 +- .../system_sockets/sockets/win_udp_socket.cpp | 2 +- aether/type_traits.h | 48 +- aether/types/address.h | 4 +- aether/types/aligned_storage.h | 271 ----------- aether/types/client_config.h | 4 +- aether/types/nullable_type.h | 2 +- aether/types/result.h | 288 ----------- aether/types/ring_index.h | 2 +- aether/types/server_config.h | 4 +- aether/types/small_function.h | 250 ---------- aether/types/statistic_counter.h | 2 +- aether/types/uid.h | 4 +- aether/types/variant_type.h | 2 +- aether/wifi/wifi_driver.h | 2 +- aether/wifi/wifi_driver_types.h | 2 +- aether/work_cloud_api/ae_message.h | 2 +- aether/work_cloud_api/telemetric.h | 2 +- aether/write_action/buffer_write.h | 2 +- .../benches/send_message_delays/receiver.cpp | 2 +- .../send_message_delays_manager.h | 2 +- .../send_message_delays/statistics_write.h | 2 +- .../common/bandwidth.h | 2 +- .../common/test_action.h | 2 +- .../receiver/message_receiver.h | 2 +- .../sender/message_sender.h | 2 +- examples/cloud/aether_construct_esp_wifi.h | 11 +- tests/CMakeLists.txt | 3 - tests/test-actions/CMakeLists.txt | 2 +- tests/test-events/CMakeLists.txt | 2 +- tests/test-format/CMakeLists.txt | 36 -- tests/test-format/main.cpp | 32 -- tests/test-format/test-format-str.cpp | 57 --- tests/test-format/test-format-time.cpp | 51 -- tests/test-format/test-format-types.cpp | 145 ------ tests/test-meta/CMakeLists.txt | 37 -- tests/test-meta/main.cpp | 28 -- tests/test-meta/test-type-list.cpp | 132 ----- tests/test-object-system/CMakeLists.txt | 2 +- tests/test-ptr/CMakeLists.txt | 2 +- tests/test-ptr/pipe_there_they_are_sitting.h | 2 +- tests/test-reflect/CMakeLists.txt | 41 -- tests/test-reflect/main.cpp | 30 -- tests/test-reflect/test-domain-visitor.cpp | 202 -------- tests/test-reflect/test-reflect.cpp | 116 ----- tests/test-tasks/CMakeLists.txt | 2 +- tests/test-tele/CMakeLists.txt | 2 +- tests/test-tele/test-tele.cpp | 2 +- tests/test-types/CMakeLists.txt | 4 +- tests/test-types/main.cpp | 4 - tests/test-types/test-aligned-storage.cpp | 460 ------------------ tests/test-types/test-small-function.cpp | 264 ---------- 169 files changed, 167 insertions(+), 5188 deletions(-) delete mode 100644 aether/crc.h delete mode 100644 aether/format/default_formatters.h delete mode 100644 aether/format/format.h delete mode 100644 aether/format/format_impl.h delete mode 100644 aether/format/format_time.h delete mode 100644 aether/format/formatter.h delete mode 100644 aether/meta/arg_at.h delete mode 100644 aether/meta/as_type.h delete mode 100644 aether/meta/function_signature.h delete mode 100644 aether/meta/ignore_t.h delete mode 100644 aether/meta/index_sequence.h delete mode 100644 aether/meta/tag_invoke.h delete mode 100644 aether/meta/time_traits.h delete mode 100644 aether/meta/type_list.h delete mode 100644 aether/misc/defer.h delete mode 100644 aether/misc/from_chars.h delete mode 100644 aether/misc/override.h delete mode 100644 aether/reflect/container_node_visitor.h delete mode 100644 aether/reflect/cycle_detector.h delete mode 100644 aether/reflect/domain_visitor.h delete mode 100644 aether/reflect/domain_visitor_impl.h delete mode 100644 aether/reflect/node_visitor.h delete mode 100644 aether/reflect/override_func.h delete mode 100644 aether/reflect/ptr_like_node_visitor.h delete mode 100644 aether/reflect/reflect.h delete mode 100644 aether/reflect/reflect_impl.h delete mode 100644 aether/reflect/reflect_node_visitor.h delete mode 100644 aether/reflect/type_index.h delete mode 100644 aether/types/aligned_storage.h delete mode 100644 aether/types/result.h delete mode 100644 aether/types/small_function.h delete mode 100644 tests/test-format/CMakeLists.txt delete mode 100644 tests/test-format/main.cpp delete mode 100644 tests/test-format/test-format-str.cpp delete mode 100644 tests/test-format/test-format-time.cpp delete mode 100644 tests/test-format/test-format-types.cpp delete mode 100644 tests/test-meta/CMakeLists.txt delete mode 100644 tests/test-meta/main.cpp delete mode 100644 tests/test-meta/test-type-list.cpp delete mode 100644 tests/test-reflect/CMakeLists.txt delete mode 100644 tests/test-reflect/main.cpp delete mode 100644 tests/test-reflect/test-domain-visitor.cpp delete mode 100644 tests/test-reflect/test-reflect.cpp delete mode 100644 tests/test-types/test-aligned-storage.cpp delete mode 100644 tests/test-types/test-small-function.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index df9cdeb7..a12bef95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,12 +105,6 @@ CPMAddPackage( GIT_TAG "master" EXCLUDE_FROM_ALL FALSE ) -# TODO: remove date -CPMAddPackage( - URI "https://github.com/HowardHinnant/date.git#master" - OPTIONS "ENABLE_DATE_INSTALL ${AE_INSTALL}" - EXCLUDE_FROM_ALL FALSE -) CPMAddPackage( NAME numeric GIT_REPOSITORY "https://github.com/aethernetio/aethernet-numeric.git" @@ -118,6 +112,13 @@ CPMAddPackage( OPTIONS "AE_NUMERIC_INSTALL ${AE_INSTALL}" EXCLUDE_FROM_ALL FALSE ) +CPMAddPackage( + NAME aether-miscpp + GIT_REPOSITORY "https://github.com/aethernetio/aether-miscpp.git" + GIT_TAG "main" + OPTIONS "AE_INSTALL ${AE_INSTALL}" "AE_BUILD_TESTS ${AE_BUILD_TESTS}" + EXCLUDE_FROM_ALL FALSE +) CPMAddPackage( NAME etl GIT_REPOSITORY "https://github.com/ETLCPP/etl.git" @@ -152,7 +153,7 @@ target_link_libraries(${TARGET_NAME} PUBLIC etl stdexec numeric - date) + aether::miscpp) message(STATUS "Aether build for CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}") if(CMAKE_SYSTEM_NAME STREQUAL "Linux" diff --git a/aether/actions/actions_queue.h b/aether/actions/actions_queue.h index b75a1b4b..74e712b0 100644 --- a/aether/actions/actions_queue.h +++ b/aether/actions/actions_queue.h @@ -22,7 +22,7 @@ #include #include -#include "aether/types/small_function.h" +#include "aether-miscpp/types/small_function.h" #include "aether/events/event_subscription.h" namespace ae { diff --git a/aether/actions/repeatable_task.h b/aether/actions/repeatable_task.h index 484f684e..210b5351 100644 --- a/aether/actions/repeatable_task.h +++ b/aether/actions/repeatable_task.h @@ -21,8 +21,8 @@ #include #include "aether/actions/action.h" -#include "aether/meta/time_traits.h" -#include "aether/types/small_function.h" +#include "aether-miscpp/meta/time_traits.h" +#include "aether-miscpp/types/small_function.h" #include "aether/actions/action_context.h" namespace ae { diff --git a/aether/ae_actions/check_access_for_send_message.h b/aether/ae_actions/check_access_for_send_message.h index 0c46b69c..04ff648a 100644 --- a/aether/ae_actions/check_access_for_send_message.h +++ b/aether/ae_actions/check_access_for_send_message.h @@ -19,7 +19,7 @@ #include "aether/common.h" #include "aether/types/uid.h" -#include "aether/types/result.h" +#include "aether-miscpp/types/result.h" #include "aether/events/events.h" #include "aether/actions/action.h" #include "aether/cloud_connections/cloud_request.h" diff --git a/aether/ae_actions/get_servers.h b/aether/ae_actions/get_servers.h index 925360f6..b78aef5a 100644 --- a/aether/ae_actions/get_servers.h +++ b/aether/ae_actions/get_servers.h @@ -20,7 +20,7 @@ #include #include "aether/ae_context.h" -#include "aether/types/result.h" +#include "aether-miscpp/types/result.h" #include "aether/events/events.h" #include "aether/types/server_id.h" #include "aether/actions/action.h" diff --git a/aether/ae_actions/select_client.h b/aether/ae_actions/select_client.h index 53803463..9633df68 100644 --- a/aether/ae_actions/select_client.h +++ b/aether/ae_actions/select_client.h @@ -20,7 +20,7 @@ #include "aether/config.h" #include "aether/ae_context.h" #include "aether/obj/obj_ptr.h" -#include "aether/types/result.h" +#include "aether-miscpp/types/result.h" #include "aether/events/events.h" #include "aether/actions/action.h" #include "aether/events/event_subscription.h" diff --git a/aether/ae_actions/telemetry.cpp b/aether/ae_actions/telemetry.cpp index 04b179a5..0937d956 100644 --- a/aether/ae_actions/telemetry.cpp +++ b/aether/ae_actions/telemetry.cpp @@ -19,7 +19,7 @@ #if defined TELEMETRY_ENABLED # include "aether/aether.h" -# include "aether/format/format.h" +# include "aether-miscpp/format/format.h" # include "aether/tele/tele.h" # include "aether/tele/traps/tele_statistics.h" diff --git a/aether/ae_actions/time_sync.cpp b/aether/ae_actions/time_sync.cpp index 14020aaa..2f9827c7 100644 --- a/aether/ae_actions/time_sync.cpp +++ b/aether/ae_actions/time_sync.cpp @@ -23,7 +23,7 @@ # include "aether/client.h" # include "aether/aether.h" # include "aether/uap/uap.h" -# include "aether/misc/override.h" +# include "aether-miscpp/misc/override.h" # include "aether/types/iterator.h" # include "aether/executors/executors.h" # include "aether/cloud_connections/cloud_visit.h" diff --git a/aether/aether_app.h b/aether/aether_app.h index 1511b6fa..e2acece3 100644 --- a/aether/aether_app.h +++ b/aether/aether_app.h @@ -27,7 +27,7 @@ #include "aether/ptr/ptr.h" #include "aether/ptr/rc_ptr.h" #include "aether/obj/domain.h" -#include "aether/types/small_function.h" +#include "aether-miscpp/types/small_function.h" #include "aether/events/events.h" // IWYU pragma: keep #include "aether/actions/action.h" // IWYU pragma: keep diff --git a/aether/all.h b/aether/all.h index 7e271de7..264735f5 100644 --- a/aether/all.h +++ b/aether/all.h @@ -32,8 +32,8 @@ #include "aether/events/event_subscription.h" #include "aether/events/multi_subscription.h" -#include "aether/format/format.h" -#include "aether/reflect/reflect.h" +#include "aether-miscpp/format/format.h" +#include "aether-miscpp/reflect/reflect.h" #include "aether/ptr/ptr.h" #include "aether/ptr/rc_ptr.h" #include "aether/ptr/ptr_view.h" diff --git a/aether/api_protocol/api_class_impl.h b/aether/api_protocol/api_class_impl.h index 01a6de4f..d41e6f0f 100644 --- a/aether/api_protocol/api_class_impl.h +++ b/aether/api_protocol/api_class_impl.h @@ -17,7 +17,7 @@ #ifndef AETHER_API_PROTOCOL_API_CLASS_IMPL_H_ #define AETHER_API_PROTOCOL_API_CLASS_IMPL_H_ -#include "aether/reflect/reflect.h" +#include "aether-miscpp/reflect/reflect.h" #include "aether/api_protocol/api_class.h" #include "aether/api_protocol/api_pack_parser.h" diff --git a/aether/api_protocol/api_promise.h b/aether/api_protocol/api_promise.h index bf672302..aa037b81 100644 --- a/aether/api_protocol/api_promise.h +++ b/aether/api_protocol/api_promise.h @@ -19,7 +19,7 @@ #include -#include "aether/types/result.h" +#include "aether-miscpp/types/result.h" #include "aether/events/events.h" #include "aether/api_protocol/request_id.h" diff --git a/aether/api_protocol/protocol_context.h b/aether/api_protocol/protocol_context.h index 18315d9c..051935bf 100644 --- a/aether/api_protocol/protocol_context.h +++ b/aether/api_protocol/protocol_context.h @@ -21,7 +21,7 @@ #include #include -#include "aether/types/small_function.h" +#include "aether-miscpp/types/small_function.h" #include "aether/api_protocol/request_id.h" namespace ae { diff --git a/aether/api_protocol/request_id.h b/aether/api_protocol/request_id.h index 45f34c92..bf5aa504 100644 --- a/aether/api_protocol/request_id.h +++ b/aether/api_protocol/request_id.h @@ -19,7 +19,7 @@ #include -#include "aether/reflect/reflect.h" +#include "aether-miscpp/reflect/reflect.h" namespace ae { struct RequestId { diff --git a/aether/api_protocol/sub_api.h b/aether/api_protocol/sub_api.h index 70ff75e6..58922b78 100644 --- a/aether/api_protocol/sub_api.h +++ b/aether/api_protocol/sub_api.h @@ -19,10 +19,10 @@ #include -#include "aether/meta/type_list.h" -#include "aether/reflect/reflect.h" -#include "aether/types/small_function.h" -#include "aether/meta/function_signature.h" +#include "aether-miscpp/meta/type_list.h" +#include "aether-miscpp/reflect/reflect.h" +#include "aether-miscpp/types/small_function.h" +#include "aether-miscpp/meta/function_signature.h" #include "aether/api_protocol/api_context.h" #include "aether/api_protocol/api_pack_parser.h" diff --git a/aether/channels/channels_types.h b/aether/channels/channels_types.h index 3ec204fc..fed6411a 100644 --- a/aether/channels/channels_types.h +++ b/aether/channels/channels_types.h @@ -20,7 +20,7 @@ #include #include -#include "aether/reflect/reflect.h" +#include "aether-miscpp/reflect/reflect.h" namespace ae { enum class ConnectionType : std::uint8_t { diff --git a/aether/cloud_connections/cloud_callbacks.h b/aether/cloud_connections/cloud_callbacks.h index e0e8135d..962734fc 100644 --- a/aether/cloud_connections/cloud_callbacks.h +++ b/aether/cloud_connections/cloud_callbacks.h @@ -17,7 +17,7 @@ #ifndef AETHER_CLOUD_CONNECTIONS_CLOUD_CALLBACKS_H_ #define AETHER_CLOUD_CONNECTIONS_CLOUD_CALLBACKS_H_ -#include "aether/types/small_function.h" +#include "aether-miscpp/types/small_function.h" #include "aether/events/event_deleter.h" #include "aether/api_protocol/api_protocol.h" diff --git a/aether/cloud_connections/cloud_request.cpp b/aether/cloud_connections/cloud_request.cpp index e0fe029e..7e94a3c8 100644 --- a/aether/cloud_connections/cloud_request.cpp +++ b/aether/cloud_connections/cloud_request.cpp @@ -21,7 +21,7 @@ #include "aether/server.h" #include "aether/aether.h" -#include "aether/reflect/reflect.h" +#include "aether-miscpp/reflect/reflect.h" #include "aether/write_action/write_action.h" #include "aether/cloud_connections/cloud_visit.h" diff --git a/aether/connection_manager/client_cloud_manager.h b/aether/connection_manager/client_cloud_manager.h index 2e18c273..ca3f3169 100644 --- a/aether/connection_manager/client_cloud_manager.h +++ b/aether/connection_manager/client_cloud_manager.h @@ -28,7 +28,7 @@ #include "aether/cloud.h" #include "aether/types/uid.h" -#include "aether/types/result.h" +#include "aether-miscpp/types/result.h" #include "aether/events/events.h" #include "aether/ae_actions/get_servers.h" diff --git a/aether/crc.h b/aether/crc.h deleted file mode 100644 index e020a2f4..00000000 --- a/aether/crc.h +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Copyright 2024 Aethernet Inc. - * - * 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 AETHER_CRC_H_ -#define AETHER_CRC_H_ - -#include -#include -#include - -namespace crc32 { -struct result_t { - std::uint32_t value; - constexpr result_t(); - constexpr result_t(std::uint32_t); - explicit operator std::uint32_t() const; - auto operator==(const result_t&) const -> bool; -}; - -static const auto default_v = result_t(); - -// compile-time versions - -template -constexpr auto from_literal(const char (&_str)[LEN]) -> result_t; -constexpr auto from_string_view(std::string_view _str) -> result_t; -template -constexpr auto checksum_from_literal(const char (&_str)[LEN]) -> std::uint32_t; - -// run-time versions - -auto from_string(char const* _str, result_t _curr = result_t()) -> result_t; -auto from_buffer(const std::uint8_t* _buffer, size_t _cnt, - result_t _curr = result_t()) -> result_t; - -// ============== -// Implementation -// ============== - -// helpers - -namespace details { - -static const auto INITIAL_VALUE = std::uint32_t{0xFFffFFff}; -static const auto XOR_VALUE = std::uint32_t{0xFFffFFff}; - -template -struct aux; - -constexpr std::uint32_t table[256] = { - // polynomial = 0x04C11DB7 - 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, - 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, - 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, - 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, - 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, - 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, - 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, - 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, - 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, - 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, - 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, - 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, - 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, - 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, - 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, - 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, - 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, - 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, - 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, - 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, - 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, - 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, - 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, - 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, - 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, - 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, - 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, - 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, - 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, - 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, - 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, - 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, - 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, - 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, - 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, - 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, - 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, - 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, - 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, - 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, - 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, - 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, - 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, -}; - -template <> -struct aux<1, 0> { - static constexpr auto exec(const char (&)[1], result_t, result_t) - -> result_t { - return result_t(XOR_VALUE); - } -}; // Empty string case - -template -struct aux { - static constexpr auto exec(const char (&_str)[LEN], result_t _curr, result_t) - -> result_t { - return aux::exec( - // 1. String itself - _str, - - // 2. Add '_str[INDEX]' to the current crc value - result_t{table[static_cast(_curr.value) ^ - static_cast(_str[INDEX])] ^ - (_curr.value >> 8)}, - - // 3. Pass through the unmodified current crc32 (special case of "end of - // string") - _curr); - } -}; // General case - -template -struct aux { - static constexpr auto exec(const char (&)[LEN], result_t, result_t _prev) - -> result_t { - return _prev; // we don't want to include '\0' at the end of literal - // strings - } -}; // End of string case - -} // namespace details - -// actual implementation - -template -constexpr auto from_literal(const char (&_str)[LEN]) -> result_t { - return details::aux::exec(_str, result_t(), result_t()); -} - -constexpr auto from_string_view(std::string_view _str) -> result_t { - auto _curr = result_t{}; - for (auto const& _char : _str) { - _curr.value = (_curr.value >> 8) ^ - details::table[static_cast(_curr.value) ^ - static_cast(_char)]; - } - return _curr; -} - -template -constexpr auto checksum_from_literal(const char (&_str)[LEN]) -> std::uint32_t { - return from_literal(_str).value ^ details::XOR_VALUE; -} - -inline auto from_string(char const* _str, result_t _curr) -> result_t { - if (_str) { - while (*_str != 0) { - _curr.value = - (_curr.value >> 8) ^ - details::table[uint8_t(_curr.value) ^ std::uint8_t(*_str++)]; - } - } - - return _curr; -} - -inline auto from_buffer(const std::uint8_t* _buff, size_t _cnt, result_t _curr) - -> result_t { - if (_buff) { - for (auto i = 0u; i < _cnt; ++i) { - _curr.value = - (_curr.value >> 8) ^ - details::table[uint8_t(_curr.value) ^ std::uint8_t(*(_buff + i))]; - } - } - - return _curr; -} - -inline constexpr result_t::result_t() : value(details::INITIAL_VALUE) {} -inline constexpr result_t::result_t(uint32_t _val) : value(_val) {} -inline result_t::operator std::uint32_t() const { - return value ^ details::XOR_VALUE; -} -inline auto result_t::operator==(const result_t& _rhs) const -> bool { - return value == _rhs.value; -} - -// ============ -// Unit testing -// ============ -static_assert(checksum_from_literal("") == 0, - "crc32 unit test (empty string) failed!"); -static_assert(checksum_from_literal("A") == 0xD3D99E8B, - "crc32 unit test ('A') failed!"); -static_assert(checksum_from_literal("Hello world") == 0x8BD69E52, - "crc32 unit test ('Hello world') failed!"); - -} // namespace crc32 - -#endif // AETHER_CRC_H_ */ diff --git a/aether/crypto/crypto_nonce.h b/aether/crypto/crypto_nonce.h index 45a3fc15..39975f59 100644 --- a/aether/crypto/crypto_nonce.h +++ b/aether/crypto/crypto_nonce.h @@ -21,7 +21,7 @@ #include #include "aether/config.h" -#include "aether/reflect/reflect.h" +#include "aether-miscpp/reflect/reflect.h" #if AE_CRYPTO_SYNC == AE_CHACHA20_POLY1305 diff --git a/aether/crypto/key.h b/aether/crypto/key.h index e5e5e2ca..a0892f8d 100644 --- a/aether/crypto/key.h +++ b/aether/crypto/key.h @@ -46,7 +46,7 @@ # include # endif -# include "aether/reflect/reflect.h" +# include "aether-miscpp/reflect/reflect.h" # include "aether/types/variant_type.h" namespace ae { diff --git a/aether/crypto/sign.h b/aether/crypto/sign.h index 03ac77db..d071ad11 100644 --- a/aether/crypto/sign.h +++ b/aether/crypto/sign.h @@ -33,7 +33,7 @@ # include # endif -# include "aether/reflect/reflect.h" +# include "aether-miscpp/reflect/reflect.h" # include "aether/types/variant_type.h" namespace ae { diff --git a/aether/crypto/signed_key.h b/aether/crypto/signed_key.h index 223dcd2f..b01c9ab4 100644 --- a/aether/crypto/signed_key.h +++ b/aether/crypto/signed_key.h @@ -22,7 +22,7 @@ #include "aether/crypto/key.h" #include "aether/crypto/sign.h" -#include "aether/reflect/reflect.h" +#include "aether-miscpp/reflect/reflect.h" namespace ae { #if AE_SIGNATURE != AE_NONE diff --git a/aether/dns/dns_c_ares.cpp b/aether/dns/dns_c_ares.cpp index 8693f5f4..41820cbd 100644 --- a/aether/dns/dns_c_ares.cpp +++ b/aether/dns/dns_c_ares.cpp @@ -24,10 +24,12 @@ # include "ares.h" +# include "aether-miscpp/misc/defer.h" +# include "aether-miscpp/types/result.h" + # include "aether/warning_disable.h" # include "aether/aether.h" -# include "aether/types/result.h" # include "aether/socket_initializer.h" # include "aether/events/multi_subscription.h" @@ -212,7 +214,8 @@ ResolveSender DnsResolverCares::Resolve(NamedAddr const& name_address, } return ares_impl_->Query(name_address, port_hint, protocol_hint) | - ex::continues_on(ex::SchedulerOnTasks{AeContext{*aether_.Load().as()}}); + ex::continues_on( + ex::SchedulerOnTasks{AeContext{*aether_.Load().as()}}); } } // namespace ae diff --git a/aether/domain_storage/registrar_domain_storage.cpp b/aether/domain_storage/registrar_domain_storage.cpp index c73b9043..8b19c9ef 100644 --- a/aether/domain_storage/registrar_domain_storage.cpp +++ b/aether/domain_storage/registrar_domain_storage.cpp @@ -22,7 +22,7 @@ # include # include -# include "aether/format/format.h" +# include "aether-miscpp/format/format.h" # include "aether/tele/tele.h" diff --git a/aether/domain_storage/spifs_domain_storage.cpp b/aether/domain_storage/spifs_domain_storage.cpp index e65d6f00..9eee07b5 100644 --- a/aether/domain_storage/spifs_domain_storage.cpp +++ b/aether/domain_storage/spifs_domain_storage.cpp @@ -24,7 +24,7 @@ # include "esp_spiffs.h" # include "spiffs_config.h" -# include "aether/crc.h" +# include "aether-miscpp/crc.h" # include "aether/mstream.h" # include "aether/mstream_buffers.h" diff --git a/aether/events/event_handler.h b/aether/events/event_handler.h index c2945088..5c0c52cc 100644 --- a/aether/events/event_handler.h +++ b/aether/events/event_handler.h @@ -21,7 +21,7 @@ #include "aether/config.h" #include "aether/common.h" -#include "aether/types/small_function.h" +#include "aether-miscpp/types/small_function.h" namespace ae { diff --git a/aether/events/event_list.h b/aether/events/event_list.h index 883d3569..f8899972 100644 --- a/aether/events/event_list.h +++ b/aether/events/event_list.h @@ -24,7 +24,7 @@ #include #include "aether/events/event_handler.h" -#include "aether/types/aligned_storage.h" +#include "aether-miscpp/types/aligned_storage.h" namespace ae { class EventHandlersList { diff --git a/aether/events/events.h b/aether/events/events.h index 72224f63..4922c232 100644 --- a/aether/events/events.h +++ b/aether/events/events.h @@ -26,7 +26,7 @@ #include "aether/events/event_list.h" #include "aether/events/event_handler.h" #include "aether/events/event_deleter.h" -#include "aether/types/small_function.h" +#include "aether-miscpp/types/small_function.h" #include "aether/events/event_subscription.h" namespace ae { diff --git a/aether/executors/any_waiter.h b/aether/executors/any_waiter.h index 91b1a32e..912efdbc 100644 --- a/aether/executors/any_waiter.h +++ b/aether/executors/any_waiter.h @@ -25,8 +25,8 @@ #include -#include "aether/types/result.h" -#include "aether/meta/ignore_t.h" +#include "aether-miscpp/types/result.h" +#include "aether-miscpp/meta/ignore_t.h" #include "aether/executors/waiter_traits.h" #include "aether/executors/async_context.h" #include "aether/executors/scheduler_on_tasks.h" diff --git a/aether/executors/async_waiter.h b/aether/executors/async_waiter.h index d9aa19f7..82f3a0dd 100644 --- a/aether/executors/async_waiter.h +++ b/aether/executors/async_waiter.h @@ -29,8 +29,8 @@ IGNORE_IMPLICIT_CONVERSION() #include DISABLE_WARNING_POP() -#include "aether/types/result.h" -#include "aether/types/small_function.h" +#include "aether-miscpp/types/result.h" +#include "aether-miscpp/types/small_function.h" #include "aether/executors/waiter_traits.h" #include "aether/executors/async_context.h" diff --git a/aether/executors/for_range.h b/aether/executors/for_range.h index ae522989..a8e50250 100644 --- a/aether/executors/for_range.h +++ b/aether/executors/for_range.h @@ -24,7 +24,7 @@ #include #include "aether/types/iterator.h" -#include "aether/meta/type_list.h" +#include "aether-miscpp/meta/type_list.h" namespace ae::ex { namespace for_range_internal { diff --git a/aether/executors/sync_waiter.h b/aether/executors/sync_waiter.h index ed407971..c0758293 100644 --- a/aether/executors/sync_waiter.h +++ b/aether/executors/sync_waiter.h @@ -27,7 +27,7 @@ IGNORE_IMPLICIT_CONVERSION() #include DISABLE_WARNING_POP() -#include "aether/types/result.h" +#include "aether-miscpp/types/result.h" #include "aether/executors/waiter_traits.h" namespace ae::ex { diff --git a/aether/executors/waiter_traits.h b/aether/executors/waiter_traits.h index d31a2262..852f2833 100644 --- a/aether/executors/waiter_traits.h +++ b/aether/executors/waiter_traits.h @@ -29,8 +29,8 @@ IGNORE_IMPLICIT_CONVERSION() #include DISABLE_WARNING_POP() -#include "aether/meta/ignore_t.h" -#include "aether/meta/type_list.h" +#include "aether-miscpp/meta/ignore_t.h" +#include "aether-miscpp/meta/type_list.h" namespace ae::ex { template