MapProperty

class ReflectExport(reflect) MapProperty : public Property

MapProperties represent key indexed data.

MapProperties provide key-based access and complete iteration through a callback.

See Also

Summary
MapPropertyMapProperties represent key indexed data.
Functions
ForEachKeyCalls a callback with every key in the map.
HasKeyChecks if the map has an element for the given key.
ReadDataReads the value for key.
WriteDataWrites a (possibly new) map entry.
KeyTypeRetrieves the type of keys represented by this map property.
ValueTypeRetrieves the type of values represented by this map property.

Functions

ForEachKey

virtual void ForEachKey(const void *in,  
void (*)(const Variant &key, void *ctx),  
void *ctx =  0) const = 0

Calls a callback with every key in the map.  This is the only way to iterate over the map.

HasKey

virtual bool HasKey(const void *in,
const Variant &key) const = 0

Checks if the map has an element for the given key.

ReadData

virtual bool ReadData(const void *in,
const Variant &key,
Variant &value) const = 0

Reads the value for key.

Returns

trueif the value is successfully read.
falseif the key doesn’t exist, if the key is incompatible, or if the value can’t be copied into value.

WriteData

virtual bool WriteData(void *in,
const Variant &key,
const Variant &value) const = 0

Writes a (possibly new) map entry.

Returns

trueif the value is successfully written.
falseif the key is incompatible or the value is incompatible, or if the map cannot be extended with the new key.

KeyType

virtual const Type *KeyType() const = 0

Retrieves the type of keys represented by this map property.

ValueType

virtual const Type *ValueType() const = 0

Retrieves the type of values represented by this map property.

class ReflectExport(reflect) MapProperty : public Property
MapProperties represent key indexed data.
virtual void ForEachKey(const void *in,  
void (*)(const Variant &key, void *ctx),  
void *ctx =  0) const = 0
Calls a callback with every key in the map.
virtual bool HasKey(const void *in,
const Variant &key) const = 0
Checks if the map has an element for the given key.
virtual bool ReadData(const void *in,
const Variant &key,
Variant &value) const = 0
Reads the value for key.
virtual bool WriteData(void *in,
const Variant &key,
const Variant &value) const = 0
Writes a (possibly new) map entry.
virtual const Type *KeyType() const = 0
Retrieves the type of keys represented by this map property.
virtual const Type *ValueType() const = 0
Retrieves the type of values represented by this map property.
class ReflectExport(reflect) Property : public Dynamic
Properties represent data in a reflected type, and can be used to Serialize that data through a Reflector.
Close