• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

STEllAR-GROUP / hpx / #882

31 Aug 2023 07:44PM UTC coverage: 41.798% (-44.7%) from 86.546%
#882

push

19442 of 46514 relevant lines covered (41.8%)

126375.38 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/libs/full/async_distributed/include/hpx/async_distributed/async_continue.hpp
1
//  Copyright (c) 2007-2022 Hartmut Kaiser
2
//
3
//  SPDX-License-Identifier: BSL-1.0
4
//  Distributed under the Boost Software License, Version 1.0. (See accompanying
5
//  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6

7
///////////////////////////////////////////////////////////////////////////////
8

9
#pragma once
10

11
#include <hpx/config.hpp>
12
#include <hpx/actions_base/actions_base_support.hpp>
13
#include <hpx/actions_base/traits/extract_action.hpp>
14
#include <hpx/actions_base/traits/is_distribution_policy.hpp>
15
#include <hpx/async_distributed/async_continue_fwd.hpp>
16
#include <hpx/async_distributed/promise.hpp>
17
#include <hpx/modules/async_local.hpp>
18
#include <hpx/modules/futures.hpp>
19

20
#include <type_traits>
21
#include <utility>
22

23
namespace hpx {
24
    ///////////////////////////////////////////////////////////////////////////
25
    namespace detail {
26
        template <typename Action, typename RemoteResult, typename Cont,
27
            typename Target, typename... Ts>
28
        hpx::future<typename traits::promise_local_result<
29
            typename result_of_async_continue<Action, Cont>::type>::type>
30
        async_continue_r(Cont&& cont, Target const& target, Ts&&... vs)
31
        {
32
            typedef typename traits::promise_local_result<
×
33
                typename result_of_async_continue<Action, Cont>::type>::type
34
                result_type;
35

36
            typedef
37
                typename hpx::traits::extract_action<Action>::remote_result_type
38
                    continuation_result_type;
39

40
            hpx::distributed::promise<result_type, RemoteResult> p;
41
            auto f = p.get_future();
42

43
            hpx::post<Action>(hpx::actions::typed_continuation<result_type,
×
44
                                  continuation_result_type>(
45
                                  p.get_id(), HPX_FORWARD(Cont, cont)),
×
46
                target, HPX_FORWARD(Ts, vs)...);
47

48
            return f;
49
        }
50
    }    // namespace detail
×
51

52
    ///////////////////////////////////////////////////////////////////////////
53
    template <typename Action, typename Cont, typename... Ts>
54
    hpx::future<typename traits::promise_local_result<
55
        typename detail::result_of_async_continue<Action, Cont>::type>::type>
56
    async_continue(Cont&& cont, hpx::id_type const& gid, Ts&&... vs)
57
    {
58
        typedef typename traits::promise_remote_result<
59
            typename detail::result_of_async_continue<Action, Cont>::type>::type
60
            result_type;
61

62
        return detail::async_continue_r<Action, result_type>(
63
            HPX_FORWARD(Cont, cont), gid, HPX_FORWARD(Ts, vs)...);
64
    }
65

66
    template <typename Component, typename Signature, typename Derived,
67
        typename Cont, typename... Ts>
68
    hpx::future<typename traits::promise_local_result<
69
        typename detail::result_of_async_continue<Derived, Cont>::type>::type>
70
    async_continue(hpx::actions::basic_action<Component, Signature, Derived>,
71
        Cont&& cont, hpx::id_type const& gid, Ts&&... vs)
72
    {
73
        return async_continue<Derived>(
74
            HPX_FORWARD(Cont, cont), gid, HPX_FORWARD(Ts, vs)...);
75
    }
76

77
    ///////////////////////////////////////////////////////////////////////////
78
    template <typename Action, typename Cont, typename DistPolicy,
79
        typename... Ts>
80
    std::enable_if_t<traits::is_distribution_policy_v<DistPolicy>,
81
        hpx::future<typename traits::promise_local_result<typename detail::
82
                result_of_async_continue<Action, Cont>::type>::type>>
83
    async_continue(Cont&& cont, DistPolicy const& policy, Ts&&... vs)
84
    {
85
        typedef typename traits::promise_remote_result<
86
            typename detail::result_of_async_continue<Action, Cont>::type>::type
87
            result_type;
88

89
        return detail::async_continue_r<Action, result_type>(
90
            HPX_FORWARD(Cont, cont), policy, HPX_FORWARD(Ts, vs)...);
91
    }
92

93
    template <typename Component, typename Signature, typename Derived,
94
        typename Cont, typename DistPolicy, typename... Ts>
95
    std::enable_if_t<traits::is_distribution_policy_v<DistPolicy>,
96
        hpx::future<typename traits::promise_local_result<typename detail::
97
                result_of_async_continue<Derived, Cont>::type>::type>>
98
    async_continue(hpx::actions::basic_action<Component, Signature, Derived>,
99
        Cont&& cont, DistPolicy const& policy, Ts&&... vs)
100
    {
101
        return async_continue<Derived>(
102
            HPX_FORWARD(Cont, cont), policy, HPX_FORWARD(Ts, vs)...);
103
    }
104
}    // namespace hpx
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc