ArrayProperty

class ReflectExport(reflect) ArrayProperty : public Property

ArrayProperties represent numerically indexed data.  The data represented may be either resizable, like a vector, or not, like a plain array.

See Also

Summary
ArrayPropertyArrayProperties represent numerically indexed data.
Functions
SerializeItemReads/writes a single item to the reflector.
SizeGets the current size of the array/vector in the object.
ResizableChecks if the array/vector represented by this property is resizable.
ResizeResizes the array/vector in the object.
ReadDataReads the array and stores the value into the Variant.
WriteDataWrites the Variant value to the array.
RefDataRefs the Variant to the array index.
ItemTypereturns the type of the items in the property.
SerializeSerializes the entire array/vector.

Functions

SerializeItem

virtual void SerializeItem(const void *in,
void *out,
unsigned index,
Reflector &reflector) const = 0

Reads/writes a single item to the reflector.  Used by the ArrayProperty::Serialize.

Size

virtual unsigned Size(const void *object) const = 0

Gets the current size of the array/vector in the object.

Resizable

virtual bool Resizable(const void *) const = 0

Checks if the array/vector represented by this property is resizable.

Resize

virtual bool Resize(void *,
unsigned size) const = 0

Resizes the array/vector in the object.

Returns

trueif the array size became size (even if not resizable)
falseif the array is not resiable and not of size size.

ReadData

virtual bool ReadData(const void *,
unsigned item_index,
Variant &) const = 0

Reads the array and stores the value into the Variant.

Returns

truewhen the index is valid and the value is read/converted successfully.

Example (read an int from a numeric array)

int i;
array_prop->ReadData(opaque_cast(object), 3, Variant::RefValue(i));

Example (read an anything and display it)

Variant value;
array_prop->ReadData(opaque_cast(object), 3, value);
printf("object->array_prop[3] is %s of type %s\n", value.ToString().c_str(), value.GetType()->Name());

WriteData

virtual bool WriteData(void *object,
unsigned item_index,
const Variant &value) const = 0

Writes the Variant value to the array.

Returns

truewhen the index is valid and the value is written/converted successfully.

RefData

virtual bool RefData(const void *in,
void *out,
unsigned item_index,
Variant &) const = 0

Refs the Variant to the array index.

Returns

truewhen the index is valid and the value can be referenced
falseotherwise

ItemType

virtual Type *ItemType() const = 0

returns the type of the items in the property.

Serialize

void Serialize(const void *in,
void *out,
Reflector &reflector) const

Serializes the entire array/vector.

If the property is Resizable then a [size=%d] SerializationTag::AttributeTag will be emitted here.

Implements Property::Serialize

class ReflectExport(reflect) ArrayProperty : public Property
ArrayProperties represent numerically indexed data.
virtual void SerializeItem(const void *in,
void *out,
unsigned index,
Reflector &reflector) const = 0
Reads/writes a single item to the reflector.
virtual unsigned Size(const void *object) const = 0
Gets the current size of the array/vector in the object.
virtual bool Resizable(const void *) const = 0
Checks if the array/vector represented by this property is resizable.
virtual bool Resize(void *,
unsigned size) const = 0
Resizes the array/vector in the object.
virtual bool ReadData(const void *,
unsigned item_index,
Variant &) const = 0
Reads the array and stores the value into the Variant.
class ReflectExport(reflect) Variant
Variants represent objects of any reflected type.
virtual bool WriteData(void *object,
unsigned item_index,
const Variant &value) const = 0
Writes the Variant value to the array.
virtual bool RefData(const void *in,
void *out,
unsigned item_index,
Variant &) const = 0
Refs the Variant to the array index.
virtual Type *ItemType() const = 0
returns the type of the items in the property.
void Serialize(const void *in,
void *out,
Reflector &reflector) const
Serializes the entire array/vector.
class ReflectExport(reflect) Property : public Dynamic
Properties represent data in a reflected type, and can be used to Serialize that data through a Reflector.
Starts an Attribute, the text specifies the Attribute name.
virtual void Serialize(const void *in,
void *out,
Reflector &reflector) const = 0
Reads or writes the represented data using a Reflector.
Close