cereal
cereal copied to clipboard
Is it possible deserialize from unknown type?
Someone serialize some data type A by cereal to string buffer, and I want to deserialize buffer, print as json format, without type A's class declaration, is it possible?
such as:
// process-a
struct SomeType {
……
template<class Archive>
void serialize(Archive& archive) {
archive(……);
}
};
SomeType data;
std::stringstream ss;
{
cereal::PortableBinaryOutputArchive oarchive(ss);
oarchive(data);
}
send_buffer_to_process_b(ss.str());
// process-b
std::string buffer;
recv_buffer_from_process_a(buffer);
// how to deserialize buffer, print as json format, without 'SomeType' info?
thanks.