TSDuck v3.40-3963
MPEG Transport Stream Toolkit
|
An instance of this class handles the Ctrl+C user interrupt. More...
#include <tsUserInterrupt.h>
Public Member Functions | |
UserInterrupt (InterruptHandler *handler, bool one_shot, bool auto_activate) | |
Constructor. | |
virtual | ~UserInterrupt () override |
Destructor, auto-deactivate. | |
void | activate () |
Activate this interrupt handler. | |
void | deactivate () |
Deactivate this interrupt handler. | |
bool | isActive () const |
Check if this interrupt handler is active. | |
bool | isInterrupted () const |
Check if this interrupt was triggered. | |
void | resetInterrupted () |
Reset interrupt state. | |
An instance of this class handles the Ctrl+C user interrupt.
There must be at most one active instance at a time.
Can be used in two ways:
ts::UserInterrupt::UserInterrupt | ( | InterruptHandler * | handler, |
bool | one_shot, | ||
bool | auto_activate | ||
) |
Constructor.
[in] | handler | Address of interrupt handler. Can be null. |
[in] | one_shot | If true, the interrupt will be handled only once, the second time the process will be terminated. |
[in] | auto_activate | If true, the interrupt handling is immediately activated. |
|
inline |
Check if this interrupt handler is active.
|
inline |
Check if this interrupt was triggered.
|
inline |
Reset interrupt state.
Now, isInterrupted() will return false, until the next time the interrupt is triggered.
void ts::UserInterrupt::activate | ( | ) |
Activate this interrupt handler.
Only one handler can be active at a time. This method does nothing if this handler or another handler is already active.