blob: dbeb1586eaad49017f5fd56b77e0f3f4c762c5eb [file] [log] [blame]
Krzysztof Grobelny7f06f612020-09-24 13:42:10 +02001#pragma once
2
3#include <ostream>
4#include <string>
5#include <string_view>
6#include <tuple>
7
8namespace interfaces
9{
10
11class Sensor
12{
13 public:
14 struct Id
15 {
16 Id(std::string_view type, std::string_view service,
17 std::string_view path) :
18 type(type),
19 service(service), path(path)
20 {}
21
22 std::string type;
23 std::string service;
24 std::string path;
25
26 bool operator<(const Id& other) const
27 {
28 return std::tie(type, service, path) <
29 std::tie(other.type, other.service, other.path);
30 }
31 };
32
33 virtual ~Sensor() = default;
34
35 virtual Id id() const = 0;
36};
37
38} // namespace interfaces