summaryrefslogtreecommitdiffstats
path: root/src/utils/timer.hpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-03-09 16:01:08 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-03-16 17:10:40 +0100
commit78daa605c5abd64054dad9f5fcfee638f8c515e0 (patch)
tree8b2eb222995f7197066b1a25a6038885d525198a /src/utils/timer.hpp
parentbd50c86cce2db519c6d981bc0acffc79828a3bcf (diff)
Change FrequencyClock struct to class and rename it.
Change-Id: I1076ad90e14815f3d0ab71ca9fa359d1d3c1748d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/utils/timer.hpp')
-rw-r--r--src/utils/timer.hpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/utils/timer.hpp b/src/utils/timer.hpp
index 7d0e4669..c8b7fb90 100644
--- a/src/utils/timer.hpp
+++ b/src/utils/timer.hpp
@@ -27,19 +27,24 @@
typedef long long int (*TimeFunction)();
/**
- * @struct FrequencyClock
+ * @class frequency_clock_t
* @brief A frequency counting clock.
*
- * @var FrequencyClock::frequency
+ * @var frequency_clock_t::frequency
* the clock frequency in Hz.
- * @var FrequencyClock::last_time
+ * @var frequency_clock_t::last_time
* the last time (in milliseconds since startup) that the clock
* ticked.
- * @var FrequencyClock::time_function
+ * @var frequency_clock_t::time_function
* a function returning current time
*/
-typedef struct {
- float frequency;
- unsigned long lastTick;
- TimeFunction timeFunction;
-} FrequencyClock; \ No newline at end of file
+class frequency_clock_t
+{
+private:
+ float frequency_;
+ unsigned long last_tick_;
+ TimeFunction time_function_;
+
+public:
+ frequency_clock_t();
+} \ No newline at end of file