Template class for handling state arrays. More...
#include <kanzi/core.ui/graphics/composition_stack.hpp>
Public Member Functions | |
| const T * | appliedState () const |
| Gets the currently applied state. | |
| void | apply (Renderer &renderer) |
| Apply the topmost element. | |
| T & | back () |
| Access last element. | |
| const T & | back () const |
| Access last element (const version). | |
| void | clear () |
| Pop all elements from the stack. | |
| bool | empty () const |
| Indicates whether or not the stack is empty. | |
| void | invalidateState () |
| Invalidate state. | |
| void | pop () |
| Pop element from the stack. | |
| void | push (T state) |
| Push new element into the stack. | |
| StateStack ()=default | |
Protected Member Functions | |
| bool | isLastStackApplied () |
| Indicates whether the last element in the stack has been applied. | |
Protected Attributes | |
| optional< size_t > | m_appliedStackIndex |
| What stack index has been applied. When no state is applied, this is nullopt. | |
| vector< T > | m_stack |
| Stack for holding. | |
Template class for handling state arrays.
|
explicitdefault |
|
inline |
Apply the topmost element.
If no elements present, apply default 2D rendering state.
|
inline |
Access last element.
Access last element (const version).
|
inline |
Indicates whether or not the stack is empty.
|
inline |
Invalidate state.
Only be used when stack applies some other state than any of the default states.
Push new element into the stack.
| state | State to push. |
|
inline |
Pop element from the stack.
|
inline |
Pop all elements from the stack.
|
inline |
Gets the currently applied state.
Both default states and empty stack return nullptr.
|
inlineprotected |
Indicates whether the last element in the stack has been applied.
|
protected |
Stack for holding.
|
protected |
What stack index has been applied. When no state is applied, this is nullopt.