#ifndef node_timer_h #define node_timer_h #include "node.h" #include #include namespace node { class Timer : ObjectWrap { public: static void Initialize (v8::Handle target); virtual size_t size (void) { return sizeof(Timer); } protected: static v8::Persistent constructor_template; Timer(v8::Handle handle, v8::Handle callback, ev_tstamp after, ev_tstamp repeat); ~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); private: static void OnTimeout (EV_P_ ev_timer *watcher, int revents); ev_timer watcher_; }; } // namespace node #endif // node_timer_h