Hi,

I'm assessing C++ HDF5 API under VS C++/Windows.
My code is working when I compile it in debug mode (_DEBUG preprocessor
definition set) but I encounter some issues when using release mode (NDEBUG
set).

The issue is that I cannot use the insertMember method for CompType object.

I've created a Vector3DDT CompType object with size sizeof( Vector3D ).
Vector3D is a struct with 3 double member x, y, z.

When I execute the following :
Vector3DDT.insertMember( "x", HOFFSET( Vector3D, x ),
PredType::NATIVE_DOUBLE );
Vector3DDT.insertMember( "y", HOFFSET( Vector3D, y ),
PredType::NATIVE_DOUBLE );
I get an error that member name is not unique for "y" member
I verified using getMemberName method that at that time I really have one
unique member called "x".
So the error message seems to be erroneous itself.

I got a little bit deeper in the issue and tried to use the C functions :
H5Tinsert( Vector3DDT.getId(), "x", HOFFSET( Vector3D, x ), (
PredType::NATIVE_DOUBLE ).getId() );
H5Tinsert( Vector3DDT.getId(), "y", HOFFSET( Vector3D, y ), (
PredType::NATIVE_DOUBLE ).getId() );
H5Tinsert( Vector3DDT.getId(), "z", HOFFSET( Vector3D, z ), (
PredType::NATIVE_DOUBLE ).getId() );
and it worked perfectly... (I voluntarily used C++ accessors in order to
find the issue origin).

So it seems that the C++ interface for insertMember has some bug. Obviously,
I could have made a mistake in which case I would be grateful if you could
point on it !

Thanks,

Yves

--
View this message in context: 
http://hdf-forum.184993.n3.nabble.com/Compound-data-type-member-insertion-in-C-tp3398967p3398967.html
Sent from the hdf-forum mailing list archive at Nabble.com.

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

Reply via email to