template<typename T, typename Traits = FResTraits<T>>
sk::FCachedResource class

Class that manages undo/redo.

Contents

Public functions

template<typename... Ts>
auto emplaceBack(Ts && ... args) -> T & -> auto
auto underUndo() const noexcept -> bool -> auto
auto get() noexcept -> T & -> auto
Gets the current layer.
auto get() const noexcept -> T const & -> auto
Gets the current layer as constant.
auto undo() -> bool -> auto
auto redo() -> bool -> auto

Function documentation

template<typename T, typename Traits> template<typename... Ts>
auto sk::FCachedResource<T, Traits>::emplaceBack(Ts && ... args) -> T &

Pushes a new layer in the list of layers, deleting layers at the front if history limit has been reached.

template<typename T, typename Traits>
auto sk::FCachedResource<T, Traits>::underUndo() const noexcept -> bool

Returns true If undo was called more times than redo.

template<typename T, typename Traits>
auto sk::FCachedResource<T, Traits>::undo() -> bool

Returns false If undo is no longer possible.

Current layer becomes std::prev(current_layer_iterator).

template<typename T, typename Traits>
auto sk::FCachedResource<T, Traits>::redo() -> bool

Returns false If redo is no longer possible.

Current layer becomes std::next(current_layer_iterator).