Kanzi 3.9.10
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
 Const iterator type for values.
 
using iterator
 Iterator type for values.
 

Public Member Functions

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

Static Public Member Functions

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

Protected Member Functions

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

Protected Attributes

vector< Variantm_values
 Array of values for this range.
 

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

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: