summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKristopher Ives <kris@leetbook2.(none)>2009-10-25 00:17:51 -0700
committerKristopher Ives <kris@leetbook2.(none)>2009-10-25 00:17:51 -0700
commite69b9b2279d28149d83675590101ff54ed79a10e (patch)
tree27daee9d154ac8466fc97595bac23afda2ae4007 /include
parentdb735c3a5a6db8b5eeb6816983c466c26228b7ee (diff)
downloadzcomp-e69b9b2279d28149d83675590101ff54ed79a10e.tar.gz
zcomp-e69b9b2279d28149d83675590101ff54ed79a10e.tar.bz2
Added early docs for CompTimer and it's methods.
Diffstat (limited to 'include')
-rw-r--r--include/core/timer.h49
1 files changed, 45 insertions, 4 deletions
diff --git a/include/core/timer.h b/include/core/timer.h
index d159999..93c47e0 100644
--- a/include/core/timer.h
+++ b/include/core/timer.h
@@ -28,28 +28,69 @@
#include <boost/function.hpp>
+/**
+ * A simple timer for use with invoking a CallBack during a timed duration.
+ */
class CompTimer {
public:
typedef boost::function<bool ()> CallBack;
-
+
+ /**
+ * Empty constructor setting everything to zero and NULL.
+ */
CompTimer ();
+
+ /**
+ * Frees the private data for this timer and any information about it's
+ * context.
+ */
~CompTimer ();
-
+
+ /**
+ * Checks if this timer is active and will have it's CallBack invoked.
+ */
bool active ();
unsigned int minTime ();
unsigned int maxTime ();
unsigned int minLeft ();
unsigned int maxLeft ();
-
+
+ /**
+ * Sets the timing durations of this timer.
+ */
void setTimes (unsigned int min, unsigned int max = 0);
+
+ /**
+ * Sets the callback function to invoke for this timer. This defaults
+ * to NULL.
+ */
void setCallback (CallBack callback);
-
+
+ /**
+ * Starts this timer without modifying any of it's parameters. The timer is
+ * stop()'d before this occurs.
+ */
void start ();
+
+ /**
+ * Starts this timer setting the paramters with setTimes(). The timer is stop()'d
+ * before this occurs.
+ */
void start (unsigned int min, unsigned int max = 0);
+
+ /**
+ * Starts this timer setting the parameters with setTimes() and setCallback(). The timer is
+ * stop()'d before this occurs.
+ */
void start (CallBack callback,
unsigned int min, unsigned int max = 0);
+
+ /**
+ * Stops this timer. After this the timer should not be active() and it's CallBack shouldn't
+ * be invoked.
+ */
void stop ();
friend class CompScreen;