diff options
Diffstat (limited to 'c++/src')
-rw-r--r-- | c++/src/H5CompType.cpp | 19 | ||||
-rw-r--r-- | c++/src/H5CompType.h | 3 |
2 files changed, 22 insertions, 0 deletions
diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp index df73d9b..1846846 100644 --- a/c++/src/H5CompType.cpp +++ b/c++/src/H5CompType.cpp @@ -451,6 +451,25 @@ void CompType::pack() const } //-------------------------------------------------------------------------- +// Function: CompType::setSize +///\brief Sets the total size for this compound datatype. +///\param size - IN: Size to set +///\exception H5::DataTypeIException +// Note +// H5Tset_size works on atom datatypes and compound datatypes only +// Programmer Binh-Minh Ribler - 2014 +//-------------------------------------------------------------------------- +void CompType::setSize(size_t size) const +{ + // Call C routine H5Tset_size to set the total size + herr_t ret_value = H5Tset_size(id, size); + if (ret_value < 0) + { + throw DataTypeIException("CompType::setSize", "H5Tset_size failed"); + } +} + +//-------------------------------------------------------------------------- // Function: CompType destructor ///\brief Properly terminates access to this compound datatype. // Programmer Binh-Minh Ribler - 2000 diff --git a/c++/src/H5CompType.h b/c++/src/H5CompType.h index 3d6a62f..bd6d76c 100644 --- a/c++/src/H5CompType.h +++ b/c++/src/H5CompType.h @@ -98,6 +98,9 @@ class H5_DLLCPP CompType : public DataType { // Recursively removes padding from within this compound datatype. void pack() const; + // Sets the total size for this compound datatype. + void setSize(size_t size) const; + ///\brief Returns this class name. virtual H5std_string fromClass () const { return("CompType"); } |