]>
Dogcows Code - chaz/yoink/blob - src/moof/runloop.hh
2 /*] Copyright (c) 2009-2011, Charles McGarvey [*****************************
3 **] All rights reserved.
5 * Distributable under the terms and conditions of the 2-clause BSD license;
6 * see the file COPYING for a complete text of the license.
8 *****************************************************************************/
10 #ifndef _MOOF_RUNLOOP_HH_
11 #define _MOOF_RUNLOOP_HH_
15 #include <boost/noncopyable.hpp>
17 #include <moof/thread.hh>
22 * Thread timer management class.
28 // forward declarations
32 * A runloop is a loop with scheduled timers.
34 class runloop
: public boost::noncopyable
39 * Construct a runloop.
50 * Do one iteration of the runloop.
51 * \return The number of tasks which were given time.
56 * Start running the runloop.
57 * \return The exit code.
63 * \param code The exit code.
65 void stop(int code
= 0);
67 bool is_running() const
72 void add_timer(timer
& timer
);
73 void remove_timer(timer
& timer
);
80 typedef std::vector
<timer
*> timer_table
;
82 timer_table::iterator timers_it_
;
85 MOOF_DECLARE_MUTEX(timers_mutex_
);
93 #endif // _MOOF_RUNLOOP_HH_
This page took 0.044226 seconds and 5 git commands to generate.