diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2017-09-04 05:41:47 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2017-09-04 05:41:47 (GMT) |
commit | 9b6f4d4937bd0e196e472e71120d6ed4b17e24f7 (patch) | |
tree | 433214c61b8cac549ce12f3073d479b697113d05 /c++/src/H5FloatType.cpp | |
parent | 883a235d5ca81770228c5cb5f9d162afda0b411f (diff) | |
download | hdf5-9b6f4d4937bd0e196e472e71120d6ed4b17e24f7.zip hdf5-9b6f4d4937bd0e196e472e71120d6ed4b17e24f7.tar.gz hdf5-9b6f4d4937bd0e196e472e71120d6ed4b17e24f7.tar.bz2 |
Adding new C++ wrappers
Description:
Added wrappers for H5Tencode to class DataType and H5Tdecode to
classes DataType and its subclasses.
// Creates a binary object description of this datatype.
void DataType::encode()
// Returns the decoded type from the binary object description.
virtual DataType* DataType::decode() const;
virtual DataType* ArrayType::decode() const;
virtual DataType* CompType::decode() const;
virtual DataType* DataType::decode() const;
virtual DataType* EnumType::decode() const;
virtual DataType* FloatType::decode() const;
virtual DataType* IntType::decode() const;
virtual DataType* StrType::decode() const;
virtual DataType* VarLenType::decode() const;
Platforms tested:
Linux/32 2.6 (jam)
Linux/64 (platypus)
Darwin (osx1010test)
Diffstat (limited to 'c++/src/H5FloatType.cpp')
-rw-r--r-- | c++/src/H5FloatType.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/c++/src/H5FloatType.cpp b/c++/src/H5FloatType.cpp index 6bb3fd6..66a7466 100644 --- a/c++/src/H5FloatType.cpp +++ b/c++/src/H5FloatType.cpp @@ -71,7 +71,7 @@ FloatType::FloatType(const hid_t existing_id) : AtomType( existing_id ) {} FloatType::FloatType(const FloatType& original) : AtomType( original ){} //-------------------------------------------------------------------------- -// Function: EnumType overloaded constructor +// Function: FloatType overloaded constructor ///\brief Gets the floating-point datatype of the specified dataset ///\param dataset - IN: Dataset that this floating-point datatype /// associates with @@ -128,6 +128,27 @@ FloatType::FloatType(const H5Location& loc, const H5std_string& dtype_name) : At } //-------------------------------------------------------------------------- +// Function: FloatType::decode +///\brief Returns an FloatType object via DataType* by decoding the +/// binary object description of this type. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Aug 2017 +//-------------------------------------------------------------------------- +DataType* FloatType::decode() const +{ + hid_t encoded_flttype_id; + try { + encoded_flttype_id = p_decode(); + } + catch (DataTypeIException &err) { + throw; + } + FloatType *encoded_flttype = new FloatType; + encoded_flttype->p_setId(encoded_flttype_id); + return(encoded_flttype); +} + +//-------------------------------------------------------------------------- // Function: FloatType::getFields ///\brief Retrieves floating point datatype bit field information. ///\param spos - OUT: Retrieved floating-point sign bit |