template<class T>
Magnum::Ui::Storage class new in Git master

Read-only non-owning multi-dimensional storage for arbitrary types.

Exposes a view on external values for use with DataLayer. The values cannot be modified through the storage. It's expected that setDirty() is called when the value is modified externally.

Base classes

class AbstractStorage new in Git master
Base for DataLayer storage implementations.

Public types

using Type = T
Storage and query type.

Constructors, destructors, conversion operators

Storage(DataLayer& layer, const T& value, StorageFlags flags = {}) explicit
Construct a single-item storage.
Storage(DataLayer& layer, const Containers::StridedArrayView3D<const T>& values, StorageFlags flags = {}) explicit
Construct a storage.
template<class UserInterface>
Storage(UserInterface& ui, const T& value, StorageFlags flags = {}) explicit
Construct a single-item storage using the default DataLayer in given user interface.
template<class UserInterface>
Storage(UserInterface& ui, const Containers::StridedArrayView3D<const T>& values, StorageFlags flags = {}) explicit
Construct a storage using the default DataLayer in given user interface.
operator StorageQuery<T>() const
Single-item storage value query.

Public functions

auto stride() const -> Containers::Stride3D
Storage stride.
auto value() const -> StorageQuery<T>
Single-item storage value.
auto operator[](std::size_t index) const -> StorageQuery<T>
1D storage value at given index
auto operator[](const Containers::Size2D& index) const -> StorageQuery<T>
2D storage value at given index
auto operator[](const Containers::Size3D& index) const -> StorageQuery<T>
3D storage value at given index
template<class U>
auto value() const -> StorageQuery<U>
Single-item storage value at given index, cast to a different type.
template<class U>
auto value(std::size_t index) const -> StorageQuery<U>
1D storage value at given index, cast to a different type
template<class U>
auto value(const Containers::Size2D& index) const -> StorageQuery<U>
2D storage value at given index, cast to a different type
template<class U>
auto value(const Containers::Size3D& index) const -> StorageQuery<U>
3D storage value query, cast to a different type
auto data() const -> Containers::StridedArrayView3D<const T>
Raw storage data.

Function documentation

template<class T>
Magnum::Ui::Storage<T>::Storage(DataLayer& layer, const T& value, StorageFlags flags = {}) explicit

Construct a single-item storage.

Equivalent to calling Storage(DataLayer&, const Containers::StridedArrayView3D<const T>&, StorageFlags) with value turned into a view of size {1, 1, 1}.

template<class T>
Magnum::Ui::Storage<T>::Storage(DataLayer& layer, const Containers::StridedArrayView3D<const T>& values, StorageFlags flags = {}) explicit

Construct a storage.

Parameters
layer Data layer to create the storage in
values Value view. Passing a 1D or 2D view will implicitly expand it to a 3D view, adding extra dimensions at the front.
flags Storage flags

The values view is expected to be non-empty with its contents staying in scope for the whole storage lifetime. Delegates to AbstractStorage::AbstractStorage(DataLayer&, const Containers::Size3D&, StorageFlags), see its documentation for detailed description of all constraints.

template<class T> template<class UserInterface>
Magnum::Ui::Storage<T>::Storage(UserInterface& ui, const T& value, StorageFlags flags = {}) explicit

Construct a single-item storage using the default DataLayer in given user interface.

Equivalent to calling Storage(DataLayer&, const Containers::StridedArrayView3D<const T>&, StorageFlags) with value turned into a view of size {1, 1, 1}.

template<class T> template<class UserInterface>
Magnum::Ui::Storage<T>::Storage(UserInterface& ui, const Containers::StridedArrayView3D<const T>& values, StorageFlags flags = {}) explicit

Construct a storage using the default DataLayer in given user interface.

Like Storage(DataLayer&, const Containers::StridedArrayView3D<const T>&, StorageFlags) but using the default DataLayer available through UserInterface::dataLayer(). Expects that the ui contains a DataLayer instance.

template<class T>
Magnum::Ui::Storage<T>::operator StorageQuery<T>() const

Single-item storage value query.

Equivalent to value(), see its documentation for more information.

template<class T>
StorageQuery<T> Magnum::Ui::Storage<T>::value() const

Single-item storage value.

Expects that size() is {1, 1, 1}. If it's not, use one of the operator[]() overloads.

See documentation of operator[](const Containers::Size3D&) const for details about what is all supported by the returned query.

template<class T>
StorageQuery<T> Magnum::Ui::Storage<T>::operator[](std::size_t index) const

1D storage value at given index

Expects that size() is {1, 1, size} and index is less than size. Use operator[](const Containers::Size2D&) const for indexing a 2D storage and operator[](const Containers::Size3D&) const for indexing a 3D storage.

See documentation of operator[](const Containers::Size3D&) const for details about what is all supported by the returned query.

template<class T>
StorageQuery<T> Magnum::Ui::Storage<T>::operator[](const Containers::Size2D& index) const

2D storage value at given index

Expects that size() is {1, size[0], size[1]} and index is less than size. Use operator[](const Containers::Size3D&) const for indexing a 3D storage.

See documentation of operator[](const Containers::Size3D&) const for details about what is all supported by the returned query.

template<class T>
StorageQuery<T> Magnum::Ui::Storage<T>::operator[](const Containers::Size3D& index) const

3D storage value at given index

Expects that index is less than size().

As the storage itself is immutable, the returned query neither supports any StorageOperations nor it has a parser.

template<class T> template<class U>
StorageQuery<U> Magnum::Ui::Storage<T>::value() const

Single-item storage value at given index, cast to a different type.

Expects that size() is {1, 1, 1}. If it's not, use one of the other overloads.

See documentation of operator[](const Containers::Size3D&) const for details about what is all supported by the returned query.

template<class T> template<class U>
StorageQuery<U> Magnum::Ui::Storage<T>::value(std::size_t index) const

1D storage value at given index, cast to a different type

Expects that size() is {1, 1, size} and index is less than size. Use value(const Containers::Size2D&) const for indexing a 2D storage and value(const Containers::Size3D&) const for indexing a 3D storage.

See documentation of operator[](const Containers::Size3D&) const for details about what is all supported by the returned query.

template<class T> template<class U>
StorageQuery<U> Magnum::Ui::Storage<T>::value(const Containers::Size2D& index) const

2D storage value at given index, cast to a different type

Expects that size() is {1, size[0], size[1]} and index is less than size. Use operator[](const Containers::Size3D&) const for indexing a 3D storage.

See documentation of operator[](const Containers::Size3D&) const for details about what is all supported by the returned query.

template<class T> template<class U>
StorageQuery<U> Magnum::Ui::Storage<T>::value(const Containers::Size3D& index) const

3D storage value query, cast to a different type

Expects that index is less than size().

See documentation of operator[](const Containers::Size3D&) const for details about what is all supported by the returned query.

template<class T>
Containers::StridedArrayView3D<const T> Magnum::Ui::Storage<T>::data() const

Raw storage data.

Meant to be used mainly for diagnostic purposes, for value access prefer to use the StorageQuery instances returned by operator[]() and value(). The returned view matches the one passed to the constructor.