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

Class representing a timeout since construction or reset. More...

#include <eagine/timeout.hpp>

Public Member Functions

 timeout () noexcept
 Default construction. Saves current time. Immediately expires. More...
 
 timeout (_clock::duration duration, _clock::duration initial) noexcept
 Construction from the default and initial timeout duration. More...
 
 timeout (_clock::duration duration, nothing_t) noexcept
 Construction from the default and zero initial timeout duration. More...
 
 timeout (_clock::duration duration) noexcept
 Construction from the default duration. More...
 
template<typename R , typename P >
 timeout (std::chrono::duration< R, P > duration) noexcept
 Construction from the default duration. More...
 
auto reset () noexcept -> auto &
 Resets the timeout using the previously specified duration.
 
auto reset (_clock::duration duration, _clock::duration initial) noexcept -> auto &
 Resets the timeout using the specified duration values.
 
auto reset (_clock::duration duration, nothing_t) noexcept -> auto &
 Resets the timeout using the specified duration values. More...
 
auto reset (_clock::duration duration) noexcept -> auto &
 Resets the timeout using the specified duration value. More...
 
auto elapsed_time () const noexcept
 Returns the time since reset as clocks duration type.
 
auto is_expired () const noexcept -> bool
 Indicates if the timeout is expired. More...
 
 operator bool () const noexcept
 Indicates if the timeout is expired. More...
 
auto period () const noexcept -> auto &
 Returns the timeout period. More...
 

Detailed Description

Class representing a timeout since construction or reset.

See also
time_measure
resetting_timeout

Constructor & Destructor Documentation

◆ timeout() [1/5]

eagine::timeout::timeout ( )
inlinenoexcept

Default construction. Saves current time. Immediately expires.

Postcondition
is_expired()

◆ timeout() [2/5]

eagine::timeout::timeout ( _clock::duration  duration,
_clock::duration  initial 
)
inlinenoexcept

Construction from the default and initial timeout duration.

See also
reset
period

◆ timeout() [3/5]

eagine::timeout::timeout ( _clock::duration  duration,
nothing_t   
)
inlinenoexcept

Construction from the default and zero initial timeout duration.

See also
reset
period

◆ timeout() [4/5]

eagine::timeout::timeout ( _clock::duration  duration)
inlinenoexcept

Construction from the default duration.

See also
reset
period

◆ timeout() [5/5]

template<typename R , typename P >
eagine::timeout::timeout ( std::chrono::duration< R, P >  duration)
inlinenoexcept

Construction from the default duration.

See also
reset
period

Member Function Documentation

◆ is_expired()

auto eagine::timeout::is_expired ( ) const -> bool
inlinenoexcept

Indicates if the timeout is expired.

See also
reset
period

Referenced by operator bool(), and eagine::resetting_timeout::operator bool().

◆ operator bool()

eagine::timeout::operator bool ( ) const
inlineexplicitnoexcept

Indicates if the timeout is expired.

See also
is_expired

◆ period()

auto eagine::timeout::period ( ) const -> auto&
inlinenoexcept

Returns the timeout period.

See also
reset
is_expired

◆ reset() [1/2]

auto eagine::timeout::reset ( _clock::duration  duration) -> auto&
inlinenoexcept

Resets the timeout using the specified duration value.

See also
is_expired

◆ reset() [2/2]

auto eagine::timeout::reset ( _clock::duration  duration,
nothing_t   
) -> auto&
inlinenoexcept

Resets the timeout using the specified duration values.

Postcondition
is_expired()

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