diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2017-09-12 19:46:06 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2017-09-12 19:46:06 (GMT) |
commit | c7b27a76749fa0c299fd33299ac59b36348ada5f (patch) | |
tree | fc76e85d0e10252df420cee6ecf7bcc74b288560 /c++/src/H5VarLenType.cpp | |
parent | ff2c10c3f0f2174545e608dfbf668a05ad8d0f10 (diff) | |
download | hdf5-c7b27a76749fa0c299fd33299ac59b36348ada5f.zip hdf5-c7b27a76749fa0c299fd33299ac59b36348ada5f.tar.gz hdf5-c7b27a76749fa0c299fd33299ac59b36348ada5f.tar.bz2 |
New overloaded functions and tests
Description:
- Added VarLenType::VarLenType(const DataType& base_type)
- Marked VarLenType::VarLenType(const DataType* base_type) deprecated
- Added a static wrapper for H5Tdetect_class for PredType
static bool DataType::detectClass(const PredType& pred_type, ...)
- Removed the deprecated function Exception::printError() from code
- Miscellaneous improvements in comments
- Added test functions test_detect_type_class() and test_vltype()
Platforms tested:
Linux/32 2.6 (jam)
Linux/64 (jelly)
Darwin (osx1010test)
Diffstat (limited to 'c++/src/H5VarLenType.cpp')
-rw-r--r-- | c++/src/H5VarLenType.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/c++/src/H5VarLenType.cpp b/c++/src/H5VarLenType.cpp index b5ca9c4..5b29682 100644 --- a/c++/src/H5VarLenType.cpp +++ b/c++/src/H5VarLenType.cpp @@ -51,13 +51,14 @@ VarLenType::VarLenType(const VarLenType& original) : DataType(original) {} //-------------------------------------------------------------------------- // Function: VarLenType overloaded constructor -///\brief Creates a new variable-length datatype based on the specified -/// \a base_type. +///\brief Deprecated - will be removed after 1.10.2 ///\param base_type - IN: Pointer to existing datatype ///\exception H5::DataTypeIException // Description // DataType passed by pointer to avoid clashing with copy // constructor. +// Updated: this is unnecessary. +// -BMR, Sep, 2017 // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- VarLenType::VarLenType(const DataType* base_type) : DataType() @@ -72,6 +73,24 @@ VarLenType::VarLenType(const DataType* base_type) : DataType() //-------------------------------------------------------------------------- // Function: VarLenType overloaded constructor +///\brief Creates a new variable-length datatype based on the specified +/// \a base_type. +///\param base_type - IN: An existing datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - May, 2004 +//-------------------------------------------------------------------------- +VarLenType::VarLenType(const DataType& base_type) : DataType() +{ + id = H5Tvlen_create(base_type.getId()); + if (id < 0) + { + throw DataTypeIException("VarLenType constructor", + "H5Tvlen_create returns negative value"); + } +} + +//-------------------------------------------------------------------------- +// Function: VarLenType overloaded constructor ///\brief Creates an VarLenType instance by opening an HDF5 variable /// length datatype given its name, provided as a C char*. ///\param loc - IN: Location of the type |