PropertyPath

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

Summary
PropertyPathA PropertyPath is a generic proxy for a data in an object.
Enumerations
NormalizedTypeThe type of data that this path represents.
Functions
PropertyPathdefault constructor.
PropertyPath
PropertyPath
PropertyPath
Write(Reflector&) const
Read(Reflector&) const
Write(string::Fragment) const
Writef
Read(mutable_string) const
Read(string)
Read
IsRefcheck if this path result is a Ref, ArrayRef, or MapRef property
IsOpaquecheck if this path result is an Opaque property (just a Property::Serialize function with no associated structure or Type.
IsDatacheck if this path result is a Data property (not ref, array, map...)
IsDatumcheck if this path result is not an array or map, (may be Data or Ref).
IsMapDatacheck if this path result is a map data property.
IsArrayDatacheck if this path result is an array data property.
DataExistscheck if this path result is an existing map data property, requires IsMapData() or IsArrayData() to be true.
IsArraycheck if this path result is an array property.
IsMapcheck if this path result is a map property.
ArraySizeget the array size, requires IsArray() to be true.
ArrayResizesets the array size, requires IsArray() to be true, and the property should be ArrayProperty.Resizable.
ArrayItemgets an array item as a property path, requires IsArray() to be true.
MapItemgets a map item as a property path, requires IsMap() to be true.
GetTyperetrieves the type of this path as an enum.
GetDataTypethe data class of the property.
GetRefClassthe type of reference of the property.
GetArrayItemTypethe type of items in an array, requires IsArray() to be true.
GetArrayItemRefClassthe type of item pointers in an array of Dynamic *, requires IsArray() and IsRef() to be true.
GetMapKeyTypeThe type of item representing map keys.
GetMapValueTypeThe type of item representing map values.
GetMapRefValueClassThe type of item representing map values.
AnnotationsReturns the annotations for the current property.
AnnotationReturns the annotation by name for the current property.
AnnotationAsReturns the annotation by name for the current property.
ReadValueEasy way to read data templated on data type.
WriteDataEasy way to write data templated on data type.

Enumerations

NormalizedType

The type of data that this path represents.

Datarepresents a basic property (see: DataProperty).
Arrayrepresents a property of many items (see: ArrayProperty).
Maprepresents a property representing a map (see: MapProperty).
Opaquerepresents a custom property which can serialize but provides no apriori hints about its contents.  (see: Property).
Objectrepresents an object, not a property.  // TODO
Invalidbad path.

Functions

PropertyPath

PropertyPath()

default constructor.

PropertyPath

PropertyPath(const Persistent *,
Persistent *)

PropertyPath

PropertyPath(Persistent *)

PropertyPath

PropertyPath(const Persistent *)

Write(Reflector&) const

void Write(Reflector &reflector) const

Read(Reflector&) const

void Read(Reflector &reflector) const

Write(string::Fragment) const

bool Write(string::Fragment) const

Writef

bool Writef(const char *format,
 ...) const

Read(mutable_string) const

bool Read(string::MutableString) const

Read(string)

bool Read(string::String&) const

Read

string::String Read() const

IsRef

bool IsRef() const

check if this path result is a Ref, ArrayRef, or MapRef property

IsOpaque

bool IsOpaque() const

check if this path result is an Opaque property (just a Property::Serialize function with no associated structure or Type.

IsData

bool IsData() const

check if this path result is a Data property (not ref, array, map...).

IsDatum

bool IsDatum() const

check if this path result is not an array or map, (may be Data or Ref).

IsMapData

bool IsMapData() const

check if this path result is a map data property.  Map data may not exist (until it is added to the map).

IsArrayData

bool IsArrayData() const

check if this path result is an array data property.  Array data is may not exist (until the underlying vector is resized).

DataExists

bool DataExists() const

check if this path result is an existing map data property, requires IsMapData() or IsArrayData() to be true.

IsArray

bool IsArray() const

check if this path result is an array property.

IsMap

bool IsMap() const

check if this path result is a map property.

ArraySize

unsigned ArraySize() const

get the array size, requires IsArray() to be true.

ArrayResize

bool ArrayResize(unsigned newsize) const

sets the array size, requires IsArray() to be true, and the property should be ArrayProperty.Resizable.

ArrayItem

PropertyPath ArrayItem(unsigned index) const

gets an array item as a property path, requires IsArray() to be true.

MapItem

PropertyPath MapItem(string::Fragment key) const

gets a map item as a property path, requires IsMap() to be true.

GetType

NormalizedType GetType() const

retrieves the type of this path as an enum.

GetDataType

const Type *GetDataType() const

the data class of the property. requires IsDatum() to be true.

GetRefClass

const Class *GetRefClass() const

the type of reference of the property.

GetArrayItemType

const Type *GetArrayItemType() const

the type of items in an array, requires IsArray() to be true.

GetArrayItemRefClass

const Class *GetArrayItemRefClass() const

the type of item pointers in an array of Dynamic *, requires IsArray() and IsRef() to be true.

GetMapKeyType

const Type *GetMapKeyType() const

The type of item representing map keys.  Requires IsMap() to be true.

GetMapValueType

const Type *GetMapValueType() const

The type of item representing map values.  Requires IsMap() to be true.

GetMapRefValueClass

const Class *GetMapRefValueClass() const

The type of item representing map values.  Requires IsMap() and IsRef() to be true.

Annotations

const PersistentClass::Annotations *Annotations() const

Returns the annotations for the current property.

Annotation

Variant Annotation(string::Fragment name) const

Returns the annotation by name for the current property.

AnnotationAs

template<typename T> T AnnotationAs(string::Fragment name) const

Returns the annotation by name for the current property.

ReadValue

template<typename T> bool ReadValue(&data) const

Easy way to read data templated on data type.

WriteData

Easy way to write data templated on data type.

class ReflectExport(reflect) PropertyPath
A PropertyPath is a generic proxy for a data in an object.
PropertyPath()
default constructor.
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
bool IsRef() const
check if this path result is a Ref, ArrayRef, or MapRef property
bool IsOpaque() const
check if this path result is an Opaque property (just a Property::Serialize function with no associated structure or Type.
virtual void Serialize(const void *in,
void *out,
Reflector &reflector) const = 0
Reads or writes the represented data using a Reflector.
bool IsData() const
check if this path result is a Data property (not ref, array, map...)
bool IsDatum() const
check if this path result is not an array or map, (may be Data or Ref).
bool IsMapData() const
check if this path result is a map data property.
bool IsArrayData() const
check if this path result is an array data property.
bool DataExists() const
check if this path result is an existing map data property, requires IsMapData() or IsArrayData() to be true.
bool IsArray() const
check if this path result is an array property.
bool IsMap() const
check if this path result is a map property.
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.
virtual bool Resizable(const void *) const = 0
Checks if the array/vector represented by this property is 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.
NormalizedType GetType() const
retrieves the type of this path as an enum.
const Type *GetDataType() const
the data class of the property.
const Class *GetRefClass() const
the type of reference of the property.
const Type *GetArrayItemType() const
the type of items in an array, requires IsArray() to be true.
const Class *GetArrayItemRefClass() const
the type of item pointers in an array of Dynamic *, requires IsArray() and IsRef() to be true.
const Type *GetMapKeyType() const
The type of item representing map keys.
const Type *GetMapValueType() const
The type of item representing map values.
const Class *GetMapRefValueClass() const
The type of item representing map values.
const PersistentClass::Annotations *Annotations() const
Returns the annotations 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
Returns the annotation by name for the current property.
template<typename T> bool ReadValue(&data) const
Easy way to read data templated on data type.
class ReflectExport(reflect) Dynamic
This class defines the core interface for all runtime type identification (RTTI) in reflect.
static bool ResolvePropertyPath(PropertyPath &result,
const Persistent *,
string::Fragment path)
class ReflectExport(reflect) Reflector
Reflectors provides an easy and uniform interface for using Serializers, and Deserializers, and maintain a bool for error detection/handling.
class ReflectExport(reflect) StandardSerializer : public Serializer
A basic ascii text serializer.
class ReflectExport(reflect) StandardDeserializer : public Deserializer
A basic ascii text deserializer.
class ReflectExport(reflect) DataProperty : public Property
Properties represent a single data element.
class ReflectExport(reflect) ArrayProperty : public Property
ArrayProperties represent numerically indexed data.
class ReflectExport(reflect) MapProperty : public Property
MapProperties represent key indexed data.
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