#ifndef node_timer_h #define node_timer_h #include #include #include #include namespace node { class Timer : EventEmitter { public: static void Initialize (v8::Handle target); protected: static v8::Persistent constructor_template; Timer () : EventEmitter () { } ~Timer(); static v8::Handle New (const v8::Arguments& args); static v8::Handle Start (const v8::Arguments& args); static v8::Handle Stop (const v8::Arguments& args); static v8::Handle RepeatGetter (v8::Local property, const v8::AccessorInfo& info); static void RepeatSetter (v8::Local property, v8::Local value, const v8::AccessorInfo& info); private: static void OnTimeout (EV_P_ ev_timer *watcher, int revents); ev_timer watcher_; }; } // namespace node #endif // node_timer_h