Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow binding hpx::util::functions to actions #236

Closed
brycelelbach opened this issue Jul 10, 2012 · 3 comments
Closed

Allow binding hpx::util::functions to actions #236

brycelelbach opened this issue Jul 10, 2012 · 3 comments
Milestone

Comments

@brycelelbach
Copy link
Member

[reported by hkaiser] [Trac time Fri Oct 28 12:14:20 2011] In order to replace the current hpx::function implementation it is needed to extend the hpx::util::function such that it is possible to bind an action to it.

@brycelelbach
Copy link
Member Author

[comment by hkaiser] [Trac time Wed Feb 22 02:26:36 2012] hpx_init.cpp now uses sthis:

    ///////////////////////////////////////////////////////////////////////////
    // Functional wrapper for any action2
    template <typename Action>
    struct action_wrapper2
    {
        typedef typename boost::add_const<
            typename Action::arguments_type
        >::type arguments_type;

        typedef typename
            boost::fusion::result_of::at_c<arguments_type, 0>::type
        arg1_type;
        typedef typename
            boost::fusion::result_of::at_c<arguments_type, 1>::type
        arg2_type;

        // default constructor is required for serialization
        action_wrapper2()
        {}

        action_wrapper2(naming::id_type const& target)
          : target_(target)
        {}

        void operator() (arg1_type s, arg2_type t) const
        {
            applier::apply<Action>(target_, s, t);
        }

        template <typename Archive>
        void serialize(Archive& ar, unsigned /*version*/)
        {
            ar & target_;
        }

        naming::id_type target_;
    };

This wrapper is a good example of how we could generically bind actions to util::function.

@brycelelbach
Copy link
Member Author

[comment by blelbach] [Trac time Sun Apr 8 18:15:19 2012] What's the status of this?

@brycelelbach
Copy link
Member Author

[comment by hkaiser] [Trac time Sat Apr 14 01:50:58 2012] This is fixed in rev. a7b8c5c, hpx::util::bind can now be used to bind an action into a generic (and remotable) function object.

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

No branches or pull requests

1 participant