CppWAMP
C++11 client library for the WAMP protocol
|
Wrapper around a call slot which automatically unpacks positional payload arguments. More...
#include <cppwamp/unpacker.hpp>
Public Types | |
using | Slot = TSlot |
The function type to be wrapped. | |
using | ResultType = TResult |
The static result type returned by the slot. | |
Public Member Functions | |
SimpleInvocationUnpacker (Slot slot) | |
Constructor taking a callable target. | |
Outcome | operator() (Invocation inv) const |
Dispatches the stored call slot. More... | |
Related Functions | |
(Note that these are not member functions.) | |
template<typename TResult , typename... TArgs, typename TSlot > | |
SimpleInvocationUnpacker< DecayedSlot< TSlot >, TResult, TArgs... > | simpleRpc (TSlot &&slot) |
Wrapper around a call slot which automatically unpacks positional payload arguments.
The wamp::simpleRpc convenience function should be used to construct instances of SimpleInvocationUnpacker. This class differs from InvocationUnpacker in that the slot type returns TResult
and does not take an Invocation as the first parameter. The slot cannot defer the outcome of the RPC and must return a result immediately (or throw a wamp::Error).
TSlot | Function type to be wrapped. |
TResult | The static result type returned by the slot (may be void ). |
TArgs | List of static types the call slot expects as arguments. |
Outcome wamp::SimpleInvocationUnpacker< S, R, A >::operator() | ( | Invocation | inv | ) | const |
Dispatches the stored call slot.
The inv.args()
positional arguments will be unpacked and passed to the stored call slot as parameters.
|
related |
Converts an unpacked call slot into a regular slot than can be passed to Session::enroll. This function differs from unpackedRpc in that the slot type returns TResult and is not expected to take an Invocation as the first parameter.
TArgs | List of static types the call slot expects as arguments. |
TResult | The static result type returned by the slot (may be void ). |
TSlot | (deduced) Function type to be converted. |