summaryrefslogtreecommitdiffstats
path: root/c++/src/H5EnumType.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'c++/src/H5EnumType.cpp')
-rw-r--r--c++/src/H5EnumType.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp
index a96239c..f9adc47 100644
--- a/c++/src/H5EnumType.cpp
+++ b/c++/src/H5EnumType.cpp
@@ -22,7 +22,9 @@
#include "H5DcreatProp.h"
#include "H5DxferProp.h"
#include "H5DataSpace.h"
+#include "H5LcreatProp.h"
#include "H5LaccProp.h"
+#include "H5DaccProp.h"
#include "H5Location.h"
#include "H5Object.h"
#include "H5AbstractDs.h"
@@ -52,7 +54,7 @@ EnumType::EnumType(const hid_t existing_id) : DataType( existing_id ) {}
//--------------------------------------------------------------------------
// Function: EnumType copy constructor
-///\brief Copy constructor: makes a copy of the original EnumType object.
+///\brief Copy constructor: same HDF5 object as \a original
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
EnumType::EnumType(const EnumType& original) : DataType( original ) {}
@@ -146,6 +148,28 @@ EnumType::EnumType(const H5Location& loc, const H5std_string& dtype_name) : Data
}
//--------------------------------------------------------------------------
+// Function: EnumType::decode
+///\brief Returns an EnumType object via DataType* by decoding the
+/// binary object description of this type.
+///
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - Aug 2017
+//--------------------------------------------------------------------------
+DataType* EnumType::decode() const
+{
+ hid_t encoded_enumtype_id = H5I_INVALID_HID;
+ try {
+ encoded_enumtype_id = p_decode();
+ }
+ catch (DataTypeIException &err) {
+ throw;
+ }
+ EnumType *encoded_enumtype = new EnumType;
+ encoded_enumtype->p_setId(encoded_enumtype_id);
+ return(encoded_enumtype);
+}
+
+//--------------------------------------------------------------------------
// Function: EnumType::insert
///\brief Inserts a new member to this enumeration datatype.
///\param name - IN: Name of the new member