h5gt 0.2.0
C++ wrapper for HDF5 library (based on HighFive project)
Loading...
Searching...
No Matches
h5gt_py.h
1#ifndef H5GTPY_H
2#define H5GTPY_H
3
4#ifndef H5GT_USE_EIGEN
5#define H5GT_USE_EIGEN // should be defined before including h5gt
6#endif
7
8#include <h5gt/H5Object.hpp>
9#include <h5gt/H5File.hpp>
10#include <h5gt/H5DataSet.hpp>
11#include <h5gt/H5DataSpace.hpp>
12
13#include <Eigen/Dense>
14
15#include <pybind11/pybind11.h>
16#include <pybind11/eigen.h>
17#include <pybind11/stl.h>
18#include <pybind11/stl_bind.h>
19#include <pybind11/complex.h>
20#include <pybind11/operators.h>
21
22using namespace h5gt;
23
24namespace py = pybind11;
25
26// opaque types must be included to every translation unit or ODR falls (warnings is given)
27PYBIND11_MAKE_OPAQUE(std::vector<CompoundType::member_def>);
28PYBIND11_MAKE_OPAQUE(std::vector<EnumType<int>::member_def>);
29PYBIND11_MAKE_OPAQUE(std::vector<EnumType<unsigned>::member_def>);
30PYBIND11_MAKE_OPAQUE(std::vector<EnumType<long long>::member_def>);
31PYBIND11_MAKE_OPAQUE(std::vector<EnumType<unsigned long long>::member_def>);
32
33/* to generate .pyi the returned type should be declared before it
34 * is called. For example `createGroup` returns `Group` so I need to
35 * place `py::class_<Group, Object>(m, "Group")`
36 * before calling `.def("createGroup", ...` ) */
37
38/* py::arithmetic() -> create an enumeration that also supports
39 * rudimentary arithmetic and bit-level operations like
40 * comparisons, and, or, xor, negation, etc. */
41
42/* export_values() -> export the enum entries into the parent scope,
43 * which should be skipped for newer C++11-style strongly typed enums */
44
45/* py::const_ -> is neccessary when binding overoaded functions */
46
47/* All declarations are here. And all functions are invoked in `h5gt.cpp` */
48
49
50#endif // H5GTPY_H
Use for defining a member of enum type.
Definition H5DataType.hpp:245