Kanzi  3.9.5
Kanzi Engine API
kanzi::AbstractRangeLocation Class Referenceabstract

Location into a range. More...

#include <kanzi/core/property/abstract_range.hpp>

Inheritance diagram for kanzi::AbstractRangeLocation:
[legend]

Public Member Functions

bool advance ()
 Advances the location. More...
 
unique_ptr< AbstractRangeLocationclone ()
 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...
 
AbstractRangegetRange ()
 Returns a reference to the range being iterated. More...
 
const AbstractRangegetRange () 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< AbstractRangeLocationcloneOverride ()=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

AbstractRangem_range
 Reference to source range. More...
 

Detailed Description

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.

Since
Kanzi 3.9.0

Constructor & Destructor Documentation

◆ ~AbstractRangeLocation()

virtual kanzi::AbstractRangeLocation::~AbstractRangeLocation ( )
virtualdefault

Destructor.

◆ AbstractRangeLocation()

kanzi::AbstractRangeLocation::AbstractRangeLocation ( AbstractRange range)
inlineexplicitprotected

Constructor.

Parameters
rangeSource range.

Member Function Documentation

◆ getRange() [1/2]

AbstractRange& kanzi::AbstractRangeLocation::getRange ( )
inline

Returns a reference to the range being iterated.

This function should have a static polymorphism override in inheriting location classes.

Returns
Reference to a range.

◆ getRange() [2/2]

const AbstractRange& kanzi::AbstractRangeLocation::getRange ( ) const
inline

Returns a const reference to the range being iterated.

This function should have a static polymorphism override in inheriting location classes.

Returns
Const reference to a range.

◆ clone()

unique_ptr<AbstractRangeLocation> kanzi::AbstractRangeLocation::clone ( )
inline

Returns a clone of this range location.

Returns
Clone of this range location.

◆ matches()

bool kanzi::AbstractRangeLocation::matches ( const AbstractRangeLocation other) const
inline

Indicates whether a range location matches another.

Parameters
otherOther range location.
Returns
If locations match, true, false otherwise.

◆ isValid()

bool kanzi::AbstractRangeLocation::isValid ( ) const
inline

Indicates whether the location is valid.

A location is valid if it's not at the end of iteration and can be read.

Returns
If the location is valid, true, false otherwise.

◆ advance()

bool kanzi::AbstractRangeLocation::advance ( )
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.

Returns
True if location was both advanced and is still readable.

◆ getPropertyObject()

PropertyObjectSharedPtr kanzi::AbstractRangeLocation::getPropertyObject ( )
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.

Returns
Property object at location or nullptr.

◆ getPropertyValue()

bool kanzi::AbstractRangeLocation::getPropertyValue ( AbstractPropertyType  propertyType,
Variant value 
)
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.

Parameters
propertyTypeproperty type to access.
valueVariant to store the value to.
Returns
If a value was true, false otherwise.

◆ getValue()

bool kanzi::AbstractRangeLocation::getValue ( Variant value)
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.

Parameters
valueVariant to store the value to.
Returns
If a value was true, false otherwise.

◆ operator bool()

kanzi::AbstractRangeLocation::operator bool ( ) const
inline

Cast to bool operator.

Returns
If the iterator is valid and can be dereferenced true, false otherwise.

◆ operator==()

bool kanzi::AbstractRangeLocation::operator== ( const AbstractRangeLocation rhs) const
inline

Equals operator.

Parameters
rhsRight-hand-side operand.
Returns
If locations are equal, true, otherwise false.

◆ operator!=()

bool kanzi::AbstractRangeLocation::operator!= ( const AbstractRangeLocation rhs) const
inline

Not equals operator.

Parameters
rhsRight-hand-side operand.
Returns
If locations are equal, true, otherwise false.

◆ cloneOverride()

◆ matchesOverride()

virtual bool kanzi::AbstractRangeLocation::matchesOverride ( const AbstractRangeLocation other) const
protectedpure virtual

◆ isValidOverride()

◆ advanceOverride()

◆ getPropertyObjectOverride()

◆ getPropertyValueOverride()

virtual bool kanzi::AbstractRangeLocation::getPropertyValueOverride ( AbstractPropertyType  propertyType,
Variant value 
)
protectedpure virtual

◆ getValueOverride()

Member Data Documentation

◆ m_range

AbstractRange& kanzi::AbstractRangeLocation::m_range
protected

Reference to source range.

The reference is shared, since temporary ranges must remain valid if they're being iterated.


The documentation for this class was generated from the following file: