GDAL
Classes | Public Member Functions | List of all members
CPLErrorAccumulator Class Reference

Class typically used by a worker thread to store errors emitted by their worker functions, and replay them in the main thread. More...

#include <cpl_error_internal.h>

Classes

struct  Context
 Object returned by InstallForCurrentScope() during life-time of which, errors are redirected to the CPLErrorAccumulator instance. More...
 

Public Member Functions

 CPLErrorAccumulator ()=default
 Constructor.
 
Context InstallForCurrentScope ()
 Install a temporary error handler that will store errors and warnings.
 
const std::vector< CPLErrorHandlerAccumulatorStruct > & GetErrors () const
 Return error list.
 
void ReplayErrors ()
 Replay stored errors.
 

Detailed Description

Class typically used by a worker thread to store errors emitted by their worker functions, and replay them in the main thread.

An instance of CPLErrorAccumulator can be shared by several threads. Each thread calls InstallForCurrentScope() in its processing function. The main thread may invoke ReplayErrors() to replay errors (and warnings).

Since
3.11

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