Boost logo

Boost Users :

Subject: [Boost-users] Library advice
From: Mathew Benson (mathew.benson_at_[hidden])
Date: 2014-04-26 13:23:20


Is there a boost library that I can use to dynamically deserialize structures from untyped buffers? I need to write code that receives a buffer of data from another computer, with some data serialized with bitfield structs. Yes, I do understand the difficulty of doing this and that it would have been easier if the data was serialized properly before transmission. I have no control over the transmitted data, but I can get the data format defined accurately. I fully understand the numerous edge cases and pitfalls with doing this and don't take the task lightly. Therefore, I'm looking for libs and open source code to make it easier.

The incoming data format can and frequently does change so I can't hard code the format, but the format is defined in an XML file. I wrote an internal database containing field type, offset, and bit lengths, and populated via the XML file. My XML file is auto generated to match the as built interface definition, bit for bit. I wrote code that deserializes most of the data, but I need to rewrite it as a general purpose function to work for all cases, including bitfield structs. For now, I can assume same CPU (little endian) and the same compiler (gcc). However, both source and destination CPUs and OS's might be 32 bit or 64 bit. In future versions, I would like to add support for endian conversion and differing compiler packing.

Does boost have something that would help?

Sent from my Packard Bell 386


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net