OSVR-Core
|
Traits class indicating how to serialize a type with a given tag. More...
#include <SerializationTraits.h>
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 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
.