PCL
|
Client-side interface to a PixInsight Timer object. More...
#include <Timer.h>
Public Types | |
using | timer_event_handler = void(Control::*)(Timer &sender) |
Public Member Functions | |
Timer () | |
~Timer () override | |
unsigned | Count () const |
void | EnsureUnique () override |
double | Interval () const |
bool | IsPeriodic () const |
bool | IsRunning () const |
bool | IsSingleShot () const |
void | OnTimer (timer_event_handler handler, Control &receiver) |
void | SetInterval (double seconds) |
void | SetPeriodic (bool p=true) |
void | SetSingleShot (bool=true) |
void | Start () |
void | Stop () |
Public Member Functions inherited from pcl::UIObject | |
virtual | ~UIObject () noexcept(false) |
bool | IsAlias () const |
bool | IsGarbage () const |
bool | IsNull () const |
bool | IsSameObject (const UIObject &o) const |
bool | IsUnique () const |
String | ObjectId () const |
IsoString | ObjectType () const |
bool | operator< (const UIObject &o) const |
bool | operator== (const UIObject &o) const |
size_type | RefCount () const |
void | SetObjectId (const String &id) |
Static Public Member Functions | |
static Timer & | Null () |
Static Public Member Functions inherited from pcl::UIObject | |
static UIObject & | Null () |
Additional Inherited Members | |
Protected Member Functions inherited from pcl::UIObject | |
UIObject ()=default | |
UIObject (const UIObject &x) | |
UIObject (UIObject &&x) | |
UIObject & | operator= (const UIObject &x) |
UIObject & | operator= (UIObject &&x) |
A Timer object can work in two ways:
pcl::Timer::Timer | ( | ) |
Default constructor.
|
inlineoverride |
|
inline |
|
inlineoverridevirtual |
Ensures that the server-side object managed by this instance is uniquely referenced.
Since timers are unique objects by definition, calling this member function has no effect.
Reimplemented from pcl::UIObject.
double pcl::Timer::Interval | ( | ) | const |
Returns the timer interval in seconds.
|
inline |
bool pcl::Timer::IsRunning | ( | ) | const |
Returns true iff this Timer object is active. An active timer is generating timer events.
bool pcl::Timer::IsSingleShot | ( | ) | const |
Returns true iff this is a single-shot timer.
|
static |
Returns a reference to a null Timer instance. A null Timer does not correspond to an existing timer in the PixInsight core application.
void pcl::Timer::SetInterval | ( | double | seconds | ) |
Sets the timer interval in seconds.
|
inline |
void pcl::Timer::SetSingleShot | ( | bool | = true | ) |
Enables or disables single-shot mode for this Timer object.
void pcl::Timer::Start | ( | ) |
Activates this Timer object. Starts generation of timer event(s).
void pcl::Timer::Stop | ( | ) |
Stops this Timer object, if it is currently active.