Fixposition SDK 0.0.0-heads/main-0-g90a51ff
Collection of c++ libraries and apps for use with Fixposition products
|
Helper to catch SIGINT (CTRL-c) More...
#include <app.hpp>
Public Member Functions | |
SigIntHelper (const bool warn=true) | |
Constructor. | |
~SigIntHelper () | |
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. | |
Helper to catch SIGINT (CTRL-c)
On construction this installs a handler for SIGINT. On destruction it sets the handler back to its previous state. Note that signal handlers are global and therefore you can only use one SigIntHelper in a app.
Example:
fpsdk::common::app::SigIntHelper::SigIntHelper | ( | const bool | warn = true | ) |
bool fpsdk::common::app::SigIntHelper::ShouldAbort | ( | ) |
Check if signal was raised and we should abort.
bool fpsdk::common::app::SigIntHelper::WaitAbort | ( | const uint32_t | millis = 0 | ) |
Wait (block) until signal is raised and we should abort.
[in] | millis | Wait at most this long [ms], 0 = forever |