OGLplus  (0.59.0) a C++ wrapper for rendering APIs

eagine::value_with_history_storage< T, N > Class Template Reference

Base storage class for values and variables with history. More...

#include <eagine/value_with_history.hpp>

Public Member Functions

constexpr value_with_history_storage ()=default
 Default constructor.
 
template<typename... I, typename = std::enable_if_t<sizeof...(I) == N>>
constexpr value_with_history_storage (I &&... initial)
 Initializes the individual revisions of the value.
 
constexpr value_with_history_storage (const T &initial) noexcept
 Initializes all revisions with the same initial value.
 
constexpr auto get (std::size_t i) const noexcept -> const T &
 Returns the i-th revision of the stored value (0 = current value).
 
void set (std::size_t i, const T &value) noexcept
 Sets the i-th revision of the stored value (0 = current value).
 
void make_history () noexcept
 Move the stored revisions by one, to make place for new value. More...
 
void sync () noexcept
 Synchronize the historic revisions to the current value. More...
 

Detailed Description

template<typename T, std::size_t N>
class eagine::value_with_history_storage< T, N >

Base storage class for values and variables with history.

Template Parameters
Tthe type of the value
Nthe number of latest historical revisions of the stored value.
See also
value_with_history
Note
Do not use this class directly. Use value_with_history or variable_with_history.

Member Function Documentation

◆ make_history()

template<typename T , std::size_t N>
void eagine::value_with_history_storage< T, N >::make_history ( )
inlinenoexcept

Move the stored revisions by one, to make place for new value.

See also
sync

◆ sync()

template<typename T , std::size_t N>
void eagine::value_with_history_storage< T, N >::sync ( )
inlinenoexcept

Synchronize the historic revisions to the current value.

See also
make_history

The documentation for this class was generated from the following file:

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).