/** * @brief Atomic signal implementation. * * Configuration: * STA_ATOMIC_ENABLE: Enable module */ #ifndef STA_ATOMIC_SIGNAL_HPP #define STA_ATOMIC_SIGNAL_HPP #include #ifdef STA_ATOMIC_ENABLE #include #include namespace sta { /** * @brief Implementation of `Signal` interface using `std::atomic`. */ class AtomicSignal : public Signal { public: AtomicSignal(); void notify() override; bool peek() override; bool test() override; void wait() override; private: std::atomic signal_; /**< Atomic bool used as signal */ }; } // namespace sta #endif // STA_ATOMIC_ENABLE #endif // STA_ATOMIC_SIGNAL_HPP