Encodes a data space object description into a binary buffer
Procedure:
H5S_ENCODE1 ( obj_id, buf, nalloc)
Signature:
herr_t H5Sencode1 ( hid_t obj_id, void *buf, size_t *nalloc )
Parameters:
hid_t obj_id | IN: Identifier of the object to be encoded |
void *buf | IN/OUT: Buffer for the object to be encoded into If the provided buffer is NULL, only the size of buffer needed is returned through nalloc . |
size_t *nalloc | IN: The size of the allocated buffer OUT: The size of the buffer needed |
Description:
Given the data space identifier obj_id
, H5S_ENCODE1 converts a data space description into binary form in a buffer. Using this binary form in the buffer, a data space object can be reconstructed using H5S_DECODE to return a new object handle (hid_t
) for this data space.
A preliminary H5S_ENCODE1 call can be made to find out the size of the buffer needed. This value is returned as nalloc
. That value can then be assigned to nalloc
for a second H5S_ENCODE1 call, which will retrieve the actual encoded object.
If the library finds out nalloc
is not big enough for the object, it simply returns the size of the buffer needed through nalloc
without encoding the provided buffer.
The types of data space we address in this function are null, scalar, and simple space. For simple data space, the information of selection, for example, hyperslab selection, is also encoded and decoded. A complex data space has not been implemented in the library.
Returns:
Returns a non-negative value if successful; otherwise returns a negative value.
History:
Release | Change |
---|
1.12.0 | The function H5S_ENCODE was renamed H5S_ENCODE1 and deprecated. |
--- Last Modified: August 28, 2019 | 03:06 PM