roo_control
API Documentation for roo_control
Loading...
Searching...
No Matches
thermometer.h
Go to the documentation of this file.
1#pragma once
2
3#include "roo_logging.h"
4#include "roo_quantity.h"
5#include "roo_quantity/temperature.h"
6
7namespace roo_control {
8
9/// An abstraction of a thermometer, i.e., a device that reports temperature.
11 public:
12 /// Captures a temperature measured at a specific time.
13 struct Reading {
14 /// Measured temperature value.
15 roo_quantity::Temperature value;
16 /// Timestamp of the reading.
17 roo_time::Uptime time;
18 };
19
20 virtual ~Thermometer() = default;
21
22 /// Returns the latest available temperature reading.
23 virtual Reading readTemperature() const = 0;
24};
25
26/// Streams a human-readable reading.
27roo_logging::Stream &operator<<(roo_logging::Stream &os,
28 const Thermometer::Reading &r);
29
30} // namespace roo_control
An abstraction of a multi-state settable switch.
Definition switch.h:24
An abstraction of a thermometer, i.e., a device that reports temperature.
Definition thermometer.h:10
virtual ~Thermometer()=default
virtual Reading readTemperature() const =0
Returns the latest available temperature reading.
roo_logging::Stream & operator<<(roo_logging::Stream &out, BinaryLogicalState state)
Streams a human-readable state name.
Captures a temperature measured at a specific time.
Definition thermometer.h:13
roo_quantity::Temperature value
Measured temperature value.
Definition thermometer.h:15
roo_time::Uptime time
Timestamp of the reading.
Definition thermometer.h:17