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

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

Class for mutable variables with history. More...

#include <eagine/value_with_history.hpp>

Public Member Functions

constexpr variable_with_history () noexcept=default
 Default constructor.
 
constexpr variable_with_history (const T &initial) noexcept
 Initialize the all revisions to the initial value.
 
auto assign (const T &new_value) -> bool
 Shifts the revisions and assigns a new value.
 
auto advance (const T &delta_value) -> bool
 Shifts the revisions and advanced the current value by given delta.
 
- Public Member Functions inherited from eagine::value_with_history< T, N >
template<typename... I>
constexpr value_with_history (I &&... initial)
 Initialized the individual revisions of this value.
 
auto values () const noexcept -> const value_with_history_storage< T, N > &
 Returns a reference to the value storage.
 
auto get () const noexcept
 Returns the current revision of the value. More...
 
auto value () const noexcept
 Returns the current revision of the value. More...
 
auto old_value () const noexcept
 Returns the previous revision of the value. More...
 
auto value (bool old) const noexcept
 Returns the current or previous revision of the value. More...
 
 operator T () const noexcept
 Returns the current revision of the value. More...
 
auto delta () const noexcept
 Returns the difference between the current and the previous revision.
 
auto deltas () const noexcept
 Returns the differences between the adjacent revisions.
 
auto distance () const noexcept
 Returns the distance between the current and the previous revisions.
 
auto changed () const noexcept -> bool
 Indicates if the current and previous revisions differ.
 
template<typename U >
auto as () const
 Returns this with the values cast to new type U.
 
void sync ()
 Synchronize the historic revisions to the current value. More...
 

Detailed Description

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

Class for mutable variables with history.

Template Parameters
Tthe type of the value
Nthe number of latest historical revisions of the stored value.

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).