My Project  1.12.2
H5EnumType.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 COPYING file, which can be found at the root of the source code *
10  * distribution tree, or in https://www.hdfgroup.org/licenses. *
11  * If you do not have access to either file, you may request a copy from *
12  * help@hdfgroup.org. *
13  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
14 
15 #ifndef H5EnumType_H
16 #define H5EnumType_H
17 
18 namespace H5 {
19 
24 // Inheritance: DataType -> H5Object -> H5Location -> IdComponent
25 class H5_DLLCPP EnumType : public DataType {
26 
27  public:
28  // Creates an empty enumeration datatype based on a native signed
29  // integer type, whose size is given by size.
30  EnumType(size_t size);
31 
32  // Gets the enum datatype of the specified dataset
33  EnumType(const DataSet &dataset); // H5Dget_type
34 
35  // Creates a new enum datatype based on an integer datatype
36  EnumType(const IntType &data_type); // H5Tenum_create
37 
38  // Constructors that open an enum datatype, given a location.
39  EnumType(const H5Location &loc, const char *name);
40  EnumType(const H5Location &loc, const H5std_string &name);
41 
42  // Returns an EnumType object via DataType* by decoding the
43  // binary object description of this type.
44  virtual DataType *decode() const H5_OVERRIDE;
45 
46  // Returns the number of members in this enumeration datatype.
47  int getNmembers() const;
48 
49  // Returns the index of a member in this enumeration data type.
50  int getMemberIndex(const char *name) const;
51  int getMemberIndex(const H5std_string &name) const;
52 
53  // Returns the value of an enumeration datatype member
54  void getMemberValue(unsigned memb_no, void *value) const;
55 
56  // Inserts a new member to this enumeration type.
57  void insert(const char *name, void *value) const;
58  void insert(const H5std_string &name, void *value) const;
59 
60  // Returns the symbol name corresponding to a specified member
61  // of this enumeration datatype.
62  H5std_string nameOf(void *value, size_t size) const;
63 
64  // Returns the value corresponding to a specified member of this
65  // enumeration datatype.
66  void valueOf(const char *name, void *value) const;
67  void valueOf(const H5std_string &name, void *value) const;
68 
70  virtual H5std_string
71  fromClass() const H5_OVERRIDE
72  {
73  return ("EnumType");
74  }
75 
76  // Default constructor
77  EnumType();
78 
79  // Creates an enumeration datatype using an existing id
80  EnumType(const hid_t existing_id);
81 
82  // Copy constructor: same as the original EnumType.
83  EnumType(const EnumType &original);
84 
85  virtual ~EnumType() H5_OVERRIDE;
86 
87 }; // end of EnumType
88 } // namespace H5
89 
90 #endif // H5EnumType_H
Class DataSet operates on HDF5 datasets.
Definition: H5DataSet.h:28
Class DataType provides generic operations on HDF5 datatypes.
Definition: H5DataType.h:28
EnumType is a derivative of a DataType and operates on HDF5 enum datatypes.
Definition: H5EnumType.h:25
virtual H5std_string fromClass() const H5_OVERRIDE
Returns this class name.
Definition: H5EnumType.h:71
H5Location is an abstract base class, added in version 1.8.12.
Definition: H5Location.h:31
IntType is a derivative of a DataType and operates on HDF5 integer datatype.
Definition: H5IntType.h:25
Definition: H5AbstractDs.cpp:34


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