Kanzi  3.9.4
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
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
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

Iterator type for values.

◆ const_iterator

Const iterator type for values.

Constructor & Destructor Documentation

◆ ValueRange() [1/2]

kanzi::ValueRange::ValueRange ( )
explicitprotecteddefault

Default constructor.

◆ ValueRange() [2/2]

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

Constructor.

Parameters
valueValue to copy.

Member Function Documentation

◆ create() [1/2]

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

Creates a new value range.

Returns
Value range shared pointer.

◆ create() [2/2]

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.

◆ push_back() [1/2]

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.

◆ push_back() [2/2]

template<typename T >
void kanzi::ValueRange::push_back ( T &&  value)
inline

Appends a value to the end of internal storage.

Parameters
valueValue to add.

◆ setValue()

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.

◆ clear()

void kanzi::ValueRange::clear ( )
inline

Clears all values from internal storage.

◆ begin() [1/2]

iterator kanzi::ValueRange::begin ( )
inline

Gets an iterator to the beginning of the range.

Returns
Mutable iterator to the beginning of values.

◆ begin() [2/2]

const_iterator kanzi::ValueRange::begin ( ) const
inline

Gets an iterator to the beginning of the range.

Returns
Const iterator to the beginning of values.

◆ cbegin()

const_iterator kanzi::ValueRange::cbegin ( ) const
inline

Gets an iterator to the beginning of the range.

Returns
Const iterator to the beginning of values.

◆ end() [1/2]

iterator kanzi::ValueRange::end ( )
inline

Gets an iterator to the end of the range.

Returns
Mutable iterator to the end of values.

◆ end() [2/2]

const_iterator kanzi::ValueRange::end ( ) const
inline

Gets an iterator to the end of the range.

Returns
Const iterator to the end of values.

◆ cend()

const_iterator kanzi::ValueRange::cend ( ) const
inline

Gets an iterator to the end of the range.

Returns
Const iterator to the end of values.

◆ front() [1/2]

Variant& kanzi::ValueRange::front ( )
inline

Returns a reference to the element at the front.

Returns
Reference to first element.

◆ front() [2/2]

const Variant& kanzi::ValueRange::front ( ) const
inline

Returns a reference to the element at the front.

Returns
Const reference to first element.

◆ back() [1/2]

Variant& kanzi::ValueRange::back ( )
inline

Returns a reference to the element at the back.

Returns
Reference to last element.

◆ back() [2/2]

const Variant& kanzi::ValueRange::back ( ) const
inline

Returns a reference to the element at the back.

Returns
Const reference to last element.

◆ data() [1/2]

Variant* kanzi::ValueRange::data ( )
inline

Access data array.

Returns
Pointer to data array.

◆ data() [2/2]

const Variant* kanzi::ValueRange::data ( ) const
inline

Access data array.

Returns
Pointer to data array.

◆ size()

size_t kanzi::ValueRange::size ( ) const
inline

Tells the number of elements in the range.

Returns
Element count.

◆ resize()

void kanzi::ValueRange::resize ( size_t  count)
inline

Resizes the range container.

Parameters
countNumber of elements.

◆ incrementSize()

void kanzi::ValueRange::incrementSize ( )
inline

Add an empty variant at the end of value range.

◆ decrementSize()

void kanzi::ValueRange::decrementSize ( )
inline

Decrement the size by one.

◆ operator[]() [1/2]

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

Access by index operator.

Parameters
indexIndex to access.
Returns
Reference to index.

◆ operator[]() [2/2]

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

Access by index operator.

Parameters
indexIndex to access.
Returns
Const reference to index.

◆ locationBeginOverride()

AbstractRangeLocationPtr kanzi::ValueRange::locationBeginOverride ( )
overrideprotectedvirtual

◆ getSizeOverride()

size_t kanzi::ValueRange::getSizeOverride ( )
overrideprotectedvirtual

◆ getPropertyObjectByIndexOverride()

PropertyObjectSharedPtr kanzi::ValueRange::getPropertyObjectByIndexOverride ( size_t  index)
overrideprotectedvirtual

◆ getPropertyValueByIndexOverride()

bool kanzi::ValueRange::getPropertyValueByIndexOverride ( size_t  index,
AbstractPropertyType  propertyType,
Variant value 
)
overrideprotectedvirtual

◆ getValueByIndexOverride()

bool kanzi::ValueRange::getValueByIndexOverride ( size_t  index,
Variant value 
)
overrideprotectedvirtual

AbstractIndexedRange::getValueByIndexeOverride() implementation.

Implements kanzi::AbstractIndexedRange.

Member Data Documentation

◆ m_values

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

Array of values for this range.


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