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.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp
index a96239c..f9046be 100644
--- a/c++/src/H5EnumType.cpp
+++ b/c++/src/H5EnumType.cpp
@@ -146,6 +146,27 @@ 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_cmptype_id;
+ try {
+ encoded_cmptype_id = p_decode();
+ }
+ catch (DataTypeIException &err) {
+ throw;
+ }
+ EnumType *encoded_cmptype = new EnumType;
+ encoded_cmptype->p_setId(encoded_cmptype_id);
+ return(encoded_cmptype);
+}
+
+//--------------------------------------------------------------------------
// Function: EnumType::insert
///\brief Inserts a new member to this enumeration datatype.
///\param name - IN: Name of the new member