VersionDecorator

Alternative contiguous version decorator implementation for usage in less performance critical applications. Is capable of converting through multiple struct versions in one go for added convenience.

Amount of allowed conversions for single call is set via constructor argument, 10 by default

Constructors

this
this(size_t limit, size_t buffer_size)

Constructor

Members

Aliases

This
alias This = VersionDecorator

Convenience shortcut

Functions

convert
Contiguous!(S) convert(Buffer!(void) buffer)
Contiguous!(S) convert(void[] buffer)

Helper method that takes care of actual conversion routine between two struct types (those are assumed to be of compatible versions)

handleVersion
Contiguous!(S) handleVersion(Buffer!(void) buffer, Version.Type input_version)
Contiguous!(S) handleVersion(void[] buffer, Version.Type input_version)

Utility method to convert struct contained in input buffer to needed struct version. Converted struct will be stored in the same buffer replacing old data.

load
Contiguous!(S) load(Buffer!(void) buffer)
Contiguous!(S) load(void[] buffer)

Loads versioned struct from buffer in-place

loadCopy
Contiguous!(S) loadCopy(void[] buffer, Contiguous!(S) copy_buffer)

Loads versioned struct from buffer and stores resulting data in copy_buffer, leaving buffer untouched.

Static functions

store
void[] store(S input, Buffer!(void) buffer)
void[] store(S input, D[] buffer)

Serializes input with This.Serializer and prepends version number before struct data in the buffer.

Variables

e
VersionHandlingException e;

Reused exception instance

Meta