struct TRTTIPlainTypeImplementation

template<class T, typename = void>

Default implementation of RTTIPlainType for a particular type T.

Separated from RTTIPlainType primarily so we can specialize this for entire category of objects (such as enums) using std::enable_if. Default implementation causes a compile error if used, because user must explicitly specialize it.

Public

Methods

staticToMemory

static BitLength ToMemory(const T &data, Bitstream &stream, const RTTIFieldInfo &fieldInfo, bool compress)

Serializes the provided object into the provided stream and advances the stream cursor.

Returns the number of bytes written. If is true the serialization system is allowed to compress the data into bits (e.g. a boolean can be represented via a single bit), otherwise it is guaranteed the written data will be aligned to byte boundaries. can be used for providing additional data, such as wanted method of serialization and compression.

staticFromMemory

static BitLength FromMemory(T &data, Bitstream &stream, const RTTIFieldInfo &fieldInfo, bool compress)

Deserializes a previously allocated object from the provided stream and advances the stream cursor.

Return the number of bytes read. and should match the values provided when it was originally encoded using toMemory(). See toMemory() for the description of those parameters.

staticGetSize

static BitLength GetSize(const T &data, const RTTIFieldInfo &fieldInfo, bool compress)

Returns the size of the provided object. (Works for both static and dynamic size types)

staticToMemory

static BitLength ToMemory(const T &data, Bitstream &stream, const RTTIFieldInfo &fieldInfo, bool compress)

staticFromMemory

static BitLength FromMemory(T &data, Bitstream &stream, const RTTIFieldInfo &fieldInfo, bool compress)

staticGetSize

static BitLength GetSize(const T &data, const RTTIFieldInfo &fieldInfo, bool compress)

Returns the size of the provided object. (Works for both static and dynamic size types)