blob: 64333d84a2aab87de8f243e3a24684e84f9dfd27 [file] [log] [blame]
Patrick Williams3667cf32015-10-20 22:39:11 -05001#ifndef __SENSORCACHE_H
2#define __SENSORCACHE_H
3
4#include <map>
5
6class SensorCache
7{
8 public:
9 typedef std::map<std::pair<std::string, std::string>,
10 int> container_t;
11
12 bool update(const container_t::key_type& k,
13 const container_t::mapped_type& v)
14 {
15 auto& i = container[k];
16 if (v == i) return false;
17 else
18 {
19 i = v;
20 return true;
21 }
22 }
23 private:
24 container_t container;
25};
26
27#endif