X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2Fmoof%2Frunloop.hh;h=6d56d83dcb60662a7a2fd0bb0367d5c24806ad32;hp=29529521e8d16c96a35c4472fbe603e93396e8ce;hb=574af38ed616d1adfa5e6ce35f67cda1f707f89d;hpb=6c9943707d4f33035830eba0587a61a34eaecbc2 diff --git a/src/moof/runloop.hh b/src/moof/runloop.hh index 2952952..6d56d83 100644 --- a/src/moof/runloop.hh +++ b/src/moof/runloop.hh @@ -1,13 +1,11 @@ -/*] 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_ @@ -29,7 +27,6 @@ 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_table; timer_table timers_;