23 #ifndef _THREAD_LOOPER_HPP_ 24 #define _THREAD_LOOPER_HPP_ 94 looper (
const period_function &setup_period_function);
97 looper (
const delta_time &fixed_period);
103 template<std::
size_t Count>
104 looper (
const std::array<delta_time, Count> periods);
168 template<std::
size_t Count>
172 static_assert (Count <= MAX_LOOPER_PERIODS,
"Count template cannot exceed MAX_LOOPER_PERIODS=3");
184 std::placeholders::_2);
191 #endif // _THREAD_LOOPER_HPP_ delta_time m_periods[MAX_LOOPER_PERIODS]
void put_to_sleep(waiter &waiter_arg)
void get_stats(cubperf::stat_value *stats_out)
generic_value< false > stat_value
std::atomic< bool > m_was_woken_up
std::chrono::system_clock::time_point m_start_execution_time
const std::size_t MAX_LOOPER_PERIODS
void setup_infinite_wait(bool &is_timed_wait, delta_time &period)
clock::time_point time_point
std::atomic< bool > m_stop
std::atomic< std::size_t > m_period_index
bool was_woken_up(void) const
cubperf::statset & m_stats
static const char * get_stat_name(std::size_t stat_index)
std::chrono::system_clock::duration delta_time
bool is_stopped(void) const
void setup_increasing_waits(bool &is_timed_wait, delta_time &period)
std::function< void(bool &, delta_time &)> period_function
void setup_fixed_waits(bool &is_timed_wait, delta_time &period)
period_function m_setup_period
std::size_t m_periods_count
static std::size_t get_stats_value_count(void)