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

Comparing libev/ev++.h (file contents):
Revision 1.32 by root, Sat Jan 19 00:49:06 2008 UTC vs.
Revision 1.37 by root, Fri Jan 25 15:45:08 2008 UTC

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
161 return false; 157 return false;
162#endif 158#endif
163 } 159 }
164 160
165#if EV_MULTIPLICITY 161#if EV_MULTIPLICITY
166 bool operator== (struct ev_loop *other) const throw () 162 bool operator == (struct ev_loop *other) const throw ()
167 { 163 {
168 return this->EV_AX == other; 164 return this->EV_AX == other;
169 } 165 }
170 166
171 bool operator!= (struct ev_loop *other) const throw () 167 bool operator != (struct ev_loop *other) const throw ()
172 { 168 {
173 return ! (*this == other); 169 return ! (*this == other);
174 } 170 }
175 171
176 bool operator== (const struct ev_loop *other) const throw () 172 bool operator == (const struct ev_loop *other) const throw ()
177 { 173 {
178 return this->EV_AX == other; 174 return this->EV_AX == other;
179 } 175 }
180 176
181 bool operator!= (const struct ev_loop *other) const throw () 177 bool operator != (const struct ev_loop *other) const throw ()
182 { 178 {
183 return (*this == other); 179 return (*this == other);
184 } 180 }
185 181
186 operator struct ev_loop * () const throw () 182 operator struct ev_loop * () const throw ()
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 ();
693 start (); 695 start ();
694 } 696 }
695 EV_END_WATCHER (sig, signal) 697 EV_END_WATCHER (sig, signal)
696 698
697 EV_BEGIN_WATCHER (child, child) 699 EV_BEGIN_WATCHER (child, child)
698 void set (int pid) throw () 700 void set (int pid, int trace = 0) throw ()
699 { 701 {
700 int active = is_active (); 702 int active = is_active ();
701 if (active) stop (); 703 if (active) stop ();
702 ev_child_set (static_cast<ev_child *>(this), pid); 704 ev_child_set (static_cast<ev_child *>(this), pid, trace);
703 if (active) start (); 705 if (active) start ();
704 } 706 }
705 707
706 void start (int pid) throw () 708 void start (int pid, int trace = 0) throw ()
707 { 709 {
708 set (pid); 710 set (pid, trace);
709 start (); 711 start ();
710 } 712 }
711 EV_END_WATCHER (child, child) 713 EV_END_WATCHER (child, child)
712 714
713 #if EV_STAT_ENABLE 715 #if EV_STAT_ENABLE
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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines