blob: 9b0f17a199ce8f6d364ae3f571409db334e308eb [file] [log] [blame]
// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_CHROME_CHROME_BENCHMARK_METADATA_PROTO_H_
#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_CHROME_CHROME_BENCHMARK_METADATA_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 ChromeBenchmarkMetadata_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/9, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
public:
ChromeBenchmarkMetadata_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
explicit ChromeBenchmarkMetadata_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
explicit ChromeBenchmarkMetadata_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
bool has_benchmark_start_time_us() const { return at<1>().valid(); }
int64_t benchmark_start_time_us() const { return at<1>().as_int64(); }
bool has_story_run_time_us() const { return at<2>().valid(); }
int64_t story_run_time_us() const { return at<2>().as_int64(); }
bool has_benchmark_name() const { return at<3>().valid(); }
::protozero::ConstChars benchmark_name() const { return at<3>().as_string(); }
bool has_benchmark_description() const { return at<4>().valid(); }
::protozero::ConstChars benchmark_description() const { return at<4>().as_string(); }
bool has_label() const { return at<5>().valid(); }
::protozero::ConstChars label() const { return at<5>().as_string(); }
bool has_story_name() const { return at<6>().valid(); }
::protozero::ConstChars story_name() const { return at<6>().as_string(); }
bool has_story_tags() const { return at<7>().valid(); }
::protozero::RepeatedFieldIterator<::protozero::ConstChars> story_tags() const { return GetRepeated<::protozero::ConstChars>(7); }
bool has_story_run_index() const { return at<8>().valid(); }
int32_t story_run_index() const { return at<8>().as_int32(); }
bool has_had_failures() const { return at<9>().valid(); }
bool had_failures() const { return at<9>().as_bool(); }
};
class ChromeBenchmarkMetadata : public ::protozero::Message {
public:
using Decoder = ChromeBenchmarkMetadata_Decoder;
enum : int32_t {
kBenchmarkStartTimeUsFieldNumber = 1,
kStoryRunTimeUsFieldNumber = 2,
kBenchmarkNameFieldNumber = 3,
kBenchmarkDescriptionFieldNumber = 4,
kLabelFieldNumber = 5,
kStoryNameFieldNumber = 6,
kStoryTagsFieldNumber = 7,
kStoryRunIndexFieldNumber = 8,
kHadFailuresFieldNumber = 9,
};
using FieldMetadata_BenchmarkStartTimeUs =
::protozero::proto_utils::FieldMetadata<
1,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kInt64,
int64_t,
ChromeBenchmarkMetadata>;
// 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_BenchmarkStartTimeUs kBenchmarkStartTimeUs() { return {}; }
void set_benchmark_start_time_us(int64_t value) {
static constexpr uint32_t field_id = FieldMetadata_BenchmarkStartTimeUs::kFieldId;
// Call the appropriate protozero::Message::Append(field_id, ...)
// method based on the type of the field.
::protozero::internal::FieldWriter<
::protozero::proto_utils::ProtoSchemaType::kInt64>
::Append(*this, field_id, value);
}
using FieldMetadata_StoryRunTimeUs =
::protozero::proto_utils::FieldMetadata<
2,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kInt64,
int64_t,
ChromeBenchmarkMetadata>;
// 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_StoryRunTimeUs kStoryRunTimeUs() { return {}; }
void set_story_run_time_us(int64_t value) {
static constexpr uint32_t field_id = FieldMetadata_StoryRunTimeUs::kFieldId;
// Call the appropriate protozero::Message::Append(field_id, ...)
// method based on the type of the field.
::protozero::internal::FieldWriter<
::protozero::proto_utils::ProtoSchemaType::kInt64>
::Append(*this, field_id, value);
}
using FieldMetadata_BenchmarkName =
::protozero::proto_utils::FieldMetadata<
3,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kString,
std::string,
ChromeBenchmarkMetadata>;
// 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_BenchmarkName kBenchmarkName() { return {}; }
void set_benchmark_name(const char* data, size_t size) {
AppendBytes(FieldMetadata_BenchmarkName::kFieldId, data, size);
}
void set_benchmark_name(std::string value) {
static constexpr uint32_t field_id = FieldMetadata_BenchmarkName::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_BenchmarkDescription =
::protozero::proto_utils::FieldMetadata<
4,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kString,
std::string,
ChromeBenchmarkMetadata>;
// 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_BenchmarkDescription kBenchmarkDescription() { return {}; }
void set_benchmark_description(const char* data, size_t size) {
AppendBytes(FieldMetadata_BenchmarkDescription::kFieldId, data, size);
}
void set_benchmark_description(std::string value) {
static constexpr uint32_t field_id = FieldMetadata_BenchmarkDescription::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_Label =
::protozero::proto_utils::FieldMetadata<
5,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kString,
std::string,
ChromeBenchmarkMetadata>;
// 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(const char* data, size_t size) {
AppendBytes(FieldMetadata_Label::kFieldId, data, size);
}
void set_label(std::string 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::kString>
::Append(*this, field_id, value);
}
using FieldMetadata_StoryName =
::protozero::proto_utils::FieldMetadata<
6,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kString,
std::string,
ChromeBenchmarkMetadata>;
// 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_StoryName kStoryName() { return {}; }
void set_story_name(const char* data, size_t size) {
AppendBytes(FieldMetadata_StoryName::kFieldId, data, size);
}
void set_story_name(std::string value) {
static constexpr uint32_t field_id = FieldMetadata_StoryName::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_StoryTags =
::protozero::proto_utils::FieldMetadata<
7,
::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
::protozero::proto_utils::ProtoSchemaType::kString,
std::string,
ChromeBenchmarkMetadata>;
// 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_StoryTags kStoryTags() { return {}; }
void add_story_tags(const char* data, size_t size) {
AppendBytes(FieldMetadata_StoryTags::kFieldId, data, size);
}
void add_story_tags(std::string value) {
static constexpr uint32_t field_id = FieldMetadata_StoryTags::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_StoryRunIndex =
::protozero::proto_utils::FieldMetadata<
8,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kInt32,
int32_t,
ChromeBenchmarkMetadata>;
// 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_StoryRunIndex kStoryRunIndex() { return {}; }
void set_story_run_index(int32_t value) {
static constexpr uint32_t field_id = FieldMetadata_StoryRunIndex::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_HadFailures =
::protozero::proto_utils::FieldMetadata<
9,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kBool,
bool,
ChromeBenchmarkMetadata>;
// 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_HadFailures kHadFailures() { return {}; }
void set_had_failures(bool value) {
static constexpr uint32_t field_id = FieldMetadata_HadFailures::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);
}
};
} // Namespace.
} // Namespace.
} // Namespace.
#endif // Include guard.