OpenZGY/C++ API and Internals (ALPHA)
Access seismic data stored in ZGY format.
Public Member Functions | List of all members
InternalZGY::ZgyInternalBulk::ErrorsWillCorruptFile Class Reference

Public Member Functions

 ErrorsWillCorruptFile (ZgyInternalBulk *owner)
 
void disarm ()
 

Detailed Description

Duplicated between impl/bulk.cpp and impl/meta.cpp but sets different flags.

Start a critical section where any exception means that the owner class should be permanently flagged with _is_bad = True. Typically this is used to prevent secondary errors after a write failure that has most likely corrupted the entire file. The exception itself will not be caught.

The _is_bad flag normally means that any further attempts to access this class, at least for writing, will raise a ZgyCorruptedFile exception. Regardless of what the exception was that caused the flag to be set.

C++ note: Unlike Python it isn't trivial (or portable) to check whether a destructor is being called due to leaving scope normally or due to unwinding an exception. So in the C++ version the code should explicitly call disarm() at the end of the critical section.


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