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

Comparing libev/ev++.h (file contents):
Revision 1.49 by root, Tue Mar 16 00:43:22 2010 UTC vs.
Revision 1.54 by root, Fri Oct 22 05:57:55 2010 UTC

62 { 62 {
63 UNDEF = EV_UNDEF, 63 UNDEF = EV_UNDEF,
64 NONE = EV_NONE, 64 NONE = EV_NONE,
65 READ = EV_READ, 65 READ = EV_READ,
66 WRITE = EV_WRITE, 66 WRITE = EV_WRITE,
67#if EV_COMPAT3
67 TIMEOUT = EV_TIMEOUT, 68 TIMEOUT = EV_TIMEOUT,
69#endif
70 TIMER = EV_TIMER,
68 PERIODIC = EV_PERIODIC, 71 PERIODIC = EV_PERIODIC,
69 SIGNAL = EV_SIGNAL, 72 SIGNAL = EV_SIGNAL,
70 CHILD = EV_CHILD, 73 CHILD = EV_CHILD,
71 STAT = EV_STAT, 74 STAT = EV_STAT,
72 IDLE = EV_IDLE, 75 IDLE = EV_IDLE,
74 PREPARE = EV_PREPARE, 77 PREPARE = EV_PREPARE,
75 FORK = EV_FORK, 78 FORK = EV_FORK,
76 ASYNC = EV_ASYNC, 79 ASYNC = EV_ASYNC,
77 EMBED = EV_EMBED, 80 EMBED = EV_EMBED,
78# undef ERROR // some systems stupidly #define ERROR 81# undef ERROR // some systems stupidly #define ERROR
79 ERROR = EV_ERROR, 82 ERROR = EV_ERROR
80 }; 83 };
81 84
82 enum 85 enum
83 { 86 {
84 AUTO = EVFLAG_AUTO, 87 AUTO = EVFLAG_AUTO,
93 PORT = EVBACKEND_PORT 96 PORT = EVBACKEND_PORT
94 }; 97 };
95 98
96 enum 99 enum
97 { 100 {
101#if EV_COMPAT3
98 NONBLOCK = EVLOOP_NONBLOCK, 102 NONBLOCK = EVLOOP_NONBLOCK,
99 ONESHOT = EVLOOP_ONESHOT 103 ONESHOT = EVLOOP_ONESHOT,
104#endif
105 NOWAIT = EVRUN_NOWAIT,
106 ONCE = EVRUN_ONCE
100 }; 107 };
101 108
102 enum how_t 109 enum how_t
103 { 110 {
104 ONE = EVUNLOOP_ONE, 111 ONE = EVBREAK_ONE,
105 ALL = EVUNLOOP_ALL 112 ALL = EVBREAK_ALL
106 }; 113 };
107 114
108 struct bad_loop 115 struct bad_loop
109#if EV_USE_STDEXCEPT 116#if EV_USE_STDEXCEPT
110 : std::runtime_error 117 : std::runtime_error
186 { 193 {
187 return EV_AX == ev_default_loop (0); 194 return EV_AX == ev_default_loop (0);
188 } 195 }
189#endif 196#endif
190 197
198#if EV_COMPAT3
191 void loop (int flags = 0) 199 void loop (int flags = 0)
192 { 200 {
193 ev_loop (EV_AX_ flags); 201 ev_run (EV_AX_ flags);
194 } 202 }
195 203
196 void unloop (how_t how = ONE) throw () 204 void unloop (how_t how = ONE) throw ()
197 { 205 {
198 ev_unloop (EV_AX_ how); 206 ev_break (EV_AX_ how);
207 }
208#endif
209
210 void run (int flags = 0)
211 {
212 ev_run (EV_AX_ flags);
213 }
214
215 void break_loop (how_t how = ONE) throw ()
216 {
217 ev_break (EV_AX_ how);
199 } 218 }
200 219
201 void post_fork () throw () 220 void post_fork () throw ()
202 { 221 {
203#if EV_MULTIPLICITY 222#if EV_MULTIPLICITY
226 { 245 {
227 ev_unref (EV_AX); 246 ev_unref (EV_AX);
228 } 247 }
229 248
230#if EV_FEATURE_API 249#if EV_FEATURE_API
231 unsigned int count () const throw () 250 unsigned int iteration () const throw ()
232 { 251 {
233 return ev_loop_count (EV_AX); 252 return ev_iteration (EV_AX);
234 } 253 }
235 254
236 unsigned int depth () const throw () 255 unsigned int depth () const throw ()
237 { 256 {
238 return ev_loop_depth (EV_AX); 257 return ev_depth (EV_AX);
239 } 258 }
240 259
241 void set_io_collect_interval (tstamp interval) throw () 260 void set_io_collect_interval (tstamp interval) throw ()
242 { 261 {
243 ev_set_io_collect_interval (EV_AX_ interval); 262 ev_set_io_collect_interval (EV_AX_ interval);
413 struct base : ev_watcher 432 struct base : ev_watcher
414 { 433 {
415 #if EV_MULTIPLICITY 434 #if EV_MULTIPLICITY
416 EV_PX; 435 EV_PX;
417 436
437 // loop set
418 void set (EV_P) throw () 438 void set (EV_P) throw ()
419 { 439 {
420 this->EV_A = EV_A; 440 this->EV_A = EV_A;
421 } 441 }
422 #endif 442 #endif
478 } 498 }
479 499
480 template<class K, void (K::*method)()> 500 template<class K, void (K::*method)()>
481 static void method_noargs_thunk (EV_P_ ev_watcher *w, int revents) 501 static void method_noargs_thunk (EV_P_ ev_watcher *w, int revents)
482 { 502 {
483 static_cast<K *>(w->data)->*method 503 (static_cast<K *>(w->data)->*method)
484 (); 504 ();
485 } 505 }
486 506
487 void operator ()(int events = EV_UNDEF) 507 void operator ()(int events = EV_UNDEF)
488 { 508 {
781 EV_END_WATCHER (fork, fork) 801 EV_END_WATCHER (fork, fork)
782 #endif 802 #endif
783 803
784 #if EV_ASYNC_ENABLE 804 #if EV_ASYNC_ENABLE
785 EV_BEGIN_WATCHER (async, async) 805 EV_BEGIN_WATCHER (async, async)
786 void set () throw () { }
787
788 void send () throw () 806 void send () throw ()
789 { 807 {
790 ev_async_send (EV_A_ static_cast<ev_async *>(this)); 808 ev_async_send (EV_A_ static_cast<ev_async *>(this));
791 } 809 }
792 810

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines