Tomáš Pecka | 0a2e890 | 2020-06-09 21:11:20 +0200 | [diff] [blame^] | 1 | #pragma once |
| 2 | |
| 3 | #include <memory> |
| 4 | #include <mutex> |
| 5 | #include <sdbus-c++/sdbus-c++.h> |
| 6 | #include <string> |
| 7 | |
| 8 | class DbusSemaphoreServer { |
| 9 | public: |
| 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 | |
| 13 | private: |
| 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 | }; |