summaryrefslogtreecommitdiffstats
path: root/c++/src/H5DataType.h
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2017-09-04 05:41:47 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2017-09-04 05:41:47 (GMT)
commit9b6f4d4937bd0e196e472e71120d6ed4b17e24f7 (patch)
tree433214c61b8cac549ce12f3073d479b697113d05 /c++/src/H5DataType.h
parent883a235d5ca81770228c5cb5f9d162afda0b411f (diff)
downloadhdf5-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/H5DataType.h')
-rw-r--r--c++/src/H5DataType.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h
index 32a79fa..50d2fc1 100644
--- a/c++/src/H5DataType.h
+++ b/c++/src/H5DataType.h
@@ -50,6 +50,13 @@ class H5_DLLCPP DataType : public H5Object {
// Copies the datatype of dset to this datatype object.
void copy(const DataSet& dset);
+ // Returns a DataType instance by decoding the binary object
+ // description of this datatype.
+ virtual DataType* decode() const;
+
+ // Creates a binary object description of this datatype.
+ void encode();
+
// Returns the datatype class identifier.
H5T_class_t getClass() const;
@@ -130,6 +137,9 @@ class H5_DLLCPP DataType : public H5Object {
// Default constructor
DataType();
+ // Determines whether this datatype has a binary object description.
+ bool hasBinaryDesc() const;
+
// Gets the datatype id.
virtual hid_t getId() const;
@@ -140,6 +150,10 @@ class H5_DLLCPP DataType : public H5Object {
#ifndef DOXYGEN_SHOULD_SKIP_THIS
hid_t id; // HDF5 datatype id
+ // Returns an id of a type by decoding the binary object
+ // description of this datatype.
+ hid_t p_decode() const;
+
// Sets the datatype id.
virtual void p_setId(const hid_t new_id);
@@ -149,6 +163,11 @@ class H5_DLLCPP DataType : public H5Object {
#endif // DOXYGEN_SHOULD_SKIP_THIS
private:
+ // Buffer for binary object description of this datatype, allocated
+ // in DataType::encode and used in DataType::decode
+ unsigned char *encoded_buf;
+ size_t buf_size;
+
// Friend function to set DataType id. For library use only.
friend void f_DataType_setId(DataType* dtype, hid_t new_id);