11template <
typename CompletionHandler,
typename Transform>
13 return [innerHandler = std::forward<CompletionHandler>(handler),
14 innerTransform = std::forward<Transform>(transform)](
auto&& result)
mutable {
15 auto transformed = std::invoke(innerTransform, std::forward<
decltype(result)>(result));
16 std::invoke(innerHandler, transformed);
24template <
typename TransformFunction,
typename CompletionToken>
26 TransformToken(TransformFunction&& transformFunction, CompletionToken&& completionToken)
27 :
transform(std::move(transformFunction)),
28 token(std::move(completionToken)) {}
31 std::decay_t<CompletionToken>
token;
34template <
typename TransformFunction,
typename CompletionToken>
42template <
typename TransformFunction,
typename CompletionToken,
typename T>
43struct AsyncResult<services::detail::TransformToken<TransformFunction, CompletionToken>, T> {
46 template <
typename Initiation,
typename... Args>
48 Initiation&& initiation,
52 using TransformResult = std::invoke_result_t<TransformFunction, T&>;
54 [innerInitiation = std::forward<Initiation>(initiation),
55 innerTransform = std::forward<Token>(token).transform](
56 auto&& handler,
auto&&... innerArgs
61 std::forward<
decltype(handler)>(handler), std::move(innerTransform)
63 std::forward<
decltype(innerArgs)>(innerArgs)...
66 std::forward<Token>(token).token,
67 std::forward<Args>(
args)...
auto asyncInitiate(Initiation &&initiation, CompletionToken &&token, Args &&... args)
static UA_LogCategory const char va_list args
TransformToken(TransformFunction &&, CompletionToken &&) -> TransformToken< TransformFunction, CompletionToken >
auto asyncTransform(CompletionHandler &&handler, Transform &&transform)