Fixposition SDK 0.0.0-heads/main-0-g155c724
Collection of c++ libraries and apps for use with Fixposition products on Linux
Loading...
Searching...
No Matches
fpsdk::common::app::SigTermHelper Class Reference

Helper to catch SIGTERM. More...

#include <app.hpp>

Public Member Functions

 SigTermHelper (const bool warn=true)
 Constructor.
 ~SigTermHelper ()
 Destructor.
bool ShouldAbort ()
 Check if signal was raised and we should abort.
bool WaitAbort (const uint32_t millis=0)
 Wait (block) until signal is raised and we should abort.

Detailed Description

Helper to catch SIGTERM.

On construction this installs a handler for SIGTERM. On destruction it sets the handler back to its previous state. Note that signal handlers are global and therefore you can only use one SigTermHelper in a app.

Definition at line 101 of file app.hpp.

Constructor & Destructor Documentation

◆ SigTermHelper()

fpsdk::common::app::SigTermHelper::SigTermHelper ( const bool warn = true)

Constructor.

Parameters
[in]warnPrint a WARNING() (true, default) or a DEBUG() (false) on signal

Member Function Documentation

◆ ShouldAbort()

bool fpsdk::common::app::SigTermHelper::ShouldAbort ( )

Check if signal was raised and we should abort.

Returns
true if signal was raised and we should abort, false otherwise

◆ WaitAbort()

bool fpsdk::common::app::SigTermHelper::WaitAbort ( const uint32_t millis = 0)

Wait (block) until signal is raised and we should abort.

Parameters
[in]millisWait at most this long [ms], 0 = forever
Returns
true if the signal was raised, false if timeout expired

The documentation for this class was generated from the following file:
  • fpsdk_common/include/fpsdk_common/app.hpp