Skip to content

Instantly share code, notes, and snippets.

/* At run-time deserialization of a protobuf buffer to a C++ object example
* Based on https://cxwangyi.wordpress.com/2010/06/29/google-protocol-buffers-online-parsing-of-proto-file-and-related-data-files/
* @author: Floris Van den Abeele <floris@vdna.be>
*
* Starting from a protobuf definition, main() does the following:
* 1) Translate protobuf definition to FileDescriptorProto object using the
* Parser from protoc. FileDescriptorProto seems to be nothing more than an
* in-memory representation of the proto definition.
* 2) Use a DescriptorPool to construct a FileDescriptor. FileDescriptor
* seems to contain all necessary meta data to describe all the members of a