gramods
Loading...
Searching...
No Matches
ButtonsTracker.hh
1
2#ifndef GRAMODS_TRACK_BUTTONSTRACKER
3#define GRAMODS_TRACK_BUTTONSTRACKER
4
5#include <gmTrack/config.hh>
6
7#include <gmCore/Object.hh>
8
9#include <chrono>
10#include <map>
11
12BEGIN_NAMESPACE_GMTRACK;
13
18 : public gmCore::Object {
19
20public:
21
22 typedef std::chrono::steady_clock clock;
23
28
32 std::map<size_t, bool> buttons;
33
37 clock::time_point time;
38 };
39
44 virtual std::string getDefaultKey() override { return "buttonsTracker"; }
45
51 virtual bool getButtons(ButtonsSample &b) = 0;
52};
53
54END_NAMESPACE_GMTRACK;
55
56#endif
Base type for objects in the Gramods package for standardized handling of construction,...
Definition Object.hh:42
The base of ButtonsTrackers, reporting button states.
Definition ButtonsTracker.hh:18
virtual bool getButtons(ButtonsSample &b)=0
Replaces the contents of p with button data.
virtual std::string getDefaultKey() override
Returns the default key, in Configuration, for the Object.
Definition ButtonsTracker.hh:44
A sample containing the state of any number of buttons.
Definition ButtonsTracker.hh:27
std::map< size_t, bool > buttons
The state of the buttons communicated.
Definition ButtonsTracker.hh:32
clock::time_point time
The time of the sample.
Definition ButtonsTracker.hh:37