Loads or writes binary data with its associated reflection schema from or into a C++ object.
More...
#include <SerializationBinaryTypeErased.h>
|
template<typename T > |
static bool | write (const T &object, Buffer &buffer, size_t *numberOfWrites=nullptr) |
| Writes object T to a buffer.
|
|
template<typename T > |
static bool | loadExact (T &object, Span< const char > buffer, size_t *numberOfReads=nullptr) |
| Reads object T from a buffer, assuming no versioning changes.
|
|
template<typename T > |
static bool | loadVersioned (T &object, Span< const char > buffer, Span< const Reflection::TypeInfo > schema, SerializationBinaryOptions options={}, size_t *numberOfReads=nullptr) |
| Deserialize object T from a Binary buffer with a reflection schema not matching T schema.
|
|
Loads or writes binary data with its associated reflection schema from or into a C++ object.
◆ loadExact()
template<typename T >
static bool SC::SerializationBinaryTypeErased::loadExact |
( |
T & | object, |
|
|
Span< const char > | buffer, |
|
|
size_t * | numberOfReads = nullptr ) |
|
inlinestaticnodiscard |
Reads object T
from a buffer, assuming no versioning changes.
- Template Parameters
-
T | Type of object to be deserialized |
- Parameters
-
object | The object to be deserialized |
buffer | The buffer providing bytes for deserialization |
numberOfReads | If provided, will return the number deserialization operations |
- Returns
true
if the operation succeeded
◆ loadVersioned()
template<typename T >
static bool SC::SerializationBinaryTypeErased::loadVersioned |
( |
T & | object, |
|
|
Span< const char > | buffer, |
|
|
Span< const Reflection::TypeInfo > | schema, |
|
|
SerializationBinaryOptions | options = {}, |
|
|
size_t * | numberOfReads = nullptr ) |
|
inlinestaticnodiscard |
Deserialize object T
from a Binary buffer with a reflection schema not matching T
schema.
- Template Parameters
-
T | Type of object to be deserialized |
- Parameters
-
object | The object to deserialize |
buffer | The buffer holding the bytes to be used for deserialization |
schema | The schema used to serialize data in the buffer |
options | Options for data conversion (allow dropping fields, array items etc) |
numberOfReads | If provided, will return the number deserialization operations |
- Returns
true
if deserialization succeeded
◆ write()
template<typename T >
static bool SC::SerializationBinaryTypeErased::write |
( |
const T & | object, |
|
|
Buffer & | buffer, |
|
|
size_t * | numberOfWrites = nullptr ) |
|
inlinestaticnodiscard |
Writes object T
to a buffer.
- Template Parameters
-
T | Type of object to be serialized |
- Parameters
-
object | The object to be serialized |
buffer | The buffer receiving serialized bytes |
numberOfWrites | If provided, will return the number of serialization operations |
- Returns
true
if the operation succeeded
The documentation for this struct was generated from the following file: