diff options
author | Vernon Mauery <vernon.mauery@linux.intel.com> | 2019-04-02 16:26:11 -0700 |
---|---|---|
committer | Vernon Mauery <vernon.mauery@linux.intel.com> | 2019-04-05 16:53:33 +0000 |
commit | ded4c74ea034e3ca9a1de2e8b6a88b1b01f2f917 (patch) | |
tree | d8062563ae0193869c6023d4f8dc49fb4df9c1c9 /include | |
parent | bae91350cc4bad07b841037f078c0df282beffbf (diff) | |
download | phosphor-host-ipmid-ded4c74ea034e3ca9a1de2e8b6a88b1b01f2f917.tar.gz phosphor-host-ipmid-ded4c74ea034e3ca9a1de2e8b6a88b1b01f2f917.zip |
Fix utility.hpp to use correct types for Request and Context
When requesting a Request or Context object as part of the handler
signature, it should be a std::shared_ptr<ipmi::Context> or
std::shared_ptr<ipmi:message::Request>. There was a bug that made it so
it was not possible to have either of those in the signature. This
commit enables both.
Change-Id: Ib52000f643d7b5f21bc4022629e7d7b03a524dc1
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/ipmid/utility.hpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/include/ipmid/utility.hpp b/include/ipmid/utility.hpp index 3a36434..79c76f7 100644 --- a/include/ipmid/utility.hpp +++ b/include/ipmid/utility.hpp @@ -27,7 +27,12 @@ namespace ipmi { +// forward declare Context and Request for NonIpmiArgsCount struct Context; +namespace message +{ +struct Request; +} namespace utility { @@ -86,7 +91,11 @@ struct NonIpmiArgsCount<std::tuple<FirstArg, OtherArgs...>> { constexpr static std::size_t size() { - if constexpr (std::is_same<FirstArg, ipmi::Context>::value || + if constexpr (std::is_same< + FirstArg, + std::shared_ptr<ipmi::message::Request>>::value || + std::is_same<FirstArg, + std::shared_ptr<ipmi::Context>>::value || std::is_same<FirstArg, boost::asio::yield_context>::value) { return 1 + NonIpmiArgsCount<std::tuple<OtherArgs...>>::size(); |