]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/clock.h
Make the simulation independent of wall clock time
[r2c2.git] / source / libr2c2 / clock.h
diff --git a/source/libr2c2/clock.h b/source/libr2c2/clock.h
new file mode 100644 (file)
index 0000000..0fa5f59
--- /dev/null
@@ -0,0 +1,24 @@
+#ifndef LIBR2C2_CLOCK_H_
+#define LIBR2C2_CLOCK_H_
+
+#include <msp/time/timedelta.h>
+
+namespace R2C2 {
+
+class Clock
+{
+private:
+       Msp::Time::TimeDelta current_time;
+       float rate;
+
+public:
+       Clock();
+
+       void set_rate(float);
+       const Msp::Time::TimeDelta &get_current_time() const { return current_time; }
+       void tick(const Msp::Time::TimeDelta &);
+};
+
+} // namespace R2C2
+
+#endif