Plaquette
 
Loading...
Searching...
No Matches
Chronometer.h
1/*
2 * Chronometer.h
3 *
4 * (c) 2018 Sofian Audry :: info(@)sofianaudry(.)com
5 * (c) 2018 Thomas O Fredericks :: tof(@)t-o-f(.)info
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef PQ_CHRONOMETER_H_
22#define PQ_CHRONOMETER_H_
23
24#include "AbstractChronometer.h"
25
26namespace pq {
27
28class Chronometer : public Unit, public AbstractChronometer {
29public:
32
34 virtual float get() { return elapsed(); }
35
37 virtual float put(float value);
38
39protected:
40 virtual void begin();
41 virtual void step();
42
43 // Returns current absolute time (in seconds).
44 virtual float _time() const;
45};
46
47}
48
49#endif
Definition AbstractChronometer.h:29
virtual float elapsed() const
The time currently elapsed by the chronometer (in seconds).
Definition AbstractChronometer.h:42
Definition Chronometer.h:28
virtual float put(float value)
Sets current time in seconds and returns it.
Definition Chronometer.cpp:28
virtual float get()
Returns elapsed time since start (in seconds).
Definition Chronometer.h:34
The main Plaquette static class containing all the units.
Definition PqCore.h:60
static Engine & primary()
Returns the main instance of Plaquette.
Definition PqCore.cpp:31
A generic class representing a unit in the system.
Definition PqCore.h:335
Engine * engine() const
Returns the engine that owns this unit.
Definition PqCore.h:382