Kanzi 3.9.10
kanzi::AbstractRangeIterator Class Reference

Abstract range iterator interface. More...

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

Public Member Functions

 AbstractRangeIterator ()=default
 Default constructor.
 
 AbstractRangeIterator (AbstractIndexedRange &range)
 Constructor.
 
 AbstractRangeIterator (AbstractRange &range)
 Constructor.
 
 AbstractRangeIterator (AbstractRangeIterator &&other) noexcept
 Move constructor.
 
 AbstractRangeIterator (AbstractRangeLocationPtr location)
 Constructor.
 
 AbstractRangeIterator (const AbstractRangeIterator &other)
 Copy constructor.
 
bool advance ()
 Advances the iterator.
 
PropertyObjectSharedPtr getPropertyObject ()
 Access to a property object at the iterator location.
 
bool getPropertyValue (AbstractPropertyType propertyType, Variant &value)
 Access a property at the iterator location.
 
AbstractRangegetRange () const
 Accesses the shared range being iterated.
 
bool getValue (Variant &value)
 Access a value from a location.
 
bool isValid () const
 Indicates whether the iterator is valid.
 
 operator bool () const
 Operator for checking if the iterator has been initialized.
 
bool operator!= (const AbstractRangeIterator &rhs) const
 Not equals operator.
 
AbstractRangeIteratoroperator= (AbstractRangeIterator &&other) noexcept
 Move operator.
 
AbstractRangeIteratoroperator= (const AbstractRangeIterator &other)
 Copy operator.
 
bool operator== (const AbstractRangeIterator &rhs) const
 Equals operator.
 

Protected Attributes

size_t m_index
 Index of the iteration.
 
AbstractIndexedRangem_indexedRange
 Reference to indexed range.
 
AbstractRangeLocationPtr m_location
 Location in this iterator.
 
size_t m_size
 Size of the indexed range.
 

Detailed Description

Abstract range iterator interface.

Range iterators are value types, so the virtual access to the range is implemented through range location. If the range becomes invalid, the iterator is also no longer valid.

Since
Kanzi 3.9.0

Constructor & Destructor Documentation

◆ AbstractRangeIterator() [1/6]

kanzi::AbstractRangeIterator::AbstractRangeIterator ( )
explicitdefault

Default constructor.

Constructs an invalid iterator. Functions should not be called.

◆ AbstractRangeIterator() [2/6]

kanzi::AbstractRangeIterator::AbstractRangeIterator ( AbstractRangeLocationPtr location)
inlineexplicit

Constructor.

Parameters
locationRange location.

◆ AbstractRangeIterator() [3/6]

kanzi::AbstractRangeIterator::AbstractRangeIterator ( AbstractIndexedRange & range)
inlineexplicit

Constructor.

Parameters
rangeReference to an indexed range.

◆ AbstractRangeIterator() [4/6]

kanzi::AbstractRangeIterator::AbstractRangeIterator ( AbstractRange & range)
inlineexplicit

Constructor.

Parameters
rangeRange to iterate.

◆ AbstractRangeIterator() [5/6]

kanzi::AbstractRangeIterator::AbstractRangeIterator ( const AbstractRangeIterator & other)
inline

Copy constructor.

Parameters
otherSource iterator.

◆ AbstractRangeIterator() [6/6]

kanzi::AbstractRangeIterator::AbstractRangeIterator ( AbstractRangeIterator && other)
inlinenoexcept

Move constructor.

Parameters
otherSource iterator location.

Member Function Documentation

◆ getRange()

AbstractRange * kanzi::AbstractRangeIterator::getRange ( ) const
inline

Accesses the shared range being iterated.

Only returns a meaningful pointer if the iterator is valid.

Returns
Pointer to iterated range.

◆ isValid()

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

Indicates whether the iterator is valid.

If the location has not been set, an iterator is not valid. A iterator 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::AbstractRangeIterator::advance ( )
inline

Advances the iterator.

If the iterator was valid before advance() was called, it always increments. The return value only depends on whether the iterator is readable post the increment.

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

◆ getPropertyObject()

PropertyObjectSharedPtr kanzi::AbstractRangeIterator::getPropertyObject ( )
inline

Access to a property object at the iterator location.

If the iterator is not valid, results are undefined.

Returns
Property object at location or nullptr.

◆ getPropertyValue()

bool kanzi::AbstractRangeIterator::getPropertyValue ( AbstractPropertyType propertyType,
Variant & value )
inline

Access a property at the iterator location.

If the iterator is not valid, results are undefined.

Parameters
propertyTypeproperty type to access.
valueVariant to store the value to.
Returns
If a property value could be written to output value true, false otherwise.

◆ getValue()

bool kanzi::AbstractRangeIterator::getValue ( Variant & value)
inline

Access a value from a location.

If the iterator is not valid, results are undefined.

Parameters
valueVariant to store the value to.
Returns
If value could be written true, false otherwise.

◆ operator bool()

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

Operator for checking if the iterator has been initialized.

move() from an AbstractRangeIterator makes it uninitialized.

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

◆ operator==()

bool kanzi::AbstractRangeIterator::operator== ( const AbstractRangeIterator & rhs) const
inline

Equals operator.

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

◆ operator!=()

bool kanzi::AbstractRangeIterator::operator!= ( const AbstractRangeIterator & rhs) const
inline

Not equals operator.

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

◆ operator=() [1/2]

AbstractRangeIterator & kanzi::AbstractRangeIterator::operator= ( const AbstractRangeIterator & other)
inline

Copy operator.

Parameters
otherSource object.

◆ operator=() [2/2]

AbstractRangeIterator & kanzi::AbstractRangeIterator::operator= ( AbstractRangeIterator && other)
inlinenoexcept

Move operator.

Parameters
otherSource object.

Member Data Documentation

◆ m_location

AbstractRangeLocationPtr kanzi::AbstractRangeIterator::m_location
protected

Location in this iterator.

◆ m_indexedRange

AbstractIndexedRange* kanzi::AbstractRangeIterator::m_indexedRange
protected

Reference to indexed range.

◆ m_size

size_t kanzi::AbstractRangeIterator::m_size
protected

Size of the indexed range.

◆ m_index

size_t kanzi::AbstractRangeIterator::m_index
protected

Index of the iteration.


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