diff --git a/include/adclib/adclib_device.h b/include/adclib/adclib_device.h index ca423f9..377a36b 100644 --- a/include/adclib/adclib_device.h +++ b/include/adclib/adclib_device.h @@ -108,7 +108,7 @@ concept device_command_exec_t = snplib::callable_c && (snplib::func_traits_t< template concept device_attr_getter_c = std::same_as || requires(T t) { - { t() } -> adc_result_c; + { t() } -> ret_result_c; }; template @@ -118,16 +118,16 @@ concept device_attr_setter_c = // deduce value type from getter and setter -template -using adclib_attr_value_deduced_t = std::conditional_t< +template +using device_attr_value_deduced_t = std::conditional_t< std::is_null_pointer_v, std::conditional_t, void, std::remove_cvref_t>>, typename std::invoke_result_t::value_type>; -template -struct adclib_is_deduced_void_t { - static constexpr bool value = std::is_void_v>; +template +struct is_deduced_void_t { + static constexpr bool value = std::is_void_v>; }; // conversional function signature: @@ -342,7 +342,7 @@ public: template void addAttr(ATTR_ID_T id, GT&& getter, ST&& setter, std::tuple = std::tuple<>{}) { - using v_t = adclib_attr_value_deduced_t; + using v_t = device_attr_value_deduced_t; static_assert(!std::is_void_v, "Getter and setter cannot be nullptr_t at the same time!"); if constexpr (!std::is_null_pointer_v && !std::is_null_pointer_v) { @@ -353,7 +353,7 @@ public: std::tuple...>{}); } - template + template requires(sizeof...(FuncTs) > 1) void addAttr(ATTR_ID_T id, GT&& getter, ST&& setter, FuncTs&&... cnv_pairs) { @@ -361,7 +361,7 @@ public: static_assert(NFUNCS % 2 == 0, "Number of conversional functions must be an even!"); - using v_t = adclib_attr_value_deduced_t; + using v_t = device_attr_value_deduced_t; static_assert(!std::is_void_v, "Getter and setter cannot be nullptr_t at the same time!"); @@ -372,7 +372,7 @@ public: auto tp = std::forward_as_tuple(std::forward(cnv_pairs_cap)...); // static_assert( - // std::disjunction_v, // std::tuple_element_t>...>, @@ -382,7 +382,7 @@ public: using from_fn_t = std::decay_t>; using to_fn_t = std::decay_t>; - using u_t = typename adclib_attr_user_deduced_t::value_type; + using u_t = typename device_attr_user_deduced_t::value_type; return [&func_tp](attr_t const& attr) mutable -> attr_t { return attr_t{ @@ -406,7 +406,7 @@ public: // using from_fn_t = std::decay_t>; // using to_fn_t = std::decay_t>; - // using u_t = adclib_attr_user_deduced_t; + // using u_t = attr_user_deduced_t; // return [func_tp_cap = std::forward(func_tp)](attr_t const& attr) mutable -> attr_t { // using tp_cap_t = decltype(func_tp_cap); @@ -436,7 +436,7 @@ public: using from_fn_t = std::decay_t>; using to_fn_t = std::decay_t>; - using u_t = typename adclib_attr_user_deduced_t::value_type; + using u_t = typename device_attr_user_deduced_t::value_type; return [id, this](attr_t const&) -> attr_t { return _attrs.template get>(id).value(); @@ -455,7 +455,7 @@ public: // add attribute of one of arithmetic type template - requires std::is_arithmetic_v> + requires std::is_arithmetic_v> void addArithAttr(ATTR_ID_T id, GT&& getter, ST&& setter) { addAttr(std::move(id), std::forward(getter), std::forward(setter), AdcGenericDevice::arithmetic_types);