struct RTTIDataBlockFieldBase

Inherits: RTTIField

Base class containing common functionality for a data block class field.

Data block fields contain blocks of memory that may, or may not be released automatically when they are no longer referenced. When such fields are being deserialized, the stream will point directly to the location we're deserializing from (e.g. a file). This allows the caller either to immediately read the data, or store the stream pointer for a streaming read later.

Public

Methods

GetValue

virtual SPtr<DataStream> GetValue(RTTIType *rtti, void *object, u32 &size) = 0

Retrieves a data block from the specified instance.

SetValue

virtual void SetValue(RTTIType *rtti, void *object, const SPtr<DataStream> &data, u32 size) = 0

Sets a data block on the specified instance.

~RTTIField

virtual ~RTTIField() noexcept = default

InitSchema

virtual void InitSchema()

Initializes the field's RTTI schema.

Should be called once after construction.

CheckIsArray

void CheckIsArray(bool array) const

Throws an exception depending if the field is or isn't an array.

array
If true, then exception will be thrown if field is not an array. If false, then it will be thrown if field is an array.

Fields

Name

String Name

Schema

Protected

Methods

Init

void Init(String name, const RTTIFieldSchema &schema)