| 1 | // Copyright (C) 2023 The Qt Company Ltd.cxx . . $ `<file>/src/wellknown/qprotobufanysupport.h`/ |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef Q_PROTOBUF_ANYSUPPORT_H |
| 5 | #define Q_PROTOBUF_ANYSUPPORT_Hcxx . . $ `src/wellknown/qprotobufanysupport.h:5:9`! |
| 6 | |
| 7 | #include <QtProtobufWellKnownTypes/qtprotobufwellknowntypesexports.h>cxx . . $ `<file>/build/include/QtProtobufWellKnownTypes/qtprotobufwellknowntypesexports.h`/ |
| 8 | |
| 9 | #include <QtProtobuf/qprotobufmessage.h>cxx . . $ `<file>/build/include/QtProtobuf/qprotobufmessage.h`/ |
| 10 | #include <QtProtobuf/qtprotobuftypes.h>cxx . . $ `<file>/build/include/QtProtobuf/qtprotobuftypes.h`/ |
| 11 | |
| 12 | #include <QtCore/qanystringview.h> |
| 13 | #include <QtCore/qbytearray.h> |
| 14 | #include <QtCore/qstring.h> |
| 15 | |
| 16 | #include <utility> |
| 17 | #include <optional> |
| 18 | #include <type_traits> |
| 19 | |
| 20 | QT_BEGIN_NAMESPACEcxx . . $ `<external>/7770798561591309169/qtconfigmacros.h:103:10`! |
| 21 | |
| 22 | class QAbstractProtobufSerializercxx . . $ QAbstractProtobufSerializer#; |
| 23 | |
| 24 | namespace QtProtobufcxx . . $ QtProtobuf/ { |
| 25 | class AnyPrivatecxx . . $ QtProtobuf/AnyPrivate#; |
| 26 | class Anycxx . . $ QtProtobuf/Any# final : public QProtobufMessagecxx . . $ QProtobufMessage# |
| 27 | { |
| 28 | Q_GADGET_EXPORTcxx . . $ `<external>/4830994369567095248/qtmetamacros.h:153:9`!(Q_PROTOBUFWELLKNOWNTYPES_EXPORTcxx . . $ `build/include/QtProtobufWellKnownTypes/qtprotobufwellknowntypesexports.h:13:13`!) |
| 29 | Q_PROPERTYcxx . . $ `<external>/4830994369567095248/qtmetamacros.h:58:9`!(QString typeUrl READ typeUrl WRITE setTypeUrl SCRIPTABLE true) |
| 30 | Q_PROPERTYcxx . . $ `<external>/4830994369567095248/qtmetamacros.h:58:9`!(QByteArray value READ value WRITE setValue SCRIPTABLE true) |
| 31 | public: |
| 32 | static void registerTypescxx . . $ QtProtobuf/Any#registerTypes(49f6e7a06ebc5aa8).(); |
| 33 | |
| 34 | Q_PROTOBUFWELLKNOWNTYPES_EXPORTcxx . . $ `build/include/QtProtobufWellKnownTypes/qtprotobufwellknowntypesexports.h:13:13`! Anycxx . . $ QtProtobuf/Any#Any(49f6e7a06ebc5aa8).(); |
| 35 | Q_PROTOBUFWELLKNOWNTYPES_EXPORTcxx . . $ `build/include/QtProtobufWellKnownTypes/qtprotobufwellknowntypesexports.h:13:13`! ~cxx . . $ QtProtobuf/Any#`~Any`(ced63f7c635d850d).Anycxx . . $ QtProtobuf/Any#(); |
| 36 | Q_PROTOBUFWELLKNOWNTYPES_EXPORTcxx . . $ `build/include/QtProtobufWellKnownTypes/qtprotobufwellknowntypesexports.h:13:13`! Anycxx . . $ QtProtobuf/Any#Any(57d75b9321bbb956).(const Anycxx . . $ QtProtobuf/Any# &other); |
| 37 | Q_PROTOBUFWELLKNOWNTYPES_EXPORTcxx . . $ `build/include/QtProtobufWellKnownTypes/qtprotobufwellknowntypesexports.h:13:13`! Anycxx . . $ QtProtobuf/Any# &operatorcxx . . $ QtProtobuf/Any#`operator=`(7804904903ec6486).=(const Anycxx . . $ QtProtobuf/Any# &other); |
| 38 | Anycxx . . $ QtProtobuf/Any#Any(4e4ada4046fb268c).(Anycxx . . $ QtProtobuf/Any# &&other) noexcept = default; |
| 39 | Anycxx . . $ QtProtobuf/Any# &operatorcxx . . $ QtProtobuf/Any#`operator=`(342d119b56a71c1e). =(Anycxx . . $ QtProtobuf/Any# &&other) noexcept = default; |
| 40 | void swapcxx . . $ QtProtobuf/Any#swap(9fe0542cb22214f).(Anycxx . . $ QtProtobuf/Any# &other) noexcept |
| 41 | { |
| 42 | QProtobufMessagecxx . . $ QProtobufMessage#::swapcxx . . $ QProtobufMessage#swap(83f977f9edce785b).(other); |
| 43 | } |
| 44 | |
| 45 | Q_PROTOBUFWELLKNOWNTYPES_EXPORTcxx . . $ `build/include/QtProtobufWellKnownTypes/qtprotobufwellknowntypesexports.h:13:13`! QStringcxx . . $ QString# typeUrlcxx . . $ QtProtobuf/Any#typeUrl(6ef7b6c27b00b43d).() const; |
| 46 | Q_PROTOBUFWELLKNOWNTYPES_EXPORTcxx . . $ `build/include/QtProtobufWellKnownTypes/qtprotobufwellknowntypesexports.h:13:13`! QByteArraycxx . . $ QByteArray# valuecxx . . $ QtProtobuf/Any#value(a96750bfbcb1fbe9).() const; |
| 47 | Q_PROTOBUFWELLKNOWNTYPES_EXPORTcxx . . $ `build/include/QtProtobufWellKnownTypes/qtprotobufwellknowntypesexports.h:13:13`! void setTypeUrlcxx . . $ QtProtobuf/Any#setTypeUrl(3520e46b33348bf6).(const QStringcxx . . $ QString# &typeUrl); |
| 48 | Q_PROTOBUFWELLKNOWNTYPES_EXPORTcxx . . $ `build/include/QtProtobufWellKnownTypes/qtprotobufwellknowntypesexports.h:13:13`! void setValuecxx . . $ QtProtobuf/Any#setValue(45672f3c6961a244).(const QByteArraycxx . . $ QByteArray# &value); |
| 49 | |
| 50 | template <typename T> |
| 51 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<T> unpackcxx . . $ QtProtobuf/Any#unpack(f99dd9f816903b1f).(QAbstractProtobufSerializercxx . . $ QAbstractProtobufSerializer# *serializer) const |
| 52 | { |
| 53 | static_assert(QtProtobufcxx . . $ QtProtobuf/::has_q_protobuf_object_macro_vcxx . . $ QtProtobuf/has_q_protobuf_object_macro_v.<T>, |
| 54 | "T must have the Q_PROTOBUF_OBJECT macro"); |
| 55 | |
| 56 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<T> opt(stdcxx . . $ std/::in_placecxx . . $ std/in_place.); |
| 57 | if (!unpackImplcxx . . $ QtProtobuf/Any#unpackImpl(d64c471741fe64a7).(serializer, &cxx . . $ `operator&`(73f913476c07dd28).opt.valuecxx . . $ std/optional#value(8cf0592b1484bc82).())) |
| 58 | opt.resetcxx . . $ std/optional#reset(ced63f7c635d850d).(); |
| 59 | return opt; |
| 60 | } |
| 61 | |
| 62 | template <typename T> |
| 63 | static Anycxx . . $ QtProtobuf/Any# fromMessagecxx . . $ QtProtobuf/Any#fromMessage(93fcebbb60d6983b).(QAbstractProtobufSerializercxx . . $ QAbstractProtobufSerializer# *serializer, const T &message, |
| 64 | QAnyStringViewcxx . . $ QAnyStringView# typeUrlPrefix) |
| 65 | { |
| 66 | if constexpr (stdcxx . . $ std/::is_same_v<T, Anycxx . . $ QtProtobuf/Any#>) |
| 67 | return fromAnyMessageImplcxx . . $ QtProtobuf/Any#fromAnyMessageImpl(19ac434df9981590).(serializer, &cxx . . $ `operator&`(73f913476c07dd28).message, typeUrlPrefix); |
| 68 | |
| 69 | static_assert(QtProtobufcxx . . $ QtProtobuf/::has_q_protobuf_object_macro_vcxx . . $ QtProtobuf/has_q_protobuf_object_macro_v.<T>, |
| 70 | "T must have the Q_PROTOBUF_OBJECT macro"); |
| 71 | return fromMessageImplcxx . . $ QtProtobuf/Any#fromMessageImpl(6fe02e089c81b655).(serializer, &cxx . . $ `operator&`(73f913476c07dd28).message, typeUrlPrefix); |
| 72 | } |
| 73 | |
| 74 | template <typename T> |
| 75 | static Anycxx . . $ QtProtobuf/Any# fromMessagecxx . . $ QtProtobuf/Any#fromMessage(992269af0d2a160).(QAbstractProtobufSerializercxx . . $ QAbstractProtobufSerializer# *serializer, const T &message) |
| 76 | { |
| 77 | if constexpr (stdcxx . . $ std/::is_same_v<T, Anycxx . . $ QtProtobuf/Any#>) |
| 78 | return fromAnyMessageImplcxx . . $ QtProtobuf/Any#fromAnyMessageImpl(19ac434df9981590).(serializer, &cxx . . $ `operator&`(73f913476c07dd28).message); |
| 79 | |
| 80 | static_assert(QtProtobufcxx . . $ QtProtobuf/::has_q_protobuf_object_macro_vcxx . . $ QtProtobuf/has_q_protobuf_object_macro_v.<T>, |
| 81 | "T must have the Q_PROTOBUF_OBJECT macro"); |
| 82 | return fromMessageImplcxx . . $ QtProtobuf/Any#fromMessageImpl(6fe02e089c81b655).(serializer, &cxx . . $ `operator&`(73f913476c07dd28).message); |
| 83 | } |
| 84 | |
| 85 | private: |
| 86 | Q_DECLARE_PRIVATEcxx . . $ `<external>/9561028201570787675/qtclasshelpermacros.h:146:9`!(Any) |
| 87 | |
| 88 | Q_PROTOBUFWELLKNOWNTYPES_EXPORTcxx . . $ `build/include/QtProtobufWellKnownTypes/qtprotobufwellknowntypesexports.h:13:13`! bool unpackImplcxx . . $ QtProtobuf/Any#unpackImpl(d64c471741fe64a7).(QAbstractProtobufSerializercxx . . $ QAbstractProtobufSerializer# *serializer, |
| 89 | QProtobufMessagecxx . . $ QProtobufMessage# *message) const; |
| 90 | static Q_PROTOBUFWELLKNOWNTYPES_EXPORTcxx . . $ `build/include/QtProtobufWellKnownTypes/qtprotobufwellknowntypesexports.h:13:13`! Anycxx . . $ QtProtobuf/Any# |
| 91 | fromMessageImplcxx . . $ QtProtobuf/Any#fromMessageImpl(7f4210e0413c24c9).(QAbstractProtobufSerializercxx . . $ QAbstractProtobufSerializer# *serializer, const QProtobufMessagecxx . . $ QProtobufMessage# *message, |
| 92 | QAnyStringViewcxx . . $ QAnyStringView# typeUrlPrefix); |
| 93 | static Q_PROTOBUFWELLKNOWNTYPES_EXPORTcxx . . $ `build/include/QtProtobufWellKnownTypes/qtprotobufwellknowntypesexports.h:13:13`! Anycxx . . $ QtProtobuf/Any# |
| 94 | fromAnyMessageImplcxx . . $ QtProtobuf/Any#fromAnyMessageImpl(1635e1c0e57261cc).(QAbstractProtobufSerializercxx . . $ QAbstractProtobufSerializer# *serializer, const Anycxx . . $ QtProtobuf/Any# *message, |
| 95 | QAnyStringViewcxx . . $ QAnyStringView# typeUrlPrefix); |
| 96 | |
| 97 | static Q_PROTOBUFWELLKNOWNTYPES_EXPORTcxx . . $ `build/include/QtProtobufWellKnownTypes/qtprotobufwellknowntypesexports.h:13:13`! Anycxx . . $ QtProtobuf/Any# |
| 98 | fromMessageImplcxx . . $ QtProtobuf/Any#fromMessageImpl(6fe02e089c81b655).(QAbstractProtobufSerializercxx . . $ QAbstractProtobufSerializer# *serializer, const QProtobufMessagecxx . . $ QProtobufMessage# *message); |
| 99 | static Q_PROTOBUFWELLKNOWNTYPES_EXPORTcxx . . $ `build/include/QtProtobufWellKnownTypes/qtprotobufwellknowntypesexports.h:13:13`! Anycxx . . $ QtProtobuf/Any# |
| 100 | fromAnyMessageImplcxx . . $ QtProtobuf/Any#fromAnyMessageImpl(19ac434df9981590).(QAbstractProtobufSerializercxx . . $ QAbstractProtobufSerializer# *serializer, const Anycxx . . $ QtProtobuf/Any# *message); |
| 101 | |
| 102 | Q_PROTOBUFWELLKNOWNTYPES_EXPORTcxx . . $ `build/include/QtProtobufWellKnownTypes/qtprotobufwellknowntypesexports.h:13:13`! |
| 103 | friend bool comparesEqualcxx . . $ QtProtobuf/comparesEqual(a00991bd17c7be3d).(const Anycxx . . $ QtProtobuf/Any# &lhs, const Anycxx . . $ QtProtobuf/Any# &rhs) noexcept; |
| 104 | |
| 105 | Q_DECLARE_EQUALITY_COMPARABLEcxx . . $ `<external>/17817106167546751335/qcomparehelpers.h:430:9`!(Any) |
| 106 | }; |
| 107 | |
| 108 | template <> |
| 109 | Q_PROTOBUFWELLKNOWNTYPES_EXPORTcxx . . $ `build/include/QtProtobufWellKnownTypes/qtprotobufwellknowntypesexports.h:13:13`! stdcxx . . $ std/::optionalcxx . . $ std/optional#<Anycxx . . $ QtProtobuf/Any#> |
| 110 | Anycxx . . $ QtProtobuf/Any#::unpackcxx . . $ QtProtobuf/Any#unpack(af925a51361e794e).<Anycxx . . $ QtProtobuf/Any#>(QAbstractProtobufSerializercxx . . $ QAbstractProtobufSerializer# *serializer) const; |
| 111 | |
| 112 | Q_DECLARE_SHARED_NScxx . . $ `<external>/9561028201570787675/qtclasshelpermacros.h:212:9`!(QtProtobuf, Any) |
| 113 | |
| 114 | } // namespace QtProtobuf |
| 115 | |
| 116 | QT_END_NAMESPACEcxx . . $ `<external>/7770798561591309169/qtconfigmacros.h:104:10`! |
| 117 | |
| 118 | #endif // Q_PROTOBUF_ANYSUPPORT_H |