ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev++.h
(Generate patch)

Comparing libev/ev++.h (file contents):
Revision 1.24 by llucax, Fri Jan 18 18:13:21 2008 UTC vs.
Revision 1.27 by llucax, Fri Jan 18 18:14:23 2008 UTC

66 FORK = EV_FORK, 66 FORK = EV_FORK,
67 EMBED = EV_EMBED, 67 EMBED = EV_EMBED,
68 ERROR = EV_ERROR, 68 ERROR = EV_ERROR,
69 }; 69 };
70 70
71 enum
72 {
73 AUTO = EVFLAG_AUTO,
74 NOENV = EVFLAG_NOENV,
75 FORKCHECK = EVFLAG_FORKCHECK,
76 SELECT = EVBACKEND_SELECT,
77 POLL = EVBACKEND_POLL,
78 EPOLL = EVBACKEND_EPOLL,
79 KQUEUE = EVBACKEND_KQUEUE,
80 DEVPOLL = EVBACKEND_DEVPOLL,
81 PORT = EVBACKEND_PORT
82 };
83
84 enum
85 {
86 NONBLOCK = EVLOOP_NONBLOCK,
87 ONESHOT = EVLOOP_ONESHOT
88 };
89
90 enum how_t
91 {
92 ONE = EVUNLOOP_ONE,
93 ALL = EVUNLOOP_ALL
94 };
95
71 template<class ev_watcher, class watcher> 96 template<class ev_watcher, class watcher>
72 struct base : ev_watcher 97 struct base : ev_watcher
73 { 98 {
74 #if EV_MULTIPLICITY 99 #if EV_MULTIPLICITY
75 EV_P; 100 EV_P;
159 184
160 bool is_pending () const 185 bool is_pending () const
161 { 186 {
162 return ev_is_pending (static_cast<const ev_watcher *>(this)); 187 return ev_is_pending (static_cast<const ev_watcher *>(this));
163 } 188 }
189
190 void feed_event (int revents)
191 {
192 ev_feed_event (EV_A_ static_cast<const ev_watcher *>(this), revents);
193 }
194 };
195
196 inline void delay (tstamp interval)
197 {
198 ev_sleep (interval);
164 }; 199 }
200
201 inline int version_major ()
202 {
203 return ev_version_major ();
204 }
205
206 inline int version_minor ()
207 {
208 return ev_version_minor ();
209 }
210
211 inline unsigned int supported_backends ()
212 {
213 return ev_supported_backends ();
214 }
215
216 inline unsigned int recommended_backends ()
217 {
218 return ev_recommended_backends ();
219 }
220
221 inline unsigned int embeddable_backends ()
222 {
223 return ev_embeddable_backends ();
224 }
225
226 inline void set_allocator (void *(*cb)(void *ptr, long size))
227 {
228 ev_set_allocator (cb);
229 }
230
231 inline void set_syserr_cb (void (*cb)(const char *msg))
232 {
233 ev_set_syserr_cb (cb);
234 }
165 235
166 236
167 inline ev_tstamp now (EV_P) 237 inline ev_tstamp now (EV_P)
168 { 238 {
169 return ev_now (EV_A); 239 return ev_now (EV_A);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines