CppWAMP
C++11 client library for the WAMP protocol
wamp::Options< TDerived, TMessage > Class Template Reference

Wrapper around a WAMP message containing an options dictionary. More...

#include <cppwamp/options.hpp>

Inheritance diagram for wamp::Options< TDerived, TMessage >:

Public Member Functions

TDerived & withOption (String key, Variant value)
 Adds an option.
 
TDerived & withOptions (Object opts)
 Sets all options at once.
 
const Objectoptions () const
 Accesses the entire dictionary of options.
 
Variant optionByKey (const String &key) const
 Obtains an option by key.
 
template<typename T >
ValueTypeOf< T > optionOr (const String &key, T &&fallback) const
 Obtains an option by key or a fallback value. More...
 

Protected Member Functions

template<typename... TArgs>
 Options (TArgs &&... args)
 Constructor taking message construction aruments.
 

Detailed Description

template<typename TDerived, typename TMessage>
class wamp::Options< TDerived, TMessage >

Wrapper around a WAMP message containing an options dictionary.

Member Function Documentation

◆ optionOr()

template<typename TDerived , typename TMessage >
template<typename T >
ValueTypeOf<T> wamp::Options< TDerived, TMessage >::optionOr ( const String key,
T &&  fallback 
) const
inline

Obtains an option by key or a fallback value.

Parameters
keyThe key to search under.
fallbackThe fallback value to return if the key was not found.

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