Magnum::Ui::AbstractStorageQuery class new in Git master

Base for DataLayer storage queries.

Used through the StorageQuery subclass which is returned from AbstractStorage implementations and is meant to be passed to DataLayer::onUpdate() along with an update function.

Derived classes

template<class T>
class StorageQuery new in Git master
DataLayer storage query

Public functions

auto layer() const -> DataLayer&
Data layer reference.
auto storage() const -> StorageHandle
Storage handle.
auto index() const -> Containers::Size3D
Data index.
auto isMutable() const -> bool
Whether the query is mutable.
auto operations() const -> StorageOperations
Available storage operations.
void reset() const
Reset the storage value.
void toggle() const
Toggle the storage value.
void increment() const
Increment the storage value.
void decrement() const
Decrement the storage value.
void setToMin() const
Set the storage value to a minimum.
void setToMax() const
Set the storage value to a maximum.

Function documentation

StorageHandle Magnum::Ui::AbstractStorageQuery::storage() const

Storage handle.

Guaranteed to be associated with layer() and never StorageHandle::Null.

bool Magnum::Ui::AbstractStorageQuery::isMutable() const

Whether the query is mutable.

Mutable queries allow StorageQuery::set(), reset(), toggle(), increment(), decrement(), setToMin() and setToMax() to be called based on which operations() are available. Immutable queries allow only getting the current value, potentially along with StorageQuery::min() and StorageQuery::max() if operations() expose them.

void Magnum::Ui::AbstractStorageQuery::reset() const

Reset the storage value.

Expects that storage() is still valid in the layer() and operations() list StorageOperation::Reset.

Calling this function causes the storage to get marked as dirty and LayerState::NeedsCommonDataUpdate to be set on the layer if the stored value actually changed.

void Magnum::Ui::AbstractStorageQuery::toggle() const

Toggle the storage value.

Expects that storage() is still valid in the layer() and operations() list StorageOperation::Toggle.

Calling this function causes the storage to get marked as dirty and LayerState::NeedsCommonDataUpdate to be set on the layer if the stored value actually changed.

void Magnum::Ui::AbstractStorageQuery::increment() const

Increment the storage value.

Expects that storage() is still valid in the layer() and operations() list StorageOperation::Increment.

Calling this function causes the storage to get marked as dirty and LayerState::NeedsCommonDataUpdate to be set on the layer if the stored value actually changed.

void Magnum::Ui::AbstractStorageQuery::decrement() const

Decrement the storage value.

Expects that storage() is still valid in the layer() and operations() list StorageOperation::Decrement.

Calling this function causes the storage to get marked as dirty and LayerState::NeedsCommonDataUpdate to be set on the layer if the stored value actually changed.

void Magnum::Ui::AbstractStorageQuery::setToMin() const

Set the storage value to a minimum.

Expects that storage() is still valid in the layer() and operations() list StorageOperation::Min.

Calling this function causes the storage to get marked as dirty and LayerState::NeedsCommonDataUpdate to be set on the layer if the stored value actually changed.

void Magnum::Ui::AbstractStorageQuery::setToMax() const

Set the storage value to a maximum.

Expects that storage() is still valid in the layer() and operations() list StorageOperation::Max.

Calling this function causes the storage to get marked as dirty and LayerState::NeedsCommonDataUpdate to be set on the layer if the stored value actually changed.