diff --git a/hpx/runtime/actions/basic_action.hpp b/hpx/runtime/actions/basic_action.hpp index a75a0a48763f..6d10b2b4006a 100644 --- a/hpx/runtime/actions/basic_action.hpp +++ b/hpx/runtime/actions/basic_action.hpp @@ -461,6 +461,8 @@ namespace hpx { namespace actions return static_cast(components::get_component_type()); } + typedef std::false_type direct_execution; + /// The function \a get_action_type returns whether this action needs /// to be executed in a new thread or directly. static base_action::action_type get_action_type() @@ -521,30 +523,14 @@ namespace hpx { namespace actions }; } - /////////////////////////////////////////////////////////////////////////// - template - class basic_action_impl; - /////////////////////////////////////////////////////////////////////////// template - struct action - : basic_action_impl, - Derived - >::type> - { - typedef typename detail::action_type< - action, Derived - >::type derived_type; - - typedef std::false_type direct_execution; - }; + struct action; /////////////////////////////////////////////////////////////////////////// template struct direct_action - : basic_action_impl, Derived diff --git a/hpx/runtime/actions/component_action.hpp b/hpx/runtime/actions/component_action.hpp index cbfde8013f88..da0250b3b838 100644 --- a/hpx/runtime/actions/component_action.hpp +++ b/hpx/runtime/actions/component_action.hpp @@ -87,15 +87,23 @@ namespace hpx { namespace actions /////////////////////////////////////////////////////////////////////////// template < typename Component, typename R, typename ...Ps, - typename TF, TF F, typename Derived> - class basic_action_impl - : public basic_action + R (Component::*F)(Ps...), typename Derived> + struct action + : basic_action, + Derived + >::type + > { - public: + typedef typename detail::action_type< + action, Derived + >::type derived_type; + static std::string get_action_name(naming::address::address_type lva) { return detail::make_component_action_name( - detail::get_action_name(), + detail::get_action_name(), get_lva::call(lva)); } @@ -104,7 +112,7 @@ namespace hpx { namespace actions naming::address::address_type lva, naming::address::component_type comptype, Ts&&... vs) { - basic_action:: + basic_action:: increment_invocation_count(); using is_future = typename traits::is_future::type; @@ -119,15 +127,23 @@ namespace hpx { namespace actions /////////////////////////////////////////////////////////////////////////// template < typename Component, typename R, typename ...Ps, - typename TF, TF F, typename Derived> - class basic_action_impl - : public basic_action + R (Component::*F)(Ps...) const, typename Derived> + struct action + : basic_action, + Derived + >::type + > { - public: + typedef typename detail::action_type< + action, Derived + >::type derived_type; + static std::string get_action_name(naming::address::address_type lva) { return detail::make_component_action_name( - detail::get_action_name(), + detail::get_action_name(), get_lva::call(lva)); } @@ -136,7 +152,7 @@ namespace hpx { namespace actions naming::address::address_type lva, naming::address::component_type comptype, Ts&&... vs) { - basic_action:: + basic_action:: increment_invocation_count(); using is_future = typename traits::is_future::type; diff --git a/hpx/runtime/actions/lambda_to_action.hpp b/hpx/runtime/actions/lambda_to_action.hpp index 35cccd948529..1ac4ea320d4a 100644 --- a/hpx/runtime/actions/lambda_to_action.hpp +++ b/hpx/runtime/actions/lambda_to_action.hpp @@ -43,8 +43,6 @@ namespace hpx { namespace actions lambda_action> { typedef lambda_action derived_type; - typedef std::false_type direct_execution; - typedef void is_plain_action; static std::string get_action_name(naming::address::address_type /*lva*/) { diff --git a/hpx/runtime/actions/plain_action.hpp b/hpx/runtime/actions/plain_action.hpp index 677be1108d1a..b95a016df1c1 100644 --- a/hpx/runtime/actions/plain_action.hpp +++ b/hpx/runtime/actions/plain_action.hpp @@ -63,15 +63,23 @@ namespace hpx { namespace actions /////////////////////////////////////////////////////////////////////////// template < typename R, typename ...Ps, - typename TF, TF F, typename Derived> - class basic_action_impl - : public basic_action + R (*F)(Ps...), typename Derived> + struct action + : basic_action, + Derived + >::type + > { - public: + typedef typename detail::action_type< + action, Derived + >::type derived_type; + static std::string get_action_name(naming::address::address_type /*lva*/) { return detail::make_plain_action_name( - detail::get_action_name()); + detail::get_action_name()); } template @@ -79,7 +87,7 @@ namespace hpx { namespace actions naming::address::address_type /*lva*/, naming::address::component_type comptype, Ts&&... vs) { - basic_action:: + basic_action:: increment_invocation_count(); return F(std::forward(vs)...); } diff --git a/hpx/runtime/components/server/console_error_sink.hpp b/hpx/runtime/components/server/console_error_sink.hpp index 3f7dd174c983..87a9895e2150 100644 --- a/hpx/runtime/components/server/console_error_sink.hpp +++ b/hpx/runtime/components/server/console_error_sink.hpp @@ -20,9 +20,7 @@ namespace hpx { namespace components { namespace server // console logging happens here void console_error_sink(std::exception_ptr const&); - typedef actions::action< - void (*)(std::exception_ptr const&), console_error_sink - > console_error_sink_action; + HPX_DEFINE_PLAIN_ACTION(console_error_sink, console_error_sink_action); }}} HPX_ACTION_HAS_CRITICAL_PRIORITY(