Twitch SDK (Internal)
Static Public Member Functions | Static Private Member Functions | List of all members
ttv::json::ObjectSchema< ObjectDescription > Struct Template Reference

#include <jsonserialization.h>

Static Public Member Functions

template<typename OutputType >
static bool Parse (const ttv::json::Value &value, OutputType &output)
 
template<typename InputType >
static bool Emit (const InputType &input, ttv::json::Value &value)
 

Static Private Member Functions

template<typename FieldsTuple >
static bool ParseValues (const ttv::json::Value &value, FieldsTuple &&tuple)
 
template<int index, typename FieldsTuple >
static std::enable_if_t<(index< std::tuple_size< FieldsTuple >::value), bool > ParseValuesAtIndex (const ttv::json::Value &value, FieldsTuple &&tuple)
 
template<int index, typename FieldsTuple >
static std::enable_if_t<(index >=std::tuple_size< FieldsTuple >::value), bool > ParseValuesAtIndex (const ttv::json::Value &, FieldsTuple &&)
 
template<typename FieldsTuple >
static bool EmitValues (ttv::json::Value &value, FieldsTuple &&tuple)
 
template<int index, typename FieldsTuple >
static std::enable_if_t<(index< std::tuple_size< FieldsTuple >::value), bool > EmitValuesAtIndex (ttv::json::Value &value, FieldsTuple &&tuple)
 
template<int index, typename FieldsTuple >
static std::enable_if_t<(index >=std::tuple_size< FieldsTuple >::value), bool > EmitValuesAtIndex (ttv::json::Value &, FieldsTuple &&)
 

Detailed Description

template<typename ObjectDescription>
struct ttv::json::ObjectSchema< ObjectDescription >

Object Schema

The ObjectSchema is a reusable schema that takes in an ObjectDescription type, which conforms to the following concept:

struct ObjectDescription
{
template <typename ObjectType>
static auto BindFields(ObjectType& info);
};

It must provide an implementation of the static method "BindFields", which provides a tuple of JavaField objects (documented below) that map JSON fields to C++ fields. The method is templated so that it can bind to the fields of const and non-const objects.

Member Function Documentation

◆ Emit()

template<typename ObjectDescription >
template<typename InputType >
static bool ttv::json::ObjectSchema< ObjectDescription >::Emit ( const InputType &  input,
ttv::json::Value value 
)
inlinestatic

◆ EmitValues()

template<typename ObjectDescription >
template<typename FieldsTuple >
static bool ttv::json::ObjectSchema< ObjectDescription >::EmitValues ( ttv::json::Value value,
FieldsTuple &&  tuple 
)
inlinestaticprivate

◆ EmitValuesAtIndex() [1/2]

template<typename ObjectDescription >
template<int index, typename FieldsTuple >
static std::enable_if_t<(index < std::tuple_size<FieldsTuple>::value), bool> ttv::json::ObjectSchema< ObjectDescription >::EmitValuesAtIndex ( ttv::json::Value value,
FieldsTuple &&  tuple 
)
inlinestaticprivate

◆ EmitValuesAtIndex() [2/2]

template<typename ObjectDescription >
template<int index, typename FieldsTuple >
static std::enable_if_t<(index >= std::tuple_size<FieldsTuple>::value), bool> ttv::json::ObjectSchema< ObjectDescription >::EmitValuesAtIndex ( ttv::json::Value ,
FieldsTuple &&   
)
inlinestaticprivate

◆ Parse()

template<typename ObjectDescription >
template<typename OutputType >
static bool ttv::json::ObjectSchema< ObjectDescription >::Parse ( const ttv::json::Value value,
OutputType &  output 
)
inlinestatic

◆ ParseValues()

template<typename ObjectDescription >
template<typename FieldsTuple >
static bool ttv::json::ObjectSchema< ObjectDescription >::ParseValues ( const ttv::json::Value value,
FieldsTuple &&  tuple 
)
inlinestaticprivate

◆ ParseValuesAtIndex() [1/2]

template<typename ObjectDescription >
template<int index, typename FieldsTuple >
static std::enable_if_t<(index < std::tuple_size<FieldsTuple>::value), bool> ttv::json::ObjectSchema< ObjectDescription >::ParseValuesAtIndex ( const ttv::json::Value value,
FieldsTuple &&  tuple 
)
inlinestaticprivate

◆ ParseValuesAtIndex() [2/2]

template<typename ObjectDescription >
template<int index, typename FieldsTuple >
static std::enable_if_t<(index >= std::tuple_size<FieldsTuple>::value), bool> ttv::json::ObjectSchema< ObjectDescription >::ParseValuesAtIndex ( const ttv::json::Value ,
FieldsTuple &&   
)
inlinestaticprivate

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