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

Register the compress and decompress functions in the factory. More...

Public Member Functions

 Register ()
 Register this plug-in. More...
 
 ~Register ()
 Unregister this plug-in. More...
 

Detailed Description

Register the compress and decompress functions in the factory.

Compressors use a factory so the application code can write something like

compressor = ZgyCompressFactory("ZFP", "snr", "30");

without getting a link time dependency on the "ZFP" code.

Decompressors use a factory because when reading blocks from the file it is not possible to hard code a specific decompressor.

It is safe to construct an instance from a static initializer. Do note that this is not true for the destructor. If Register will be instanciated from a static initializer then the destructor should be empty or omitted altogether.

The reason for this is that the destruction is done in an unspecified order at exit. Also, cleaning up the registry on exit would be pointless anyway.

Constructor & Destructor Documentation

◆ Register()

InternalZGY::NullCompressPlugin::Register::Register ( )

Register this plug-in.

It is safe to construct an instance from a static initializer. Do note that this is not true for the destructor. If Register will be instanciated from a static initializer then the destructor should be empty or omitted altogether.

◆ ~Register()

InternalZGY::NullCompressPlugin::Register::~Register ( )

Unregister this plug-in.

Do NOTHING if Register will be used as a static initializer. We don't want any cleanup to happen on application exit. That is pointless and it is also tricky to get destructors called in the right order.

If Register is going to be instanciated only when needed then a destructor is in order. See e.g. MockCompressPlugin and MockCompressInstaller in the unit tests.


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