#pragma once | |
#include <map> | |
class SensorCache | |
{ | |
public: | |
typedef std::map<std::pair<std::string, std::string>, | |
int> container_t; | |
bool update(const container_t::key_type& k, | |
const container_t::mapped_type& v) | |
{ | |
auto& i = container[k]; | |
if (v == i) | |
{ | |
return false; | |
} | |
else | |
{ | |
i = v; | |
return true; | |
} | |
} | |
private: | |
container_t container; | |
}; | |
// vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 |