I'm a HDF library developer. I'm trying to add support for bitfield data type to H5Tget_native_type in the library. H5Tget_native_type currently returns an error message for it. I wonder how we should interpret bitfield type. Does the byte order matter? How is it different from unsigned integer? What is its native type? Could you give me your opinions?
One suggestion among our group is to remove the byte order information and let H5Tget_native_type simply return a copy of the bitfield type. The bitfield data is a bit sequence opaque to the library. The interpretation is totally up to the user. That will change the library's current behavior.
Internally, the library does byte order conversion between memory and file. The suggestion I mentioned earlier is to remove the byte order information and its conversion. The library will store whatever the user writes. This makes the bitfield type more like the opaque type, not like the integer type.
I hope this helps people understand the situation.
Ray
Raymond Lu wrote:
···
Hello, everyone.
I'm a HDF library developer. I'm trying to add support for bitfield data type to H5Tget_native_type in the library. H5Tget_native_type currently returns an error message for it. I wonder how we should interpret bitfield type. Does the byte order matter? How is it different from unsigned integer? What is its native type? Could you give me your opinions?
One suggestion among our group is to remove the byte order information and let H5Tget_native_type simply return a copy of the bitfield type. The bitfield data is a bit sequence opaque to the library. The interpretation is totally up to the user. That will change the library's current behavior.
It should be possible to write a std::vector<bool> directly to
an HDF5 dataset and read it from there, with no data conversion
required.
cheers,
Werner
···
On Thu, 03 Dec 2009 10:06:11 -0600, Raymond Lu <songyulu@hdfgroup.org> wrote:
Hello, everyone.
I'm a HDF library developer. I'm trying to add support for bitfield
data type to H5Tget_native_type in the library. H5Tget_native_type
currently returns an error message for it. I wonder how we should
interpret bitfield type. Does the byte order matter? How is it
different from unsigned integer? What is its native type? Could you
give me your opinions?
One suggestion among our group is to remove the byte order information
and let H5Tget_native_type simply return a copy of the bitfield type.
The bitfield data is a bit sequence opaque to the library. The
interpretation is totally up to the user. That will change the
library's current behavior.
--
___________________________________________________________________________
Dr. Werner Benger Visualization Research
Laboratory for Creative Arts and Technology (LCAT)
Center for Computation & Technology at Louisiana State University (CCT/LSU)
211 Johnston Hall, Baton Rouge, Louisiana 70803
Tel.: +1 225 578 4809 Fax.: +1 225 578-5362
A Thursday 03 December 2009 17:06:11 Raymond Lu escrigué:
Hello, everyone.
I'm a HDF library developer. I'm trying to add support for bitfield
data type to H5Tget_native_type in the library. H5Tget_native_type
currently returns an error message for it. I wonder how we should
interpret bitfield type. Does the byte order matter? How is it
different from unsigned integer? What is its native type? Could you
give me your opinions?
One suggestion among our group is to remove the byte order information
and let H5Tget_native_type simply return a copy of the bitfield type.
The bitfield data is a bit sequence opaque to the library. The
interpretation is totally up to the user. That will change the
library's current behavior.
I completely agree with this vision. So my vote is +1 here.
In the next C++ standard vector<bool> will use proper bools instead of bits.
So I think it is better not to rely on vector<bool> for bitsets.
In our software we read/write a bitset as a sequence of uchars. This is to avoid byte ordering problems.
What does bitfield support mean if it is entirely up to the user to interpret the data? In that way it is not different from a simple sequence of bytes.
Cheers,
Ger
···
On Thu, Dec 3, 2009 at 7:11 PM, in message <op.u4djhyzgzis4y7@tardis>, "Werner Benger" <werner@cct.lsu.edu> wrote:
Hello Ray,
I would suggest to follow the behavior of std::vector<bool> :
I'm a HDF library developer. I'm trying to add support for bitfield
data type to H5Tget_native_type in the library. H5Tget_native_type
currently returns an error message for it. I wonder how we should
interpret bitfield type. Does the byte order matter? How is it
different from unsigned integer? What is its native type? Could you
give me your opinions?
One suggestion among our group is to remove the byte order information
and let H5Tget_native_type simply return a copy of the bitfield type.
The bitfield data is a bit sequence opaque to the library. The
interpretation is totally up to the user. That will change the
library's current behavior.