TSDuck v3.46-4930
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::UserInterrupt Class Reference

#include <tsUserInterrupt.h>

Inheritance diagram for ts::UserInterrupt:
Collaboration diagram for ts::UserInterrupt:

Public Member Functions

 UserInterrupt (InterruptHandler *handler, bool one_shot, bool auto_activate)
virtual ~UserInterrupt () override
void activate ()
void deactivate ()
bool isActive () const
bool isInterrupted () const
void resetInterrupted ()

Detailed Description

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:

Constructor & Destructor Documentation

◆ UserInterrupt()

ts::UserInterrupt::UserInterrupt ( InterruptHandler * handler,
bool one_shot,
bool auto_activate )

Constructor.

Parameters
[in]handlerAddress of interrupt handler. Can be null.
[in]one_shotIf true, the interrupt will be handled only once, the second time the process will be terminated.
[in]auto_activateIf true, the interrupt handling is immediately activated.

◆ ~UserInterrupt()

virtual ts::UserInterrupt::~UserInterrupt ( )
overridevirtual

Destructor, auto-deactivate.

Member Function Documentation

◆ 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: