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

MISR Toolkit - Copyright © 2005 - 2020 Jet Propulsion Laboratory
Generated on Fri Jun 19 2020 22:49:52