class ReflectExport( reflect ) PropertyPath
A PropertyPath is a generic proxy for a data in an object. It can represent data, a Dynamic pointer, an array, a map, an array of pointers, etc...
PropertyPaths are normally constructed using PersistentClass.ResolvePropertyPath.
Reading and writing data using property paths can be done using Reflectors or by strings (which are serialized or deserialized with StandardSerializers and StandardDeserializers).
PropertyPaths
PropertyPath | A PropertyPath is a generic proxy for a data in an object. |
Enumerations | |
NormalizedType | The type of data that this path represents. |
Functions | |
PropertyPath | default constructor. |
PropertyPath | |
PropertyPath | |
PropertyPath | |
Write(Reflector&) const | |
Read(Reflector&) const | |
Write(string:: | |
Writef | |
Read(mutable_string) const | |
Read(string) | |
Read | |
IsRef | check if this path result is a Ref, ArrayRef, or MapRef property |
IsOpaque | check if this path result is an Opaque property (just a Property::Serialize function with no associated structure or Type. |
IsData | check if this path result is a Data property (not ref, array, map...) |
IsDatum | check if this path result is not an array or map, (may be Data or Ref). |
IsMapData | check if this path result is a map data property. |
IsArrayData | check if this path result is an array data property. |
DataExists | check if this path result is an existing map data property, requires IsMapData() or IsArrayData() to be true. |
IsArray | check if this path result is an array property. |
IsMap | check if this path result is a map property. |
ArraySize | get the array size, requires IsArray() to be true. |
ArrayResize | sets the array size, requires IsArray() to be true, and the property should be ArrayProperty.Resizable. |
ArrayItem | gets an array item as a property path, requires IsArray() to be true. |
MapItem | gets a map item as a property path, requires IsMap() to be true. |
GetType | retrieves the type of this path as an enum. |
GetDataType | the data class of the property. |
GetRefClass | the type of reference of the property. |
GetArrayItemType | the type of items in an array, requires IsArray() to be true. |
GetArrayItemRefClass | the type of item pointers in an array of Dynamic *, requires IsArray() and IsRef() to be true. |
GetMapKeyType | The type of item representing map keys. |
GetMapValueType | The type of item representing map values. |
GetMapRefValueClass | The type of item representing map values. |
Annotations | Returns the annotations for the current property. |
Annotation | Returns the annotation by name for the current property. |
AnnotationAs | Returns the annotation by name for the current property. |
ReadValue | Easy way to read data templated on data type. |
WriteData | Easy way to write data templated on data type. |
The type of data that this path represents.
Data | represents a basic property (see: DataProperty). |
Array | represents a property of many items (see: ArrayProperty). |
Map | represents a property representing a map (see: MapProperty). |
Opaque | represents a custom property which can serialize but provides no apriori hints about its contents. (see: Property). |
Object | represents an object, not a property. // TODO |
Invalid | bad path. |
bool IsOpaque() const
check if this path result is an Opaque property (just a Property::Serialize function with no associated structure or Type.
bool DataExists() const
check if this path result is an existing map data property, requires IsMapData() or IsArrayData() to be true.
unsigned ArraySize() const
get the array size, requires IsArray() to be true.
bool ArrayResize( unsigned newsize ) const
sets the array size, requires IsArray() to be true, and the property should be ArrayProperty.Resizable.
PropertyPath ArrayItem( unsigned index ) const
gets an array item as a property path, requires IsArray() to be true.
PropertyPath MapItem( string:: Fragment key ) const
gets a map item as a property path, requires IsMap() to be true.
const Type *GetDataType() const
the data class of the property. requires IsDatum() to be true.
const Type *GetArrayItemType() const
the type of items in an array, requires IsArray() to be true.
const Type *GetMapKeyType() const
The type of item representing map keys. Requires IsMap() to be true.
const Type *GetMapValueType() const
The type of item representing map values. Requires IsMap() to be true.
A PropertyPath is a generic proxy for a data in an object.
class ReflectExport( reflect ) PropertyPath
default constructor.
PropertyPath()
void Write( Reflector & reflector ) const
void Read( Reflector & reflector ) const
bool Write( string::Fragment ) const
bool Writef( const char * format, ... ) const
bool Read( string::MutableString ) const
bool Read( string::String& ) const
string::String Read() const
check if this path result is a Ref, ArrayRef, or MapRef property
bool IsRef() const
check if this path result is an Opaque property (just a Property::Serialize function with no associated structure or Type.
bool IsOpaque() const
Reads or writes the represented data using a Reflector.
virtual void Serialize( const void * in, void * out, Reflector & reflector ) const = 0
check if this path result is a Data property (not ref, array, map...)
bool IsData() const
check if this path result is not an array or map, (may be Data or Ref).
bool IsDatum() const
check if this path result is a map data property.
bool IsMapData() const
check if this path result is an array data property.
bool IsArrayData() const
check if this path result is an existing map data property, requires IsMapData() or IsArrayData() to be true.
bool DataExists() const
check if this path result is an array property.
bool IsArray() const
check if this path result is a map property.
bool IsMap() const
get the array size, requires IsArray() to be true.
unsigned ArraySize() const
sets the array size, requires IsArray() to be true, and the property should be ArrayProperty.Resizable.
bool ArrayResize( unsigned newsize ) const
Checks if the array/vector represented by this property is resizable.
virtual bool Resizable( const void * ) const = 0
gets an array item as a property path, requires IsArray() to be true.
PropertyPath ArrayItem( unsigned index ) const
gets a map item as a property path, requires IsMap() to be true.
PropertyPath MapItem( string:: Fragment key ) const
retrieves the type of this path as an enum.
NormalizedType GetType() const
the data class of the property.
const Type *GetDataType() const
the type of reference of the property.
const Class *GetRefClass() const
the type of items in an array, requires IsArray() to be true.
const Type *GetArrayItemType() const
the type of item pointers in an array of Dynamic *, requires IsArray() and IsRef() to be true.
const Class *GetArrayItemRefClass() const
The type of item representing map keys.
const Type *GetMapKeyType() const
The type of item representing map values.
const Type *GetMapValueType() const
The type of item representing map values.
const Class *GetMapRefValueClass() const
Returns the annotations for the current property.
const PersistentClass::Annotations *Annotations() const
Returns the annotation by name for the current property.
Variant Annotation( string:: Fragment name ) const
Returns the annotation by name for the current property.
template<typename T> T AnnotationAs( string:: Fragment name ) const
Easy way to read data templated on data type.
template<typename T> bool ReadValue( T & data ) const
This class defines the core interface for all runtime type identification (RTTI) in reflect.
class ReflectExport( reflect ) Dynamic
static bool ResolvePropertyPath( PropertyPath & result, const Persistent * , string:: Fragment path )
Reflectors provides an easy and uniform interface for using Serializers, and Deserializers, and maintain a bool for error detection/handling.
class ReflectExport( reflect ) Reflector
A basic ascii text serializer.
class ReflectExport( reflect ) StandardSerializer : public Serializer
A basic ascii text deserializer.
class ReflectExport( reflect ) StandardDeserializer : public Deserializer
Properties represent a single data element.
class ReflectExport( reflect ) DataProperty : public Property
ArrayProperties represent numerically indexed data.
class ReflectExport( reflect ) ArrayProperty : public Property
MapProperties represent key indexed data.
class ReflectExport( reflect ) MapProperty : public Property
Properties represent data in a reflected type, and can be used to Serialize that data through a Reflector.
class ReflectExport( reflect ) Property : public Dynamic