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
h5basecontainer_py.h
1#ifndef H5BASECONTAINER_PY_H
2#define H5BASECONTAINER_PY_H
3
4#include "h5geo_py.h"
5
6#include <h5geo/private/h5basecontainerimpl.h>
7
8namespace h5geopy {
9
10template <class TBase>
12{
14 py::class_<
17 H5Base,
18 std::unique_ptr<H5BaseContainer, ObjectDeleter>>
19 &py_obj)
20 {
21 py_obj
22 .def("openObject", py::overload_cast<
23 const std::string&>(&H5BaseContainer::openObject))
24 .def("openObject", py::overload_cast<
25 h5gt::Group>(&H5BaseContainer::openObject))
26
27 .def("openPoints", py::overload_cast<
28 const std::string&>(&H5BaseContainer::openPoints))
29 .def("openPoints", py::overload_cast<
30 h5gt::Group>(&H5BaseContainer::openPoints))
31
32 .def("openHorizon", py::overload_cast<
33 const std::string&>(&H5BaseContainer::openHorizon))
34 .def("openHorizon", py::overload_cast<
35 h5gt::Group>(&H5BaseContainer::openHorizon))
36
37 .def("createPoints1", py::overload_cast<
38 std::string&,
40 h5geo::CreationType>(&H5BaseContainer::createPoints3))
41 .def("createPoints1", py::overload_cast<
42 h5gt::Group,
44 h5geo::CreationType>(&H5BaseContainer::createPoints3))
45 .def("createPoints2", py::overload_cast<
46 std::string&,
48 h5geo::CreationType>(&H5BaseContainer::createPoints3))
49 .def("createPoints2", py::overload_cast<
50 h5gt::Group,
52 h5geo::CreationType>(&H5BaseContainer::createPoints3))
53 .def("createPoints3", py::overload_cast<
54 std::string&,
56 h5geo::CreationType>(&H5BaseContainer::createPoints3))
57 .def("createPoints3", py::overload_cast<
58 h5gt::Group,
60 h5geo::CreationType>(&H5BaseContainer::createPoints3))
61 .def("createPoints4", py::overload_cast<
62 std::string&,
64 h5geo::CreationType>(&H5BaseContainer::createPoints3))
65 .def("createPoints4", py::overload_cast<
66 h5gt::Group,
68 h5geo::CreationType>(&H5BaseContainer::createPoints3))
69
70 .def("createHorizon", py::overload_cast<
71 std::string&,
73 h5geo::CreationType>(&H5BaseContainer::createHorizon))
74 .def("createHorizon", py::overload_cast<
75 h5gt::Group,
77 h5geo::CreationType>(&H5BaseContainer::createHorizon))
78
79 .def("getH5File", &H5BaseContainer::getH5File)
80 .def("getObjGroupList", &H5BaseContainer::getObjGroupList)
81 .def("getObjNameList", &H5BaseContainer::getObjNameList)
82 .def("getObjCount", &H5BaseContainer::getObjCount)
83 .def("getContainerType", &H5BaseContainer::getContainerType)
84
85 .def("isEqual", &H5BaseContainer::isEqual)
86
87 // operators == for abstract classes https://github.com/pybind/pybind11/issues/1487
88 .def("__eq__", [](const H5BaseContainer &self, const H5BaseContainer &other){ return self == other; })
89 .def("__ne__", [](const H5BaseContainer &self, const H5BaseContainer &other){ return self != other; });
90 }
91};
92
93} // h5geopy
94
95
96#endif // H5BASECONTAINER_PY_H
Base class for geo-containers.
Definition h5basecontainer.h:9
virtual size_t getObjCount(const h5geo::ObjectType &objType, bool recursive)=0
Get number of geo-objects of specified type within current container.
virtual std::vector< std::string > getObjNameList(const h5geo::ObjectType &objType, bool recursive)=0
Find all geo-objects of specified type within current container and return them as vector of names.
virtual h5gt::File getH5File() const =0
Get HDF5 file.
virtual bool isEqual(H5BaseContainer *other) const =0
Check if containers are the same.
virtual H5BaseObject * openObject(const std::string &name)=0
Open geo-object.
virtual H5BasePoints * openPoints(const std::string &name)=0
Open H5BasePoints derived points.
virtual h5geo::ContainerType getContainerType()=0
Get current container type.
virtual std::vector< h5gt::Group > getObjGroupList(const h5geo::ObjectType &objType, bool recursive)=0
Find all geo-objects of specified type within current container and return them as vector of Groups.
Definition h5basecontainerimpl.h:11
Base class for all geo-containers and geo-objects.
Definition h5base.h:182
CreationType
Definition h5enum.h:468
Class for creating H5Horizon.
Definition h5base.h:87
Common class for creating H5Points1, H5Points2, H5Points3, H5Points4.
Definition h5base.h:71
Definition h5basecontainer_py.h:12