HDF5 C++ API  1.8.18
 All Classes Namespaces Functions Variables Typedefs Friends Pages
H5CompType.h
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 files COPYING and Copyright.html. COPYING can be found at the root *
10  * of the source code distribution tree; Copyright.html can be found at the *
11  * root level of an installed copy of the electronic HDF5 document set and *
12  * is linked from the top-level documents page. It can also be found at *
13  * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
14  * access to either file, you may request a copy from help@hdfgroup.org. *
15  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
16 
17 #ifndef __H5CompType_H
18 #define __H5CompType_H
19 
20 namespace H5 {
21 
26 class H5_DLLCPP CompType : public DataType {
27  public:
28  // Default constructor
29  CompType();
30 
31  // Creates a compound datatype using an existing id
32  CompType( const hid_t existing_id );
33 
34  // Creates a new compound datatype, given the type's size
35  CompType( size_t size ); // H5Tcreate
36 
37  // Gets the compound datatype of the specified dataset
38  CompType( const DataSet& dataset ); // H5Dget_type
39 
40  // Copy constructor - makes a copy of original object
41  CompType( const CompType& original );
42 
43  // Returns the type class of the specified member of this compound
44  // datatype. It provides to the user a way of knowing what type
45  // to create another datatype of the same class
46  H5T_class_t getMemberClass( unsigned member_num ) const;
47 
48  // Returns the index of a member in this compound data type.
49  int getMemberIndex(const char* name) const;
50  int getMemberIndex(const H5std_string& name) const;
51 
52  // Returns the offset of a member of this compound datatype.
53  size_t getMemberOffset( unsigned memb_no ) const;
54 
55  // Returns the name of a member of this compound datatype.
56  H5std_string getMemberName( unsigned member_num ) const;
57 
58  // Returns the generic datatype of the specified member in
59  // this compound datatype.
60  DataType getMemberDataType( unsigned member_num ) const;
61 
62  // Returns the array datatype of the specified member in
63  // this compound datatype.
64  ArrayType getMemberArrayType( unsigned member_num ) const;
65 
66  // Returns the compound datatype of the specified member in
67  // this compound datatype.
68  CompType getMemberCompType( unsigned member_num ) const;
69 
70  // Returns the enumeration datatype of the specified member in
71  // this compound datatype.
72  EnumType getMemberEnumType( unsigned member_num ) const;
73 
74  // Returns the integer datatype of the specified member in
75  // this compound datatype.
76  IntType getMemberIntType( unsigned member_num ) const;
77 
78  // Returns the floating-point datatype of the specified member in
79  // this compound datatype.
80  FloatType getMemberFloatType( unsigned member_num ) const;
81 
82  // Returns the string datatype of the specified member in
83  // this compound datatype.
84  StrType getMemberStrType( unsigned member_num ) const;
85 
86  // Returns the variable length datatype of the specified member in
87  // this compound datatype.
88  VarLenType getMemberVarLenType( unsigned member_num ) const;
89 
90  // Returns the number of members in this compound datatype.
91  int getNmembers() const;
92 
93  // Adds a new member to this compound datatype.
94  void insertMember( const H5std_string& name, size_t offset, const DataType& new_member ) const;
95 
96  // Recursively removes padding from within this compound datatype.
97  void pack() const;
98 
99  // Sets the total size for this compound datatype.
100  void setSize(size_t size) const;
101 
103  virtual H5std_string fromClass () const { return("CompType"); }
104 
105  // Noop destructor.
106  virtual ~CompType();
107 
108  private:
109  // Contains common code that is used by the member functions
110  // getMemberXxxType
111  hid_t p_get_member_type(unsigned member_num) const;
112 };
113 }
114 #endif // __H5CompType_H
Class EnumType operates on HDF5 enum datatypes.
Definition: H5EnumType.h:23
Class IntType operates on HDF5 integer datatype.
Definition: H5IntType.h:23
Class DataType provides generic operations on HDF5 datatypes.
Definition: H5DataType.h:32
VarLenType operates on the HDF5 C's Variable-length Datatypes.
Definition: H5VarLenType.h:26
Class DataSet operates on HDF5 datasets.
Definition: H5DataSet.h:29
Class ArrayType inherits from DataType and provides wrappers for the HDF5's Array Datatypes...
Definition: H5ArrayType.h:26
Class FloatType operates on HDF5 floating point datatype.
Definition: H5FloatType.h:23
virtual H5std_string fromClass() const
Returns this class name.
Definition: H5CompType.h:103
Class StrType operates on HDF5 string datatypes.
Definition: H5StrType.h:23
CompType is a derivative of a DataType and operates on HDF5 compound datatypes.
Definition: H5CompType.h:26


The HDF Group Help Desk:
  Copyright by The HDF Group
and the Board of Trustees of the University of Illinois