… | |
… | |
54 | watcher *self = static_cast<watcher *>(w); |
54 | watcher *self = static_cast<watcher *>(w); |
55 | K *obj = static_cast<K *>(self->data); |
55 | K *obj = static_cast<K *>(self->data); |
56 | (obj->*method) (*self, revents); |
56 | (obj->*method) (*self, revents); |
57 | } |
57 | } |
58 | |
58 | |
59 | template<void (*function)(watcher &w, int)> |
59 | template<void (*function)(watcher &w, int), void *data = 0> |
60 | void set () |
60 | void set () |
61 | { |
61 | { |
62 | set_ (0, function_thunk<function>); |
62 | set_ (data, function_thunk<function>); |
63 | } |
63 | } |
64 | |
64 | |
65 | template<void (*function)(watcher &w, int)> |
65 | template<void (*function)(watcher &w, int)> |
66 | static void function_thunk (EV_P_ ev_watcher *w, int revents) |
66 | static void function_thunk (EV_P_ ev_watcher *w, int revents) |
67 | { |
67 | { |