My Project 1.10.10
Loading...
Searching...
No Matches
H5CompType.h
1// C++ informative line for the emacs editor: -*- C++ -*-
2/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
3 * Copyright by The HDF Group. *
4 * All rights reserved. *
5 * *
6 * This file is part of HDF5. The full HDF5 copyright notice, including *
7 * terms governing use, modification, and redistribution, is contained in *
8 * the COPYING file, which can be found at the root of the source code *
9 * distribution tree, or in https://www.hdfgroup.org/licenses. *
10 * If you do not have access to either file, you may request a copy from *
11 * help@hdfgroup.org. *
12 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
13
14#ifndef H5CompType_H
15#define H5CompType_H
16
17namespace H5 {
18
23// Inheritance: DataType -> H5Object -> H5Location -> IdComponent
24class H5_DLLCPP CompType : public DataType {
25 public:
26 // Default constructor
27 CompType();
28
29 // Creates a compound datatype using an existing id
30 CompType(const hid_t existing_id);
31
32 // Creates a new compound datatype, given the type's size
33 CompType(size_t size); // H5Tcreate
34
35 // Gets the compound datatype of the specified dataset
36 CompType(const DataSet &dataset); // H5Dget_type
37
38 // Copy constructor - same as the original CompType.
39 CompType(const CompType &original);
40
41 // Constructors that open a compound datatype, given a location.
42 CompType(const H5Location &loc, const char *name);
43 CompType(const H5Location &loc, const H5std_string &name);
44
45 // Returns a CompType object via DataType* by decoding the binary
46 // object description of this type.
47 virtual DataType *decode() const;
48
49 // Returns the type class of the specified member of this compound
50 // datatype. It provides to the user a way of knowing what type
51 // to create another datatype of the same class
52 H5T_class_t getMemberClass(unsigned member_num) const;
53
54 // Returns the index of a member in this compound data type.
55 int getMemberIndex(const char *name) const;
56 int getMemberIndex(const H5std_string &name) const;
57
58 // Returns the offset of a member of this compound datatype.
59 size_t getMemberOffset(unsigned memb_no) const;
60
61 // Returns the name of a member of this compound datatype.
62 H5std_string getMemberName(unsigned member_num) const;
63
64 // Returns the generic datatype of the specified member in
65 // this compound datatype.
66 DataType getMemberDataType(unsigned member_num) const;
67
68 // Returns the array datatype of the specified member in
69 // this compound datatype.
70 ArrayType getMemberArrayType(unsigned member_num) const;
71
72 // Returns the compound datatype of the specified member in
73 // this compound datatype.
74 CompType getMemberCompType(unsigned member_num) const;
75
76 // Returns the enumeration datatype of the specified member in
77 // this compound datatype.
78 EnumType getMemberEnumType(unsigned member_num) const;
79
80 // Returns the integer datatype of the specified member in
81 // this compound datatype.
82 IntType getMemberIntType(unsigned member_num) const;
83
84 // Returns the floating-point datatype of the specified member in
85 // this compound datatype.
86 FloatType getMemberFloatType(unsigned member_num) const;
87
88 // Returns the string datatype of the specified member in
89 // this compound datatype.
90 StrType getMemberStrType(unsigned member_num) const;
91
92 // Returns the variable length datatype of the specified member in
93 // this compound datatype.
94 VarLenType getMemberVarLenType(unsigned member_num) const;
95
96 // Returns the number of members in this compound datatype.
97 int getNmembers() const;
98
99 // Adds a new member to this compound datatype.
100 void insertMember(const H5std_string &name, size_t offset, const DataType &new_member) const;
101
102 // Recursively removes padding from within this compound datatype.
103 void pack() const;
104
105 // Sets the total size for this compound datatype.
106 void setSize(size_t size) const;
107
109 virtual H5std_string
110 fromClass() const
111 {
112 return ("CompType");
113 }
114
115 // Noop destructor.
116 virtual ~CompType();
117
118 private:
119 // Contains common code that is used by the member functions
120 // getMemberXxxType
121 hid_t p_get_member_type(unsigned member_num) const;
122
123}; // end of CompType
124} // namespace H5
125
126#endif // H5CompType_H
Class ArrayType inherits from DataType and provides wrappers for the HDF5's Array Datatypes.
Definition H5ArrayType.h:24
CompType is a derivative of a DataType and operates on HDF5 compound datatypes.
Definition H5CompType.h:24
virtual H5std_string fromClass() const
Returns this class name.
Definition H5CompType.h:110
Class DataSet operates on HDF5 datasets.
Definition H5DataSet.h:27
Class DataType provides generic operations on HDF5 datatypes.
Definition H5DataType.h:27
EnumType is a derivative of a DataType and operates on HDF5 enum datatypes.
Definition H5EnumType.h:24
FloatType is a derivative of a DataType and operates on HDF5 floating point datatype.
Definition H5FloatType.h:24
H5Location is an abstract base class, added in version 1.8.12.
Definition H5Location.h:30
IntType is a derivative of a DataType and operates on HDF5 integer datatype.
Definition H5IntType.h:24
StrType is a derivative of a DataType and operates on HDF5 string datatype.
Definition H5StrType.h:24
VarLenType is a derivative of a DataType and operates on HDF5 Variable-length Datatypes.
Definition H5VarLenType.h:24
Definition H5AbstractDs.cpp:33


The HDF Group Help Desk:
  Copyright by The HDF Group