#pragma once /* ABSTRACT DEVICE COMPONENTS LIBRARY */ #include #include "../common/adc_traits.h" /* */ namespace adc { namespace traits { template concept adc_cmd_exec_c = traits::adc_func_traits::arity == 0 && !std::same_as; } // namespace traits template class AdcDeviceCommand { protected: IdentT _ident; std::function _execFunc; public: typedef IdentT ident_t; template AdcDeviceCommand(const IdentT& ident, ExecFuncT&& exec_func) : _ident(ident), _execFunc(std::forward(exec_func)) { } AdcDeviceCommand(const AdcDeviceCommand&) = default; AdcDeviceCommand(AdcDeviceCommand&&) = default; AdcDeviceCommand& operator=(const AdcDeviceCommand&) = default; AdcDeviceCommand& operator=(AdcDeviceCommand&&) = default; virtual ~AdcDeviceCommand() = default; /* PUBLIC METHODS */ ident_t ident() const { return _ident; } void operator()() { _execFunc(); } }; } // namespace adc