… | |
… | |
57 | #if IOM_IDLE |
57 | #if IOM_IDLE |
58 | struct idle_watcher; |
58 | struct idle_watcher; |
59 | #endif |
59 | #endif |
60 | |
60 | |
61 | template<class watcher> |
61 | template<class watcher> |
62 | struct io_manager_vec : protected vector<watcher *> { |
62 | struct io_manager_vec : vector<watcher *> { |
63 | friend class io_manager; |
63 | #if IOM_CHECK |
64 | protected: |
64 | bool activity; |
|
|
65 | #endif |
|
|
66 | |
65 | void erase_unordered (unsigned int pos) |
67 | void erase_unordered (unsigned int pos) |
66 | { |
68 | { |
67 | watcher *w = (*this)[size () - 1]; |
69 | watcher *w = (*this)[size () - 1]; |
68 | pop_back (); |
70 | pop_back (); |
69 | |
71 | |
… | |
… | |
156 | void start (tstamp when) { set (when); iom.reg (this); } |
158 | void start (tstamp when) { set (when); iom.reg (this); } |
157 | void stop () { iom.unreg (this); } |
159 | void stop () { iom.unreg (this); } |
158 | |
160 | |
159 | template<class O1, class O2> |
161 | template<class O1, class O2> |
160 | time_watcher (O1 *object, void (O2::*method)(time_watcher &)) |
162 | time_watcher (O1 *object, void (O2::*method)(time_watcher &)) |
161 | : callback1<void, time_watcher &>(object,method) |
163 | : callback1<void, time_watcher &>(object,method), at(0) |
162 | { } |
164 | { } |
163 | ~time_watcher () { stop (); } |
165 | ~time_watcher () { stop (); } |
164 | }; |
166 | }; |
165 | #endif |
167 | #endif |
166 | |
168 | |