]> Dogcows Code - chaz/yoink/blobdiff - src/moof/runloop.hh
fixed documentation about where to find licenses
[chaz/yoink] / src / moof / runloop.hh
index 29529521e8d16c96a35c4472fbe603e93396e8ce..43d4ea2e580fc2e2f5982797401a3a1e6caae20a 100644 (file)
@@ -1,22 +1,15 @@
 
-/*]  Copyright (c) 2009-2010, Charles McGarvey  [**************************
+/*]  Copyright (c) 2009-2011, Charles McGarvey  [*****************************
 **]  All rights reserved.
 *
-* vi:ts=4 sw=4 tw=75
-*
 * Distributable under the terms and conditions of the 2-clause BSD license;
 * see the file COPYING for a complete text of the license.
 *
-**************************************************************************/
+*****************************************************************************/
 
 #ifndef _MOOF_RUNLOOP_HH_
 #define _MOOF_RUNLOOP_HH_
 
-/**
- * \file runloop.hh
- * Thread timer management class.
- */
-
 #include <vector>
 
 #include <boost/noncopyable.hpp>
 #include <moof/thread.hh>
 
 
+/**
+ * \file runloop.hh
+ * Thread timer management class.
+ */
+
 namespace moof {
 
 
 // forward declarations
 class timer;
-       
 
 /**
  * A runloop is a loop with scheduled timers.
@@ -51,9 +48,9 @@ public:
 
        /**
         * Do one iteration of the runloop.
+        * \return The number of tasks which were given time.
         */
-       void run_once();
-
+       int run_once();
 
        /**
         * Start running the runloop.
@@ -67,15 +64,18 @@ public:
         */
        void stop(int code = 0);
 
+       bool is_running() const
+       {
+               return !stop_;
+       }
 
        void add_timer(timer& timer);
        void remove_timer(timer& timer);
 
-
 private:
 
        bool            stop_;
-       int                     code_;
+       int             code_;
 
        typedef std::vector<timer*> timer_table;
        timer_table     timers_;
This page took 0.022586 seconds and 4 git commands to generate.