Skip to content

Commit

Permalink
Rename plain and component actions to just actions
Browse files Browse the repository at this point in the history
  • Loading branch information
K-ballo committed Dec 18, 2014
1 parent 6e98a85 commit 486808a
Show file tree
Hide file tree
Showing 39 changed files with 1,888 additions and 5,724 deletions.
4 changes: 2 additions & 2 deletions hpx/components/remote_object/server/remote_object.hpp
Expand Up @@ -63,7 +63,7 @@ namespace hpx { namespace components { namespace server
///////////////////////////////////////////////////////////////////////////
template <typename F>
struct remote_object_apply_action1
: hpx::actions::component_action<
: hpx::actions::action<
typename F::result_type (remote_object::*)(F const &)
, &remote_object::apply1<F>
, remote_object_apply_action1<F>
Expand All @@ -72,7 +72,7 @@ namespace hpx { namespace components { namespace server

template <typename F, typename A>
struct remote_object_apply_action2
: hpx::actions::component_action<
: hpx::actions::action<
typename F::result_type (remote_object::*)(F const &, A const &)
, &remote_object::apply2<F, A>
, remote_object_apply_action2<F, A>
Expand Down
34 changes: 30 additions & 4 deletions hpx/runtime/actions/action_support.hpp
Expand Up @@ -853,7 +853,7 @@ namespace hpx { namespace actions
{
typedef Component component_type;
typedef Derived derived_type;

typedef R result_type;
typedef typename traits::promise_local_result<R>::type local_result_type;
typedef typename detail::remote_action_result<R>::type remote_result_type;
Expand Down Expand Up @@ -938,17 +938,43 @@ namespace hpx { namespace actions
{};
}

///////////////////////////////////////////////////////////////////////////
template <typename TF, TF F, typename Derived>
class basic_action_impl;

///////////////////////////////////////////////////////////////////////////
template <typename TF, TF F, typename Derived = detail::this_type>
struct action;

///////////////////////////////////////////////////////////////////////////
template <typename TF, TF F, typename Derived = detail::this_type>
struct direct_action;

///////////////////////////////////////////////////////////////////////////
// Base template allowing to generate a concrete action type from a function
// pointer. It is instantiated only if the supplied pointer is not a
// supported function pointer.
template <typename F, F funcptr, typename Derived = detail::this_type,
template <typename TF, TF F, typename Derived = detail::this_type,
typename Direct = boost::mpl::false_>
struct make_action;

template <typename F, F funcptr, typename Derived = detail::this_type>
template <typename TF, TF F, typename Derived>
struct make_action<TF, F, Derived, boost::mpl::false_>
: action<TF, F, Derived>
{
typedef action<TF, F, Derived> type;
};

template <typename TF, TF F, typename Derived>
struct make_action<TF, F, Derived, boost::mpl::true_>
: direct_action<TF, F, Derived>
{
typedef direct_action<TF, F, Derived> type;
};

template <typename TF, TF F, typename Derived = detail::this_type>
struct make_direct_action
: make_action<F, funcptr, Derived, boost::mpl::true_>
: make_action<TF, F, Derived, boost::mpl::true_>
{};

// older compilers require BOOST_TYPEOF, newer compilers have decltype()
Expand Down
17 changes: 0 additions & 17 deletions hpx/runtime/actions/component_action.hpp
Expand Up @@ -26,23 +26,6 @@
#include <cstdlib>
#include <stdexcept>

namespace hpx { namespace actions
{
// declarations for main templates

///////////////////////////////////////////////////////////////////////////
template <typename TF, TF F, typename Derived>
class component_base_action;

///////////////////////////////////////////////////////////////////////////
template <typename TF, TF F, typename Derived = detail::this_type>
struct component_action;

///////////////////////////////////////////////////////////////////////////
template <typename TF, TF F, typename Derived = detail::this_type>
struct component_direct_action;
}}

///////////////////////////////////////////////////////////////////////////////
// bring in nullary actions and all other arities
#include <hpx/runtime/actions/component_const_action.hpp>
Expand Down
56 changes: 16 additions & 40 deletions hpx/runtime/actions/component_const_action.hpp
Expand Up @@ -25,7 +25,7 @@ namespace hpx { namespace actions
template <
typename Component, typename R,
R (Component::*F)() const, typename Derived>
class component_base_action<R (Component::*)() const, F, Derived>
class basic_action_impl<R (Component::*)() const, F, Derived>
: public basic_action<Component const, R(), Derived>
{
public:
Expand Down Expand Up @@ -87,7 +87,7 @@ namespace hpx { namespace actions
public:
/// \brief This static \a construct_thread_function allows to construct
/// a proper thread function for a \a thread without having to
/// instantiate the \a component_base_action type. This is used by the \a
/// instantiate the \a basic_action_impl type. This is used by the \a
/// applier in case no continuation has been supplied.
template <typename Arguments>
static threads::thread_function_type
Expand All @@ -103,7 +103,7 @@ namespace hpx { namespace actions

/// \brief This static \a construct_thread_function allows to construct
/// a proper thread function for a \a thread without having to
/// instantiate the \a component_base_action type. This is used by the \a
/// instantiate the \a basic_action_impl type. This is used by the \a
/// applier in case a continuation has been supplied
template <typename Arguments>
static threads::thread_function_type
Expand All @@ -123,7 +123,7 @@ namespace hpx { namespace actions
Arguments &&)
{
LTM_(debug)
<< "component_base_action::execute_function: name("
<< "basic_action_impl::execute_function: name("
<< detail::get_action_name<Derived>()
<< ") lva(" << reinterpret_cast<void const*>(
get_lva<Component const>::call(lva)) << ")";
Expand All @@ -135,46 +135,34 @@ namespace hpx { namespace actions
///////////////////////////////////////////////////////////////////////////
template <typename Component, typename R,
R (Component::*F)() const, typename Derived>
struct component_action<R (Component::*)() const, F, Derived>
: component_base_action<
struct action<R (Component::*)() const, F, Derived>
: basic_action_impl<
R (Component::*)() const, F,
typename detail::action_type<
component_action<R (Component::*)() const, F, Derived>,
action<R (Component::*)() const, F, Derived>,
Derived
>::type>
{
typedef typename detail::action_type<
component_action, Derived
action, Derived
>::type derived_type;

typedef boost::mpl::false_ direct_execution;
};

///////////////////////////////////////////////////////////////////////////
template <
typename Component, typename R,
R (Component::*F)() const, typename Derived>
struct make_action<R (Component::*)() const, F, Derived, boost::mpl::false_>
: component_action<R (Component::*)() const, F, Derived>
{
typedef component_action<
R (Component::*)() const, F, Derived
> type;
};

///////////////////////////////////////////////////////////////////////////
template <typename Component, typename R,
R (Component::*F)() const, typename Derived>
struct component_direct_action<R (Component::*)() const, F, Derived>
: public component_base_action<
struct direct_action<R (Component::*)() const, F, Derived>
: public basic_action_impl<
R (Component::*)() const, F,
typename detail::action_type<
component_direct_action<R (Component::*)() const, F, Derived>,
direct_action<R (Component::*)() const, F, Derived>,
Derived
>::type>
{
typedef typename detail::action_type<
component_direct_action, Derived
direct_action, Derived
>::type derived_type;

typedef boost::mpl::true_ direct_execution;
Expand All @@ -187,22 +175,10 @@ namespace hpx { namespace actions
}
};

///////////////////////////////////////////////////////////////////////////
template <
typename Component, typename R,
R (Component::*F)() const, typename Derived>
struct make_action<R (Component::*)() const, F, Derived, boost::mpl::true_>
: component_direct_action<R (Component::*)() const, F, Derived>
{
typedef component_direct_action<
R (Component::*)() const, F, Derived
> type;
};

///////////////////////////////////////////////////////////////////////////
// zero parameter version, no result value
template <typename Component, void (Component::*F)() const, typename Derived>
class component_base_action<void (Component::*)() const, F, Derived>
class basic_action_impl<void (Component::*)() const, F, Derived>
: public basic_action<Component const, util::unused_type(), Derived>
{
public:
Expand Down Expand Up @@ -264,7 +240,7 @@ namespace hpx { namespace actions
public:
/// \brief This static \a construct_thread_function allows to construct
/// a proper thread function for a \a thread without having to
/// instantiate the component_base_action type. This is used by the \a applier in
/// instantiate the basic_action_impl type. This is used by the \a applier in
/// case no continuation has been supplied.
template <typename Arguments>
static threads::thread_function_type
Expand All @@ -280,7 +256,7 @@ namespace hpx { namespace actions

/// \brief This static \a construct_thread_function allows to construct
/// a proper thread function for a \a thread without having to
/// instantiate the component_base_action type. This is used by the \a applier in
/// instantiate the basic_action_impl type. This is used by the \a applier in
/// case a continuation has been supplied
template <typename Arguments>
static threads::thread_function_type
Expand All @@ -300,7 +276,7 @@ namespace hpx { namespace actions
Arguments &&)
{
LTM_(debug)
<< "component_base_action::execute_function: name("
<< "basic_action_impl::execute_function: name("
<< detail::get_action_name<Derived>()
<< ") lva(" << reinterpret_cast<void const*>(
get_lva<Component const>::call(lva)) << ")";
Expand Down
60 changes: 16 additions & 44 deletions hpx/runtime/actions/component_const_action_implementations.hpp
Expand Up @@ -57,7 +57,7 @@ namespace hpx { namespace actions
typename Component, typename R,
BOOST_PP_ENUM_PARAMS(N, typename T),
R (Component::*F)(BOOST_PP_ENUM_PARAMS(N, T)) const, typename Derived>
class component_base_action<
class basic_action_impl<
R (Component::*)(BOOST_PP_ENUM_PARAMS(N, T)) const, F, Derived>
: public basic_action<
Component const, R(BOOST_PP_REPEAT(N, HPX_REMOVE_QUALIFIERS, _)),
Expand Down Expand Up @@ -133,7 +133,7 @@ namespace hpx { namespace actions

// This static construct_thread_function allows to construct
// a proper thread function for a thread without having to
// instantiate the component_base_action type. This is used by the
// instantiate the basic_action_impl type. This is used by the
// applier in case no continuation has been supplied.
template <typename Arguments>
static threads::thread_function_type
Expand All @@ -147,7 +147,7 @@ namespace hpx { namespace actions

// This static construct_thread_function allows to construct
// a proper thread function for a thread without having to
// instantiate the component_base_action type. This is used by the
// instantiate the basic_action_impl type. This is used by the
// applier in case a continuation has been supplied
template <typename Arguments>
static threads::thread_function_type
Expand All @@ -167,7 +167,7 @@ namespace hpx { namespace actions
Arguments && args)
{
LTM_(debug)
<< "component_base_action" << N
<< "basic_action_impl" << N
<< "::execute_function name("
<< detail::get_action_name<Derived>()
<< ") lva(" << reinterpret_cast<void const*>(
Expand All @@ -185,56 +185,42 @@ namespace hpx { namespace actions
BOOST_PP_ENUM_PARAMS(N, typename T),
R (Component::*F)(BOOST_PP_ENUM_PARAMS(N, T)) const,
typename Derived>
struct component_action<
struct action<
R (Component::*)(BOOST_PP_ENUM_PARAMS(N, T)) const, F, Derived>
: component_base_action<
: basic_action_impl<
R (Component::*)(BOOST_PP_ENUM_PARAMS(N, T)) const, F,
typename detail::action_type<
component_action<
action<
R (Component::*)(BOOST_PP_ENUM_PARAMS(N, T)) const, F, Derived>,
Derived
>::type>
{
typedef typename detail::action_type<
component_action, Derived
action, Derived
>::type derived_type;

typedef boost::mpl::false_ direct_execution;
};

///////////////////////////////////////////////////////////////////////////
template <
typename Component, typename R, BOOST_PP_ENUM_PARAMS(N, typename T),
R (Component::*F)(BOOST_PP_ENUM_PARAMS(N, T)) const, typename Derived>
struct make_action<R (Component::*)(BOOST_PP_ENUM_PARAMS(N, T)) const,
F, Derived, boost::mpl::false_>
: component_action<
R (Component::*)(BOOST_PP_ENUM_PARAMS(N, T)) const, F, Derived>
{
typedef component_action<
R (Component::*)(BOOST_PP_ENUM_PARAMS(N, T)) const, F, Derived
> type;
};

///////////////////////////////////////////////////////////////////////////
// N parameter version, direct execution with result
template <
typename Component, typename R,
BOOST_PP_ENUM_PARAMS(N, typename T),
R (Component::*F)(BOOST_PP_ENUM_PARAMS(N, T)) const,
typename Derived>
struct component_direct_action<
struct direct_action<
R (Component::*)(BOOST_PP_ENUM_PARAMS(N, T)) const, F, Derived>
: component_base_action<
: basic_action_impl<
R (Component::*)(BOOST_PP_ENUM_PARAMS(N, T)) const, F,
typename detail::action_type<
component_direct_action<
direct_action<
R (Component::*)(BOOST_PP_ENUM_PARAMS(N, T)) const, F, Derived>,
Derived
>::type>
{
typedef typename detail::action_type<
component_direct_action, Derived
direct_action, Derived
>::type derived_type;

typedef boost::mpl::true_ direct_execution;
Expand All @@ -247,26 +233,12 @@ namespace hpx { namespace actions
}
};

///////////////////////////////////////////////////////////////////////////
template <
typename Component, typename R, BOOST_PP_ENUM_PARAMS(N, typename T),
R (Component::*F)(BOOST_PP_ENUM_PARAMS(N, T)) const, typename Derived>
struct make_action<R (Component::*)(BOOST_PP_ENUM_PARAMS(N, T)) const,
F, Derived, boost::mpl::true_>
: component_direct_action<
R (Component::*)(BOOST_PP_ENUM_PARAMS(N, T)) const, F, Derived>
{
typedef component_direct_action<
R (Component::*)(BOOST_PP_ENUM_PARAMS(N, T)) const, F, Derived
> type;
};

///////////////////////////////////////////////////////////////////////////
// N parameter version, no result type
template <
typename Component, BOOST_PP_ENUM_PARAMS(N, typename T),
void (Component::*F)(BOOST_PP_ENUM_PARAMS(N, T)) const, typename Derived>
class component_base_action<
class basic_action_impl<
void (Component::*)(BOOST_PP_ENUM_PARAMS(N, T)) const, F, Derived>
: public basic_action<
Component const, util::unused_type(BOOST_PP_REPEAT(N, HPX_REMOVE_QUALIFIERS, _)),
Expand Down Expand Up @@ -340,7 +312,7 @@ namespace hpx { namespace actions
public:
// This static construct_thread_function allows to construct
// a proper thread function for a thread without having to
// instantiate the component_base_action type. This is used by the applier in
// instantiate the basic_action_impl type. This is used by the applier in
// case no continuation has been supplied.
template <typename Arguments>
static threads::thread_function_type
Expand All @@ -356,7 +328,7 @@ namespace hpx { namespace actions

// This static construct_thread_function allows to construct
// a proper thread function for a thread without having to
// instantiate the component_base_action type. This is used by the applier in
// instantiate the basic_action_impl type. This is used by the applier in
// case a continuation has been supplied
template <typename Arguments>
static threads::thread_function_type
Expand All @@ -376,7 +348,7 @@ namespace hpx { namespace actions
Arguments && args)
{
LTM_(debug)
<< "component_base_action" << N
<< "basic_action_impl" << N
<< "::execute_function name("
<< detail::get_action_name<Derived>()
<< ") lva(" << reinterpret_cast<void const*>(
Expand Down

0 comments on commit 486808a

Please sign in to comment.