OpendTect  6.6
hdf5readerimpl.h
Go to the documentation of this file.
1 #pragma once
2 /*+
3 ________________________________________________________________________
4 
5  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
6  Author: Bert
7  Date: Feb 2018
8 ________________________________________________________________________
9 
10 -*/
11 
12 #include "hdf5common.h"
13 #include "hdf5accessimpl.h"
14 #include "hdf5reader.h"
15 
16 
17 namespace HDF5
18 {
19 
20 mExpClass(ODHDF5) ReaderImpl : public Reader
21  , public AccessImpl
23 public:
24 
25  ReaderImpl();
26  ReaderImpl(const H5::H5File&);
27  virtual ~ReaderImpl();
28 
29 private:
30 
31  const char* fileName() const { return gtFileName(); }
32  void openFile(const char*,uiRetVal&,bool) override;
33  void closeFile() override { doCloseFile(*this); }
34 
35  DataSetKey scope() const override { return gtScope(); }
36  od_int64 curGroupID() const override { return gtGroupID(); }
37  H5::H5Object* setScope( const DataSetKey* dsky ) override
38  { return stScope( dsky ); }
39  H5::H5Object* getScope( const DataSetKey* dsky ) const override
40  { return stScope( dsky ); }
41  H5::Group* setGrpScope( const DataSetKey* dsky ) override
42  { return stGrpScope( dsky ); }
43  H5::Group* getGrpScope( const DataSetKey* dsky ) const override
44  { return stGrpScope( dsky ); }
45  H5::DataSet* setDSScope( const DataSetKey& dsky ) override
46  { return stDSScope( dsky ); }
47  H5::DataSet* getDSScope( const DataSetKey& dsky ) const override
48  { return stDSScope( dsky ); }
49 
50  void getGroups(BufferStringSet&) const override;
51  void getDataSets(const char* grpnm,
52  BufferStringSet&) const override;
53  template <class H5Dir>
54  void listObjs(const H5Dir&,BufferStringSet&,
55  bool wantgroups) const;
56 
57  const H5DataType& h5DataType(const H5::DataSet&) const;
58  ODDataType gtDataType(const H5::DataSet&) const override;
59  ArrayNDInfo* gtDataSizes(const H5::DataSet&) const override;
60  nr_dims_type gtNrDims() const override { return nrdims_; }
61 
62  void gtSlab(const H5::DataSet&,const SlabSpec&,void*,
63  uiRetVal&) const override;
64  void gtAll(const H5::DataSet&,void*,
65  uiRetVal&) const override;
67  uiRetVal&) const override;
68  void gtValues(const H5::DataSet&,const NDPosBufSet&,
69  void*,uiRetVal&) const override;
70 
71  bool hasAttribute(const char*,
72  const DataSetKey* =nullptr) const override;
73  int getNrAttributes(const DataSetKey* =nullptr) const override;
74  void gtAttribNames(const H5::H5Object&,
75  BufferStringSet&) const override;
76 
77  bool getAttribute(const char*,BufferString&,
78  const DataSetKey* =nullptr) const override;
79 #define mHDF5DeclFns(type) \
80  bool getAttribute(const char*,type&, \
81  const DataSetKey* =nullptr) const override;
88  mHDF5DeclFns(float);
89  mHDF5DeclFns(double);
90 #undef mHDF5DeclFns
91  void gtInfo(const H5::H5Object&,IOPar&,
92  uiRetVal&) const override;
94  const DataSetKey* =nullptr) const override;
95 
96 };
97 
98 } // namespace HDF5
od_uint64
#define od_uint64
Definition: plftypes.h:36
hdf5reader.h
HDF5::ReaderImpl::gtValues
void gtValues(const H5::DataSet &, const NDPosBufSet &, void *, uiRetVal &) const override
HDF5::ReaderImpl::getScope
H5::H5Object * getScope(const DataSetKey *dsky) const override
Definition: hdf5readerimpl.h:39
ArrayNDInfo
Contains the information about the size of ArrayND, and in what order the data is stored (if accessab...
Definition: arrayndinfo.h:25
BufferStringSet
Set of BufferString objects.
Definition: bufstringset.h:26
HDF5::ReaderImpl
Definition: hdf5readerimpl.h:22
HDF5::ReaderImpl::gtStrings
void gtStrings(const H5::DataSet &, BufferStringSet &, uiRetVal &) const override
HDF5::ReaderImpl::openFile
void openFile(const char *, uiRetVal &, bool) override
od_int64
#define od_int64
Definition: plftypes.h:35
HDF5::ReaderImpl::setGrpScope
H5::Group * setGrpScope(const DataSetKey *dsky) override
Definition: hdf5readerimpl.h:41
hdf5common.h
HDF5::Reader
Reads HDF5 file data.
Definition: hdf5reader.h:34
mExpClass
#define mExpClass(module)
Definition: commondefs.h:177
HDF5
Definition: hdf5access.h:22
HDF5::ReaderImpl::getGroups
void getGroups(BufferStringSet &) const override
All groups with full names (recursive)
HDF5::ReaderImpl::curGroupID
od_int64 curGroupID() const override
Definition: hdf5readerimpl.h:36
sKey::DataSet
FixedString DataSet()
Definition: keystrs.h:56
HDF5::ReaderImpl::~ReaderImpl
virtual ~ReaderImpl()
uiRetVal
Definition: uistringset.h:105
HDF5::ReaderImpl::readJSonAttribute
uiRetVal readJSonAttribute(const char *, OD::JSON::ValueSet &, const DataSetKey *=nullptr) const override
HDF5::ReaderImpl::getNrAttributes
int getNrAttributes(const DataSetKey *=nullptr) const override
mODTextTranslationClass
#define mODTextTranslationClass(clss)
Definition: uistring.h:40
HDF5::ReaderImpl::scope
DataSetKey scope() const override
Definition: hdf5readerimpl.h:35
HDF5::ReaderImpl::gtAll
void gtAll(const H5::DataSet &, void *, uiRetVal &) const override
HDF5::ReaderImpl::hasAttribute
bool hasAttribute(const char *, const DataSetKey *=nullptr) const override
mHDF5DeclFns
#define mHDF5DeclFns(type)
Definition: hdf5readerimpl.h:79
HDF5::ReaderImpl::closeFile
void closeFile() override
Definition: hdf5readerimpl.h:33
HDF5::ReaderImpl::gtAttribNames
void gtAttribNames(const H5::H5Object &, BufferStringSet &) const override
od_int16
#define od_int16
Definition: plftypes.h:26
HDF5::ReaderImpl::getDataSets
void getDataSets(const char *grpnm, BufferStringSet &) const override
Pass a full group name.
hdf5accessimpl.h
od_uint16
#define od_uint16
Definition: plftypes.h:27
HDF5::ReaderImpl::ReaderImpl
mODTextTranslationClass(ReaderImpl) public ReaderImpl(const H5::H5File &)
BufferString
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size.
Definition: bufstring.h:40
HDF5::ReaderImpl::setDSScope
H5::DataSet * setDSScope(const DataSetKey &dsky) override
Definition: hdf5readerimpl.h:45
HDF5::ReaderImpl::gtNrDims
nr_dims_type gtNrDims() const override
Definition: hdf5readerimpl.h:60
OD::DataRepType
DataRepType
Definition: commontypes.h:49
od_int32
#define od_int32
Definition: plftypes.h:30
HDF5::ReaderImpl::getAttribute
bool getAttribute(const char *, BufferString &, const DataSetKey *=nullptr) const override
HDF5::ReaderImpl::setScope
H5::H5Object * setScope(const DataSetKey *dsky) override
Definition: hdf5readerimpl.h:37
HDF5::ReaderImpl::gtInfo
void gtInfo(const H5::H5Object &, IOPar &, uiRetVal &) const override
HDF5::ReaderImpl::gtDataSizes
ArrayNDInfo * gtDataSizes(const H5::DataSet &) const override
HDF5::AccessImpl::H5DataType
H5::PredType H5DataType
Definition: hdf5accessimpl.h:62
HDF5::ReaderImpl::h5DataType
const H5DataType & h5DataType(const H5::DataSet &) const
OD::JSON::ValueSet
holds values and sets of values. Is base class for either Array or Object.
Definition: odjson.h:95
HDF5::DataSetKey
Definition: hdf5access.h:42
HDF5::ReaderImpl::gtDataType
ODDataType gtDataType(const H5::DataSet &) const override
od_uint32
#define od_uint32
Definition: plftypes.h:31
HDF5::ReaderImpl::getDSScope
H5::DataSet * getDSScope(const DataSetKey &dsky) const override
Returns (new) scope. null for root scope.
Definition: hdf5readerimpl.h:47
HDF5::ReaderImpl::gtSlab
void gtSlab(const H5::DataSet &, const SlabSpec &, void *, uiRetVal &) const override
HDF5::AccessImpl
brief Mixin for common stuff
Definition: hdf5accessimpl.h:25
HDF5::ReaderImpl::getGrpScope
H5::Group * getGrpScope(const DataSetKey *dsky) const override
Definition: hdf5readerimpl.h:43
IOPar
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:55
HDF5::ReaderImpl::fileName
const char * fileName() const
Definition: hdf5readerimpl.h:31
HDF5::ReaderImpl::listObjs
void listObjs(const H5Dir &, BufferStringSet &, bool wantgroups) const
HDF5::SlabSpec
Definition: hdf5access.h:109

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