#pragma once #include #include #include #include #include #include #include namespace interfaces { class SensorListener; class Sensor { public: struct Id { Id(std::string_view type, std::string_view service, std::string_view path) : type(type), service(service), path(path) {} std::string type; std::string service; std::string path; bool operator<(const Id& other) const { return std::tie(type, service, path) < std::tie(other.type, other.service, other.path); } inline std::string str() const { return type + ":" + service + ":" + path; } }; virtual ~Sensor() = default; virtual Id id() const = 0; virtual void registerForUpdates(const std::weak_ptr&) = 0; virtual void unregisterFromUpdates(const std::weak_ptr&) = 0; }; } // namespace interfaces using Sensors = std::vector>;