diff options
author | root <root> | 2010-10-22 05:57:55 +0000 |
---|---|---|
committer | root <root> | 2010-10-22 05:57:55 +0000 |
commit | b5335f1d75c19c2618d6f9cc53ab530e1ed45b28 (patch) | |
tree | 09a17c77fa0c6aa5719c3ce847db5456d34dd159 /ev++.h | |
parent | 161ca5d6241779e10976c8e0e3ab090a7d539112 (diff) |
compat3 for ev++.h, default args c++
Diffstat (limited to 'ev++.h')
-rw-r--r-- | ev++.h | 29 |
1 files changed, 24 insertions, 5 deletions
@@ -64,7 +64,10 @@ namespace ev { NONE = EV_NONE, READ = EV_READ, WRITE = EV_WRITE, +#if EV_COMPAT3 TIMEOUT = EV_TIMEOUT, +#endif + TIMER = EV_TIMER, PERIODIC = EV_PERIODIC, SIGNAL = EV_SIGNAL, CHILD = EV_CHILD, @@ -95,14 +98,18 @@ namespace ev { enum { +#if EV_COMPAT3 NONBLOCK = EVLOOP_NONBLOCK, - ONESHOT = EVLOOP_ONESHOT + ONESHOT = EVLOOP_ONESHOT, +#endif + NOWAIT = EVRUN_NOWAIT, + ONCE = EVRUN_ONCE }; enum how_t { - ONE = EVUNLOOP_ONE, - ALL = EVUNLOOP_ALL + ONE = EVBREAK_ONE, + ALL = EVBREAK_ALL }; struct bad_loop @@ -188,14 +195,26 @@ namespace ev { } #endif +#if EV_COMPAT3 void loop (int flags = 0) { - ev_loop (EV_AX_ flags); + ev_run (EV_AX_ flags); } void unloop (how_t how = ONE) throw () { - ev_unloop (EV_AX_ how); + ev_break (EV_AX_ how); + } +#endif + + void run (int flags = 0) + { + ev_run (EV_AX_ flags); + } + + void break_loop (how_t how = ONE) throw () + { + ev_break (EV_AX_ how); } void post_fork () throw () |