IntrOS
Loading...
Searching...
No Matches
intros::Timer Struct Reference

create and initialize a timer object More...

#include <ostimer.h>

Inheritance diagram for intros::Timer:

Public Member Functions

 Timer ()
 constructor, see the constructor parameters of the class
template<class F>
 Timer (F &&_proc)
 constructor, see the constructor parameters of the class
 Timer (std::nullptr_t)
 constructor, see the constructor parameters of the class
template<typename F, typename... A>
 Timer (F &&_proc, A &&... _args)
 constructor, see the constructor parameters of the class
 Timer (Timer &&_src)
 move constructor
 Timer (const Timer &)=delete
Timer & operator= (Timer &&)=delete
Timer & operator= (const Timer &)=delete

Static Public Member Functions

static Timer Make ()
 create and initialize static timer object
template<class F>
static Timer Make (F &&_proc)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
static Timer Make (std::nullptr_t)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<typename F, typename... A>
static Timer Make (F &&_proc, A &&... _args)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<typename T>
static Timer Start (const T &_delay, const T &_period)
 create and initialize static timer object and start periodic timer for given duration of time
template<typename T, class F>
static Timer Start (const T &_delay, const T &_period, F &&_proc)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<typename T>
static Timer Start (const T &_delay, const T &_period, std::nullptr_t)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<typename T, typename F, typename... A>
static Timer Start (const T &_delay, const T &_period, F &&_proc, A &&... _args)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<typename T>
static Timer StartFor (const T &_delay)
 create and initialize static timer object and start one-shot timer for given duration of time
template<typename T, class F>
static Timer StartFor (const T &_delay, F &&_proc)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<typename T>
static Timer StartFor (const T &_delay, std::nullptr_t)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<typename T, typename F, typename... A>
static Timer StartFor (const T &_delay, F &&_proc, A &&... _args)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<typename T>
static Timer StartPeriodic (const T &_period)
 create and initialize static timer object and start periodic timer for given duration of time
template<typename T, class F>
static Timer StartPeriodic (const T &_period, F &&_proc)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<typename T>
static Timer StartPeriodic (const T &_period, std::nullptr_t)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<typename T, typename F, typename... A>
static Timer StartPeriodic (const T &_period, F &&_proc, A &&... _args)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<typename T>
static Timer StartUntil (const T &_time)
 create and initialize static timer object and start one-shot timer until given timepoint
template<typename T, class F>
static Timer StartUntil (const T &_time, F &&_proc)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<typename T>
static Timer StartUntil (const T &_time, std::nullptr_t)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<typename T, typename F, typename... A>
static Timer StartUntil (const T &_time, F &&_proc, A &&... _args)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Detailed Description

create and initialize a timer object

Constructor parameters
  • proc: callback procedure
    • none / nullptr: no callback

Member Function Documentation

◆ Make()

Timer intros::Timer::Make ( )
inlinestatic

create and initialize static timer object

Parameters
  • proc: callback procedure
    • none / nullptr: no callback
  • args: arguments for callback procedure
Returns
Timer object

◆ Start()

template<typename T>
Timer intros::Timer::Start ( const T & _delay,
const T & _period )
inlinestatic

create and initialize static timer object and start periodic timer for given duration of time

when the timer has finished the countdown, the callback procedure is launched

do this periodically

Parameters
  • delay: duration of time (maximum number of ticks to countdown) for first expiration
    • IMMEDIATE: don't countdown
    • INFINITE: countdown indefinitely
  • period: duration of time (maximum number of ticks to countdown) for all next expirations
    • IMMEDIATE: don't countdown
    • INFINITE: countdown indefinitely
  • proc: callback procedure
    • none / nullptr: no callback
  • args: arguments for callback procedure
Returns
Timer object

◆ StartFor()

template<typename T>
Timer intros::Timer::StartFor ( const T & _delay)
inlinestatic

create and initialize static timer object and start one-shot timer for given duration of time

when the timer has finished the countdown, the callback procedure is launched

Parameters
  • delay: duration of time (maximum number of ticks to countdown)
    • IMMEDIATE: don't countdown
    • INFINITE: countdown indefinitely
  • proc: callback procedure
    • none / nullptr: no callback
  • args: arguments for callback procedure
Returns
Timer object

◆ StartPeriodic()

template<typename T>
Timer intros::Timer::StartPeriodic ( const T & _period)
inlinestatic

create and initialize static timer object and start periodic timer for given duration of time

when the timer has finished the countdown, the callback procedure is launched

do this periodically

Parameters
  • period: duration of time (maximum number of ticks to countdown)
    • IMMEDIATE: don't countdown
    • INFINITE: countdown indefinitely
  • proc: callback procedure
    • none / nullptr: no callback
  • args: arguments for callback procedure
Returns
Timer object

◆ StartUntil()

template<typename T>
Timer intros::Timer::StartUntil ( const T & _time)
inlinestatic

create and initialize static timer object and start one-shot timer until given timepoint

when the timer has finished the countdown, the callback procedure is launched

Parameters
  • time: timepoint value
  • proc: callback procedure
    • none / nullptr: no callback
  • args: arguments for callback procedure
Returns
Timer object

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