blob: f844fb8cb08e880983ff4a9b684b382b9b8b6846 [file] [log] [blame]
// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACE_PACKET_DEFAULTS_PROTO_H_
#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACE_PACKET_DEFAULTS_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 PerfSampleDefaults;
class TrackEventDefaults;
class TracePacketDefaults_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/58, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
public:
TracePacketDefaults_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
explicit TracePacketDefaults_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
explicit TracePacketDefaults_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
bool has_timestamp_clock_id() const { return at<58>().valid(); }
uint32_t timestamp_clock_id() const { return at<58>().as_uint32(); }
bool has_track_event_defaults() const { return at<11>().valid(); }
::protozero::ConstBytes track_event_defaults() const { return at<11>().as_bytes(); }
bool has_perf_sample_defaults() const { return at<12>().valid(); }
::protozero::ConstBytes perf_sample_defaults() const { return at<12>().as_bytes(); }
};
class TracePacketDefaults : public ::protozero::Message {
public:
using Decoder = TracePacketDefaults_Decoder;
enum : int32_t {
kTimestampClockIdFieldNumber = 58,
kTrackEventDefaultsFieldNumber = 11,
kPerfSampleDefaultsFieldNumber = 12,
};
using FieldMetadata_TimestampClockId =
::protozero::proto_utils::FieldMetadata<
58,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kUint32,
uint32_t,
TracePacketDefaults>;
// 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_TimestampClockId kTimestampClockId() { return {}; }
void set_timestamp_clock_id(uint32_t value) {
static constexpr uint32_t field_id = FieldMetadata_TimestampClockId::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);
}
using FieldMetadata_TrackEventDefaults =
::protozero::proto_utils::FieldMetadata<
11,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kMessage,
TrackEventDefaults,
TracePacketDefaults>;
// 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_TrackEventDefaults kTrackEventDefaults() { return {}; }
template <typename T = TrackEventDefaults> T* set_track_event_defaults() {
return BeginNestedMessage<T>(11);
}
using FieldMetadata_PerfSampleDefaults =
::protozero::proto_utils::FieldMetadata<
12,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kMessage,
PerfSampleDefaults,
TracePacketDefaults>;
// 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_PerfSampleDefaults kPerfSampleDefaults() { return {}; }
template <typename T = PerfSampleDefaults> T* set_perf_sample_defaults() {
return BeginNestedMessage<T>(12);
}
};
} // Namespace.
} // Namespace.
} // Namespace.
#endif // Include guard.