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

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

Class for read-only values with history. More...

#include <eagine/value_with_history.hpp>

Public Member Functions

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::value_with_history< T, N >

Class for read-only values with history.

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

Member Function Documentation

◆ get()

template<typename T , std::size_t N>
auto eagine::value_with_history< T, N >::get ( ) const
inlinenoexcept

Returns the current revision of the value.

See also
value

Referenced by eagine::application::input::operator bool().

◆ old_value()

template<typename T , std::size_t N>
auto eagine::value_with_history< T, N >::old_value ( ) const
inlinenoexcept

◆ operator T()

template<typename T , std::size_t N>
eagine::value_with_history< T, N >::operator T ( ) const
inlinenoexcept

Returns the current revision of the value.

See also
value

◆ sync()

template<typename T , std::size_t N>
void eagine::value_with_history< T, N >::sync ( )
inline

Synchronize the historic revisions to the current value.

See also
make_history

◆ value() [1/2]

◆ value() [2/2]

template<typename T , std::size_t N>
auto eagine::value_with_history< T, N >::value ( bool  old) const
inlinenoexcept

Returns the current or previous revision of the value.

See also
value
old_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).