OSVR Framework (Internal Development Docs)  0.6-1962-g59773924
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
osvr::common::serialization::SerializationTraits< Tag, Dummy > Struct Template Reference

Traits class indicating how to serialize a type with a given tag. The default tag for a type T is DefaultSerializationTag<T> More...

#include <osvr/Common/SerializationTraits.h>

Detailed Description

template<typename Tag, typename Dummy = void>
struct osvr::common::serialization::SerializationTraits< Tag, Dummy >

Traits class indicating how to serialize a type with a given tag. The default tag for a type T is DefaultSerializationTag<T>

Note that if you're serializing a simple struct-like type, you have an easier route than specializing this traits template: see SimpleStructSerialization

A traits class must implement:

  • `template <typename buffertype>=""> static void serialize(BufferType &buf, typename Base::param_type val, Tag const&) -template <typename bufferreadertype>=""> static void deserialize(BufferReaderType &buf, typename Base::reference_type val, Tag const&) -static size_t spaceRequired(size_t existingBytes, typename Base::param_type val, Tag const&)`

The tag parameter may be used to pass runtime arguments in (like a length), if required.

A traits class should inherit from BaseSerializationTraits<T> to get useful typedefs.

See the internals example SerializationTraitExample_Complicated.h for a starting point.

The dummy template parameter exists for usage of enable_if.

Definition at line 86 of file SerializationTraits.h.


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