fpmas 1.5
Static Public Member Functions | List of all members
fpmas::io::json::light_serializer< T, typename std::enable_if<!std::is_default_constructible< T >::value >::type > Struct Template Reference

#include <json.h>

Static Public Member Functions

static void to_json (light_json &j, const T &data)
 
static T from_json (const light_json &j)
 

Detailed Description

template<typename T>
struct fpmas::io::json::light_serializer< T, typename std::enable_if<!std::is_default_constructible< T >::value >::type >

light_serializer specialization for non default constructible types, still based on nlohmann::adl_serializer, as explained in the light_serializer documentation.

Template Parameters
Ta non default constructible type to serialize

Member Function Documentation

◆ to_json()

template<typename T >
static void fpmas::io::json::light_serializer< T, typename std::enable_if<!std::is_default_constructible< T >::value >::type >::to_json ( light_json j,
const T &  data 
)
inlinestatic

Serializes data into j using the regular nlohmann::adl_serializer implementation for T.

Equivalent to:

static void to_json(light_json &j, const T &data)
Definition: json.h:107
Parameters
jjson output
datadata to serialize

◆ from_json()

template<typename T >
static T fpmas::io::json::light_serializer< T, typename std::enable_if<!std::is_default_constructible< T >::value >::type >::from_json ( const light_json j)
inlinestatic

Unserializes non default constructible data from j using the regular nlohmann::adl_serializer implementation for T.

Equivalent to:

static void from_json(const light_json &j, T &data)
Definition: json.h:123
Parameters
jjson input
Returns
unserialized data

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