TSDuck v3.44-4659
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::ReporterGuard Class Reference

Temporarily modify the Report of a ReporterBase object. More...

#include <tsReporterGuard.h>

Public Member Functions

 ReporterGuard (ReporterBase &base, Report *replacement)
 Constructor.
 
 ~ReporterGuard ()
 Destructor.
 

Detailed Description

Temporarily modify the Report of a ReporterBase object.

This "guard" class uses the RAII pattern (Resource Acquisition Is Initialization) to replace the Report of a ReporterBase object during its initialization and restores the previous Report in its destructor. Somehow, ReporterGuard acts on ReporterBase as std::lock_guard acts on std::mutex.

Constructor & Destructor Documentation

◆ ReporterGuard()

ts::ReporterGuard::ReporterGuard ( ReporterBase base,
Report replacement 
)

Constructor.

Parameters
[in]baseReporterBase object for which the report is modified.
[in]replacementTemporary Report to set on base. Use nullptr to drop reported messages.

◆ ~ReporterGuard()

ts::ReporterGuard::~ReporterGuard ( )

Destructor.

The Report that was used in base before the constructor of this object is restored.


The documentation for this class was generated from the following file: