31 #ifndef AUTOBAHN_WAMP_INVOCATION_HPP 32 #define AUTOBAHN_WAMP_INVOCATION_HPP 34 #include "wamp_arguments.hpp" 39 #include <msgpack.hpp> 56 const std::string&
uri()
const;
87 template <
typename List>
101 template <
typename List>
120 template <
typename... T>
140 template <
typename T>
143 template <
typename T>
163 template <
typename T>
164 T
kw_argument_or(
const std::string& key,
const T& fallback)
const;
166 template <
typename T>
177 template <
typename Map>
191 template <
typename Map>
211 template <
typename T>
212 T
detail(
const std::string& key)
const;
214 template <
typename T>
215 T
detail(
const char* key)
const;
234 template <
typename T>
235 T
detail_or(
const std::string& key,
const T& fallback)
const;
237 template <
typename T>
238 T
detail_or(
const char* key,
const T& fallback)
const;
248 template <
typename Map>
262 template <
typename Map>
277 template <
typename List>
278 void progress(
const List& arguments);
283 template <
typename List,
typename Map>
284 void progress(
const List& arguments,
const Map& kw_arguments);
289 template <
typename List>
290 void result(
const List& arguments);
295 template <
typename List,
typename Map>
296 void result(
const List& arguments,
const Map& kw_arguments);
301 void error(
const std::string& error_uri);
306 template <
typename List>
307 void error(
const std::string& error_uri,
const List& arguments);
312 template <
typename List,
typename Map>
314 const std::string& error_uri,
315 const List& arguments,
const Map& kw_arguments);
320 using result_type =
enum {
325 using send_result_fn = std::function<void(const std::shared_ptr<wamp_message>&)>;
326 void set_send_result_fn(send_result_fn&&);
327 void set_details(
const msgpack::object& details);
328 void set_request_id(std::uint64_t);
329 void set_zone(msgpack::zone&&);
330 void set_arguments(
const msgpack::object& arguments);
331 void set_kw_arguments(
const msgpack::object& kw_arguments);
332 bool sendable()
const;
335 void throw_if_not_sendable()
const;
337 template <
typename List>
338 void send_result(
const List& arguments, result_type resultType);
340 template <
typename List,
typename Map>
341 void send_result(
const List& arguments,
const Map& kw_arguments, result_type resultType);
345 msgpack::zone m_zone;
346 msgpack::object m_arguments;
347 msgpack::object m_kw_arguments;
348 msgpack::object m_details;
349 send_result_fn m_send_result_fn;
350 std::uint64_t m_request_id;
352 bool m_progressive_results_expected;
355 using wamp_invocation = std::shared_ptr<wamp_invocation_impl>;
359 #include "wamp_invocation.ipp" 361 #endif // AUTOBAHN_WAMP_INVOCATION_HPP void empty_result()
Reply to the invocation with an empty result.
void get_each_argument(T &...args) const
Convert and assign the positional arguments to a given list of individual parameters.
void result(const List &arguments)
Reply to the invocation with positional arguments.
T kw_argument(const std::string &key) const
The keyword argument passed to the invocation with the given key, converted to type T...
void get_kw_arguments(Map &kw_args) const
Convert and assign the keyword arguments to the given kw_args map.
T argument(std::size_t index) const
The positional argument passed to the invocation with the given index, converted to type T...
T detail(const std::string &key) const
The call detail passed to the invocation with the given key, converted to type T. ...
std::size_t number_of_arguments() const
The number of positional arguments passed to the invocation.
void error(const std::string &error_uri)
Reply to the invocation with an error and no further details.
bool progressive_results_expected() const
Checks if caller expects progressive results.
std::size_t number_of_kw_arguments() const
The number of keyword arguments passed to the invocation.
Map details() const
The call details passed to the invocation, converted to a map type.
T kw_argument_or(const std::string &key, const T &fallback) const
The keyword argument passed to the invocation with the given key, converted to type T...
List arguments() const
The positional arguments passed to the invocation, converted to a list type.
const std::string & uri() const
Invocatition procedure URI.
T detail_or(const std::string &key, const T &fallback) const
The call detail passed to the invocation with the given key, converted to type T, or the given fallba...
void get_arguments(List &args) const
Convert and assign the positional arguments to the given args list.
void progress(const List &arguments)
Send progressive/partial result with positional arguments.
void get_details(Map &details) const
Convert and assign the call details to the given details map.
Map kw_arguments() const
The keyword arguments passed to the invocation, converted to a map type.