AdcNetServiceASIOBase: delete move constructor (asio::streambuf is not

movable), acceptor_t.asyncAccept completion token has signature:
void(std::error_code, std::shared_ptr<netservice_t>)
This commit is contained in:
2024-10-02 16:43:45 +03:00
parent f329bcecec
commit 3d89dd3715
5 changed files with 103 additions and 54 deletions

View File

@@ -52,13 +52,14 @@ using adc_common_duration_t = adc_duration_common_type_t<std::chrono::nanosecond
// a) true - asynchronous operation completed without errors
// b) false - an error occured
template <typename ERRT>
concept adc_async_callback_err_t = std::convertible_to<std::remove_cvref_t<ERRT>, bool>;
concept adc_async_callback_err_t = std::convertible_to<std::remove_cvref_t<ERRT>, bool> ||
requires(const std::remove_cvref_t<ERRT> err) { err.operator bool(); };
// concepts for asynchronous opereration callback callable
// 1) the type must be a callable with at least 1 input argument
// 2) the first argument type must satisfy the concept adc_async_callback_err_t
template <typename T>
concept adc_async_callback_t = traits::adc_is_callable<T> && traits::adc_func_traits<T>::arity &&
concept adc_async_callback_t = traits::adc_is_callable<T> && (traits::adc_func_traits<T>::arity >= 1) &&
adc_async_callback_err_t<traits::adc_func_arg1_t<T>>;
/*
@@ -94,7 +95,8 @@ concept adc_async_callback_t = traits::adc_is_callable<T> && traits::adc_func_tr
}
*/
template <typename SRVT>
concept adc_netservice_c = std::movable<SRVT> && requires(SRVT srv, const SRVT srv_const) {
concept adc_netservice_c = requires(SRVT srv, const SRVT srv_const) {
// concept adc_netservice_c = std::movable<SRVT> && requires(SRVT srv, const SRVT srv_const) {
typename SRVT::netservice_ident_t; // service identificator type
typename SRVT::send_msg_t; // sending message type
@@ -117,7 +119,8 @@ concept adc_netservice_c = std::movable<SRVT> && requires(SRVT srv, const SRVT s
acc.asyncAccept(std::declval<typename SRVT::acceptor_t::async_accept_callback_t>(),
std::declval<const typename SRVT::timeout_t&>());
{ acc.accept(std::declval<const typename SRVT::timeout_t&>()) } -> std::same_as<SRVT>;
// { acc.accept(std::declval<const typename SRVT::timeout_t&>()) } -> std::same_as<SRVT>;
acc.accept(std::declval<const typename SRVT::timeout_t&>());
};