HDF5 C++ API  1.10.1
 All Classes Namespaces Functions Variables Typedefs Friends Pages
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://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 __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  public:
27  // Creates an empty enumeration datatype based on a native signed
28  // integer type, whose size is given by size.
29  EnumType(size_t size);
30 
31  // Gets the enum datatype of the specified dataset
32  EnumType(const DataSet& dataset); // H5Dget_type
33 
34  // Creates a new enum datatype based on an integer datatype
35  EnumType(const IntType& data_type); // H5Tenum_create
36 
37  // Constructors that open an enum datatype, given a location.
38  EnumType(const H5Location& loc, const char* name);
39  EnumType(const H5Location& loc, const H5std_string& name);
40 
41  // Returns the number of members in this enumeration datatype.
42  int getNmembers () const;
43 
44  // Returns the index of a member in this enumeration data type.
45  int getMemberIndex(const char* name) const;
46  int getMemberIndex(const H5std_string& name) const;
47 
48  // Returns the value of an enumeration datatype member
49  void getMemberValue(unsigned memb_no, void *value) const;
50 
51  // Inserts a new member to this enumeration type.
52  void insert(const char* name, void *value) const;
53  void insert(const H5std_string& name, void *value) const;
54 
55  // Returns the symbol name corresponding to a specified member
56  // of this enumeration datatype.
57  H5std_string nameOf(void *value, size_t size) const;
58 
59  // Returns the value corresponding to a specified member of this
60  // enumeration datatype.
61  void valueOf(const char* name, void *value) const;
62  void valueOf(const H5std_string& name, void *value) const;
63 
65  virtual H5std_string fromClass () const { return("EnumType"); }
66 
67  // Default constructor
68  EnumType();
69 
70  // Creates an enumeration datatype using an existing id
71  EnumType(const hid_t existing_id);
72 
73  // Copy constructor: makes a copy of the original EnumType object.
74  EnumType(const EnumType& original);
75 
76  virtual ~EnumType();
77 
78 }; // end of EnumType
79 } // namespace H5
80 
81 #endif // __H5EnumType_H
EnumType is derived from a DataType and operates on HDF5 enum datatypes.
Definition: H5EnumType.h:25
IntType is derived from a DataType and operates on HDF5 integer datatype.
Definition: H5IntType.h:25
Class DataType provides generic operations on HDF5 datatypes.
Definition: H5DataType.h:28
H5Location is an abstract base class, added in version 1.8.12.
Definition: H5Location.h:36
Class DataSet operates on HDF5 datasets.
Definition: H5DataSet.h:28
virtual H5std_string fromClass() const
Returns this class name.
Definition: H5EnumType.h:65


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