-
Notifications
You must be signed in to change notification settings - Fork 9
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
1112 Callback: Add sendMsg() which takes MsgPtrThief #1119
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1119 +/- ##
===========================================
- Coverage 75.92% 75.90% -0.02%
===========================================
Files 713 713
Lines 26940 26928 -12
===========================================
- Hits 20453 20441 -12
Misses 6487 6487
|
0fb6789
to
84c5c2d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me 👍
@@ -128,9 +128,15 @@ struct CallbackRawBaseSingle { | |||
bool null() const { return cb_.null(); } | |||
bool valid() const { return cb_.valid(); } | |||
|
|||
template <typename MsgT, typename... Args> | |||
void send(Args... args); | |||
|
|||
template <typename MsgT> | |||
void send(MsgT* msg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As elsewhere, do we want to mark this overload as deprecated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would assume it's widely used in EMPIRE, not sure if we want to flood it with warnings. We could add doxygen \deprecated
command though.
Can you comment on that @lifflander?
@@ -232,12 +238,22 @@ struct CallbackTyped : CallbackRawBaseSingle { | |||
cb_ = std::move(other.cb_); | |||
} | |||
|
|||
template <typename MsgU, typename... Args> | |||
void send(Args... args) { | |||
static_assert(std::is_same<MsgT, MsgU>::value, "Required exact type match"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could see us wanting to loosen this to derivation, or even convertibility. No need to do that here and now, though.
@@ -128,9 +128,15 @@ struct CallbackRawBaseSingle { | |||
bool null() const { return cb_.null(); } | |||
bool valid() const { return cb_.valid(); } | |||
|
|||
template <typename MsgT, typename... Args> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that I'm looking at this, is there some way to avoid having to specify MsgT
when the type is known by the (e.g, callback Callback<MyMsg>
)?
…ts (when applicable)
…gs and using them creates message which should be sent
…y using template param
84c5c2d
to
1f66454
Compare
Fixes #1112
Changes: