h5geo 0.4.0
C++17 and python API to work with geo-data (seismic, wells, maps, other in process) based on HDF5. Aimed at geoscientists and developers.
Loading...
Searching...
No Matches
h5baseimpl.h
1#ifndef H5BASEIMPL_H
2#define H5BASEIMPL_H
3
4#include "../h5base.h"
5
6template <typename TBase = H5Base>
7class H5BaseImpl : public TBase
8{
9protected:
10 virtual ~H5BaseImpl() = default;
11
12public:
13 virtual H5Base* clone() override;
14 virtual void Delete() override;
15
16protected:
17 virtual std::vector<h5gt::Group>
18 getChildGroupList(h5gt::Group& group,
19 const h5geo::ObjectType& objType,
20 bool recursive = false);
22 virtual std::vector<std::string>
23 getChildNameList(h5gt::Group& group,
24 const h5geo::ObjectType& objType,
25 const std::string& referencePath,
26 bool recursive = false);
27 virtual size_t
28 getChildCount(h5gt::Group& group,
29 const h5geo::ObjectType& objType,
30 bool recursive = false);
31
32 static std::optional<h5gt::File> createContainer(
33 std::string& fileName,
34 const h5geo::ContainerType& containerType,
35 h5geo::CreationType createFlag);
36 static std::optional<h5gt::File> createContainer(
37 h5gt::File h5File,
38 const h5geo::ContainerType& containerType,
39 h5geo::CreationType createFlag);
40
48 std::optional<h5gt::Group>
50 std::string& objName,
51 h5gt::File parentFile,
52 const h5geo::ObjectType& objType,
53 void* p,
54 h5geo::CreationType createFlag);
55
63 std::optional<h5gt::Group>
65 std::string& objName,
66 h5gt::Group parentGroup,
67 const h5geo::ObjectType& objType,
68 void* p,
69 h5geo::CreationType createFlag);
70
71 std::optional<h5gt::Group>
73 h5gt::Group objG,
74 const h5geo::ObjectType& objType,
75 void* p,
76 h5geo::CreationType createFlag);
77
78private:
79 static std::optional<h5gt::File>
80 createNewContainer(
81 h5gt::File &file,
82 const h5geo::ContainerType& containerType);
83 std::optional<h5gt::Group>
84 createNewObject(
85 h5gt::Group &group,
86 const h5geo::ObjectType& objType,
87 void* p);
88 std::optional<h5gt::Group>
89 createNewPoints(h5gt::Group &group, void* p, h5geo::ObjectType pointsType);
90 std::optional<h5gt::Group>
91 createNewWellTops(h5gt::Group &group, void* p);
92 std::optional<h5gt::Group>
93 createNewHorizon(h5gt::Group &group, void* p);
94 std::optional<h5gt::Group>
95 createNewMap(h5gt::Group &group, void* p);
96 std::optional<h5gt::Group>
97 createNewWell(h5gt::Group &group, void* p);
98 std::optional<h5gt::Group>
99 createNewLogCurve(h5gt::Group &group, void* p);
100 std::optional<h5gt::Group>
101 createNewDevCurve(h5gt::Group &group, void* p);
102 std::optional<h5gt::Group>
103 createNewSeis(h5gt::Group &group, void* p);
104 std::optional<h5gt::Group>
105 createNewVol(h5gt::Group &group, void* p);
106
107 // Seismic
108 std::optional<h5gt::DataSet>
109 createTextHeader(
110 h5gt::Group &seisGroup,
111 bool mapSEGY);
112 std::optional<h5gt::DataSet>
113 createBinHeader(
114 h5gt::Group &seisGroup,
115 const hsize_t& stdChunk,
116 bool mapSEGY);
117 std::optional<h5gt::DataSet>
118 createTrace(
119 h5gt::Group &seisGroup,
120 const size_t& nTrc,
121 const size_t& nSamp,
122 const hsize_t& trcChunk,
123 bool mapSEGY);
124 std::optional<h5gt::DataSet>
125 createTraceHeader(
126 h5gt::Group &seisGroup,
127 const size_t& nTrc,
128 const hsize_t& trcChunk,
129 bool mapSEGY);
130 std::optional<h5gt::Group>
131 createSort(
132 h5gt::Group &seisGroup);
133
134 // Seismic SEGY
135 std::optional<h5gt::Group>
136 createExternalSEGY(
137 h5gt::Group &seisGroup,
138 const size_t& nTrc,
139 const size_t& nSamp,
140 const hsize_t& trcChunk,
141 const hsize_t& stdChunk,
142 const std::vector<std::string>& segyFiles,
143 h5geo::Endian endian);
144
145// --------------MISCELLANEOUS------------
146protected:
151 bool isSuccessor(const h5gt::Group& parentG, const h5gt::Group& childG);
156 bool isSuccessor(const std::string& parent, const std::string& child);
157
158 //----------- FRIEND CLASSES -----------
160 h5gt::File h5File);
162 h5gt::File h5File);
164 h5gt::File h5File);
166 h5gt::File h5File);
167};
168
169#endif // H5BASEIMPL_H
Base class for all geo-containers and geo-objects.
Definition h5base.h:182
Definition h5baseimpl.h:8
bool isSuccessor(const h5gt::Group &parentG, const h5gt::Group &childG)
isSuccessor checks whether childG is successor of parentG
Definition h5baseimpl.cpp:1310
virtual std::vector< std::string > getChildNameList(h5gt::Group &group, const h5geo::ObjectType &objType, const std::string &referencePath, bool recursive=false)
referencePath to get relative path from it (set to empty to get full path)
Definition h5baseimpl.cpp:109
std::optional< h5gt::Group > createObject(std::string &objName, h5gt::File parentFile, const h5geo::ObjectType &objType, void *p, h5geo::CreationType createFlag)
createObject Creates new object. If CREATE_UNDER_NEW_NAME then objName will be chaged to be unique in...
Definition h5baseimpl.cpp:286
virtual H5Base * clone() override
Definition h5baseimpl.cpp:60
A container built around HDF5 file and used for storing and manipulating H5Map objects.
Definition h5mapcontainer.h:15
A container built around HDF5 file and used for storing and manipulating H5Seis objects.
Definition h5seiscontainer.h:15
A container built around HDF5 file and used for storing and manipulating H5Vol objects.
Definition h5volcontainer.h:15
A container built around HDF5 file and used for storing and manipulating H5Well objects.
Definition h5wellcontainer.h:15
H5GEO_EXPORT H5VolContainer * openVolContainer(h5gt::File h5File)
Factory function for opening H5VolContainer.
Definition h5baseimpl.cpp:1879
H5GEO_EXPORT H5WellContainer * openWellContainer(h5gt::File h5File)
Factory function for opening H5WellContainer.
Definition h5baseimpl.cpp:1925
H5GEO_EXPORT H5MapContainer * openMapContainer(h5gt::File h5File)
Factory function for opening H5MapContainer.
Definition h5baseimpl.cpp:1788
CreationType
Definition h5enum.h:468
H5GEO_EXPORT H5SeisContainer * openSeisContainer(h5gt::File h5File)
Factory function for opening H5SeisContainer.
Definition h5baseimpl.cpp:1834