HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions
tt::Trigger< Clock > Class Template Reference

#include <TTauri/Foundation/Trigger.hpp>

Public Member Functions

 Trigger (Trigger *parent=nullptr) noexcept
 
 Trigger (Trigger const &) noexcept=delete
 
 Trigger (Trigger &&) noexcept=delete
 
Triggeroperator= (Trigger const &) noexcept=delete
 
Triggeroperator= (Trigger &&) noexcept=delete
 
Triggeradd (time_point time_point, int level) noexcept
 Add a time_point to the trigger.
 
int check (time_point current_time) noexcept
 Retrieve the trigger level at the current time.
 
Triggeroperator++ () noexcept
 Set to immediately trigger at level 1.
 
Triggeroperator+= (time_point time_point) noexcept
 Set to trigger at a specified time at level 1.
 
template<typename T , std::enable_if_t< std::is_arithmetic_v< T >, int > = 0>
Triggeroperator+= (T level) noexcept
 Set to immediately trigger with a specified level.
 

Detailed Description

template<typename Clock>
class tt::Trigger< Clock >

Information on when to trigger.

Member Function Documentation

◆ add()

template<typename Clock >
Trigger & tt::Trigger< Clock >::add ( time_point time_point,
int level )
inlinenoexcept

Add a time_point to the trigger.

Both time_point and level are atomically updated, however the minimum time_point and maximum level is recorded independently. determined.

Level should be larger than zero, zero means idle when using the check() method.

Parameters
time_pointThe next moment to trigger.
levelThe level of the trigger.
Returns
this instance.

◆ check()

template<typename Clock >
int tt::Trigger< Clock >::check ( time_point current_time)
inlinenoexcept

Retrieve the trigger level at the current time.

This function will destructively and atomically read the trigger level.

Parameters
current_timeThe current time.
Returns
The highest level of a set trigger, or zero when it is not triggered.

◆ operator++()

template<typename Clock >
Trigger & tt::Trigger< Clock >::operator++ ( )
inlinenoexcept

Set to immediately trigger at level 1.

◆ operator+=() [1/2]

template<typename Clock >
template<typename T , std::enable_if_t< std::is_arithmetic_v< T >, int > = 0>
Trigger & tt::Trigger< Clock >::operator+= ( T level)
inlinenoexcept

Set to immediately trigger with a specified level.

◆ operator+=() [2/2]

template<typename Clock >
Trigger & tt::Trigger< Clock >::operator+= ( time_point time_point)
inlinenoexcept

Set to trigger at a specified time at level 1.


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