#include <tsUserInterrupt.h>
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:
◆ UserInterrupt()
| ts::UserInterrupt::UserInterrupt |
( |
InterruptHandler * | handler, |
|
|
bool | one_shot, |
|
|
bool | auto_activate ) |
Constructor.
- Parameters
-
| [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. |
◆ ~UserInterrupt()
| virtual ts::UserInterrupt::~UserInterrupt |
( |
| ) |
|
|
overridevirtual |
Destructor, auto-deactivate.
◆ isActive()
| bool ts::UserInterrupt::isActive |
( |
| ) |
const |
|
inline |
Check if this interrupt handler is active.
- Returns
- True if this interrupt handler is active.
◆ isInterrupted()
| bool ts::UserInterrupt::isInterrupted |
( |
| ) |
const |
|
inline |
Check if this interrupt was triggered.
- Returns
- True if this interrupt handler was triggered.
◆ resetInterrupted()
| void ts::UserInterrupt::resetInterrupted |
( |
| ) |
|
|
inline |
Reset interrupt state. Now, isInterrupted() will return false, until the next time the interrupt is triggered.
◆ activate()
| 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.
◆ deactivate()
| void ts::UserInterrupt::deactivate |
( |
| ) |
|
Deactivate this interrupt handler.
The documentation for this class was generated from the following file: