My Project  1.10.11
H5FloatType.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 H5FloatType_H
15 #define H5FloatType_H
16 
17 namespace H5 {
18 
23 // Inheritance: AtomType -> DataType -> H5Object -> H5Location -> IdComponent
24 class H5_DLLCPP FloatType : public AtomType {
25  public:
26  // Creates a floating-point type using a predefined type.
27  FloatType(const PredType &pred_type);
28 
29  // Gets the floating-point datatype of the specified dataset.
30  FloatType(const DataSet &dataset);
31 
32  // Constructors that open an HDF5 float datatype, given a location.
33  FloatType(const H5Location &loc, const char *name);
34  FloatType(const H5Location &loc, const H5std_string &name);
35 
36  // Returns an FloatType object via DataType* by decoding the
37  // binary object description of this type.
38  virtual DataType *decode() const;
39 
40  // Retrieves the exponent bias of a floating-point type.
41  size_t getEbias() const;
42 
43  // Sets the exponent bias of a floating-point type.
44  void setEbias(size_t ebias) const;
45 
46  // Retrieves floating point datatype bit field information.
47  void getFields(size_t &spos, size_t &epos, size_t &esize, size_t &mpos, size_t &msize) const;
48 
49  // Sets locations and sizes of floating point bit fields.
50  void setFields(size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize) const;
51 
52  // Retrieves the internal padding type for unused bits in floating-point datatypes.
53  H5T_pad_t getInpad(H5std_string &pad_string) const;
54 
55  // Fills unused internal floating point bits.
56  void setInpad(H5T_pad_t inpad) const;
57 
58  // Retrieves mantissa normalization of a floating-point datatype.
59  H5T_norm_t getNorm(H5std_string &norm_string) const;
60 
61  // Sets the mantissa normalization of a floating-point datatype.
62  void setNorm(H5T_norm_t norm) const;
63 
65  virtual H5std_string
66  fromClass() const
67  {
68  return ("FloatType");
69  }
70 
71  // Default constructor
72  FloatType();
73 
74  // Creates a floating-point datatype using an existing id.
75  FloatType(const hid_t existing_id);
76 
77  // Copy constructor: same as the original FloatType.
78  FloatType(const FloatType &original);
79 
80  // Noop destructor.
81  virtual ~FloatType();
82 
83 }; // end of FloatType
84 } // namespace H5
85 
86 #endif // H5FloatType_H
H5::FloatType::FloatType
FloatType()
Default constructor: Creates a stub floating-point datatype.
Definition: H5FloatType.cpp:42
H5::FloatType
FloatType is a derivative of a DataType and operates on HDF5 floating point datatype.
Definition: H5FloatType.h:24
H5::FloatType::setFields
void setFields(size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize) const
Sets locations and sizes of floating point bit fields.
Definition: H5FloatType.cpp:192
H5::FloatType::~FloatType
virtual ~FloatType()
Noop destructor.
Definition: H5FloatType.cpp:350
H5::AtomType
AtomType is a base class, inherited by IntType, FloatType, StrType, and PredType.
Definition: H5AtomType.h:27
H5::DataType::copy
void copy(const DataType &like_type)
Copies an existing datatype to this datatype object.
Definition: H5DataType.cpp:208
H5::FloatType::setInpad
void setInpad(H5T_pad_t inpad) const
Fills unused internal floating point bits.
Definition: H5FloatType.cpp:337
H5::FloatType::getFields
void getFields(size_t &spos, size_t &epos, size_t &esize, size_t &mpos, size_t &msize) const
Retrieves floating point datatype bit field information.
Definition: H5FloatType.cpp:171
H5::FloatType::getInpad
H5T_pad_t getInpad(H5std_string &pad_string) const
Retrieves the internal padding type for unused bits in this floating-point datatypes.
Definition: H5FloatType.cpp:303
H5::DataSet
Class DataSet operates on HDF5 datasets.
Definition: H5DataSet.h:27
H5::FloatType::getNorm
H5T_norm_t getNorm(H5std_string &norm_string) const
Retrieves mantissa normalization of a floating-point datatype.
Definition: H5FloatType.cpp:250
H5::DataTypeIException
Definition: H5Exception.h:109
H5::FloatType::setEbias
void setEbias(size_t ebias) const
Sets the exponent bias of a floating-point type.
Definition: H5FloatType.cpp:226
H5::FloatType::fromClass
virtual H5std_string fromClass() const
Returns this class name.
Definition: H5FloatType.h:66
H5::FloatType::decode
virtual DataType * decode() const
Returns an FloatType object via DataType* by decoding the binary object description of this type.
Definition: H5FloatType.cpp:145
H5::PredType
Class PredType holds the definition of all the HDF5 predefined datatypes.
Definition: H5PredType.h:27
H5::DataSet::getId
virtual hid_t getId() const
Get the id of this dataset.
Definition: H5DataSet.cpp:693
H5::FloatType::getEbias
size_t getEbias() const
Retrieves the exponent bias of a floating-point type.
Definition: H5FloatType.cpp:208
H5::FloatType::setNorm
void setNorm(H5T_norm_t norm) const
Sets the mantissa normalization of a floating-point datatype.
Definition: H5FloatType.cpp:279
H5
Definition: H5AbstractDs.cpp:33
H5::DataType
Class DataType provides generic operations on HDF5 datatypes.
Definition: H5DataType.h:27
H5::H5Location
H5Location is an abstract base class, added in version 1.8.12.
Definition: H5Location.h:30
H5::DataSetIException
Definition: H5Exception.h:130


The HDF Group Help Desk:
  Copyright by The HDF Group