blob: 1a57c1b1c5ae119d5d3ee1425a512d01cf8333a1 [file] [log] [blame]
Tomáš Pecka0a2e8902020-06-09 21:11:20 +02001#pragma once
2
3#include <memory>
4#include <mutex>
5#include <sdbus-c++/sdbus-c++.h>
6#include <string>
7
8class DbusSemaphoreServer {
9public:
10 DbusSemaphoreServer(sdbus::IConnection& connection, const std::string& objectPath, const std::string& propertyName, const std::string& propertyInterface, const std::string& state);
11 void runStateChanges(const std::vector<std::pair<std::string, std::chrono::milliseconds>>& sequence);
12
13private:
14 std::unique_ptr<sdbus::IObject> m_object;
15 std::string m_propertyName;
16 std::string m_propertyInterface;
17 std::string m_semaphoreState;
18 std::mutex m_semaphoreStateMtx;
19};