OSVR-Core
osvr::common::serialization::SimpleStructSerialization< T > Struct Template Reference

An alternate, simpler method of serializing things that are effectively structs is to explicitly specialize SimpleStructSerialization for your type, inheriting from SimpleStructSerializationBase, and having a member: template <typename F, typename T> static void apply(F &f, T &val) that just calls f with each member of your type (which will come in as val), optionally with a serialization tag. More...

#include <SerializationTraits.h>

Detailed Description

template<typename T>
struct osvr::common::serialization::SimpleStructSerialization< T >

An alternate, simpler method of serializing things that are effectively structs is to explicitly specialize SimpleStructSerialization for your type, inheriting from SimpleStructSerializationBase, and having a member: template <typename F, typename T> static void apply(F &f, T &val) that just calls f with each member of your type (which will come in as val), optionally with a serialization tag.

Explicitly specializing this template as instructed produces the more complex serialization code automatically.

See the internals example SerializationTraitExample_Simple.h


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