neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
neolib::timer Class Referenceabstract

#include <timer.hpp>

Inheritance diagram for neolib::timer:
neolib::noncopyable neolib::lifetime< Base > neolib::i_lifetime neolib::callback_timer neogfx::widget_timer

Classes

struct  already_disabled
 
struct  already_enabled
 
struct  already_waiting
 

Public Types

typedef std::chrono::duration< double > duration_type
 
- Public Types inherited from neolib::lifetime< Base >
typedef neolib::destroyed_flag destroyed_flag
 

Public Member Functions

 timer (i_async_task &aTask, const duration_type &aDuration_s, bool aInitialWait=true)
 
 timer (i_async_task &aTask, const i_lifetime &aContext, const duration_type &aDuration_s, bool aInitialWait=true)
 
template<typename Context >
 timer (i_async_task &aTask, const Context &aContext, const duration_type &aDuration_s, bool aInitialWait=true)
 
 timer (const timer &aOther)
 
timeroperator= (const timer &aOther)
 
virtual ~timer ()
 
i_async_taskowner_task () const
 
void enable (bool aWait=true)
 
void disable ()
 
bool enabled () const
 
bool disabled () const
 
void again ()
 
void again_if ()
 
void cancel ()
 
void reset ()
 
bool waiting () const
 
const duration_typeduration () const
 
void set_duration (const duration_type &aDuration_s, bool aEffectiveImmediately=false)
 
void set_debug (bool aDebug)
 
- Public Member Functions inherited from neolib::lifetime< Base >
 lifetime (lifetime_state aState=lifetime_state::Alive)
 
virtual ~lifetime ()
 
lifetime_state object_state () const final
 
std::shared_ptr< std::atomic< lifetime_state > > object_state_ptr () const final
 
bool is_creating () const final
 
bool is_alive () const final
 
bool is_destroying () const final
 
bool is_destroyed () const final
 
void set_alive () override
 
void set_destroying () override
 
void set_destroyed () override
 
- Public Member Functions inherited from neolib::i_lifetime
virtual ~i_lifetime ()=default
 

Protected Member Functions

void unsubscribe ()
 

Detailed Description

Definition at line 50 of file timer.hpp.

Member Typedef Documentation

◆ duration_type

typedef std::chrono::duration<double> neolib::timer::duration_type

Definition at line 54 of file timer.hpp.

Constructor & Destructor Documentation

◆ timer() [1/4]

neolib::timer::timer ( i_async_task aTask,
const duration_type aDuration_s,
bool  aInitialWait = true 
)

◆ timer() [2/4]

neolib::timer::timer ( i_async_task aTask,
const i_lifetime aContext,
const duration_type aDuration_s,
bool  aInitialWait = true 
)

◆ timer() [3/4]

template<typename Context >
neolib::timer::timer ( i_async_task aTask,
const Context aContext,
const duration_type aDuration_s,
bool  aInitialWait = true 
)
inline

Definition at line 65 of file timer.hpp.

◆ timer() [4/4]

neolib::timer::timer ( const timer aOther)

◆ ~timer()

virtual neolib::timer::~timer ( )
virtual

Member Function Documentation

◆ again()

void neolib::timer::again ( )

◆ again_if()

void neolib::timer::again_if ( )

◆ cancel()

void neolib::timer::cancel ( )

◆ disable()

void neolib::timer::disable ( )

◆ disabled()

bool neolib::timer::disabled ( ) const

◆ duration()

const duration_type & neolib::timer::duration ( ) const

◆ enable()

void neolib::timer::enable ( bool  aWait = true)

◆ enabled()

bool neolib::timer::enabled ( ) const

◆ operator=()

timer & neolib::timer::operator= ( const timer aOther)

◆ owner_task()

i_async_task & neolib::timer::owner_task ( ) const

◆ reset()

void neolib::timer::reset ( )

◆ set_debug()

void neolib::timer::set_debug ( bool  aDebug)

◆ set_duration()

void neolib::timer::set_duration ( const duration_type aDuration_s,
bool  aEffectiveImmediately = false 
)

◆ unsubscribe()

void neolib::timer::unsubscribe ( )
protected

◆ waiting()

bool neolib::timer::waiting ( ) const

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