OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Functions | Variables
tags Namespace Reference

Functions

constexpr PresizedTag presized (size_t size)
 
template<class T >
constexpr ContextTag< T > context (const T &ctx)
 

Variables

constexpr UnsizedTag unsized
 
constexpr AppendTag append
 
template<class From , class To >
constexpr CastTag< From, To > cast
 
template<auto First, auto Last>
constexpr SegmentTag< First, Last > segment
 
constexpr ReverseBitOrderTag reverseBits
 
template<class Via >
constexpr ViaTag< Via > via
 

Function Documentation

◆ context()

template<class T >
constexpr ContextTag< T > tags::context ( const T &  ctx)
constexpr

This tag is mainly for the users who want to pass additional context into their serialization routines. The way to do this is to accept a ContextTag as the last parameter in the serialization function, and then pass the context into the call by invoking tags::context at the call site.

Parameters
ctxContext to pass to the serialization routine.
Returns
Tag object containing a reference to the passed context.

◆ presized()

constexpr PresizedTag tags::presized ( size_t  size)
constexpr

Deserialization tag that instructs the binary serialization to use the supplied vector size instead of reading it from the stream. Note that this implies that the serialization must have been performed with the tags::unsized tag.

Parameters
sizeNumber of elements to deserialize.
Returns
Tag object to be passed into the deserialize call.
See also
unsized

Variable Documentation

◆ append

constexpr AppendTag tags::append
constexpr

Deserialization tag that instructs the binary serialization framework to append deserialized elements into the target vector instead of replacing its contents. This is useful when you want to deserialize several sequences into the same std::vector - normally, subsequent deserialize calls would replace the vector contents, but using this tag lets you accumulate the results of several deserialize calls instead.

◆ cast

template<class From , class To >
constexpr CastTag<From, To> tags::cast
constexpr

◆ reverseBits

constexpr ReverseBitOrderTag tags::reverseBits
constexpr

◆ segment

template<auto First, auto Last>
constexpr SegmentTag<First, Last> tags::segment
constexpr

◆ unsized

constexpr UnsizedTag tags::unsized
constexpr

Serialization tag that instructs the binary serialization framework to NOT write the vector size into the stream. Note that this implies that you'll have to use the tags::presized tag when deserializing.

See also
presized

◆ via

template<class Via >
constexpr ViaTag<Via> tags::via
constexpr

Deserialization tag that instructs the binary serialization framework to first read a Via object from a stream, and then use it to reconstruct the target object.

Example usage:

Blob headerBlob = readHeaderBlob();
deserialize(headerBlob, &header, tags::via<SaveGameHeader_MM7>);
void deserialize(InputStream &src, IndoorLocation_MM7 *dst)
Definition: CompositeSnapshots.cpp:149
Definition: Blob.h:23
Definition: SaveLoad.h:15
Template Parameters
ViaIntermediate type to read from the stream.