H5Pget_class fails to match HP5_create

Hello everyone

The return value from H5Pget_class fails to match the argument to
H5P_create, creating a dataset creation prop list. Other calls to this list
seems to work (chunk, layout etc). Have I misunderstood the get_class
function ? I'm using my own compiled version of HDF5 1.8.4 for MSVC 2008.
Also, the call to isa_class works.

hid_t id = H5Pcreate(H5P_DATASET_CREATE);
throw_on_true(id == H5P_NO_CLASS); // WORKS
throw_on_negative(id); // WORKS

htri_t is_class = H5Pisa_class( id, H5P_DATASET_CREATE);
throw_on_false (is_class); // WORKS

is_class = H5Pisa_class( id, H5P_FILE_CREATE);
HDFormat5::throw_on_true(is_class); // WORKS

hid_t test_class = H5Pget_class(id);
Q_ASSERT (test_class == H5P_DATASET_CREATE); // FAILS.

Thanks,
Anders

Hi Anders,

Hello everyone

The return value from H5Pget_class fails to match the argument to H5P_create, creating a dataset creation prop list. Other calls to this list seems to work (chunk, layout etc). Have I misunderstood the get_class function ? I'm using my own compiled version of HDF5 1.8.4 for MSVC 2008. Also, the call to isa_class works.

  Yes, that's intentional. The H5Pget_class() call returns a class ID, which is essentially a copy of the default H5P_DATASET_CREATE class, so the values are different. As you've noted, H5Pisa_class() is the intended way to compare them.

  Quincey

···

On Feb 22, 2010, at 5:30 AM, Anders Moe wrote:

    hid_t id = H5Pcreate(H5P_DATASET_CREATE);
    throw_on_true(id == H5P_NO_CLASS); // WORKS
    throw_on_negative(id); // WORKS

    htri_t is_class = H5Pisa_class( id, H5P_DATASET_CREATE);
    throw_on_false (is_class); // WORKS

    is_class = H5Pisa_class( id, H5P_FILE_CREATE);
    HDFormat5::throw_on_true(is_class); // WORKS

    hid_t test_class = H5Pget_class(id);
    Q_ASSERT (test_class == H5P_DATASET_CREATE); // FAILS.

Thanks,
Anders

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