Skip to content

actions_base: integrate reflect_action with basic_action#7281

Open
Priyanshi507 wants to merge 2 commits into
TheHPXProject:masterfrom
Priyanshi507:reflect-action-basic-action
Open

actions_base: integrate reflect_action with basic_action#7281
Priyanshi507 wants to merge 2 commits into
TheHPXProject:masterfrom
Priyanshi507:reflect-action-basic-action

Conversation

@Priyanshi507
Copy link
Copy Markdown
Contributor

Summary

This PR makes reflect_action<F> a proper HPX action by inheriting from
basic_action<detail::plain_function, R(Ps...), reflect_action<F>>.

Problem

PR #7280 showed that reflect_action was missing required typedefs
(component_type, result_type, arguments_type, etc.) that
transfer_action depends on. These come from basic_action.

Solution

Two-step workaround for compiler restriction on splice expressions
as template arguments:

// Step 1: helper extracts func_type
template <std::meta::info F>
struct reflect_action_base {
    using func_type = [:std::meta::type_of(F):];
};

// Step 2: use alias in inheritance
template <std::meta::info F>
struct reflect_action
  : basic_action<detail::plain_function,
        typename reflect_action_base<F>::func_type,
        reflect_action<F>>

What this enables

reflect_action now provides all typedefs transfer_action requires,
making it usable in HPX's full distributed invocation chain.

Depends on

PR #7266 (merged) — reflect_action base template

Checklist

  • I have added a new feature and have added tests to go along with it.

reflect_action<F> now inherits from:
  basic_action<detail::plain_function, func_type, reflect_action<F>>

This provides all typedefs required by transfer_action:
  component_type, derived_type, result_type, arguments_type,
  local_result_type, remote_result_type, direct_execution, etc.

Uses two-step workaround for GCC/Clang restriction on splice
expressions as template arguments:
  using func_type = [:std::meta::type_of(F):];  // in helper
  basic_action<..., func_type, ...>              // then use alias

get_action_name() now returns HPX format 'plain action(app::compute)'
matching make_plain_action_name output.
invoke() calls func_ptr with forwarded arguments.

Signed-off-by: Priyanshi507 <hiiuiuiabi@gmail.com>
- get_action_name() now takes lva argument (nullptr in tests)
- Name format updated to 'plain action(app::compute)' matching
  make_plain_action_name output

Signed-off-by: Priyanshi507 <hiiuiuiabi@gmail.com>
@Priyanshi507 Priyanshi507 requested a review from hkaiser as a code owner May 20, 2026 00:28
@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@StellarBot
Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@Priyanshi507
Copy link
Copy Markdown
Contributor Author

Priyanshi507 commented May 20, 2026

@hkaiser @isidorostsa @SAtacker Opened PR #7281 — integrates \reflect_actionwithbasic_actionso it provides all typedefstransfer_action requires (component_type, result_type, arguments_type`, etc.).
Key design: two-step workaround for the compiler restriction on splice expressions as template arguments:

// helper extracts func_type first
template <std::meta::info F>
struct reflect_action_base {
using func_type = [:std::meta::type_of(F):];
};
// then use alias in inheritance
template <std::meta::info F>
struct reflect_action
: basic_action<detail::plain_function,
typename reflect_action_base<F>::func_type,
reflect_action<F>>

Also updates PR #7280 dependency — once this merges, HPX_DEFINE_PLAIN_ACTION_2 can use reflect_action as a proper drop-in replacement.`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants