Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreTimer.h
Go to the documentation of this file.
1
7#ifndef __HDI_CORE_TIMER__
8#define __HDI_CORE_TIMER__
9
10#include "hdicoreTypes.h"
11
12namespace hdi
13{
14 #if defined(HDI_CORE_AIP_MODE)
15 namespace aip
16 {
17 class Timer;
18 }
19 #endif
20 // HDI_CORE_AIP_MODE
21
22 namespace core
23 {
24 class Callback;
25
31 class Timer
32 {
33 public:
46
54 Timer(const Timer& t_);
55
66 Timer(const std::string& name_, const double delay_, const Callback& responder_);
67
73 virtual ~Timer();
74
84 virtual Timer& operator=(const Timer& rhs_);
85
94 virtual bool operator==(const Timer& rhs_) const;
95
104 virtual bool operator!=(const Timer& rhs_) const;
105
119 virtual void destroy();
120
121 #if defined(HDI_CORE_AIP_MODE)
133 virtual AITimerHandle aiTimerHandle() const;
134 #endif
135 // HDI_CORE_AIP_MODE
136
144 virtual bool isEmpty() const;
145
153 virtual std::string name() const;
154
162 virtual bool active() const;
163
173 virtual void setActive(const bool active_);
174
180 virtual void activate();
181
187 virtual void deactivate();
188
196 virtual double delay() const;
197
208 virtual void setDelay(const double delay_);
209
217 virtual Callback* const callback() const;
218
226 virtual void setCallback(const Callback& cb_);
227
228
229 private:
233 void* __data;
234
235 #if defined(HDI_CORE_AIP_MODE)
236 friend aip::Timer* __accessImpl(const Timer&);
237
243 void* __impl() const;
244 #endif
245 // HDI_CORE_AIP_MODE
246 };
247
248 typedef std::unique_ptr<Timer> TimerUP;
249 typedef std::shared_ptr<Timer> TimerSP;
250 typedef std::weak_ptr<Timer> TimerWP;
251
252 #if defined(HDI_CORE_AIP_MODE)
253 extern aip::Timer* __accessImpl(const Timer&);
254 #endif
255 // HDI_CORE_AIP_MODE
256 }
257}
258
259#endif
260// __HDI_CORE_TIMER__
Base class for templated __Callback class.
Definition: hdicoreCallback.h:68
Deals with timer registration and callbacks.
Definition: hdicoreTimer.h:32
virtual bool active() const
Gets whether the timer is active.
virtual void setCallback(const Callback &cb_)
Sets the callback for the timer.
virtual AITimerHandle aiTimerHandle() const
Gets the timer handle around which the target object is wrapped.
virtual void setDelay(const double delay_)
Sets the delay in seconds for the target Timer object.
virtual double delay() const
Gets the delay in seconds for the target Timer object.
virtual std::string name() const
Gets the unique timer name.
virtual bool isEmpty() const
Gets whether the target Timer object is empty (constructed with the default ctor)
Timer(const std::string &name_, const double delay_, const Callback &responder_)
Constructs a Timer object to fire a responder (target and action) in a given number of seconds.
virtual Callback *const callback() const
Gets the registered callback for the timer.
virtual bool operator==(const Timer &rhs_) const
Tests whether a given Timer object is the same as another.
Timer()
Constructs an empty Timer object.
virtual ~Timer()
Destructs a Timer object, deactivating the timer first.
virtual void activate()
Activates (enables) the timer.
virtual bool operator!=(const Timer &rhs_) const
Tests whether a given Timer object is not the same as another.
virtual void destroy()
Destroys the timer, converting the target object to an empty Timer object (see the default constructo...
virtual void setActive(const bool active_)
Sets whether the timer is active.
Timer(const Timer &t_)
Constructs a new Timer object from an existing Timer object (copy constructor)
virtual void deactivate()
Deactivates (disables) the timer, preventing it from firing.
virtual Timer & operator=(const Timer &rhs_)
Assigns one Timer object to another.
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.