#pragma once #include "interfaces/mount_point_state_machine.hpp" #include #include struct BasicEvent { BasicEvent(const char* eventName) : eventName(eventName) { } const char* eventName; }; struct RegisterDbusEvent : public BasicEvent { RegisterDbusEvent( std::shared_ptr bus, std::shared_ptr objServer) : BasicEvent(__FUNCTION__), bus(std::move(bus)), objServer(std::move(objServer)) { } std::shared_ptr bus; std::shared_ptr objServer; }; struct MountEvent : public BasicEvent { explicit MountEvent( std::optional target) : BasicEvent(__FUNCTION__), target(std::move(target)) { } MountEvent(const MountEvent&) = delete; MountEvent(MountEvent&& other) noexcept : BasicEvent(__FUNCTION__), target(std::move(other.target)) { other.target = std::nullopt; } MountEvent& operator=(const MountEvent&) = delete; MountEvent& operator=(MountEvent&& other) noexcept { target = std::nullopt; std::swap(target, other.target); return *this; } std::optional target; }; struct UnmountEvent : public BasicEvent { UnmountEvent() : BasicEvent(__FUNCTION__) { } }; struct SubprocessStoppedEvent : public BasicEvent { SubprocessStoppedEvent() : BasicEvent(__FUNCTION__) { } }; struct UdevStateChangeEvent : public BasicEvent { explicit UdevStateChangeEvent(const StateChange& devState) : BasicEvent(__FUNCTION__), devState{devState} { } StateChange devState; }; using Event = std::variant;