serializeToVector() takes an arbitrary subclass of Serializable to do so, with the results placed in a byte array (vector). No type information caching is performed as the code to do this is presently in pvAccessCPP.
I wrote serializeToVector() for the new gateway to provide a key for a lookup table to de-duplicate requests having idential pvrequest blobs. I was concerned that, while operator< could be implemented for PVStructure for use with key std::map, this wouldn't be efficient. This would be the ideal situation for a hash table, but PVField sub-classes also doesn't define a hash function, and I can't easily use std::unordered_map anyway.
While this code began like as a workaround, I think it can function as a useful example of operating on Serialization. If it isn't accepted here I'll pull it into the gateway.
serializeToVector() takes an arbitrary subclass of Serializable to do so, with the results placed in a byte array (vector). No type information caching is performed as the code to do this is presently in pvAccessCPP.
I wrote serializeToVector() for the new gateway to provide a key for a lookup table to de-duplicate requests having idential pvrequest blobs. I was concerned that, while operator< could be implemented for PVStructure for use with key std::map, this wouldn't be efficient. This would be the ideal situation for a hash table, but PVField sub-classes also doesn't define a hash function, and I can't easily use std::unordered_map anyway.
While this code began like as a workaround, I think it can function as a useful example of operating on Serialization. If it isn't accepted here I'll pull it into the gateway.