| // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT. |
| |
| #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DESCRIPTOR_PROTO_H_ |
| #define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DESCRIPTOR_PROTO_H_ |
| |
| #include <stddef.h> |
| #include <stdint.h> |
| |
| #include "perfetto/protozero/field_writer.h" |
| #include "perfetto/protozero/message.h" |
| #include "perfetto/protozero/packed_repeated_fields.h" |
| #include "perfetto/protozero/proto_decoder.h" |
| #include "perfetto/protozero/proto_utils.h" |
| |
| namespace perfetto { |
| namespace protos { |
| namespace pbzero { |
| |
| class DescriptorProto; |
| class DescriptorProto_ReservedRange; |
| class EnumDescriptorProto; |
| class EnumValueDescriptorProto; |
| class FieldDescriptorProto; |
| class FileDescriptorProto; |
| class OneofDescriptorProto; |
| class OneofOptions; |
| enum FieldDescriptorProto_Label : int32_t; |
| enum FieldDescriptorProto_Type : int32_t; |
| |
| enum FieldDescriptorProto_Type : int32_t { |
| FieldDescriptorProto_Type_TYPE_DOUBLE = 1, |
| FieldDescriptorProto_Type_TYPE_FLOAT = 2, |
| FieldDescriptorProto_Type_TYPE_INT64 = 3, |
| FieldDescriptorProto_Type_TYPE_UINT64 = 4, |
| FieldDescriptorProto_Type_TYPE_INT32 = 5, |
| FieldDescriptorProto_Type_TYPE_FIXED64 = 6, |
| FieldDescriptorProto_Type_TYPE_FIXED32 = 7, |
| FieldDescriptorProto_Type_TYPE_BOOL = 8, |
| FieldDescriptorProto_Type_TYPE_STRING = 9, |
| FieldDescriptorProto_Type_TYPE_GROUP = 10, |
| FieldDescriptorProto_Type_TYPE_MESSAGE = 11, |
| FieldDescriptorProto_Type_TYPE_BYTES = 12, |
| FieldDescriptorProto_Type_TYPE_UINT32 = 13, |
| FieldDescriptorProto_Type_TYPE_ENUM = 14, |
| FieldDescriptorProto_Type_TYPE_SFIXED32 = 15, |
| FieldDescriptorProto_Type_TYPE_SFIXED64 = 16, |
| FieldDescriptorProto_Type_TYPE_SINT32 = 17, |
| FieldDescriptorProto_Type_TYPE_SINT64 = 18, |
| }; |
| |
| const FieldDescriptorProto_Type FieldDescriptorProto_Type_MIN = FieldDescriptorProto_Type_TYPE_DOUBLE; |
| const FieldDescriptorProto_Type FieldDescriptorProto_Type_MAX = FieldDescriptorProto_Type_TYPE_SINT64; |
| |
| enum FieldDescriptorProto_Label : int32_t { |
| FieldDescriptorProto_Label_LABEL_OPTIONAL = 1, |
| FieldDescriptorProto_Label_LABEL_REQUIRED = 2, |
| FieldDescriptorProto_Label_LABEL_REPEATED = 3, |
| }; |
| |
| const FieldDescriptorProto_Label FieldDescriptorProto_Label_MIN = FieldDescriptorProto_Label_LABEL_OPTIONAL; |
| const FieldDescriptorProto_Label FieldDescriptorProto_Label_MAX = FieldDescriptorProto_Label_LABEL_REPEATED; |
| |
| class OneofOptions_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/0, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> { |
| public: |
| OneofOptions_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {} |
| explicit OneofOptions_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {} |
| explicit OneofOptions_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {} |
| }; |
| |
| class OneofOptions : public ::protozero::Message { |
| public: |
| using Decoder = OneofOptions_Decoder; |
| }; |
| |
| class EnumValueDescriptorProto_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> { |
| public: |
| EnumValueDescriptorProto_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {} |
| explicit EnumValueDescriptorProto_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {} |
| explicit EnumValueDescriptorProto_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {} |
| bool has_name() const { return at<1>().valid(); } |
| ::protozero::ConstChars name() const { return at<1>().as_string(); } |
| bool has_number() const { return at<2>().valid(); } |
| int32_t number() const { return at<2>().as_int32(); } |
| }; |
| |
| class EnumValueDescriptorProto : public ::protozero::Message { |
| public: |
| using Decoder = EnumValueDescriptorProto_Decoder; |
| enum : int32_t { |
| kNameFieldNumber = 1, |
| kNumberFieldNumber = 2, |
| }; |
| |
| using FieldMetadata_Name = |
| ::protozero::proto_utils::FieldMetadata< |
| 1, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kString, |
| std::string, |
| EnumValueDescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_Name kName() { return {}; } |
| void set_name(const char* data, size_t size) { |
| AppendBytes(FieldMetadata_Name::kFieldId, data, size); |
| } |
| void set_name(std::string value) { |
| static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId; |
| // Call the appropriate protozero::Message::Append(field_id, ...) |
| // method based on the type of the field. |
| ::protozero::internal::FieldWriter< |
| ::protozero::proto_utils::ProtoSchemaType::kString> |
| ::Append(*this, field_id, value); |
| } |
| |
| using FieldMetadata_Number = |
| ::protozero::proto_utils::FieldMetadata< |
| 2, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kInt32, |
| int32_t, |
| EnumValueDescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_Number kNumber() { return {}; } |
| void set_number(int32_t value) { |
| static constexpr uint32_t field_id = FieldMetadata_Number::kFieldId; |
| // Call the appropriate protozero::Message::Append(field_id, ...) |
| // method based on the type of the field. |
| ::protozero::internal::FieldWriter< |
| ::protozero::proto_utils::ProtoSchemaType::kInt32> |
| ::Append(*this, field_id, value); |
| } |
| }; |
| |
| class EnumDescriptorProto_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> { |
| public: |
| EnumDescriptorProto_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {} |
| explicit EnumDescriptorProto_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {} |
| explicit EnumDescriptorProto_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {} |
| bool has_name() const { return at<1>().valid(); } |
| ::protozero::ConstChars name() const { return at<1>().as_string(); } |
| bool has_value() const { return at<2>().valid(); } |
| ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> value() const { return GetRepeated<::protozero::ConstBytes>(2); } |
| bool has_reserved_name() const { return at<5>().valid(); } |
| ::protozero::RepeatedFieldIterator<::protozero::ConstChars> reserved_name() const { return GetRepeated<::protozero::ConstChars>(5); } |
| }; |
| |
| class EnumDescriptorProto : public ::protozero::Message { |
| public: |
| using Decoder = EnumDescriptorProto_Decoder; |
| enum : int32_t { |
| kNameFieldNumber = 1, |
| kValueFieldNumber = 2, |
| kReservedNameFieldNumber = 5, |
| }; |
| |
| using FieldMetadata_Name = |
| ::protozero::proto_utils::FieldMetadata< |
| 1, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kString, |
| std::string, |
| EnumDescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_Name kName() { return {}; } |
| void set_name(const char* data, size_t size) { |
| AppendBytes(FieldMetadata_Name::kFieldId, data, size); |
| } |
| void set_name(std::string value) { |
| static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId; |
| // Call the appropriate protozero::Message::Append(field_id, ...) |
| // method based on the type of the field. |
| ::protozero::internal::FieldWriter< |
| ::protozero::proto_utils::ProtoSchemaType::kString> |
| ::Append(*this, field_id, value); |
| } |
| |
| using FieldMetadata_Value = |
| ::protozero::proto_utils::FieldMetadata< |
| 2, |
| ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, |
| ::protozero::proto_utils::ProtoSchemaType::kMessage, |
| EnumValueDescriptorProto, |
| EnumDescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_Value kValue() { return {}; } |
| template <typename T = EnumValueDescriptorProto> T* add_value() { |
| return BeginNestedMessage<T>(2); |
| } |
| |
| |
| using FieldMetadata_ReservedName = |
| ::protozero::proto_utils::FieldMetadata< |
| 5, |
| ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, |
| ::protozero::proto_utils::ProtoSchemaType::kString, |
| std::string, |
| EnumDescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_ReservedName kReservedName() { return {}; } |
| void add_reserved_name(const char* data, size_t size) { |
| AppendBytes(FieldMetadata_ReservedName::kFieldId, data, size); |
| } |
| void add_reserved_name(std::string value) { |
| static constexpr uint32_t field_id = FieldMetadata_ReservedName::kFieldId; |
| // Call the appropriate protozero::Message::Append(field_id, ...) |
| // method based on the type of the field. |
| ::protozero::internal::FieldWriter< |
| ::protozero::proto_utils::ProtoSchemaType::kString> |
| ::Append(*this, field_id, value); |
| } |
| }; |
| |
| class OneofDescriptorProto_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> { |
| public: |
| OneofDescriptorProto_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {} |
| explicit OneofDescriptorProto_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {} |
| explicit OneofDescriptorProto_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {} |
| bool has_name() const { return at<1>().valid(); } |
| ::protozero::ConstChars name() const { return at<1>().as_string(); } |
| bool has_options() const { return at<2>().valid(); } |
| ::protozero::ConstBytes options() const { return at<2>().as_bytes(); } |
| }; |
| |
| class OneofDescriptorProto : public ::protozero::Message { |
| public: |
| using Decoder = OneofDescriptorProto_Decoder; |
| enum : int32_t { |
| kNameFieldNumber = 1, |
| kOptionsFieldNumber = 2, |
| }; |
| |
| using FieldMetadata_Name = |
| ::protozero::proto_utils::FieldMetadata< |
| 1, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kString, |
| std::string, |
| OneofDescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_Name kName() { return {}; } |
| void set_name(const char* data, size_t size) { |
| AppendBytes(FieldMetadata_Name::kFieldId, data, size); |
| } |
| void set_name(std::string value) { |
| static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId; |
| // Call the appropriate protozero::Message::Append(field_id, ...) |
| // method based on the type of the field. |
| ::protozero::internal::FieldWriter< |
| ::protozero::proto_utils::ProtoSchemaType::kString> |
| ::Append(*this, field_id, value); |
| } |
| |
| using FieldMetadata_Options = |
| ::protozero::proto_utils::FieldMetadata< |
| 2, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kMessage, |
| OneofOptions, |
| OneofDescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_Options kOptions() { return {}; } |
| template <typename T = OneofOptions> T* set_options() { |
| return BeginNestedMessage<T>(2); |
| } |
| |
| }; |
| |
| class FieldDescriptorProto_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/9, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> { |
| public: |
| FieldDescriptorProto_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {} |
| explicit FieldDescriptorProto_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {} |
| explicit FieldDescriptorProto_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {} |
| bool has_name() const { return at<1>().valid(); } |
| ::protozero::ConstChars name() const { return at<1>().as_string(); } |
| bool has_number() const { return at<3>().valid(); } |
| int32_t number() const { return at<3>().as_int32(); } |
| bool has_label() const { return at<4>().valid(); } |
| int32_t label() const { return at<4>().as_int32(); } |
| bool has_type() const { return at<5>().valid(); } |
| int32_t type() const { return at<5>().as_int32(); } |
| bool has_type_name() const { return at<6>().valid(); } |
| ::protozero::ConstChars type_name() const { return at<6>().as_string(); } |
| bool has_extendee() const { return at<2>().valid(); } |
| ::protozero::ConstChars extendee() const { return at<2>().as_string(); } |
| bool has_default_value() const { return at<7>().valid(); } |
| ::protozero::ConstChars default_value() const { return at<7>().as_string(); } |
| bool has_oneof_index() const { return at<9>().valid(); } |
| int32_t oneof_index() const { return at<9>().as_int32(); } |
| }; |
| |
| class FieldDescriptorProto : public ::protozero::Message { |
| public: |
| using Decoder = FieldDescriptorProto_Decoder; |
| enum : int32_t { |
| kNameFieldNumber = 1, |
| kNumberFieldNumber = 3, |
| kLabelFieldNumber = 4, |
| kTypeFieldNumber = 5, |
| kTypeNameFieldNumber = 6, |
| kExtendeeFieldNumber = 2, |
| kDefaultValueFieldNumber = 7, |
| kOneofIndexFieldNumber = 9, |
| }; |
| using Type = ::perfetto::protos::pbzero::FieldDescriptorProto_Type; |
| using Label = ::perfetto::protos::pbzero::FieldDescriptorProto_Label; |
| static const Type TYPE_DOUBLE = FieldDescriptorProto_Type_TYPE_DOUBLE; |
| static const Type TYPE_FLOAT = FieldDescriptorProto_Type_TYPE_FLOAT; |
| static const Type TYPE_INT64 = FieldDescriptorProto_Type_TYPE_INT64; |
| static const Type TYPE_UINT64 = FieldDescriptorProto_Type_TYPE_UINT64; |
| static const Type TYPE_INT32 = FieldDescriptorProto_Type_TYPE_INT32; |
| static const Type TYPE_FIXED64 = FieldDescriptorProto_Type_TYPE_FIXED64; |
| static const Type TYPE_FIXED32 = FieldDescriptorProto_Type_TYPE_FIXED32; |
| static const Type TYPE_BOOL = FieldDescriptorProto_Type_TYPE_BOOL; |
| static const Type TYPE_STRING = FieldDescriptorProto_Type_TYPE_STRING; |
| static const Type TYPE_GROUP = FieldDescriptorProto_Type_TYPE_GROUP; |
| static const Type TYPE_MESSAGE = FieldDescriptorProto_Type_TYPE_MESSAGE; |
| static const Type TYPE_BYTES = FieldDescriptorProto_Type_TYPE_BYTES; |
| static const Type TYPE_UINT32 = FieldDescriptorProto_Type_TYPE_UINT32; |
| static const Type TYPE_ENUM = FieldDescriptorProto_Type_TYPE_ENUM; |
| static const Type TYPE_SFIXED32 = FieldDescriptorProto_Type_TYPE_SFIXED32; |
| static const Type TYPE_SFIXED64 = FieldDescriptorProto_Type_TYPE_SFIXED64; |
| static const Type TYPE_SINT32 = FieldDescriptorProto_Type_TYPE_SINT32; |
| static const Type TYPE_SINT64 = FieldDescriptorProto_Type_TYPE_SINT64; |
| static const Label LABEL_OPTIONAL = FieldDescriptorProto_Label_LABEL_OPTIONAL; |
| static const Label LABEL_REQUIRED = FieldDescriptorProto_Label_LABEL_REQUIRED; |
| static const Label LABEL_REPEATED = FieldDescriptorProto_Label_LABEL_REPEATED; |
| |
| using FieldMetadata_Name = |
| ::protozero::proto_utils::FieldMetadata< |
| 1, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kString, |
| std::string, |
| FieldDescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_Name kName() { return {}; } |
| void set_name(const char* data, size_t size) { |
| AppendBytes(FieldMetadata_Name::kFieldId, data, size); |
| } |
| void set_name(std::string value) { |
| static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId; |
| // Call the appropriate protozero::Message::Append(field_id, ...) |
| // method based on the type of the field. |
| ::protozero::internal::FieldWriter< |
| ::protozero::proto_utils::ProtoSchemaType::kString> |
| ::Append(*this, field_id, value); |
| } |
| |
| using FieldMetadata_Number = |
| ::protozero::proto_utils::FieldMetadata< |
| 3, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kInt32, |
| int32_t, |
| FieldDescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_Number kNumber() { return {}; } |
| void set_number(int32_t value) { |
| static constexpr uint32_t field_id = FieldMetadata_Number::kFieldId; |
| // Call the appropriate protozero::Message::Append(field_id, ...) |
| // method based on the type of the field. |
| ::protozero::internal::FieldWriter< |
| ::protozero::proto_utils::ProtoSchemaType::kInt32> |
| ::Append(*this, field_id, value); |
| } |
| |
| using FieldMetadata_Label = |
| ::protozero::proto_utils::FieldMetadata< |
| 4, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kEnum, |
| ::perfetto::protos::pbzero::FieldDescriptorProto_Label, |
| FieldDescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_Label kLabel() { return {}; } |
| void set_label(::perfetto::protos::pbzero::FieldDescriptorProto_Label value) { |
| static constexpr uint32_t field_id = FieldMetadata_Label::kFieldId; |
| // Call the appropriate protozero::Message::Append(field_id, ...) |
| // method based on the type of the field. |
| ::protozero::internal::FieldWriter< |
| ::protozero::proto_utils::ProtoSchemaType::kEnum> |
| ::Append(*this, field_id, value); |
| } |
| |
| using FieldMetadata_Type = |
| ::protozero::proto_utils::FieldMetadata< |
| 5, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kEnum, |
| ::perfetto::protos::pbzero::FieldDescriptorProto_Type, |
| FieldDescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_Type kType() { return {}; } |
| void set_type(::perfetto::protos::pbzero::FieldDescriptorProto_Type value) { |
| static constexpr uint32_t field_id = FieldMetadata_Type::kFieldId; |
| // Call the appropriate protozero::Message::Append(field_id, ...) |
| // method based on the type of the field. |
| ::protozero::internal::FieldWriter< |
| ::protozero::proto_utils::ProtoSchemaType::kEnum> |
| ::Append(*this, field_id, value); |
| } |
| |
| using FieldMetadata_TypeName = |
| ::protozero::proto_utils::FieldMetadata< |
| 6, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kString, |
| std::string, |
| FieldDescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_TypeName kTypeName() { return {}; } |
| void set_type_name(const char* data, size_t size) { |
| AppendBytes(FieldMetadata_TypeName::kFieldId, data, size); |
| } |
| void set_type_name(std::string value) { |
| static constexpr uint32_t field_id = FieldMetadata_TypeName::kFieldId; |
| // Call the appropriate protozero::Message::Append(field_id, ...) |
| // method based on the type of the field. |
| ::protozero::internal::FieldWriter< |
| ::protozero::proto_utils::ProtoSchemaType::kString> |
| ::Append(*this, field_id, value); |
| } |
| |
| using FieldMetadata_Extendee = |
| ::protozero::proto_utils::FieldMetadata< |
| 2, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kString, |
| std::string, |
| FieldDescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_Extendee kExtendee() { return {}; } |
| void set_extendee(const char* data, size_t size) { |
| AppendBytes(FieldMetadata_Extendee::kFieldId, data, size); |
| } |
| void set_extendee(std::string value) { |
| static constexpr uint32_t field_id = FieldMetadata_Extendee::kFieldId; |
| // Call the appropriate protozero::Message::Append(field_id, ...) |
| // method based on the type of the field. |
| ::protozero::internal::FieldWriter< |
| ::protozero::proto_utils::ProtoSchemaType::kString> |
| ::Append(*this, field_id, value); |
| } |
| |
| using FieldMetadata_DefaultValue = |
| ::protozero::proto_utils::FieldMetadata< |
| 7, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kString, |
| std::string, |
| FieldDescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_DefaultValue kDefaultValue() { return {}; } |
| void set_default_value(const char* data, size_t size) { |
| AppendBytes(FieldMetadata_DefaultValue::kFieldId, data, size); |
| } |
| void set_default_value(std::string value) { |
| static constexpr uint32_t field_id = FieldMetadata_DefaultValue::kFieldId; |
| // Call the appropriate protozero::Message::Append(field_id, ...) |
| // method based on the type of the field. |
| ::protozero::internal::FieldWriter< |
| ::protozero::proto_utils::ProtoSchemaType::kString> |
| ::Append(*this, field_id, value); |
| } |
| |
| using FieldMetadata_OneofIndex = |
| ::protozero::proto_utils::FieldMetadata< |
| 9, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kInt32, |
| int32_t, |
| FieldDescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_OneofIndex kOneofIndex() { return {}; } |
| void set_oneof_index(int32_t value) { |
| static constexpr uint32_t field_id = FieldMetadata_OneofIndex::kFieldId; |
| // Call the appropriate protozero::Message::Append(field_id, ...) |
| // method based on the type of the field. |
| ::protozero::internal::FieldWriter< |
| ::protozero::proto_utils::ProtoSchemaType::kInt32> |
| ::Append(*this, field_id, value); |
| } |
| }; |
| |
| class DescriptorProto_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/10, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> { |
| public: |
| DescriptorProto_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {} |
| explicit DescriptorProto_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {} |
| explicit DescriptorProto_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {} |
| bool has_name() const { return at<1>().valid(); } |
| ::protozero::ConstChars name() const { return at<1>().as_string(); } |
| bool has_field() const { return at<2>().valid(); } |
| ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> field() const { return GetRepeated<::protozero::ConstBytes>(2); } |
| bool has_extension() const { return at<6>().valid(); } |
| ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> extension() const { return GetRepeated<::protozero::ConstBytes>(6); } |
| bool has_nested_type() const { return at<3>().valid(); } |
| ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> nested_type() const { return GetRepeated<::protozero::ConstBytes>(3); } |
| bool has_enum_type() const { return at<4>().valid(); } |
| ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> enum_type() const { return GetRepeated<::protozero::ConstBytes>(4); } |
| bool has_oneof_decl() const { return at<8>().valid(); } |
| ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> oneof_decl() const { return GetRepeated<::protozero::ConstBytes>(8); } |
| bool has_reserved_range() const { return at<9>().valid(); } |
| ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> reserved_range() const { return GetRepeated<::protozero::ConstBytes>(9); } |
| bool has_reserved_name() const { return at<10>().valid(); } |
| ::protozero::RepeatedFieldIterator<::protozero::ConstChars> reserved_name() const { return GetRepeated<::protozero::ConstChars>(10); } |
| }; |
| |
| class DescriptorProto : public ::protozero::Message { |
| public: |
| using Decoder = DescriptorProto_Decoder; |
| enum : int32_t { |
| kNameFieldNumber = 1, |
| kFieldFieldNumber = 2, |
| kExtensionFieldNumber = 6, |
| kNestedTypeFieldNumber = 3, |
| kEnumTypeFieldNumber = 4, |
| kOneofDeclFieldNumber = 8, |
| kReservedRangeFieldNumber = 9, |
| kReservedNameFieldNumber = 10, |
| }; |
| using ReservedRange = ::perfetto::protos::pbzero::DescriptorProto_ReservedRange; |
| |
| using FieldMetadata_Name = |
| ::protozero::proto_utils::FieldMetadata< |
| 1, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kString, |
| std::string, |
| DescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_Name kName() { return {}; } |
| void set_name(const char* data, size_t size) { |
| AppendBytes(FieldMetadata_Name::kFieldId, data, size); |
| } |
| void set_name(std::string value) { |
| static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId; |
| // Call the appropriate protozero::Message::Append(field_id, ...) |
| // method based on the type of the field. |
| ::protozero::internal::FieldWriter< |
| ::protozero::proto_utils::ProtoSchemaType::kString> |
| ::Append(*this, field_id, value); |
| } |
| |
| using FieldMetadata_Field = |
| ::protozero::proto_utils::FieldMetadata< |
| 2, |
| ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, |
| ::protozero::proto_utils::ProtoSchemaType::kMessage, |
| FieldDescriptorProto, |
| DescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_Field kField() { return {}; } |
| template <typename T = FieldDescriptorProto> T* add_field() { |
| return BeginNestedMessage<T>(2); |
| } |
| |
| |
| using FieldMetadata_Extension = |
| ::protozero::proto_utils::FieldMetadata< |
| 6, |
| ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, |
| ::protozero::proto_utils::ProtoSchemaType::kMessage, |
| FieldDescriptorProto, |
| DescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_Extension kExtension() { return {}; } |
| template <typename T = FieldDescriptorProto> T* add_extension() { |
| return BeginNestedMessage<T>(6); |
| } |
| |
| |
| using FieldMetadata_NestedType = |
| ::protozero::proto_utils::FieldMetadata< |
| 3, |
| ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, |
| ::protozero::proto_utils::ProtoSchemaType::kMessage, |
| DescriptorProto, |
| DescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_NestedType kNestedType() { return {}; } |
| template <typename T = DescriptorProto> T* add_nested_type() { |
| return BeginNestedMessage<T>(3); |
| } |
| |
| |
| using FieldMetadata_EnumType = |
| ::protozero::proto_utils::FieldMetadata< |
| 4, |
| ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, |
| ::protozero::proto_utils::ProtoSchemaType::kMessage, |
| EnumDescriptorProto, |
| DescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_EnumType kEnumType() { return {}; } |
| template <typename T = EnumDescriptorProto> T* add_enum_type() { |
| return BeginNestedMessage<T>(4); |
| } |
| |
| |
| using FieldMetadata_OneofDecl = |
| ::protozero::proto_utils::FieldMetadata< |
| 8, |
| ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, |
| ::protozero::proto_utils::ProtoSchemaType::kMessage, |
| OneofDescriptorProto, |
| DescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_OneofDecl kOneofDecl() { return {}; } |
| template <typename T = OneofDescriptorProto> T* add_oneof_decl() { |
| return BeginNestedMessage<T>(8); |
| } |
| |
| |
| using FieldMetadata_ReservedRange = |
| ::protozero::proto_utils::FieldMetadata< |
| 9, |
| ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, |
| ::protozero::proto_utils::ProtoSchemaType::kMessage, |
| DescriptorProto_ReservedRange, |
| DescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_ReservedRange kReservedRange() { return {}; } |
| template <typename T = DescriptorProto_ReservedRange> T* add_reserved_range() { |
| return BeginNestedMessage<T>(9); |
| } |
| |
| |
| using FieldMetadata_ReservedName = |
| ::protozero::proto_utils::FieldMetadata< |
| 10, |
| ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, |
| ::protozero::proto_utils::ProtoSchemaType::kString, |
| std::string, |
| DescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_ReservedName kReservedName() { return {}; } |
| void add_reserved_name(const char* data, size_t size) { |
| AppendBytes(FieldMetadata_ReservedName::kFieldId, data, size); |
| } |
| void add_reserved_name(std::string value) { |
| static constexpr uint32_t field_id = FieldMetadata_ReservedName::kFieldId; |
| // Call the appropriate protozero::Message::Append(field_id, ...) |
| // method based on the type of the field. |
| ::protozero::internal::FieldWriter< |
| ::protozero::proto_utils::ProtoSchemaType::kString> |
| ::Append(*this, field_id, value); |
| } |
| }; |
| |
| class DescriptorProto_ReservedRange_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> { |
| public: |
| DescriptorProto_ReservedRange_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {} |
| explicit DescriptorProto_ReservedRange_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {} |
| explicit DescriptorProto_ReservedRange_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {} |
| bool has_start() const { return at<1>().valid(); } |
| int32_t start() const { return at<1>().as_int32(); } |
| bool has_end() const { return at<2>().valid(); } |
| int32_t end() const { return at<2>().as_int32(); } |
| }; |
| |
| class DescriptorProto_ReservedRange : public ::protozero::Message { |
| public: |
| using Decoder = DescriptorProto_ReservedRange_Decoder; |
| enum : int32_t { |
| kStartFieldNumber = 1, |
| kEndFieldNumber = 2, |
| }; |
| |
| using FieldMetadata_Start = |
| ::protozero::proto_utils::FieldMetadata< |
| 1, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kInt32, |
| int32_t, |
| DescriptorProto_ReservedRange>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_Start kStart() { return {}; } |
| void set_start(int32_t value) { |
| static constexpr uint32_t field_id = FieldMetadata_Start::kFieldId; |
| // Call the appropriate protozero::Message::Append(field_id, ...) |
| // method based on the type of the field. |
| ::protozero::internal::FieldWriter< |
| ::protozero::proto_utils::ProtoSchemaType::kInt32> |
| ::Append(*this, field_id, value); |
| } |
| |
| using FieldMetadata_End = |
| ::protozero::proto_utils::FieldMetadata< |
| 2, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kInt32, |
| int32_t, |
| DescriptorProto_ReservedRange>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_End kEnd() { return {}; } |
| void set_end(int32_t value) { |
| static constexpr uint32_t field_id = FieldMetadata_End::kFieldId; |
| // Call the appropriate protozero::Message::Append(field_id, ...) |
| // method based on the type of the field. |
| ::protozero::internal::FieldWriter< |
| ::protozero::proto_utils::ProtoSchemaType::kInt32> |
| ::Append(*this, field_id, value); |
| } |
| }; |
| |
| class FileDescriptorProto_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/11, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> { |
| public: |
| FileDescriptorProto_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {} |
| explicit FileDescriptorProto_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {} |
| explicit FileDescriptorProto_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {} |
| bool has_name() const { return at<1>().valid(); } |
| ::protozero::ConstChars name() const { return at<1>().as_string(); } |
| bool has_package() const { return at<2>().valid(); } |
| ::protozero::ConstChars package() const { return at<2>().as_string(); } |
| bool has_dependency() const { return at<3>().valid(); } |
| ::protozero::RepeatedFieldIterator<::protozero::ConstChars> dependency() const { return GetRepeated<::protozero::ConstChars>(3); } |
| bool has_public_dependency() const { return at<10>().valid(); } |
| ::protozero::RepeatedFieldIterator<int32_t> public_dependency() const { return GetRepeated<int32_t>(10); } |
| bool has_weak_dependency() const { return at<11>().valid(); } |
| ::protozero::RepeatedFieldIterator<int32_t> weak_dependency() const { return GetRepeated<int32_t>(11); } |
| bool has_message_type() const { return at<4>().valid(); } |
| ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> message_type() const { return GetRepeated<::protozero::ConstBytes>(4); } |
| bool has_enum_type() const { return at<5>().valid(); } |
| ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> enum_type() const { return GetRepeated<::protozero::ConstBytes>(5); } |
| bool has_extension() const { return at<7>().valid(); } |
| ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> extension() const { return GetRepeated<::protozero::ConstBytes>(7); } |
| }; |
| |
| class FileDescriptorProto : public ::protozero::Message { |
| public: |
| using Decoder = FileDescriptorProto_Decoder; |
| enum : int32_t { |
| kNameFieldNumber = 1, |
| kPackageFieldNumber = 2, |
| kDependencyFieldNumber = 3, |
| kPublicDependencyFieldNumber = 10, |
| kWeakDependencyFieldNumber = 11, |
| kMessageTypeFieldNumber = 4, |
| kEnumTypeFieldNumber = 5, |
| kExtensionFieldNumber = 7, |
| }; |
| |
| using FieldMetadata_Name = |
| ::protozero::proto_utils::FieldMetadata< |
| 1, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kString, |
| std::string, |
| FileDescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_Name kName() { return {}; } |
| void set_name(const char* data, size_t size) { |
| AppendBytes(FieldMetadata_Name::kFieldId, data, size); |
| } |
| void set_name(std::string value) { |
| static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId; |
| // Call the appropriate protozero::Message::Append(field_id, ...) |
| // method based on the type of the field. |
| ::protozero::internal::FieldWriter< |
| ::protozero::proto_utils::ProtoSchemaType::kString> |
| ::Append(*this, field_id, value); |
| } |
| |
| using FieldMetadata_Package = |
| ::protozero::proto_utils::FieldMetadata< |
| 2, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kString, |
| std::string, |
| FileDescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_Package kPackage() { return {}; } |
| void set_package(const char* data, size_t size) { |
| AppendBytes(FieldMetadata_Package::kFieldId, data, size); |
| } |
| void set_package(std::string value) { |
| static constexpr uint32_t field_id = FieldMetadata_Package::kFieldId; |
| // Call the appropriate protozero::Message::Append(field_id, ...) |
| // method based on the type of the field. |
| ::protozero::internal::FieldWriter< |
| ::protozero::proto_utils::ProtoSchemaType::kString> |
| ::Append(*this, field_id, value); |
| } |
| |
| using FieldMetadata_Dependency = |
| ::protozero::proto_utils::FieldMetadata< |
| 3, |
| ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, |
| ::protozero::proto_utils::ProtoSchemaType::kString, |
| std::string, |
| FileDescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_Dependency kDependency() { return {}; } |
| void add_dependency(const char* data, size_t size) { |
| AppendBytes(FieldMetadata_Dependency::kFieldId, data, size); |
| } |
| void add_dependency(std::string value) { |
| static constexpr uint32_t field_id = FieldMetadata_Dependency::kFieldId; |
| // Call the appropriate protozero::Message::Append(field_id, ...) |
| // method based on the type of the field. |
| ::protozero::internal::FieldWriter< |
| ::protozero::proto_utils::ProtoSchemaType::kString> |
| ::Append(*this, field_id, value); |
| } |
| |
| using FieldMetadata_PublicDependency = |
| ::protozero::proto_utils::FieldMetadata< |
| 10, |
| ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, |
| ::protozero::proto_utils::ProtoSchemaType::kInt32, |
| int32_t, |
| FileDescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_PublicDependency kPublicDependency() { return {}; } |
| void add_public_dependency(int32_t value) { |
| static constexpr uint32_t field_id = FieldMetadata_PublicDependency::kFieldId; |
| // Call the appropriate protozero::Message::Append(field_id, ...) |
| // method based on the type of the field. |
| ::protozero::internal::FieldWriter< |
| ::protozero::proto_utils::ProtoSchemaType::kInt32> |
| ::Append(*this, field_id, value); |
| } |
| |
| using FieldMetadata_WeakDependency = |
| ::protozero::proto_utils::FieldMetadata< |
| 11, |
| ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, |
| ::protozero::proto_utils::ProtoSchemaType::kInt32, |
| int32_t, |
| FileDescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_WeakDependency kWeakDependency() { return {}; } |
| void add_weak_dependency(int32_t value) { |
| static constexpr uint32_t field_id = FieldMetadata_WeakDependency::kFieldId; |
| // Call the appropriate protozero::Message::Append(field_id, ...) |
| // method based on the type of the field. |
| ::protozero::internal::FieldWriter< |
| ::protozero::proto_utils::ProtoSchemaType::kInt32> |
| ::Append(*this, field_id, value); |
| } |
| |
| using FieldMetadata_MessageType = |
| ::protozero::proto_utils::FieldMetadata< |
| 4, |
| ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, |
| ::protozero::proto_utils::ProtoSchemaType::kMessage, |
| DescriptorProto, |
| FileDescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_MessageType kMessageType() { return {}; } |
| template <typename T = DescriptorProto> T* add_message_type() { |
| return BeginNestedMessage<T>(4); |
| } |
| |
| |
| using FieldMetadata_EnumType = |
| ::protozero::proto_utils::FieldMetadata< |
| 5, |
| ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, |
| ::protozero::proto_utils::ProtoSchemaType::kMessage, |
| EnumDescriptorProto, |
| FileDescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_EnumType kEnumType() { return {}; } |
| template <typename T = EnumDescriptorProto> T* add_enum_type() { |
| return BeginNestedMessage<T>(5); |
| } |
| |
| |
| using FieldMetadata_Extension = |
| ::protozero::proto_utils::FieldMetadata< |
| 7, |
| ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, |
| ::protozero::proto_utils::ProtoSchemaType::kMessage, |
| FieldDescriptorProto, |
| FileDescriptorProto>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_Extension kExtension() { return {}; } |
| template <typename T = FieldDescriptorProto> T* add_extension() { |
| return BeginNestedMessage<T>(7); |
| } |
| |
| }; |
| |
| class FileDescriptorSet_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> { |
| public: |
| FileDescriptorSet_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {} |
| explicit FileDescriptorSet_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {} |
| explicit FileDescriptorSet_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {} |
| bool has_file() const { return at<1>().valid(); } |
| ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> file() const { return GetRepeated<::protozero::ConstBytes>(1); } |
| }; |
| |
| class FileDescriptorSet : public ::protozero::Message { |
| public: |
| using Decoder = FileDescriptorSet_Decoder; |
| enum : int32_t { |
| kFileFieldNumber = 1, |
| }; |
| |
| using FieldMetadata_File = |
| ::protozero::proto_utils::FieldMetadata< |
| 1, |
| ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, |
| ::protozero::proto_utils::ProtoSchemaType::kMessage, |
| FileDescriptorProto, |
| FileDescriptorSet>; |
| |
| // Ceci n'est pas une pipe. |
| // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>> |
| // type (and users are expected to use it as such, hence kCamelCase name). |
| // It is declared as a function to keep protozero bindings header-only as |
| // inline constexpr variables are not available until C++17 (while inline |
| // functions are). |
| // TODO(altimin): Use inline variable instead after adopting C++17. |
| static constexpr FieldMetadata_File kFile() { return {}; } |
| template <typename T = FileDescriptorProto> T* add_file() { |
| return BeginNestedMessage<T>(1); |
| } |
| |
| }; |
| |
| } // Namespace. |
| } // Namespace. |
| } // Namespace. |
| #endif // Include guard. |