Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
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 
12 namespace hdi
13 {
14  namespace plugin
15  {
16  class Timer;
17  }
18 
19  namespace core
20  {
21  class Callback;
22 
28  class Timer
29  {
30  public:
42  Timer();
43 
51  Timer(const Timer& t_);
52 
63  Timer(const std::string& name_, const double delay_, const Callback& responder_);
64 
70  virtual ~Timer();
71 
81  virtual Timer& operator=(const Timer& rhs_);
82 
91  virtual bool operator==(const Timer& rhs_) const;
92 
101  virtual bool operator!=(const Timer& rhs_) const;
102 
116  virtual void destroy();
117 
129  virtual AITimerHandle aiTimerHandle() const;
130 
138  virtual bool isEmpty() const;
139 
147  virtual std::string name() const;
148 
156  virtual bool active() const;
157 
167  virtual void setActive(const bool active_);
168 
174  virtual void activate();
175 
181  virtual void deactivate();
182 
190  virtual double delay() const;
191 
199  virtual void setDelay(const double delay_);
200 
208  virtual Callback* const callback() const;
209 
217  virtual void setCallback(const Callback& cb_);
218 
219 
220  private:
221  friend plugin::Timer* __accessImpl(const Timer&);
222 
226  void* __data;
227 
233  void* __impl() const;
234  };
235 
236  typedef std::auto_ptr<Timer> TimerAP;
237 
238  extern plugin::Timer* __accessImpl(const Timer&);
239  }
240 }
241 
242 #endif
243 // __HDI_CORE_TIMER__
Timer()
Constructs an empty Timer object.
virtual bool active() const
Gets whether the timer is active.
virtual AITimerHandle aiTimerHandle() const
Gets the timer handle around which the target object is wrapped.
virtual void setCallback(const Callback &cb_)
Sets the callback for the timer.
virtual void deactivate()
Deactivates (disables) the timer, preventing it from firing.
virtual std::string name() const
Gets the unique timer name.
virtual bool operator!=(const Timer &rhs_) const
Tests whether a given Timer object is not the same as another.
Deals with timer registration and callbacks.
Definition: hdicoreTimer.h:28
virtual bool isEmpty() const
Gets whether the target Timer object is empty (constructed with the default ctor) ...
virtual void activate()
Activates (enables) the timer.
Base class for templated __Callback class.
Definition: hdicoreCallback.h:67
virtual void setActive(const bool active_)
Sets whether the timer is active.
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
virtual double delay() const
Gets the delay in seconds for the target Timer object.
virtual void destroy()
Destroys the timer, converting the target object to an empty Timer object (see the default constructo...
Definition: hdicoreaiArray.h:12
virtual void setDelay(const double delay_)
Sets the delay in seconds for the target Timer object.
virtual bool operator==(const Timer &rhs_) const
Tests whether a given Timer object is the same as another.
virtual ~Timer()
Destructs a Timer object, deactivating the timer first.
virtual Callback *const callback() const
Gets the registered callback for the timer.
virtual Timer & operator=(const Timer &rhs_)
Assigns one Timer object to another.