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. | |
AbstractRangeIterator | beginIteration () |
Gets an iterator to the beginning of this range. | |
AbstractRangeSharedPtr | createView (size_t length) |
Creates a view over this range. | |
AbstractRangeSharedPtr | evaluate () |
Evaluate the abstract range. | |
AbstractRangeLocationPtr | locationBegin () |
Gets an iteratable location to beginning of the range. | |
virtual | ~AbstractRange ()=default |
Destructor. | |
Protected Member Functions | |
AbstractRange ()=default | |
Constructor. | |
virtual bool | adaptViewOverride (AbstractRange &potentialViewRange, size_t length) |
Implementation-dependent adaptation of a view over the range. | |
virtual AbstractRangeSharedPtr | createViewOverride (size_t length) |
Implementation-dependent view over the range. | |
virtual AbstractRangeSharedPtr | evaluateOverride () |
Implementation-dependent evaluation of the range. | |
virtual AbstractRangeLocationPtr | locationBeginOverride ()=0 |
Implementation of iterator to beginning. | |
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::IteratorRange, kanzi::ImmutableIteratorRange, kanzi::SplitStringRange, and kanzi::ImmutableSplitStringRange.
|
protectedpure virtual |
Implementation of iterator to beginning.
Implemented in kanzi::IteratorRange, kanzi::PropertyAccessRange, kanzi::IndexedPropertyAccessRange, kanzi::SplitStringRange, kanzi::ImmutableSplitStringRange, kanzi::TypedValueRange< T >, kanzi::TypedValueRange< LightDistanceInfo >, kanzi::TypedValueRange< LightInfo >, kanzi::TypedValueRange< NodeWeakPtr >, kanzi::ValueRange, kanzi::GatherLightsRenderPass::LightRange, kanzi::ViewRange, and kanzi::IndexedViewRange.