OSVR Framework (Internal Development Docs)  0.6-1962-g59773924
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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 <osvr/Common/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

Definition at line 153 of file SerializationTraits.h.


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