A variable length array record as one record #17
Leg501
started this conversation in
Show and tell
Replies: 1 comment
-
Hello, /**
* Variable Length Datatype struct in memory (This is only used for VL
* sequences, not VL strings, which are stored in char *'s)
*/
typedef struct {
size_t len; /**< Length of VL data (in base type units) */
void *p; /**< Pointer to VL data */
} hvl_t; You can then populate a buffer in the form of To create the HDF5 datatype you need to use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Good afternoon , I'm trying to figure out how to write and read a variable length set in 1 entry. What I mean. I have a pointer to a common data pool array of bytes uint8 and a list of segment sizes from this data pool. I want to save each segment as a single item.
std::vector<uint8_t> pool{0x35,0x34, 0x35, 0x00, 0x00, 0x35,0x36,0x36, 0x36, 0x36, 0x36, 0x00, 0x36, 0x00, 0x36, 0x36, 0x36 };
std::vectorsizeseg{4,5,3,5}
waiting in the file when saving:
0x35 0x34 0x35 0x00
0x00, 0x35,0x36,0x36, 0x36
0x36, 0x36, 0x00
0x36, 0x00, 0x36, 0x36, 0x36
When you read it, you can reconstruct it into a set of vectors if it is possible
std::vector<vector<uint8_t>>
Beta Was this translation helpful? Give feedback.
All reactions