… | |
… | |
131 | #endif |
131 | #endif |
132 | |
132 | |
133 | struct loop_ref |
133 | struct loop_ref |
134 | { |
134 | { |
135 | |
135 | |
136 | loop_ref (EV_P) throw (bad_loop) |
136 | loop_ref (EV_P) throw () |
137 | #if EV_MULTIPLICITY |
137 | #if EV_MULTIPLICITY |
138 | : EV_AX (EV_A) |
138 | : EV_AX (EV_A) |
139 | #endif |
139 | #endif |
140 | { |
140 | { |
141 | #if EV_MULTIPLICITY |
|
|
142 | if (!EV_AX) |
|
|
143 | throw bad_loop (); |
|
|
144 | #endif |
|
|
145 | } |
141 | } |
146 | |
142 | |
147 | bool operator == (const loop_ref &other) const throw () |
143 | bool operator == (const loop_ref &other) const throw () |
148 | { |
144 | { |
149 | #if EV_MULTIPLICITY |
145 | #if EV_MULTIPLICITY |
… | |
… | |
342 | #endif |
338 | #endif |
343 | |
339 | |
344 | }; |
340 | }; |
345 | |
341 | |
346 | #if EV_MULTIPLICITY |
342 | #if EV_MULTIPLICITY |
347 | struct dynamic_loop: loop_ref |
343 | struct dynamic_loop : loop_ref |
348 | { |
344 | { |
349 | |
345 | |
350 | dynamic_loop (unsigned int flags = AUTO) EV_THROW (bad_loop) |
346 | dynamic_loop (unsigned int flags = AUTO) throw (bad_loop) |
351 | : loop_ref (ev_loop_new (flags)) |
347 | : loop_ref (ev_loop_new (flags)) |
352 | { |
348 | { |
|
|
349 | if (!EV_AX) |
|
|
350 | throw bad_loop (); |
353 | } |
351 | } |
354 | |
352 | |
355 | ~dynamic_loop () throw () |
353 | ~dynamic_loop () throw () |
356 | { |
354 | { |
357 | ev_loop_destroy (EV_AX); |
355 | ev_loop_destroy (EV_AX); |
… | |
… | |
365 | dynamic_loop & operator= (const dynamic_loop &); |
363 | dynamic_loop & operator= (const dynamic_loop &); |
366 | |
364 | |
367 | }; |
365 | }; |
368 | #endif |
366 | #endif |
369 | |
367 | |
370 | struct default_loop: loop_ref |
368 | struct default_loop : loop_ref |
371 | { |
369 | { |
372 | |
370 | |
373 | default_loop (unsigned int flags = AUTO) throw (bad_loop) |
371 | default_loop (unsigned int flags = AUTO) throw (bad_loop) |
374 | #if EV_MULTIPLICITY |
372 | #if EV_MULTIPLICITY |
375 | : loop_ref (ev_default_loop (flags)) |
373 | : loop_ref (ev_default_loop (flags)) |
376 | #endif |
374 | #endif |
377 | { |
375 | { |
|
|
376 | if ( |
378 | #ifndef EV_MULTIPLICITY |
377 | #if EV_MULTIPLICITY |
|
|
378 | !EV_AX |
|
|
379 | #else |
379 | if (!ev_default_loop (flags)) |
380 | !ev_default_loop (flags) |
|
|
381 | #endif |
|
|
382 | ) |
380 | throw bad_loop (); |
383 | throw bad_loop (); |
381 | #endif |
|
|
382 | } |
384 | } |
383 | |
385 | |
384 | ~default_loop () throw () |
386 | ~default_loop () throw () |
385 | { |
387 | { |
386 | ev_default_destroy (); |
388 | ev_default_destroy (); |
… | |
… | |
774 | #undef EV_BEGIN_WATCHER |
776 | #undef EV_BEGIN_WATCHER |
775 | #undef EV_END_WATCHER |
777 | #undef EV_END_WATCHER |
776 | |
778 | |
777 | } |
779 | } |
778 | |
780 | |
779 | #undef EV_THROW |
|
|
780 | |
|
|
781 | #endif |
781 | #endif |
782 | |
782 | |