| // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT. |
| |
| #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_CHROME_CHROME_CONFIG_PROTO_H_ |
| #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_CHROME_CHROME_CONFIG_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 { |
| |
| enum ChromeConfig_ClientPriority : int32_t; |
| |
| enum ChromeConfig_ClientPriority : int32_t { |
| ChromeConfig_ClientPriority_UNKNOWN = 0, |
| ChromeConfig_ClientPriority_BACKGROUND = 1, |
| ChromeConfig_ClientPriority_USER_INITIATED = 2, |
| }; |
| |
| const ChromeConfig_ClientPriority ChromeConfig_ClientPriority_MIN = ChromeConfig_ClientPriority_UNKNOWN; |
| const ChromeConfig_ClientPriority ChromeConfig_ClientPriority_MAX = ChromeConfig_ClientPriority_USER_INITIATED; |
| |
| class ChromeConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> { |
| public: |
| ChromeConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {} |
| explicit ChromeConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {} |
| explicit ChromeConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {} |
| bool has_trace_config() const { return at<1>().valid(); } |
| ::protozero::ConstChars trace_config() const { return at<1>().as_string(); } |
| bool has_privacy_filtering_enabled() const { return at<2>().valid(); } |
| bool privacy_filtering_enabled() const { return at<2>().as_bool(); } |
| bool has_convert_to_legacy_json() const { return at<3>().valid(); } |
| bool convert_to_legacy_json() const { return at<3>().as_bool(); } |
| bool has_client_priority() const { return at<4>().valid(); } |
| int32_t client_priority() const { return at<4>().as_int32(); } |
| bool has_json_agent_label_filter() const { return at<5>().valid(); } |
| ::protozero::ConstChars json_agent_label_filter() const { return at<5>().as_string(); } |
| }; |
| |
| class ChromeConfig : public ::protozero::Message { |
| public: |
| using Decoder = ChromeConfig_Decoder; |
| enum : int32_t { |
| kTraceConfigFieldNumber = 1, |
| kPrivacyFilteringEnabledFieldNumber = 2, |
| kConvertToLegacyJsonFieldNumber = 3, |
| kClientPriorityFieldNumber = 4, |
| kJsonAgentLabelFilterFieldNumber = 5, |
| }; |
| using ClientPriority = ::perfetto::protos::pbzero::ChromeConfig_ClientPriority; |
| static const ClientPriority UNKNOWN = ChromeConfig_ClientPriority_UNKNOWN; |
| static const ClientPriority BACKGROUND = ChromeConfig_ClientPriority_BACKGROUND; |
| static const ClientPriority USER_INITIATED = ChromeConfig_ClientPriority_USER_INITIATED; |
| |
| using FieldMetadata_TraceConfig = |
| ::protozero::proto_utils::FieldMetadata< |
| 1, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kString, |
| std::string, |
| ChromeConfig>; |
| |
| // 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_TraceConfig kTraceConfig() { return {}; } |
| void set_trace_config(const char* data, size_t size) { |
| AppendBytes(FieldMetadata_TraceConfig::kFieldId, data, size); |
| } |
| void set_trace_config(std::string value) { |
| static constexpr uint32_t field_id = FieldMetadata_TraceConfig::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_PrivacyFilteringEnabled = |
| ::protozero::proto_utils::FieldMetadata< |
| 2, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kBool, |
| bool, |
| ChromeConfig>; |
| |
| // 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_PrivacyFilteringEnabled kPrivacyFilteringEnabled() { return {}; } |
| void set_privacy_filtering_enabled(bool value) { |
| static constexpr uint32_t field_id = FieldMetadata_PrivacyFilteringEnabled::kFieldId; |
| // Call the appropriate protozero::Message::Append(field_id, ...) |
| // method based on the type of the field. |
| ::protozero::internal::FieldWriter< |
| ::protozero::proto_utils::ProtoSchemaType::kBool> |
| ::Append(*this, field_id, value); |
| } |
| |
| using FieldMetadata_ConvertToLegacyJson = |
| ::protozero::proto_utils::FieldMetadata< |
| 3, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kBool, |
| bool, |
| ChromeConfig>; |
| |
| // 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_ConvertToLegacyJson kConvertToLegacyJson() { return {}; } |
| void set_convert_to_legacy_json(bool value) { |
| static constexpr uint32_t field_id = FieldMetadata_ConvertToLegacyJson::kFieldId; |
| // Call the appropriate protozero::Message::Append(field_id, ...) |
| // method based on the type of the field. |
| ::protozero::internal::FieldWriter< |
| ::protozero::proto_utils::ProtoSchemaType::kBool> |
| ::Append(*this, field_id, value); |
| } |
| |
| using FieldMetadata_ClientPriority = |
| ::protozero::proto_utils::FieldMetadata< |
| 4, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kEnum, |
| ::perfetto::protos::pbzero::ChromeConfig_ClientPriority, |
| ChromeConfig>; |
| |
| // 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_ClientPriority kClientPriority() { return {}; } |
| void set_client_priority(::perfetto::protos::pbzero::ChromeConfig_ClientPriority value) { |
| static constexpr uint32_t field_id = FieldMetadata_ClientPriority::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_JsonAgentLabelFilter = |
| ::protozero::proto_utils::FieldMetadata< |
| 5, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kString, |
| std::string, |
| ChromeConfig>; |
| |
| // 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_JsonAgentLabelFilter kJsonAgentLabelFilter() { return {}; } |
| void set_json_agent_label_filter(const char* data, size_t size) { |
| AppendBytes(FieldMetadata_JsonAgentLabelFilter::kFieldId, data, size); |
| } |
| void set_json_agent_label_filter(std::string value) { |
| static constexpr uint32_t field_id = FieldMetadata_JsonAgentLabelFilter::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); |
| } |
| }; |
| |
| } // Namespace. |
| } // Namespace. |
| } // Namespace. |
| #endif // Include guard. |