Hi Binh-Minh,

Thanks for your response. The ::FloatType( const PredType& pred_type ) works 
for me. However, it's still not clear to me why the flag 'predefined' is 
removed from constructor H5::DataType(hid_t existing_id, bool predefined) 
without extra code to handle the predefined datatype.

Cheers,

Zane
        
------------------------------

Message: 2
Date: Wed, 4 Jan 2012 11:35:58 -0500
From: "Binh-Minh Ribler" <[email protected]>
To: "'HDF Users Discussion List'" <[email protected]>
Subject: Re: [Hdf-forum] Construct H5::DataType with predefined
        datatype in     C++1.8.6
Message-ID: <023e01cccafe$f1f43880$0c00000a@lap>
Content-Type: text/plain; charset="us-ascii"

Hi Zane,

 

The predefined type should be in the form of H5::PredType::NATIVE_FLOAT, not
H5::H5T_NATIVE_FLOAT.  I'm surprised it passed the compilation.  Does
FloatType::FloatType( const PredType& pred_type ) work for you?

 

Binh-Minh

 

  _____  

From: [email protected] [mailto:[email protected]]
On Behalf Of Zhengying Wang
Sent: Wednesday, January 04, 2012 5:04 AM
To: '[email protected]'
Subject: [Hdf-forum] Construct H5::DataType with predefined datatype in
C++1.8.6

 

Hi,

 

I'm in the process to upgrade our application from 1.6.5 to 1.8.6. I have
noticed the constructor of H5::DataType (hitd_t existing_id, bool
predefined) has changed to H5::DataType (hitd_t existing_id). The interface
changes do make sense from the point view of users, however I have problem
to create an object with the predefined datatype - Here is a very simple
example:

 

#include <H5cpp.h>

int main ()

{

  H5::DataType (H5::H5T_NATIVE_FLOAT);

 

 return 0;

}

 

The destructor complains with the following errors:

 

DataType::~DataType - H5Tclose failed

HDF5-DIAG: Error detected in HDF5 (1.8.6) thread 140429119538976:

  #000: H5T.c line 1723 in H5Tclose(): immutable datatype

    major: Invalid arguments to routine

    minor: Bad value

DataType::~DataType - H5Tclose failed

 

 

I also tried to the following code:

 

#include <H5cpp.h>

int main ()

{

  H5::DataType (H5::PredType::NATIVE_FLOAT);

 

  return 0;

}

 

The code works for 1.8.6 but not 1.6.5 unfortunately.

 

Here are the errors when trying to insert the object to a compound datatype.

 

HDF5-DIAG: Error detected in HDF5 library version: 1.6.5 thread 3077396992.
Back trace follows.

  #000: H5Tcompound.c line 351 in H5Tinsert(): not a datatype

    major(01): Function arguments

    minor(03): Inappropriate type

H5Tinsert failed

 

 

Could anyone please instruct a proper way to construct H5::DataType with the
predefined datatype? It'd be nice if the code can work in both 1.6.5 and
1.8.6.

 

Thanks,


Zane

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.hdfgroup.org/pipermail/hdf-forum_hdfgroup.org/attachments/20120104/9e63be59/attachment-0001.html>

------------------------------

_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org


End of Hdf-forum Digest, Vol 31, Issue 4
****************************************

_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Reply via email to