My Project 1.10.10
Loading...
Searching...
No Matches
H5EnumType.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 H5EnumType_H
15#define H5EnumType_H
16
17namespace H5 {
18
23// Inheritance: DataType -> H5Object -> H5Location -> IdComponent
24class H5_DLLCPP EnumType : public DataType {
25
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 an EnumType object via DataType* by decoding the
42 // binary object description of this type.
43 virtual DataType *decode() const;
44
45 // Returns the number of members in this enumeration datatype.
46 int getNmembers() const;
47
48 // Returns the index of a member in this enumeration data type.
49 int getMemberIndex(const char *name) const;
50 int getMemberIndex(const H5std_string &name) const;
51
52 // Returns the value of an enumeration datatype member
53 void getMemberValue(unsigned memb_no, void *value) const;
54
55 // Inserts a new member to this enumeration type.
56 void insert(const char *name, void *value) const;
57 void insert(const H5std_string &name, void *value) const;
58
59 // Returns the symbol name corresponding to a specified member
60 // of this enumeration datatype.
61 H5std_string nameOf(void *value, size_t size) const;
62
63 // Returns the value corresponding to a specified member of this
64 // enumeration datatype.
65 void valueOf(const char *name, void *value) const;
66 void valueOf(const H5std_string &name, void *value) const;
67
69 virtual H5std_string
70 fromClass() const
71 {
72 return ("EnumType");
73 }
74
75 // Default constructor
76 EnumType();
77
78 // Creates an enumeration datatype using an existing id
79 EnumType(const hid_t existing_id);
80
81 // Copy constructor: same as the original EnumType.
82 EnumType(const EnumType &original);
83
84 virtual ~EnumType();
85
86}; // end of EnumType
87} // namespace H5
88
89#endif // H5EnumType_H
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
virtual H5std_string fromClass() const
Returns this class name.
Definition H5EnumType.h:70
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
Definition H5AbstractDs.cpp:33


The HDF Group Help Desk:
  Copyright by The HDF Group