16#ifndef IOX_HOOFS_POSIX_WRAPPER_SIGNAL_WATCHER_HPP
17#define IOX_HOOFS_POSIX_WRAPPER_SIGNAL_WATCHER_HPP
19#include "iceoryx_hoofs/posix_wrapper/semaphore.hpp"
20#include "iceoryx_hoofs/posix_wrapper/signal_handler.hpp"
50 SignalWatcher(
const SignalWatcher&) =
delete;
51 SignalWatcher(SignalWatcher&&) =
delete;
52 ~SignalWatcher() =
default;
54 SignalWatcher& operator=(
const SignalWatcher&) =
delete;
55 SignalWatcher& operator=(SignalWatcher&&) =
delete;
67 SignalWatcher() noexcept;
70 friend
void internalSignalHandler(
int) noexcept;
71 mutable std::atomic<uint64_t> m_numberOfWaiters{0U};
74 std::atomic_bool m_hasSignalOccurred{
false};
75 SignalGuard m_sigTermGuard;
76 SignalGuard m_sigIntGuard;
80void waitForTerminationRequest() noexcept;
83bool hasTerminationRequested() noexcept;
Posix semaphore C++ Wrapping class.
Definition semaphore.hpp:82
static SignalWatcher & getInstance() noexcept
Returns the singleton instance of the SignalWatcher.
bool wasSignalTriggered() const noexcept
Returns true when SIGTERM or SIGINT has occurred, otherwise false.
void waitForSignal() const noexcept
Blocks until either SIGTERM or SIGINT has occurred.
building block to easily create free function for logging in a library context
Definition lockfree_queue.hpp:29