diff --git a/.gitignore b/.gitignore index 755b8efa..53407319 100644 --- a/.gitignore +++ b/.gitignore @@ -62,3 +62,7 @@ ipch/ *.opensdf *.sdf *.cachefile + +# IntelliJ/Clion +.idea/ +cmake-build-*/ diff --git a/autobahn/wamp_invocation.hpp b/autobahn/wamp_invocation.hpp index c6e16b8d..f1f6b992 100644 --- a/autobahn/wamp_invocation.hpp +++ b/autobahn/wamp_invocation.hpp @@ -191,6 +191,29 @@ class wamp_invocation_impl template void get_kw_arguments(Map& kw_args) const; + /*! + * The details field of the invocation, converted to a map type. + * + * @tparam Map The map type. + * + * @return A Map type populated with the details of the invocation. + * + * @throw std::bad_cast + */ + template + Map details() const; + + /*! + * Convert and assign the keyword arguments to the given @p details. + * + * @tparam Map The map type. + * + * @param details A reference to a Map type object to receive the + * invocation details. + */ + template + void get_details(Map& details) const; + /*! * Checks if caller expects progressive results. */ @@ -274,6 +297,7 @@ class wamp_invocation_impl msgpack::zone m_zone; msgpack::object m_arguments; + msgpack::object m_details; msgpack::object m_kw_arguments; send_result_fn m_send_result_fn; std::uint64_t m_request_id; diff --git a/autobahn/wamp_invocation.ipp b/autobahn/wamp_invocation.ipp index a2d07428..70cf255b 100644 --- a/autobahn/wamp_invocation.ipp +++ b/autobahn/wamp_invocation.ipp @@ -173,6 +173,18 @@ inline void wamp_invocation_impl::get_kw_arguments(Map& kw_args) const m_kw_arguments.convert(kw_args); } +template +inline Map wamp_invocation_impl::details() const +{ + return m_details.as(); +} + +template +inline void wamp_invocation_impl::get_details(Map& details) const +{ + m_details.convert(details); +} + inline bool wamp_invocation_impl::progressive_results_expected() const { return m_progressive_results_expected; @@ -347,6 +359,7 @@ inline void wamp_invocation_impl::set_details(const msgpack::object& details) { m_uri = value_for_key_or(details, "procedure", std::string()); m_progressive_results_expected = value_for_key_or(details, "receive_progress", false); + m_details = details; } inline void wamp_invocation_impl::set_request_id(std::uint64_t request_id)