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

Implementation of some methods that might be shared. More...

#include <file.h>

Inheritance diagram for InternalZGY::FileCommon:
InternalZGY::FileADT InternalZGY::LocalFileLinux

Public Member Functions

 FileCommon (const std::string &filename, OpenMode mode, const OpenZGY::IOContext *iocontext)
 
virtual std::int64_t _real_eof () const
 Get the current file size for error reporting. More...
 
virtual void _check_short_read (std::int64_t offset, std::int64_t size, std::int64_t got) const
 Throw a descriptive error if there was something wrong with the read. More...
 
- Public Member Functions inherited from InternalZGY::FileADT
virtual void xx_read (void *data, std::int64_t offset, std::int64_t size, UsageHint usagehint=UsageHint::Unknown)=0
 
virtual void xx_readv (const ReadList &requests, bool parallel_ok=false, bool immutable_ok=false, bool transient_ok=false, UsageHint usagehint=UsageHint::Unknown)=0
 
virtual void xx_write (const void *data, std::int64_t offset, std::int64_t size, UsageHint usagehint=UsageHint::Unknown)=0
 
virtual void xx_close ()=0
 
virtual std::int64_t xx_eof () const =0
 
virtual bool xx_threadsafe () const =0
 
virtual bool xx_iscloud () const =0
 

Protected Attributes

FileConfig _config
 
OpenMode _mode
 
std::string _name
 
std::int64_t _eof
 
std::shared_ptr< SummaryTimer_rtimer
 
std::shared_ptr< SummaryTimer_wtimer
 

Additional Inherited Members

- Static Public Member Functions inherited from InternalZGY::FileADT
static std::shared_ptr< FileADTfactory (const std::string &filename, OpenMode mode, const OpenZGY::IOContext *iocontext)
 
- Static Protected Member Functions inherited from InternalZGY::FileADT
static std::string _nice (std::int64_t n)
 Human readable number.
 
static void _validate_read (void *data, std::int64_t offset, std::int64_t size, std::int64_t eof, OpenMode mode)
 
static void _validate_write (const void *data, std::int64_t offset, std::int64_t size, OpenMode mode)
 
static void _validate_readv (const ReadList &requests, std::int64_t eof, OpenMode mode)
 

Detailed Description

Implementation of some methods that might be shared.

Using this class is optional. Concrete classes can inherit directly from FileADT if they want to.

Member Function Documentation

◆ _check_short_read()

void InternalZGY::FileCommon::_check_short_read ( std::int64_t  offset,
std::int64_t  size,
std::int64_t  got 
) const
virtual

Throw a descriptive error if there was something wrong with the read.

Currently works for local files only. TODO-Low fix?

◆ _real_eof()

std::int64_t InternalZGY::FileCommon::_real_eof ( ) const
virtual

Get the current file size for error reporting.

The default implementation in the base class just assumes that the xx_eof() that is (probably) maintained internally is correct.

Reimplemented in InternalZGY::LocalFileLinux.


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