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

Implement AutoPacket::Call #730

Merged
merged 4 commits into from
Aug 14, 2015
Merged

Implement AutoPacket::Call #730

merged 4 commits into from
Aug 14, 2015

Conversation

codemercenary
Copy link
Contributor

This feature allows a user holding an AutoPacket to manually delegate control to another routine using AutoPacket::Call.

void MyClass::AutoFilter(AutoPacket& packet) {
  Decoration<1> myOutputValue;
  packet->Call(
    [&] (const Decoration<0>& in, Decoration<1>& out) {
      assert(&out == &myOutputValue);
      out.i = 100;
    },
    myOutputValue
  );
}

Assuming that p is decorated with Decoration<0>, the above causes the lambda function to be called with the parameters mapped correctly, and the output value is captured and stored in myOutputValue.

This process is efficient in that it doesn't create ANY copies of myOutputValue.

  • Support function object calls
  • Support dumb function calls
  • Be efficient! Outputs by value should not be copied

@codemercenary codemercenary self-assigned this Aug 14, 2015
@codemercenary codemercenary added this to the v0.7.3 milestone Aug 14, 2015
@codemercenary codemercenary force-pushed the feature-apcall branch 6 times, most recently from 7d3f990 to e5dce1a Compare August 14, 2015 00:48
No need to modify `CallExtractor`.  This use case is sufficiently different that we should reimplement.
@codemercenary codemercenary removed their assignment Aug 14, 2015
hham added a commit that referenced this pull request Aug 14, 2015
@hham hham merged commit 7479857 into develop Aug 14, 2015
@hham hham deleted the feature-apcall branch August 14, 2015 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants