CppWAMP
C++11 client library for the WAMP protocol
|
Contains the declaration of Variant and other closely related types/functions. More...
#include <algorithm>
#include <cstdint>
#include <map>
#include <ostream>
#include <sstream>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>
#include "api.hpp"
#include "blob.hpp"
#include "conversionaccess.hpp"
#include "error.hpp"
#include "null.hpp"
#include "traits.hpp"
#include "variantdefs.hpp"
#include "visitor.hpp"
#include "internal/varianttraits.hpp"
#include "internal/variantvisitors.hpp"
#include "internal/variant.ipp"
Go to the source code of this file.
Classes | |
class | wamp::Variant |
Discriminated union container that represents a JSON value. More... | |
class | wamp::ToVariantConverter |
Wrapper around a destination Variant, used for conversions. More... | |
class | wamp::FromVariantConverter |
Wrapper around a source Variant, used for conversions. More... | |
Namespaces | |
wamp | |
Macros | |
#define | CPPWAMP_CONVERSION_SPLIT_FREE(Type) |
Splits the convert free function for the given custom type. More... | |
#define | CPPWAMP_CONVERSION_SPLIT_MEMBER(Type) |
Splits the convert member function for the given custom type. More... | |
Functions | |
template<typename TConverter , typename TValue , DisableIf< std::is_enum< TValue >::value > = 0> | |
void | wamp::convert (TConverter &c, TValue &val) |
General function for converting custom types to/from Variant. More... | |
template<typename TEnum , EnableIf< std::is_enum< TEnum >::value > = 0> | |
void | wamp::convert (const FromVariantConverter &c, TEnum &e) |
Converts an integer variant to an enumerator. | |
template<typename TEnum , EnableIf< std::is_enum< TEnum >::value > = 0> | |
void | wamp::convert (ToVariantConverter &c, const TEnum &e) |
Converts an enumerator to an integer variant. | |
Contains the declaration of Variant and other closely related types/functions.
#define CPPWAMP_CONVERSION_SPLIT_FREE | ( | Type | ) |
Splits the convert
free function for the given custom type.
When split, the user must provide overloads for the covertFrom
and convertTo
functions. This can be useful when different behavior is required when converting to/from custom types.
The convertFrom
function converts from a Variant to the custom type, and should have the following signature:
The convertTo
function converts to a Variant from a custom type, and should have the following signature:
#define CPPWAMP_CONVERSION_SPLIT_MEMBER | ( | Type | ) |
Splits the convert
member function for the given custom type.
When split, the user must provide the covertFrom
and convertTo
member functions. This can be useful when different behavior is required when converting to/from custom types.
The convertFrom
member function converts from a Variant to the custom type, and should have the following signature:
The convertTo
member function converts to a Variant from a custom type, and should have the following signature: