Commit 951f948c authored by Michael Ott's avatar Michael Ott
Browse files

Add Javadoc description for SensorCache class

parent 54df6c08
......@@ -26,9 +26,37 @@ class SensorCache {
public:
SensorCache();
virtual ~SensorCache();
/**
* @brief Store a sensor reading in the SensorCache.
* @param sid The SensorId of the sensor to be cached.
* @param ts The timestamp of the sensor reading.
* @param val The actual sensor reading.
* @return Returns true if the topic string was valid and the data field of the object was populated.
*/
void storeSensor(SensorId sid, uint64_t ts, uint64_t val);
/**
* @brief Return a sensor reading from the SensorCache.
* @param sid The SensorId of the sensor to be looked up in the cache.
* @return The sensor reading of the corresponding cache entry.
* @throws std::invalid_argument if the SensorId doesn't exist in the SensorCache.
* @throws std::out_of_range if the sid was found in the cache entry but is outdated.
*/
uint64_t getSensor(SensorId sid);
uint64_t getSensor(std::string sid);
/**
* @brief Return a sensor reading from the SensorCache.
* @param topic The topic of the sensor to be looked up in the cache. May contain wildcards.
* @return The sensor reading of the corresponding cache entry.
* @throws std::invalid_argument if the topic couldn't be found in the SensorCache.
* @throws std::out_of_range if the topic was found in the cache entry but is outdated.
*/
uint64_t getSensor(std::string topic);
/**
* @brief Dump the contents of the SensorCache to stdout.
*/
void dump();
private:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment