Location into a range. More...
#include <kanzi/core/property/abstract_range.hpp>
Public Member Functions | |
bool | advance () |
Advances the location. More... | |
unique_ptr< AbstractRangeLocation > | clone () |
Returns a clone of this range location. More... | |
PropertyObjectSharedPtr | getPropertyObject () |
Access to a property object at the location. More... | |
bool | getPropertyValue (AbstractPropertyType propertyType, Variant &value) |
Access a property in a property object at a location. More... | |
AbstractRange & | getRange () |
Returns a reference to the range being iterated. More... | |
const AbstractRange & | getRange () const |
Returns a const reference to the range being iterated. More... | |
bool | getValue (Variant &value) |
Access a value from a location. More... | |
bool | isValid () const |
Indicates whether the location is valid. More... | |
bool | matches (const AbstractRangeLocation &other) const |
Indicates whether a range location matches another. More... | |
operator bool () const | |
Cast to bool operator. More... | |
bool | operator!= (const AbstractRangeLocation &rhs) const |
Not equals operator. More... | |
bool | operator== (const AbstractRangeLocation &rhs) const |
Equals operator. More... | |
virtual | ~AbstractRangeLocation ()=default |
Destructor. More... | |
Protected Member Functions | |
AbstractRangeLocation (AbstractRange &range) | |
Constructor. More... | |
virtual bool | advanceOverride ()=0 |
Implementation-dependent advance. More... | |
virtual unique_ptr< AbstractRangeLocation > | cloneOverride ()=0 |
Implementation-dependent clone operation. More... | |
virtual PropertyObjectSharedPtr | getPropertyObjectOverride ()=0 |
Implementation-dependent access to a property object. More... | |
virtual bool | getPropertyValueOverride (AbstractPropertyType propertyType, Variant &value)=0 |
Implementation-dependent access to a property in a property object. More... | |
virtual bool | getValueOverride (Variant &value)=0 |
Implementation-dependent access to a value. More... | |
virtual bool | isValidOverride () const =0 |
Implementation-dependent validity check. More... | |
virtual bool | matchesOverride (const AbstractRangeLocation &other) const =0 |
Implementation-dependent check on whether a range location matches another. More... | |
Protected Attributes | |
AbstractRange & | m_range |
Reference to source range. More... | |
Location into a range.
Abstract class used to accessing the range. Created by the range and dereferenced from AbstractRangeIterator. Virtual access to AbstractRange is implemented through AbstractRangeLocation. If the source range becomes invalid, the location is by definition invalid.
|
virtualdefault |
Destructor.
|
inlineexplicitprotected |
Constructor.
range | Source range. |
|
inline |
Returns a reference to the range being iterated.
This function should have a static polymorphism override in inheriting location classes.
|
inline |
Returns a const reference to the range being iterated.
This function should have a static polymorphism override in inheriting location classes.
|
inline |
Returns a clone of this range location.
|
inline |
Indicates whether a range location matches another.
other | Other range location. |
|
inline |
Indicates whether the location is valid.
A location is valid if it's not at the end of iteration and can be read.
|
inline |
Advances the location.
If the location was valid before advance() was called, it always increments. The return value only depends on whether the location is readable post the increment.
|
inline |
Access to a property object at the location.
If the location is not valid, the implementation must not crash. Implementation may or may not return a default value for an invalid location.
|
inline |
Access a property in a property object at a location.
If the location is not valid, the implementation must not crash. Implementation may or may not return a default value for an invalid location.
propertyType | property type to access. |
value | Variant to store the value to. |
|
inline |
Access a value from a location.
If the location is not valid, the implementation must not crash. Implementation may or may not return a default value for an invalid location.
value | Variant to store the value to. |
|
inline |
Cast to bool operator.
|
inline |
Equals operator.
rhs | Right-hand-side operand. |
|
inline |
Not equals operator.
rhs | Right-hand-side operand. |
|
protectedpure virtual |
Implementation-dependent clone operation.
Implemented in kanzi::TypedValueRange< T >::TypedValueRangeLocation, kanzi::IndexedViewRange::IndexedViewRangeLocation, kanzi::IndexedPropertyAccessRange::IndexedPropertyAccessRangeLocation, kanzi::SplitStringRange::SplitStringRangeLocation, kanzi::ViewRange::ViewRangeLocation, kanzi::ValueRange::ValueRangeLocation, kanzi::IteratorRange::IteratorRangeLocation, and kanzi::PropertyAccessRange::PropertyAccessRangeLocation.
|
protectedpure virtual |
Implementation-dependent check on whether a range location matches another.
other | Other range location. |
Implemented in kanzi::TypedValueRange< T >::TypedValueRangeLocation, kanzi::IndexedViewRange::IndexedViewRangeLocation, kanzi::IndexedPropertyAccessRange::IndexedPropertyAccessRangeLocation, kanzi::SplitStringRange::SplitStringRangeLocation, kanzi::ViewRange::ViewRangeLocation, kanzi::ValueRange::ValueRangeLocation, kanzi::IteratorRange::IteratorRangeLocation, and kanzi::PropertyAccessRange::PropertyAccessRangeLocation.
|
protectedpure virtual |
Implementation-dependent validity check.
Implemented in kanzi::TypedValueRange< T >::TypedValueRangeLocation, kanzi::IndexedViewRange::IndexedViewRangeLocation, kanzi::IndexedPropertyAccessRange::IndexedPropertyAccessRangeLocation, kanzi::SplitStringRange::SplitStringRangeLocation, kanzi::ViewRange::ViewRangeLocation, kanzi::ValueRange::ValueRangeLocation, kanzi::IteratorRange::IteratorRangeLocation, and kanzi::PropertyAccessRange::PropertyAccessRangeLocation.
|
protectedpure virtual |
Implementation-dependent advance.
Implemented in kanzi::TypedValueRange< T >::TypedValueRangeLocation, kanzi::IndexedViewRange::IndexedViewRangeLocation, kanzi::IndexedPropertyAccessRange::IndexedPropertyAccessRangeLocation, kanzi::SplitStringRange::SplitStringRangeLocation, kanzi::ViewRange::ViewRangeLocation, kanzi::ValueRange::ValueRangeLocation, kanzi::IteratorRange::IteratorRangeLocation, and kanzi::PropertyAccessRange::PropertyAccessRangeLocation.
|
protectedpure virtual |
Implementation-dependent access to a property object.
Implemented in kanzi::TypedValueRange< T >::TypedValueRangeLocation, kanzi::IndexedViewRange::IndexedViewRangeLocation, kanzi::IndexedPropertyAccessRange::IndexedPropertyAccessRangeLocation, kanzi::SplitStringRange::SplitStringRangeLocation, kanzi::ViewRange::ViewRangeLocation, kanzi::ValueRange::ValueRangeLocation, kanzi::IteratorRange::IteratorRangeLocation, and kanzi::PropertyAccessRange::PropertyAccessRangeLocation.
|
protectedpure virtual |
Implementation-dependent access to a property in a property object.
propertyType | property type to access. |
value | Variant to store the value to. |
Implemented in kanzi::TypedValueRange< T >::TypedValueRangeLocation, kanzi::IndexedViewRange::IndexedViewRangeLocation, kanzi::IndexedPropertyAccessRange::IndexedPropertyAccessRangeLocation, kanzi::SplitStringRange::SplitStringRangeLocation, kanzi::ViewRange::ViewRangeLocation, kanzi::ValueRange::ValueRangeLocation, kanzi::IteratorRange::IteratorRangeLocation, and kanzi::PropertyAccessRange::PropertyAccessRangeLocation.
|
protectedpure virtual |
Implementation-dependent access to a value.
value | Variant to store the value to. |
Implemented in kanzi::TypedValueRange< T >::TypedValueRangeLocation, kanzi::IndexedViewRange::IndexedViewRangeLocation, kanzi::IndexedPropertyAccessRange::IndexedPropertyAccessRangeLocation, kanzi::SplitStringRange::SplitStringRangeLocation, kanzi::ViewRange::ViewRangeLocation, kanzi::ValueRange::ValueRangeLocation, kanzi::IteratorRange::IteratorRangeLocation, and kanzi::PropertyAccessRange::PropertyAccessRangeLocation.
|
protected |
Reference to source range.
The reference is shared, since temporary ranges must remain valid if they're being iterated.