Kanzi  3.9.6
Kanzi Engine API
kanzi::AbstractRange Class Referenceabstract

Abstract range interface. More...

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

Inheritance diagram for kanzi::AbstractRange:
[legend]

Public Member Functions

bool adaptView (AbstractRange &potentialViewRange, size_t length)
 Attempts to reuse a view over this range. More...
 
AbstractRangeIterator beginIteration ()
 Gets an iterator to the beginning of this range. More...
 
AbstractRangeSharedPtr createView (size_t length)
 Creates a view over this range. More...
 
AbstractRangeSharedPtr evaluate ()
 Evaluate the abstract range. More...
 
AbstractRangeLocationPtr locationBegin ()
 Gets an iteratable location to beginning of the range. More...
 
virtual ~AbstractRange ()=default
 Destructor. More...
 

Protected Member Functions

 AbstractRange ()=default
 Constructor. More...
 
virtual bool adaptViewOverride (AbstractRange &potentialViewRange, size_t length)
 Implementation-dependent adaptation of a view over the range. More...
 
virtual AbstractRangeSharedPtr createViewOverride (size_t length)
 Implementation-dependent view over the range. More...
 
virtual AbstractRangeSharedPtr evaluateOverride ()
 Implementation-dependent evaluation of the range. More...
 
virtual AbstractRangeLocationPtr locationBeginOverride ()=0
 Implementation of iterator to beginning. More...
 

Detailed Description

Abstract range interface.

Provides an interface for generating iterators that extract values from a structure-like object.

The default implementation provides an iterator interface for extracting property objects. Implementations of range paradigm are free to provide alternative interfaces.

Inheriting classes should provide a way to access elements from the range by index or iteration.

Since
Kanzi 3.9.0

Constructor & Destructor Documentation

◆ ~AbstractRange()

virtual kanzi::AbstractRange::~AbstractRange ( )
virtualdefault

Destructor.

◆ AbstractRange()

kanzi::AbstractRange::AbstractRange ( )
explicitprotecteddefault

Constructor.

Member Function Documentation

◆ adaptView()

bool kanzi::AbstractRange::adaptView ( AbstractRange potentialViewRange,
size_t  length 
)
inline

Attempts to reuse a view over this range.

If it is possible to reuse the existing range to target this range, this can avoid memory allocation.

Parameters
potentialViewRangePossible view range to check.
lengthLength of view to use.
Returns
If it is possible to use the existing range, true, otherwise false.
Since
Kanzi 3.9.6

◆ createView()

AbstractRangeSharedPtr kanzi::AbstractRange::createView ( size_t  length)
inline

Creates a view over this range.

Parameters
lengthLength of the view.
Returns
New range that is a view over the range.

◆ evaluate()

AbstractRangeSharedPtr kanzi::AbstractRange::evaluate ( )
inline

Evaluate the abstract range.

Returns
New range that is an evaluation of the range.

◆ beginIteration()

AbstractRangeIterator kanzi::AbstractRange::beginIteration ( )

Gets an iterator to the beginning of this range.

Using an iterator hides the indexed or not indexed iteration detail when using ranges. Use this function to iterate ranges in an abstract fashion. Unlike STL iterators, creating an abstract iterator may have a cost, so this function is not simply named begin().

Returns
Iterator to begin.

◆ locationBegin()

AbstractRangeLocationPtr kanzi::AbstractRange::locationBegin ( )
inline

Gets an iteratable location to beginning of the range.

Use beginIteration() to use the iterator paradigm instead. The user should not generally need to call this function.

Returns
Location to begin.

◆ adaptViewOverride()

virtual bool kanzi::AbstractRange::adaptViewOverride ( AbstractRange potentialViewRange,
size_t  length 
)
protectedvirtual

Implementation-dependent adaptation of a view over the range.

Parameters
potentialViewRangePossible view range to check.
lengthLength of view to use.
Returns
If it is possible to use the existing range, true, otherwise false.
Since
Kanzi 3.9.6

Reimplemented in kanzi::AbstractIndexedRange.

◆ createViewOverride()

virtual AbstractRangeSharedPtr kanzi::AbstractRange::createViewOverride ( size_t  length)
protectedvirtual

Implementation-dependent view over the range.

Parameters
lengthLength of the view.
Returns
Evaluation of the range.

Reimplemented in kanzi::AbstractIndexedRange.

◆ evaluateOverride()

virtual AbstractRangeSharedPtr kanzi::AbstractRange::evaluateOverride ( )
protectedvirtual

Implementation-dependent evaluation of the range.

Returns
Evaluation of the range.

Reimplemented in kanzi::ImmutableSplitStringRange, kanzi::ImmutableIteratorRange, kanzi::SplitStringRange, and kanzi::IteratorRange.

◆ locationBeginOverride()


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