OpendTect  6.6
Public Member Functions | Private Member Functions | List of all members
HDF5::Writer Class Referenceabstract

writes to HDF5 file More...

Inheritance diagram for HDF5::Writer:
[legend]

Public Member Functions

virtual ReadercreateCoupledReader () const =0
 
uiRetVal createDataSet (const DataSetKey &, const ArrayNDInfo &, ODDataType)
 
uiRetVal createDataSet (const DataSetKey &, int, ODDataType)
 
uiRetVal createDataSetIfMissing (const DataSetKey &, ODDataType, const ArrayNDInfo &addedsz, const ArrayNDInfo &changedir, PtrMan< ArrayNDInfo > *existsinfo=nullptr)
 
uiRetVal createDataSetIfMissing (const DataSetKey &, ODDataType, int addedsz, int changedir=1, int *existsnrsamples=nullptr)
 
uiRetVal createTextDataSet (const DataSetKey &)
 
bool deleteObject (const DataSetKey &)
 
virtual H5::Group * ensureGroup (const char *grpnm, uiRetVal &)=0
 Creates a new group if necessary. More...
 
virtual bool isReader () const
 
uiRetVal open4Edit (const char *)
 For normal 'create', use 'open() More...
 
uiRetVal put (const DataSetKey &, const BufferStringSet &)
 
template<class T >
uiRetVal put (const DataSetKey &, const T *, int sz)
 
template<class T >
uiRetVal put (const DataSetKey &, const TypeSet< T > &)
 
uiRetVal putAll (const DataSetKey &, const void *)
 
uiRetVal putSlab (const DataSetKey &, const SlabSpec &, const void *)
 
uiRetVal removeAllAttributes (const DataSetKey *=nullptr)
 
uiRetVal removeAttribute (const char *, const DataSetKey *=nullptr)
 
uiRetVal resizeDataSet (const DataSetKey &, const ArrayNDInfo &)
 You cannot change the 'rank', just the dim sizes. More...
 
uiRetVal set (const IOPar &, const DataSetKey *=nullptr)
 
virtual void setAttribute (const char *, double, const DataSetKey *=nullptr)=0
 
virtual void setAttribute (const char *, float, const DataSetKey *=nullptr)=0
 
virtual void setAttribute (const char *, od_int16, const DataSetKey *=nullptr)=0
 
virtual void setAttribute (const char *, od_int32, const DataSetKey *=nullptr)=0
 
virtual void setAttribute (const char *, od_int64, const DataSetKey *=nullptr)=0
 
virtual void setAttribute (const char *, od_uint16, const DataSetKey *=nullptr)=0
 
virtual void setAttribute (const char *, od_uint32, const DataSetKey *=nullptr)=0
 
virtual void setAttribute (const char *, od_uint64, const DataSetKey *=nullptr)=0
 
virtual void setAttribute (const char *ky, const char *val, const DataSetKey *=nullptr)=0
 
virtual void setChunkSize (int)=0
 
virtual void setCompressionLevel (unsigned)
 
virtual void setEditableCreation (bool yn)=0
 default is false: no dataset grow/shrink More...
 
- Public Member Functions inherited from HDF5::Access
virtual ~Access ()
 
virtual od_int64 curGroupID () const =0
 
virtual const char * fileName () const =0
 
H5::H5File * getHDF5File ()
 
bool hasDataSet (const DataSetKey &) const
 
bool hasGroup (const char *grpnm) const
 
bool isOpen () const
 
uiRetVal open (const char *)
 
uiString sCantSetScope (const DataSetKey &) const
 
virtual DataSetKey scope () const =0
 

Private Member Functions

virtual H5::DataSet * crDS (const DataSetKey &, const ArrayNDInfo &, ODDataType, uiRetVal &)=0
 
virtual H5::DataSet * crTxtDS (const DataSetKey &, uiRetVal &)=0
 
virtual void ptAll (const void *, H5::DataSet &, uiRetVal &)=0
 
virtual void ptInfo (const IOPar &, H5::H5Object &, uiRetVal &)=0
 
virtual void ptSlab (const SlabSpec &, const void *, H5::DataSet &, uiRetVal &)=0
 
virtual void ptStrings (const BufferStringSet &, H5::Group &, H5::DataSet *, const char *dsnm, uiRetVal &)=0
 
virtual void reSzDS (const ArrayNDInfo &, H5::DataSet &, uiRetVal &)=0
 
virtual void rmAllAttribs (H5::H5Object &)=0
 
virtual void rmAttrib (const char *, H5::H5Object &)=0
 
virtual bool rmObj (const DataSetKey &)=0
 

Additional Inherited Members

- Static Public Member Functions inherited from HDF5::Access
static bool isEnabled (const char *fortype=0)
 
static bool isEnvBlocked (const char *fortype=0)
 
static bool isHDF5File (const char *)
 
static uiString sCannotReadDataSet (const DataSetKey &)
 
static uiString sDataSetNotFound (const DataSetKey &)
 
static const char * sFileExtension ()
 
static uiString sHDF5FileNoLongerAccessibe ()
 
static uiString sHDF5NotAvailable ()
 
static uiString sHDF5NotAvailable (const char *fnm)
 
static uiString sHDF5PackageDispName ()
 
static uiString sNotHDF5File (const char *)
 
static const char * sSettingsEnabKey ()
 
- Public Attributes inherited from HDF5::Access
 mTypeDefArrNDTypes
 
- Protected Member Functions inherited from HDF5::Access
 Access ()
 
virtual void closeFile ()=0
 
virtual H5::DataSet * getDSScope (const DataSetKey &) const =0
 Returns (new) scope. null for root scope. More...
 
virtual H5::Group * getGrpScope (const DataSetKey *) const =0
 
virtual H5::H5Object * getScope (const DataSetKey *) const =0
 
virtual void openFile (const char *, uiRetVal &, bool ed)=0
 
virtual H5::DataSet * setDSScope (const DataSetKey &)=0
 
virtual H5::Group * setGrpScope (const DataSetKey *)=0
 
virtual H5::H5Object * setScope (const DataSetKey *)=0
 
- Static Protected Member Functions inherited from HDF5::Access
static uiString sFileNotOpen ()
 
static uiString sHDF5Err (const uiString &)
 
static const char * sNeedScope ()
 
static const char * sNoDataPassed ()
 
static const char * sOpenFileFirst ()
 
- Protected Attributes inherited from HDF5::Access
H5::H5File * file_
 
bool myfile_
 

Detailed Description

writes to HDF5 file

Notes: The Writer has a notion of a 'current' DataSet. Using 'setScope' implies that you have created the Data Set first. You can write info for an entire group by simpy leaving the dataset name empty in the DataSetKey. To be able to put info for a DataSet, you have to create it first. Info for a group can be written if the group exists. When opened in 'edit' mode, you can get info about the file from a coupled Reader. Do not try to use such a Reader when the Writer is closed/destroyed. Every group or DataSet can have an IOPar attached with info. Although HDF5 supports all types of 'attributes', this is the form we support. If there are already attributes for the data set they will be completely replaced. If you want your data sets to be resizable (for example when data grows, but also when opened in edit mode), then you have to use setEditableCreation(true) before creating the DataSet. Such datasets are always chunked. You can extend (or shrink) the DataSet using resizeDataSet(). There is no auto-resize going on, so if you think the data set may already exist and the dim sizes may be changed, then always use resizeDataSet().

<>

Member Function Documentation

◆ crDS()

virtual H5::DataSet* HDF5::Writer::crDS ( const DataSetKey ,
const ArrayNDInfo ,
ODDataType  ,
uiRetVal  
)
privatepure virtual

Implemented in HDF5::WriterImpl.

◆ createCoupledReader()

virtual Reader* HDF5::Writer::createCoupledReader ( ) const
pure virtual

Implemented in HDF5::WriterImpl.

◆ createDataSet() [1/2]

uiRetVal HDF5::Writer::createDataSet ( const DataSetKey ,
const ArrayNDInfo ,
ODDataType   
)

◆ createDataSet() [2/2]

uiRetVal HDF5::Writer::createDataSet ( const DataSetKey ,
int  ,
ODDataType   
)

◆ createDataSetIfMissing() [1/2]

uiRetVal HDF5::Writer::createDataSetIfMissing ( const DataSetKey ,
ODDataType  ,
const ArrayNDInfo addedsz,
const ArrayNDInfo changedir,
PtrMan< ArrayNDInfo > *  existsinfo = nullptr 
)

param changedir: Array reshaping behaviour for each dimension: -1 = shrink, 0 = no change 1 = grow

◆ createDataSetIfMissing() [2/2]

uiRetVal HDF5::Writer::createDataSetIfMissing ( const DataSetKey ,
ODDataType  ,
int  addedsz,
int  changedir = 1,
int *  existsnrsamples = nullptr 
)

◆ createTextDataSet()

uiRetVal HDF5::Writer::createTextDataSet ( const DataSetKey )

◆ crTxtDS()

virtual H5::DataSet* HDF5::Writer::crTxtDS ( const DataSetKey ,
uiRetVal  
)
privatepure virtual

Implemented in HDF5::WriterImpl.

◆ deleteObject()

bool HDF5::Writer::deleteObject ( const DataSetKey )

after deletion, you can't add it again usually, you need a resize

◆ ensureGroup()

virtual H5::Group* HDF5::Writer::ensureGroup ( const char *  grpnm,
uiRetVal  
)
pure virtual

Creates a new group if necessary.

Implemented in HDF5::WriterImpl.

◆ isReader()

virtual bool HDF5::Writer::isReader ( ) const
inlinevirtual

Implements HDF5::Access.

◆ open4Edit()

uiRetVal HDF5::Writer::open4Edit ( const char *  )

For normal 'create', use 'open()

◆ ptAll()

virtual void HDF5::Writer::ptAll ( const void *  ,
H5::DataSet &  ,
uiRetVal  
)
privatepure virtual

Implemented in HDF5::WriterImpl.

◆ ptInfo()

virtual void HDF5::Writer::ptInfo ( const IOPar ,
H5::H5Object &  ,
uiRetVal  
)
privatepure virtual

Implemented in HDF5::WriterImpl.

◆ ptSlab()

virtual void HDF5::Writer::ptSlab ( const SlabSpec ,
const void *  ,
H5::DataSet &  ,
uiRetVal  
)
privatepure virtual

Implemented in HDF5::WriterImpl.

◆ ptStrings()

virtual void HDF5::Writer::ptStrings ( const BufferStringSet ,
H5::Group &  ,
H5::DataSet *  ,
const char *  dsnm,
uiRetVal  
)
privatepure virtual

Implemented in HDF5::WriterImpl.

◆ put() [1/3]

uiRetVal HDF5::Writer::put ( const DataSetKey ,
const BufferStringSet  
)

◆ put() [2/3]

template<class T >
uiRetVal HDF5::Writer::put ( const DataSetKey dsky,
const T *  vals,
int  sz 
)
inline

◆ put() [3/3]

template<class T >
uiRetVal HDF5::Writer::put ( const DataSetKey dsky,
const TypeSet< T > &  vals 
)
inline

◆ putAll()

uiRetVal HDF5::Writer::putAll ( const DataSetKey ,
const void *   
)

◆ putSlab()

uiRetVal HDF5::Writer::putSlab ( const DataSetKey ,
const SlabSpec ,
const void *   
)

◆ removeAllAttributes()

uiRetVal HDF5::Writer::removeAllAttributes ( const DataSetKey = nullptr)

◆ removeAttribute()

uiRetVal HDF5::Writer::removeAttribute ( const char *  ,
const DataSetKey = nullptr 
)

◆ resizeDataSet()

uiRetVal HDF5::Writer::resizeDataSet ( const DataSetKey ,
const ArrayNDInfo  
)

You cannot change the 'rank', just the dim sizes.

◆ reSzDS()

virtual void HDF5::Writer::reSzDS ( const ArrayNDInfo ,
H5::DataSet &  ,
uiRetVal  
)
privatepure virtual

Implemented in HDF5::WriterImpl.

◆ rmAllAttribs()

virtual void HDF5::Writer::rmAllAttribs ( H5::H5Object &  )
privatepure virtual

Implemented in HDF5::WriterImpl.

◆ rmAttrib()

virtual void HDF5::Writer::rmAttrib ( const char *  ,
H5::H5Object &   
)
privatepure virtual

Implemented in HDF5::WriterImpl.

◆ rmObj()

virtual bool HDF5::Writer::rmObj ( const DataSetKey )
privatepure virtual

Implemented in HDF5::WriterImpl.

◆ set()

uiRetVal HDF5::Writer::set ( const IOPar ,
const DataSetKey = nullptr 
)

◆ setAttribute() [1/9]

virtual void HDF5::Writer::setAttribute ( const char *  ,
double  ,
const DataSetKey = nullptr 
)
pure virtual

Implemented in HDF5::WriterImpl.

◆ setAttribute() [2/9]

virtual void HDF5::Writer::setAttribute ( const char *  ,
float  ,
const DataSetKey = nullptr 
)
pure virtual

Implemented in HDF5::WriterImpl.

◆ setAttribute() [3/9]

virtual void HDF5::Writer::setAttribute ( const char *  ,
od_int16  ,
const DataSetKey = nullptr 
)
pure virtual

Implemented in HDF5::WriterImpl.

◆ setAttribute() [4/9]

virtual void HDF5::Writer::setAttribute ( const char *  ,
od_int32  ,
const DataSetKey = nullptr 
)
pure virtual

Implemented in HDF5::WriterImpl.

◆ setAttribute() [5/9]

virtual void HDF5::Writer::setAttribute ( const char *  ,
od_int64  ,
const DataSetKey = nullptr 
)
pure virtual

Implemented in HDF5::WriterImpl.

◆ setAttribute() [6/9]

virtual void HDF5::Writer::setAttribute ( const char *  ,
od_uint16  ,
const DataSetKey = nullptr 
)
pure virtual

Implemented in HDF5::WriterImpl.

◆ setAttribute() [7/9]

virtual void HDF5::Writer::setAttribute ( const char *  ,
od_uint32  ,
const DataSetKey = nullptr 
)
pure virtual

Implemented in HDF5::WriterImpl.

◆ setAttribute() [8/9]

virtual void HDF5::Writer::setAttribute ( const char *  ,
od_uint64  ,
const DataSetKey = nullptr 
)
pure virtual

Implemented in HDF5::WriterImpl.

◆ setAttribute() [9/9]

virtual void HDF5::Writer::setAttribute ( const char *  ky,
const char *  val,
const DataSetKey = nullptr 
)
pure virtual

Implemented in HDF5::WriterImpl.

◆ setChunkSize()

virtual void HDF5::Writer::setChunkSize ( int  )
pure virtual

Implemented in HDF5::WriterImpl.

◆ setCompressionLevel()

virtual void HDF5::Writer::setCompressionLevel ( unsigned  )
inlinevirtual

Compression level (0-9) See gzip documentation. 0=None

Reimplemented in HDF5::WriterImpl.

◆ setEditableCreation()

virtual void HDF5::Writer::setEditableCreation ( bool  yn)
pure virtual

default is false: no dataset grow/shrink

Implemented in HDF5::WriterImpl.


Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2022