]> git.sesse.net Git - cubemap/blob - input_stats.h
Use C++11 std::mutex and std::lock_guard instead of our RAII wrapper.
[cubemap] / input_stats.h
1 #ifndef _INPUT_STATS_H
2 #define _INPUT_STATS_H 1
3
4 #include <string>
5 #include <vector>
6
7 #include "thread.h"
8
9 class Input;
10
11 // A thread that regularly writes out input statistics, ie. a list of all inputs
12 // with some information about each. Very similar to StatsThread, but for inputs instead
13 // of clients.
14
15 class InputStatsThread : public Thread {
16 public:
17         // Does not take ownership of the inputs.
18         InputStatsThread(const std::string &stats_file, int stats_interval, const std::vector<Input*> &inputs);
19
20 private:
21         virtual void do_work();
22
23         std::string stats_file;
24         int stats_interval;
25         std::vector<Input*> inputs;
26 };
27         
28 #endif  // !defined(_INPUT_STATS_H)