Pyrogenesis trunk
Classes | Namespaces | Typedefs | Functions
SerializeTemplates.h File Reference

Helper templates definitions for serializing/deserializing common objects. More...

#include "simulation2/serialization/ISerializer.h"
#include "simulation2/serialization/IDeserializer.h"
Include dependency graph for SerializeTemplates.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SerializeHelper< T, SFINAE >
 

Namespaces

namespace  Serialize
 

Typedefs

template<typename S , class T >
using Serialize::qualify = std::conditional_t< std::is_same_v< S, ISerializer & >, const T &, T & >
 

Functions

template<typename T , typename S , typename... Args>
void Serializer (S &serialize, const char *name, Args &&... args)
 
template<typename T , typename S , typename... Args>
void Serializer (S &serialize, const char *name, T &&value, Args &&... args)
 

Detailed Description

Helper templates definitions for serializing/deserializing common objects.

Usage: You need to (partially) specialize SerializeHelper for your type. The optional SFINAE argument can be used to provide generic specializations via std::enable_if_t<T>. If both paths are common, you can templatize operator()'s first argument, but you will need to templatize the passed value to account for different value categories.

See SerializedTypes.h for some examples.

Function Documentation

◆ Serializer() [1/2]

template<typename T , typename S , typename... Args>
void Serializer ( S &  serialize,
const char *  name,
Args &&...  args 
)

◆ Serializer() [2/2]

template<typename T , typename S , typename... Args>
void Serializer ( S &  serialize,
const char *  name,
T &&  value,
Args &&...  args 
)