Abstract range interface. More...
#include <kanzi/core/property/abstract_range.hpp>
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... | |
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.
|
virtualdefault |
Destructor.
|
explicitprotecteddefault |
Constructor.
|
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.
potentialViewRange | Possible view range to check. |
length | Length of view to use. |
|
inline |
Creates a view over this range.
length | Length of the view. |
|
inline |
Evaluate the abstract range.
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().
|
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.
|
protectedvirtual |
Implementation-dependent adaptation of a view over the range.
potentialViewRange | Possible view range to check. |
length | Length of view to use. |
Reimplemented in kanzi::AbstractIndexedRange.
|
protectedvirtual |
Implementation-dependent view over the range.
length | Length of the view. |
Reimplemented in kanzi::AbstractIndexedRange.
|
protectedvirtual |
Implementation-dependent evaluation of the range.
Reimplemented in kanzi::ImmutableSplitStringRange, kanzi::ImmutableIteratorRange, kanzi::SplitStringRange, and kanzi::IteratorRange.
|
protectedpure virtual |
Implementation of iterator to beginning.
Implemented in kanzi::TypedValueRange< T >, kanzi::TypedValueRange< NodeWeakPtr >, kanzi::TypedValueRange< LightInfo >, kanzi::TypedValueRange< LightDistanceInfo >, kanzi::IndexedViewRange, kanzi::ValueRange, kanzi::ImmutableSplitStringRange, kanzi::IndexedPropertyAccessRange, kanzi::GatherLightsRenderPass::LightRange, kanzi::SplitStringRange, kanzi::ViewRange, kanzi::IteratorRange, and kanzi::PropertyAccessRange.