| // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT. |
| |
| #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TEST_EXTENSIONS_PROTO_H_ |
| #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TEST_EXTENSIONS_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" |
| #include "protos/perfetto/trace/track_event/track_event.pbzero.h" |
| |
| namespace perfetto { |
| namespace protos { |
| namespace pbzero { |
| class DebugAnnotation; |
| } // Namespace pbzero. |
| } // Namespace protos. |
| } // Namespace perfetto. |
| |
| namespace perfetto { |
| namespace protos { |
| namespace pbzero { |
| |
| class TestExtensionChild_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/99, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> { |
| public: |
| TestExtensionChild_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {} |
| explicit TestExtensionChild_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {} |
| explicit TestExtensionChild_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {} |
| bool has_child_field_for_testing() const { return at<1>().valid(); } |
| ::protozero::ConstChars child_field_for_testing() const { return at<1>().as_string(); } |
| bool has_debug_annotations() const { return at<99>().valid(); } |
| ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> debug_annotations() const { return GetRepeated<::protozero::ConstBytes>(99); } |
| }; |
| |
| class TestExtensionChild : public ::protozero::Message { |
| public: |
| using Decoder = TestExtensionChild_Decoder; |
| enum : int32_t { |
| kChildFieldForTestingFieldNumber = 1, |
| kDebugAnnotationsFieldNumber = 99, |
| }; |
| static constexpr const char* GetName() { return ".perfetto.protos.TestExtensionChild"; } |
| |
| |
| using FieldMetadata_ChildFieldForTesting = |
| ::protozero::proto_utils::FieldMetadata< |
| 1, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kString, |
| std::string, |
| TestExtensionChild>; |
| |
| static constexpr FieldMetadata_ChildFieldForTesting kChildFieldForTesting{}; |
| void set_child_field_for_testing(const char* data, size_t size) { |
| AppendBytes(FieldMetadata_ChildFieldForTesting::kFieldId, data, size); |
| } |
| void set_child_field_for_testing(::protozero::ConstChars chars) { |
| AppendBytes(FieldMetadata_ChildFieldForTesting::kFieldId, chars.data, chars.size); |
| } |
| void set_child_field_for_testing(std::string value) { |
| static constexpr uint32_t field_id = FieldMetadata_ChildFieldForTesting::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_DebugAnnotations = |
| ::protozero::proto_utils::FieldMetadata< |
| 99, |
| ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, |
| ::protozero::proto_utils::ProtoSchemaType::kMessage, |
| DebugAnnotation, |
| TestExtensionChild>; |
| |
| static constexpr FieldMetadata_DebugAnnotations kDebugAnnotations{}; |
| template <typename T = DebugAnnotation> T* add_debug_annotations() { |
| return BeginNestedMessage<T>(99); |
| } |
| |
| }; |
| |
| class TestExtension : public ::perfetto::protos::pbzero::TrackEvent { |
| public: |
| |
| using FieldMetadata_StringExtensionForTesting = |
| ::protozero::proto_utils::FieldMetadata< |
| 9900, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kString, |
| std::string, |
| TestExtension>; |
| |
| static constexpr FieldMetadata_StringExtensionForTesting kStringExtensionForTesting{}; |
| void set_string_extension_for_testing(const char* data, size_t size) { |
| AppendBytes(FieldMetadata_StringExtensionForTesting::kFieldId, data, size); |
| } |
| void set_string_extension_for_testing(::protozero::ConstChars chars) { |
| AppendBytes(FieldMetadata_StringExtensionForTesting::kFieldId, chars.data, chars.size); |
| } |
| void set_string_extension_for_testing(std::string value) { |
| static constexpr uint32_t field_id = FieldMetadata_StringExtensionForTesting::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_StringExtensionForTesting2 = |
| ::protozero::proto_utils::FieldMetadata< |
| 9905, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kString, |
| std::string, |
| TestExtension>; |
| |
| static constexpr FieldMetadata_StringExtensionForTesting2 kStringExtensionForTesting2{}; |
| void set_string_extension_for_testing2(const char* data, size_t size) { |
| AppendBytes(FieldMetadata_StringExtensionForTesting2::kFieldId, data, size); |
| } |
| void set_string_extension_for_testing2(::protozero::ConstChars chars) { |
| AppendBytes(FieldMetadata_StringExtensionForTesting2::kFieldId, chars.data, chars.size); |
| } |
| void set_string_extension_for_testing2(std::string value) { |
| static constexpr uint32_t field_id = FieldMetadata_StringExtensionForTesting2::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_IntExtensionForTesting = |
| ::protozero::proto_utils::FieldMetadata< |
| 9901, |
| ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, |
| ::protozero::proto_utils::ProtoSchemaType::kInt32, |
| int32_t, |
| TestExtension>; |
| |
| static constexpr FieldMetadata_IntExtensionForTesting kIntExtensionForTesting{}; |
| void add_int_extension_for_testing(int32_t value) { |
| static constexpr uint32_t field_id = FieldMetadata_IntExtensionForTesting::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_OmittedExtensionForTesting = |
| ::protozero::proto_utils::FieldMetadata< |
| 9902, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kString, |
| std::string, |
| TestExtension>; |
| |
| static constexpr FieldMetadata_OmittedExtensionForTesting kOmittedExtensionForTesting{}; |
| void set_omitted_extension_for_testing(const char* data, size_t size) { |
| AppendBytes(FieldMetadata_OmittedExtensionForTesting::kFieldId, data, size); |
| } |
| void set_omitted_extension_for_testing(::protozero::ConstChars chars) { |
| AppendBytes(FieldMetadata_OmittedExtensionForTesting::kFieldId, chars.data, chars.size); |
| } |
| void set_omitted_extension_for_testing(std::string value) { |
| static constexpr uint32_t field_id = FieldMetadata_OmittedExtensionForTesting::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_NestedMessageExtensionForTesting = |
| ::protozero::proto_utils::FieldMetadata< |
| 9903, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kMessage, |
| TestExtensionChild, |
| TestExtension>; |
| |
| static constexpr FieldMetadata_NestedMessageExtensionForTesting kNestedMessageExtensionForTesting{}; |
| template <typename T = TestExtensionChild> T* set_nested_message_extension_for_testing() { |
| return BeginNestedMessage<T>(9903); |
| } |
| |
| |
| using FieldMetadata_UintExtensionForTesting = |
| ::protozero::proto_utils::FieldMetadata< |
| 9904, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kUint32, |
| uint32_t, |
| TestExtension>; |
| |
| static constexpr FieldMetadata_UintExtensionForTesting kUintExtensionForTesting{}; |
| void set_uint_extension_for_testing(uint32_t value) { |
| static constexpr uint32_t field_id = FieldMetadata_UintExtensionForTesting::kFieldId; |
| // Call the appropriate protozero::Message::Append(field_id, ...) |
| // method based on the type of the field. |
| ::protozero::internal::FieldWriter< |
| ::protozero::proto_utils::ProtoSchemaType::kUint32> |
| ::Append(*this, field_id, value); |
| } |
| }; |
| } // Namespace. |
| } // Namespace. |
| } // Namespace. |
| #endif // Include guard. |