![]() |
XII Release 0.1.0
|
Stores a path from an object of a given type to a property inside of it. Once initialized to a specific path, the target property/object of the path can be read or written on multiple root objects. An empty path is allowed in which case WriteToLeafObject/ReadFromLeafObject will return pRootObject directly. More...
#include <PropertyPath.h>
Public Member Functions | |
| bool | IsValid () const |
| Returns true if InitializeFromPath() has been successfully called and it is therefore possible to use the other functions. | |
| xiiResult | InitializeFromPath (const xiiRTTI &rootObjectRtti, xiiStringView sPath) |
| Resolves a path in the syntax 'propertyName[index]/propertyName[index]/...' into steps. The '[index]' part is only added for properties that require indices (arrays and maps). | |
| xiiResult | InitializeFromPath (const xiiRTTI *pRootObjectRtti, const xiiArrayPtr< const xiiPropertyPathStep > path) |
| Resolves a path provided as an array of xiiPropertyPathStep. | |
| xiiResult | WriteToLeafObject (void *pRootObject, const xiiRTTI *pType, xiiDelegate< void(void *pLeaf, const xiiRTTI &pType)> func) const |
| Applies the entire path and allows writing to the target object. | |
| xiiResult | ReadFromLeafObject (void *pRootObject, const xiiRTTI *pType, xiiDelegate< void(void *pLeaf, const xiiRTTI &pType)> func) const |
| Applies the entire path and allows reading from the target object. | |
| xiiResult | WriteProperty (void *pRootObject, const xiiRTTI &type, xiiDelegate< void(void *pLeafObject, const xiiRTTI &pLeafType, const xiiAbstractProperty *pProp, const xiiVariant &index)> func) const |
| Applies the path up to the last step and allows a functor to write to the final property. | |
| xiiResult | ReadProperty (void *pRootObject, const xiiRTTI &type, xiiDelegate< void(void *pLeafObject, const xiiRTTI &pLeafType, const xiiAbstractProperty *pProp, const xiiVariant &index)> func) const |
| Applies the path up to the last step and allows a functor to read from the final property. | |
| void | SetValue (void *pRootObject, const xiiRTTI &type, const xiiVariant &value) const |
| Convenience function that writes 'value' to the 'pRootObject' at the current path. | |
| template<typename T> | |
| XII_ALWAYS_INLINE void | SetValue (T *pRootObject, const xiiVariant &value) const |
| Convenience function that writes 'value' to the 'pRootObject' at the current path. | |
| void | GetValue (void *pRootObject, const xiiRTTI &type, xiiVariant &out_value) const |
| Convenience function that reads the value from 'pRootObject' at the current path and stores it in 'out_value'. | |
| template<typename T> | |
| XII_ALWAYS_INLINE void | GetValue (T *pRootObject, xiiVariant &out_value) const |
| Convenience function that reads the value from 'pRootObject' at the current path and stores it in 'out_value'. | |
Stores a path from an object of a given type to a property inside of it. Once initialized to a specific path, the target property/object of the path can be read or written on multiple root objects. An empty path is allowed in which case WriteToLeafObject/ReadFromLeafObject will return pRootObject directly.
TODO: read/write methods and ResolvePath should return a failure state.