MISR Toolkit  1.5.1
H5EnumType.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 __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 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 fromClass () const { return("EnumType"); }
70 
71  // Default constructor
72  EnumType();
73 
74  // Creates an enumeration datatype using an existing id
75  EnumType(const hid_t existing_id);
76 
77  // Copy constructor: makes a copy of the original EnumType object.
78  EnumType(const EnumType& original);
79 
80  virtual ~EnumType();
81 
82 }; // end of EnumType
83 } // namespace H5
84 
85 #endif // __H5EnumType_H
#define H5_DLLCPP
Definition: H5api_adpt.h:262
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
virtual H5std_string fromClass() const
Returns this class name.
Definition: H5EnumType.h:69
Class DataSet operates on HDF5 datasets.
Definition: H5DataSet.h:28
HDFFCLIBAPI _fcd name
#define H5std_string
Definition: H5Exception.h:25
HDFFCLIBAPI intf * size
int hid_t
Definition: H5Ipublic.h:54

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