Kanzi  3.9.7
Kanzi Engine API
kanzi::ValueRange Class Reference

ValueRange is an abstract range implementation that stores variant values. More...

#include <kanzi/core.ui/binding/value_range.hpp>

Inheritance diagram for kanzi::ValueRange:
[legend]

Classes

class  ValueRangeLocation
 Location implementation for typed value range. More...
 

Public Types

using const_iterator = vector< Variant >::const_iterator
 Const iterator type for values. More...
 
using iterator = vector< Variant >::iterator
 Iterator type for values. More...
 

Public Member Functions

Variantback ()
 Returns a reference to the element at the back. More...
 
const Variantback () const
 Returns a reference to the element at the back. More...
 
iterator begin ()
 Gets an iterator to the beginning of the range. More...
 
const_iterator begin () const
 Gets an iterator to the beginning of the range. More...
 
const_iterator cbegin () const
 Gets an iterator to the beginning of the range. More...
 
const_iterator cend () const
 Gets an iterator to the end of the range. More...
 
void clear ()
 Clears all values from internal storage. More...
 
Variantdata ()
 Access data array. More...
 
const Variantdata () const
 Access data array. More...
 
void decrementSize ()
 Decrement the size by one. More...
 
iterator end ()
 Gets an iterator to the end of the range. More...
 
const_iterator end () const
 Gets an iterator to the end of the range. More...
 
Variantfront ()
 Returns a reference to the element at the front. More...
 
const Variantfront () const
 Returns a reference to the element at the front. More...
 
void incrementSize ()
 Add an empty variant at the end of value range. More...
 
Variantoperator[] (size_t index)
 Access by index operator. More...
 
const Variantoperator[] (size_t index) const
 Access by index operator. More...
 
template<typename T >
void push_back (const T &value)
 Appends a value to the end of internal storage. More...
 
template<typename T >
void push_back (T &&value)
 Appends a value to the end of internal storage. More...
 
void resize (size_t count)
 Resizes the range container. More...
 
template<typename T >
void setValue (size_t index, const T &value)
 Sets a value to the internal storage index. More...
 
size_t size () const
 Tells the number of elements in the range. More...
 
- Public Member Functions inherited from kanzi::AbstractIndexedRange
PropertyObjectSharedPtr getPropertyObjectByIndex (size_t index)
 Gets a property object by index. More...
 
bool getPropertyValueByIndex (size_t index, AbstractPropertyType propertyType, Variant &value)
 Access a property in a property object at an index. More...
 
size_t getSize ()
 Gets the size of the indexed range. More...
 
bool getValueByIndex (size_t index, Variant &value)
 Reads a value by index and writes it to a variant. More...
 
- Public Member Functions inherited from kanzi::AbstractRange
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...
 

Static Public Member Functions

static ValueRangeSharedPtr create ()
 Creates a new value range. More...
 
static ValueRangeSharedPtr create (const Variant &variant)
 Creates a new value range with one value. More...
 

Protected Member Functions

PropertyObjectSharedPtr getPropertyObjectByIndexOverride (size_t index) override
 AbstractIndexedRange::getPropertyObjectByIndexOverride() implementation. More...
 
bool getPropertyValueByIndexOverride (size_t index, AbstractPropertyType propertyType, Variant &value) override
 AbstractIndexedRange::getPropertyValueByIndexOverride() implementation. More...
 
size_t getSizeOverride () override
 AbstractIndexedRange::getSizeOverride() implementation. More...
 
bool getValueByIndexOverride (size_t index, Variant &value) override
 AbstractIndexedRange::getValueByIndexeOverride() implementation. More...
 
AbstractRangeLocationPtr locationBeginOverride () override
 AbstractRange::locationBeginOverride() implementation. More...
 
 ValueRange ()=default
 Default constructor. More...
 
 ValueRange (const Variant &value)
 Constructor. More...
 
- Protected Member Functions inherited from kanzi::AbstractIndexedRange
bool adaptViewOverride (AbstractRange &potentialViewRange, size_t length) override
 AbstractRange::adaptViewOverride() implementation. More...
 
AbstractRangeSharedPtr createViewOverride (size_t length) override
 AbstractRange::createViewOverride() implementation. More...
 
- Protected Member Functions inherited from kanzi::AbstractRange
 AbstractRange ()=default
 Constructor. More...
 
virtual AbstractRangeSharedPtr evaluateOverride ()
 Implementation-dependent evaluation of the range. More...
 

Protected Attributes

vector< Variantm_values
 Array of values for this range. More...
 

Detailed Description

ValueRange is an abstract range implementation that stores variant values.

ValueRange is intended for use within bindings, so it has an assignment interface to the range. There is no capability for PropertyObject storage, as PropertyObject cannot be a result of a mathematical binding operation and also not a valid property data type.

Since
Kanzi 3.9.0

Member Typedef Documentation

Iterator type for values.

Const iterator type for values.

Constructor & Destructor Documentation

kanzi::ValueRange::ValueRange ( )
explicitprotecteddefault

Default constructor.

kanzi::ValueRange::ValueRange ( const Variant value)
explicitprotected

Constructor.

Parameters
valueValue to copy.

Member Function Documentation

static ValueRangeSharedPtr kanzi::ValueRange::create ( )
static

Creates a new value range.

Returns
Value range shared pointer.
static ValueRangeSharedPtr kanzi::ValueRange::create ( const Variant variant)
static

Creates a new value range with one value.

Copies the variant value.

Returns
Value range shared pointer.
template<typename T >
void kanzi::ValueRange::push_back ( const T value)
inline

Appends a value to the end of internal storage.

Parameters
valueValue to add.
template<typename T >
void kanzi::ValueRange::push_back ( T &&  value)
inline

Appends a value to the end of internal storage.

Parameters
valueValue to add.
template<typename T >
void kanzi::ValueRange::setValue ( size_t  index,
const T value 
)
inline

Sets a value to the internal storage index.

Parameters
indexIndex to set.
valueValue to set.
void kanzi::ValueRange::clear ( )
inline

Clears all values from internal storage.

iterator kanzi::ValueRange::begin ( )
inline

Gets an iterator to the beginning of the range.

Returns
Mutable iterator to the beginning of values.
const_iterator kanzi::ValueRange::begin ( ) const
inline

Gets an iterator to the beginning of the range.

Returns
Const iterator to the beginning of values.
const_iterator kanzi::ValueRange::cbegin ( ) const
inline

Gets an iterator to the beginning of the range.

Returns
Const iterator to the beginning of values.
iterator kanzi::ValueRange::end ( )
inline

Gets an iterator to the end of the range.

Returns
Mutable iterator to the end of values.
const_iterator kanzi::ValueRange::end ( ) const
inline

Gets an iterator to the end of the range.

Returns
Const iterator to the end of values.
const_iterator kanzi::ValueRange::cend ( ) const
inline

Gets an iterator to the end of the range.

Returns
Const iterator to the end of values.
Variant& kanzi::ValueRange::front ( )
inline

Returns a reference to the element at the front.

Returns
Reference to first element.
const Variant& kanzi::ValueRange::front ( ) const
inline

Returns a reference to the element at the front.

Returns
Const reference to first element.
Variant& kanzi::ValueRange::back ( )
inline

Returns a reference to the element at the back.

Returns
Reference to last element.
const Variant& kanzi::ValueRange::back ( ) const
inline

Returns a reference to the element at the back.

Returns
Const reference to last element.
Variant* kanzi::ValueRange::data ( )
inline

Access data array.

Returns
Pointer to data array.
const Variant* kanzi::ValueRange::data ( ) const
inline

Access data array.

Returns
Pointer to data array.
size_t kanzi::ValueRange::size ( ) const
inline

Tells the number of elements in the range.

Returns
Element count.
void kanzi::ValueRange::resize ( size_t  count)
inline

Resizes the range container.

Parameters
countNumber of elements.
void kanzi::ValueRange::incrementSize ( )
inline

Add an empty variant at the end of value range.

void kanzi::ValueRange::decrementSize ( )
inline

Decrement the size by one.

Variant& kanzi::ValueRange::operator[] ( size_t  index)
inline

Access by index operator.

Parameters
indexIndex to access.
Returns
Reference to index.
const Variant& kanzi::ValueRange::operator[] ( size_t  index) const
inline

Access by index operator.

Parameters
indexIndex to access.
Returns
Const reference to index.
AbstractRangeLocationPtr kanzi::ValueRange::locationBeginOverride ( )
overrideprotectedvirtual
size_t kanzi::ValueRange::getSizeOverride ( )
overrideprotectedvirtual
PropertyObjectSharedPtr kanzi::ValueRange::getPropertyObjectByIndexOverride ( size_t  index)
overrideprotectedvirtual
bool kanzi::ValueRange::getPropertyValueByIndexOverride ( size_t  index,
AbstractPropertyType  propertyType,
Variant value 
)
overrideprotectedvirtual
bool kanzi::ValueRange::getValueByIndexOverride ( size_t  index,
Variant value 
)
overrideprotectedvirtual

AbstractIndexedRange::getValueByIndexeOverride() implementation.

Implements kanzi::AbstractIndexedRange.

Member Data Documentation

vector<Variant> kanzi::ValueRange::m_values
protected

Array of values for this range.


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