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

Wrapper around an event slot which automatically unpacks positional payload arguments. More...

#include <cppwamp/unpacker.hpp>

Public Types

using Slot = TSlot
 The function type to be wrapped.
 

Public Member Functions

 SimpleEventUnpacker (Slot slot)
 Constructor taking a callable target.
 
void operator() (Event event) const
 Dispatches the stored event slot. More...
 

Related Functions

(Note that these are not member functions.)

template<typename... TArgs, typename TSlot >
SimpleEventUnpacker< DecayedSlot< TSlot >, TArgs... > simpleEvent (TSlot &&slot)
 

Detailed Description

template<typename TSlot, typename... TArgs>
class wamp::SimpleEventUnpacker< TSlot, TArgs >

Wrapper around an event slot which automatically unpacks positional payload arguments.

The wamp::simpleEvent convenience function should be used to construct instances of SimpleEventUnpacker. This class differs from EventUnpacker in that the slot type is not expected to take an Event as the first parameter.

See also
wamp::simpleEvent
Unpacked Event Slots
Template Parameters
TSlotFunction type to be wrapped.
TArgsList of static types the event slot expects as arguments.

Member Function Documentation

◆ operator()()

template<typename S , typename... A>
void wamp::SimpleEventUnpacker< S, A >::operator() ( Event  event) const

Dispatches the stored event slot.

The event.args() positional arguments will be unpacked and passed to the stored event slot as parameters.

Friends And Related Function Documentation

◆ simpleEvent()

template<typename... TArgs, typename TSlot >
SimpleEventUnpacker< DecayedSlot< TSlot >, TArgs... > simpleEvent ( TSlot &&  slot)
related

Converts an unpacked event slot into a regular slot than can be passed to Session::subscribe. This function differs from unpackedEvent in that the slot type does not take an Event as the first parameter.

See also
Unpacked Event Slots
Returns
An SimpleEventUnpacker that wraps the the given slot.
Template Parameters
TArgsList of static types the event slot expects as arguments.
TSlot(deduced) Function type to be converted.

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