CppWAMP
C++11 client library for the WAMP protocol
wamp::SimpleInvocationUnpacker< TSlot, TResult, TArgs > Class Template Reference

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)
 

Detailed Description

template<typename TSlot, typename TResult, typename... TArgs>
class wamp::SimpleInvocationUnpacker< TSlot, TResult, TArgs >

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).

See also
wamp::simpleRpc
Unpacked Call Slots
Template Parameters
TSlotFunction type to be wrapped.
TResultThe static result type returned by the slot (may be void).
TArgsList of static types the call slot expects as arguments.

Member Function Documentation

◆ operator()()

template<typename S , typename R , typename... A>
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.

Friends And Related Function Documentation

◆ simpleRpc()

template<typename TResult , typename... TArgs, typename TSlot >
SimpleInvocationUnpacker< DecayedSlot< TSlot >, TResult, TArgs... > simpleRpc ( TSlot &&  slot)
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.

See also
Unpacked Call Slots
Returns
A SimpleInvocationUnpacker that wraps the the given slot.
Template Parameters
TArgsList of static types the call slot expects as arguments.
TResultThe static result type returned by the slot (may be void).
TSlot(deduced) Function type to be converted.

The documentation for this class was generated from the following file: