I don't think enums are stored as 1byte. You can check with H5T.getsize.

What happens if you try your read with attr_type as a NATIVE_INT and i as an 
int? Then cast it to bb.


Scott

From: Hdf-forum [mailto:[email protected]] On Behalf Of Yury 
Girshovich
Sent: Wednesday, July 24, 2013 1:04 PM
To: [email protected]
Subject: [Hdf-forum] Reading enum bool attribute

I am trying to read an attribute defined as

typedef enum {bbo=false, bb1=true} bb;

as

bb i;
attr.read(attr_type, &i);
The size of the attribute value is 1 byte.

For attr_type I tried all kinds of 8 bit predicate types (as one advice 
suggested use int, and then interpret your data),
bur no matter what I do the code crashes.
The value is inserted in a different code using Python, so I can get no help 
from there.
How should I define the predicate type then?
Thanks


________________________________

This e-mail and any files transmitted with it may be proprietary and are 
intended solely for the use of the individual or entity to whom they are 
addressed. If you have received this e-mail in error please notify the sender. 
Please note that any views or opinions presented in this e-mail are solely 
those of the author and do not necessarily represent those of Exelis Inc. The 
recipient should check this e-mail and any attachments for the presence of 
viruses. Exelis Inc. accepts no liability for any damage caused by any virus 
transmitted by this e-mail.
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

Reply via email to