FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
H++/H5DataType.hpp
1#ifndef __H5_DATATYPE_HPP
2#define __H5_DATATYPE_HPP
3
4#include "H5Object.hpp"
5
6class H5Group;
7class H5Dataset;
8
9class H5DataType : public H5Object
10{
11protected:
12
14public:
15
16 H5DataType(hid_t);
17
23 H5DataType(hsize_t str_len, char padding);
24
29 H5DataType(hid_t FileLocation_id, const char*name);
30 H5DataType(const H5Group&, const char*name);
31 H5DataType(const H5Dataset&, const char*name);
32
37 H5DataType(hid_t CompoundType, int member_index);
38 H5DataType(const H5DataType&CompoundType, int member_index);
39
43 H5DataType(hid_t base_type_id, unsigned rank, const hsize_t dims[/*rank*/] );
44
45
46 bool equal(hid_t) const;
47
48 bool operator==(hid_t id) const
49 {
50 return equal(id);
51 }
52
53 bool operator!=(hid_t id) const
54 {
55 return !equal(id);
56 }
57
58 bool commit(hid_t Location, const char*name) const;
59
60 bool commit(hid_t Location, const std::string&name) const
61 {
62 return commit( Location, name.c_str());
63 }
64
69 int NumberOfMembers() const;
70
71static std::string getMemberName(hid_t id, unsigned field_idx );
72
73 std::string getMemberName(unsigned field_idx ) const
74 {
75 return getMemberName(getHid(), field_idx );
76 }
77
78 int get_member_index(const char *name) const;
79
80 size_t get_size() const;
81
82 hid_t get_class() const;
83
84 htri_t detect_class( H5T_class_t dtype_class ) const;
85
86 bool detectClass( H5T_class_t dtype_class ) const;
87
88 bool is_array() const
89 {
90 return get_class() == H5T_ARRAY;
91 }
92
93 int get_array_ndims( ) const;
94 int get_array_dims ( hsize_t dims[] ) const;
95
99 hid_t get_native_type( H5T_direction_t direction = H5T_DIR_ASCEND ) const;
100
101 MemCore::RefPtr<H5DataType> getNativeType( H5T_direction_t direction = H5T_DIR_ASCEND ) const;
102
103
104static std::string get_description(hid_t type_id);
105 std::string get_description() const;
106
107
112static bool is_committed(hid_t LocationID, const char*name);
113
114static bool is_committed(hid_t LocationID, const std::string&s)
115 {
116 return is_committed(LocationID, s.c_str() );
117 }
118};
119
120
121template <class Type> static hid_t getH5TypeID();
122
123template <> inline hid_t getH5TypeID<double>() { return H5T_NATIVE_DOUBLE; }
124template <> inline hid_t getH5TypeID<float>() { return H5T_NATIVE_FLOAT; }
125template <> inline hid_t getH5TypeID<unsigned short>() { return H5T_NATIVE_USHORT; }
126template <> inline hid_t getH5TypeID<unsigned long long>() { return H5T_NATIVE_ULLONG; }
127template <> inline hid_t getH5TypeID<int>() { return H5T_NATIVE_INT; }
128template <> inline hid_t getH5TypeID<unsigned char>() { return H5T_NATIVE_UCHAR; }
129
130#endif // __H5_DATATYPE_HPP
constexpr bool equal(_IIter1 __first1, _IIter1 __last1, _IIter2 __first2, _BinaryPredicate __binary_pred)
Definition H++/H5DataType.hpp:10
int NumberOfMembers() const
Retrieves the number of elements in a compound or enumeration datatype.
Definition H++/H5DataType.cpp:90
static bool is_committed(hid_t LocationID, const char *name)
Check whether the given name in the given LocationID is a named datatype.
Definition H++/H5DataType.cpp:147
hid_t get_native_type(H5T_direction_t direction=H5T_DIR_ASCEND) const
https://support.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-GetNativeType
Definition H++/H5DataType.cpp:136
Definition H++/H5Dataset.hpp:30
A group within an HDF5 file.
Definition H++/H5Group.hpp:18
Base class for groups, datasets and named datatypes.
Definition H++/H5Object.hpp:122