Providing protobuf and gRPC support for Qt.
Go to file
Mårten Nordheim 7b1d7832a2 Add support for the google.protobuf.Any type
This also means adding another library; the Protobuf Well-Known types
library. No other types added from the collection at the moment.

The Any type is like QVariant or std::any in the sense that it can hold
any type. A small string is embedded along with the Any type upon
serializing. This corresponds to some URL, that can be used for
dynamically looking up definitions of types if wanted
(we don't support this), plus the object name.
We use the embedded object name to verify, upon attempting to
deserialize, that the objects are the same. The function is called
as<T>.
Some users may want a as_unchecked<T>, in the future, where we don't do
this, since different messages may be binary compatible but miss some
fields. And this is fine.
Further, the class also contains the raw bytes of its contained message.
We, quite simply, need to deserialize it to some type when requested.

Implementation consists of a helper-class which uses the "real class" we
generate when serializing or deserializing. At some point they could
potentially be collapsed together to avoid extra overhead. But then
the metadata fields need to be dynamically created or manually
maintained.
When asked to serialize/deserialize the class simply proxies calls to
the "real class" underneath

Fixes: QTBUG-103982
Change-Id: Ie9e833cd30aa58afbd5bdd1a9e9c83bdece6f685
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-02-14 16:00:23 +01:00
LICENSES Long live qtprotobufgen 2022-11-08 10:33:39 +01:00
cmake Add support for the google.protobuf.Any type 2023-02-14 16:00:23 +01:00
coin Long live qtprotobufgen 2022-11-08 10:33:39 +01:00
examples Add example of communication using protobuf messages 2023-02-13 15:10:52 +01:00
src Add support for the google.protobuf.Any type 2023-02-14 16:00:23 +01:00
tests Add support for the google.protobuf.Any type 2023-02-14 16:00:23 +01:00
.cmake.conf Bump version to 6.6.0 2022-12-15 06:55:23 +02:00
.gitattributes Add missing .gitattributes and .tag files 2023-01-18 12:03:33 +02:00
.gitignore Long live qtprotobufgen 2022-11-08 10:33:39 +01:00
.tag Add missing .gitattributes and .tag files 2023-01-18 12:03:33 +02:00
CMakeLists.txt Add support for the google.protobuf.Any type 2023-02-14 16:00:23 +01:00
configure.cmake Long live qtprotobufgen 2022-11-08 10:33:39 +01:00
dependencies.yaml Update dependencies on 'dev' in qt/qtgrpc 2023-02-13 03:24:40 +00:00
qt_cmdline.cmake Long live qtprotobufgen 2022-11-08 10:33:39 +01:00
sync.profile Introduce QtGrpc 2022-12-09 15:00:04 +01:00