h5gt 0.2.0
C++ wrapper for HDF5 library (based on HighFive project)
Loading...
Searching...
No Matches
H5Annotate_traits_py.h
1#include "h5gt_py.h"
2
3namespace h5gtpy {
4
5namespace ext {
6
7template <typename Derivate>
8Attribute createAttribute_wrap1(
10 const std::string& attr_name,
11 const DataSpace& space,
12 const DataType& type){
13 return self.createAttribute(attr_name, space, type);
14}
15
16template <typename Derivate>
17Attribute createAttribute_wrap2(
19 const std::string& attr_name,
20 const size_t& dim,
21 const DataType& type){
22 return self.createAttribute(attr_name, DataSpace(dim), type);
23}
24
25
26} // ext
27
28
29template <typename Derivate>
30void AnnotateTraits_py(py::class_<AnnotateTraits<Derivate> > &py_obj){
31 py_obj
32 .def("createAttribute", &ext::createAttribute_wrap1<Derivate>,
33 py::arg("attr_name"),
34 py::arg("space"),
35 py::arg("type"),
36 "create a new attribute with the name attr_name")
37 .def("createAttribute", &ext::createAttribute_wrap2<Derivate>,
38 py::arg("attr_name"),
39 py::arg("dim"),
40 py::arg("type"))
41 .def("deleteAttribute", &AnnotateTraits<Derivate>::deleteAttribute,
42 py::arg("attr_name"),
43 "let you delete an attribute by its name.")
44 .def("getAttribute", &AnnotateTraits<Derivate>::getAttribute,
45 py::arg("attr_name"),
46 "open an existing attribute with the name attr_name")
47 .def("getNumberAttributes", &AnnotateTraits<Derivate>::getNumberAttributes,
48 "return the number of attributes of the object")
49 .def("listAttributeNames", &AnnotateTraits<Derivate>::listAttributeNames,
50 "list all attribute name of the object")
51 .def("hasAttribute", &AnnotateTraits<Derivate>::hasAttribute,
52 py::arg("attr_name"),
53 "open an existing attribute with the name attr_name");
54}
55
56
57} // h5gtpy
Definition H5Annotate_traits.hpp:19
Attribute createAttribute(const std::string &attr_name, const DataSpace &space, const DataType &type)
create a new attribute with the name attr_name
Definition H5Annotate_traits_misc.hpp:25
Class representing an attribute of a dataset or group.
Definition H5Attribute.hpp:22
Class representing the space (dimensions) of a dataset.
Definition H5DataSpace.hpp:37
HDF5 Data Type.
Definition H5DataType.hpp:48