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

Comparing libev/ev++.h (file contents):
Revision 1.35 by llucax, Tue Jan 22 17:57:17 2008 UTC vs.
Revision 1.38 by root, Mon Jan 28 11:43:37 2008 UTC

130# define EV_AX_ 130# define EV_AX_
131#endif 131#endif
132 132
133 struct loop_ref 133 struct loop_ref
134 { 134 {
135
136 loop_ref (EV_P) 135 loop_ref (EV_P) throw ()
137#if EV_MULTIPLICITY 136#if EV_MULTIPLICITY
138 throw (bad_loop) : EV_AX (EV_A) 137 : EV_AX (EV_A)
139 { 138#endif
140 if (!EV_AX)
141 throw bad_loop ();
142 } 139 {
143#else
144 throw ()
145 { 140 }
146 }
147#endif
148 141
149 bool operator == (const loop_ref &other) const throw () 142 bool operator == (const loop_ref &other) const throw ()
150 { 143 {
151#if EV_MULTIPLICITY 144#if EV_MULTIPLICITY
152 return EV_AX == other.EV_AX; 145 return EV_AX == other.EV_AX;
163 return false; 156 return false;
164#endif 157#endif
165 } 158 }
166 159
167#if EV_MULTIPLICITY 160#if EV_MULTIPLICITY
168 bool operator== (struct ev_loop *other) const throw () 161 bool operator == (struct ev_loop *other) const throw ()
169 { 162 {
170 return this->EV_AX == other; 163 return this->EV_AX == other;
171 } 164 }
172 165
173 bool operator!= (struct ev_loop *other) const throw () 166 bool operator != (struct ev_loop *other) const throw ()
174 { 167 {
175 return ! (*this == other); 168 return ! (*this == other);
176 } 169 }
177 170
178 bool operator== (const struct ev_loop *other) const throw () 171 bool operator == (const struct ev_loop *other) const throw ()
179 { 172 {
180 return this->EV_AX == other; 173 return this->EV_AX == other;
181 } 174 }
182 175
183 bool operator!= (const struct ev_loop *other) const throw () 176 bool operator != (const struct ev_loop *other) const throw ()
184 { 177 {
185 return (*this == other); 178 return (*this == other);
186 } 179 }
187 180
188 operator struct ev_loop * () const throw () 181 operator struct ev_loop * () const throw ()
344#endif 337#endif
345 338
346 }; 339 };
347 340
348#if EV_MULTIPLICITY 341#if EV_MULTIPLICITY
349 struct dynamic_loop: loop_ref 342 struct dynamic_loop : loop_ref
350 { 343 {
351 344
352 dynamic_loop (unsigned int flags = AUTO) throw (bad_loop) 345 dynamic_loop (unsigned int flags = AUTO) throw (bad_loop)
353 : loop_ref (ev_loop_new (flags)) 346 : loop_ref (ev_loop_new (flags))
354 { 347 {
348 if (!EV_AX)
349 throw bad_loop ();
355 } 350 }
356 351
357 ~dynamic_loop () throw () 352 ~dynamic_loop () throw ()
358 { 353 {
359 ev_loop_destroy (EV_AX); 354 ev_loop_destroy (EV_AX);
367 dynamic_loop & operator= (const dynamic_loop &); 362 dynamic_loop & operator= (const dynamic_loop &);
368 363
369 }; 364 };
370#endif 365#endif
371 366
372 struct default_loop: loop_ref 367 struct default_loop : loop_ref
373 { 368 {
374
375 default_loop (unsigned int flags = AUTO) throw (bad_loop) 369 default_loop (unsigned int flags = AUTO) throw (bad_loop)
376#if EV_MULTIPLICITY 370#if EV_MULTIPLICITY
377 : loop_ref (ev_default_loop (flags)) 371 : loop_ref (ev_default_loop (flags))
378#endif 372#endif
379 { 373 {
374 if (
380#if !EV_MULTIPLICITY 375#if EV_MULTIPLICITY
376 !EV_AX
377#else
381 if (!ev_default_loop (flags)) 378 !ev_default_loop (flags)
379#endif
380 )
382 throw bad_loop (); 381 throw bad_loop ();
383#endif
384 } 382 }
385 383
386 ~default_loop () throw () 384 ~default_loop () throw ()
387 { 385 {
388 ev_default_destroy (); 386 ev_default_destroy ();
695 start (); 693 start ();
696 } 694 }
697 EV_END_WATCHER (sig, signal) 695 EV_END_WATCHER (sig, signal)
698 696
699 EV_BEGIN_WATCHER (child, child) 697 EV_BEGIN_WATCHER (child, child)
700 void set (int pid) throw () 698 void set (int pid, int trace = 0) throw ()
701 { 699 {
702 int active = is_active (); 700 int active = is_active ();
703 if (active) stop (); 701 if (active) stop ();
704 ev_child_set (static_cast<ev_child *>(this), pid); 702 ev_child_set (static_cast<ev_child *>(this), pid, trace);
705 if (active) start (); 703 if (active) start ();
706 } 704 }
707 705
708 void start (int pid) throw () 706 void start (int pid, int trace = 0) throw ()
709 { 707 {
710 set (pid); 708 set (pid, trace);
711 start (); 709 start ();
712 } 710 }
713 EV_END_WATCHER (child, child) 711 EV_END_WATCHER (child, child)
714 712
715 #if EV_STAT_ENABLE 713 #if EV_STAT_ENABLE
773 #undef EV_PX 771 #undef EV_PX
774 #undef EV_PX_ 772 #undef EV_PX_
775 #undef EV_CONSTRUCT 773 #undef EV_CONSTRUCT
776 #undef EV_BEGIN_WATCHER 774 #undef EV_BEGIN_WATCHER
777 #undef EV_END_WATCHER 775 #undef EV_END_WATCHER
778
779} 776}
780 777
781#endif 778#endif
782 779

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines