...
This commit is contained in:
parent
1c327f8fd3
commit
242a0571e0
@ -47,6 +47,20 @@ using adc_common_duration_t = adc_duration_common_type_t<std::chrono::nanosecond
|
||||
std::chrono::months,
|
||||
std::chrono::years>;
|
||||
|
||||
// concepts for asynchronous opereration callback callable first argument type (asynchronous operation error)
|
||||
// 1) the type must be convertible to boolean and
|
||||
// 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>;
|
||||
|
||||
// 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 &&
|
||||
adc_async_callback_err_t<traits::adc_func_arg1_t<T>>;
|
||||
|
||||
/*
|
||||
struct NetService {
|
||||
typedef ImplementationDependentT netservice_ident_t;
|
||||
|
||||
@ -130,32 +130,10 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void daemonizePrepare()
|
||||
{
|
||||
//
|
||||
_impl.daemonizePrepare();
|
||||
};
|
||||
virtual void daemonizePrepare() = 0;
|
||||
|
||||
virtual void daemonizeFinalize()
|
||||
{
|
||||
//
|
||||
_impl.daemonizeFinalize();
|
||||
};
|
||||
virtual void daemonizeFinalize() = 0;
|
||||
};
|
||||
|
||||
|
||||
namespace traits
|
||||
{
|
||||
|
||||
// network server concept
|
||||
template <typename T>
|
||||
concept adc_netserver_c = requires {
|
||||
typename T::server_impl_t;
|
||||
std::derived_from<T, AdcNetServer<typename T::server_impl_t>>;
|
||||
};
|
||||
|
||||
} // namespace traits
|
||||
|
||||
|
||||
|
||||
} // namespace adc
|
||||
|
||||
@ -380,6 +380,7 @@ public:
|
||||
if (start) {
|
||||
start = false;
|
||||
if (_receiveQueue.size()) { // return message from queue
|
||||
timer->cancel();
|
||||
msg = _receiveQueue.front();
|
||||
_receiveQueue.pop();
|
||||
if constexpr (std::is_same_v<msg_t, RMSGT>) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user