| // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT. |
| |
| #ifndef PERFETTO_PROTOS_CLOCK_SNAPSHOT_PROTO_H_ |
| #define PERFETTO_PROTOS_CLOCK_SNAPSHOT_PROTO_H_ |
| |
| #include <stddef.h> |
| #include <stdint.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 ClockSnapshot_Clock; |
| enum BuiltinClock : int32_t; |
| |
| enum ClockSnapshot_Clock_BuiltinClocks : int32_t { |
| ClockSnapshot_Clock_BuiltinClocks_UNKNOWN = 0, |
| ClockSnapshot_Clock_BuiltinClocks_REALTIME = 1, |
| ClockSnapshot_Clock_BuiltinClocks_REALTIME_COARSE = 2, |
| ClockSnapshot_Clock_BuiltinClocks_MONOTONIC = 3, |
| ClockSnapshot_Clock_BuiltinClocks_MONOTONIC_COARSE = 4, |
| ClockSnapshot_Clock_BuiltinClocks_MONOTONIC_RAW = 5, |
| ClockSnapshot_Clock_BuiltinClocks_BOOTTIME = 6, |
| ClockSnapshot_Clock_BuiltinClocks_BUILTIN_CLOCK_MAX_ID = 63, |
| }; |
| |
| const ClockSnapshot_Clock_BuiltinClocks ClockSnapshot_Clock_BuiltinClocks_MIN = ClockSnapshot_Clock_BuiltinClocks_UNKNOWN; |
| const ClockSnapshot_Clock_BuiltinClocks ClockSnapshot_Clock_BuiltinClocks_MAX = ClockSnapshot_Clock_BuiltinClocks_BUILTIN_CLOCK_MAX_ID; |
| |
| class ClockSnapshot_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> { |
| public: |
| ClockSnapshot_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {} |
| explicit ClockSnapshot_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {} |
| explicit ClockSnapshot_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {} |
| bool has_clocks() const { return at<1>().valid(); } |
| ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> clocks() const { return GetRepeated<::protozero::ConstBytes>(1); } |
| bool has_primary_trace_clock() const { return at<2>().valid(); } |
| int32_t primary_trace_clock() const { return at<2>().as_int32(); } |
| }; |
| |
| class ClockSnapshot : public ::protozero::Message { |
| public: |
| using Decoder = ClockSnapshot_Decoder; |
| enum : int32_t { |
| kClocksFieldNumber = 1, |
| kPrimaryTraceClockFieldNumber = 2, |
| }; |
| using Clock = ::perfetto::protos::pbzero::ClockSnapshot_Clock; |
| template <typename T = ClockSnapshot_Clock> T* add_clocks() { |
| return BeginNestedMessage<T>(1); |
| } |
| |
| void set_primary_trace_clock(::perfetto::protos::pbzero::BuiltinClock value) { |
| AppendTinyVarInt(2, value); |
| } |
| }; |
| |
| class ClockSnapshot_Clock_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> { |
| public: |
| ClockSnapshot_Clock_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {} |
| explicit ClockSnapshot_Clock_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {} |
| explicit ClockSnapshot_Clock_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {} |
| bool has_clock_id() const { return at<1>().valid(); } |
| uint32_t clock_id() const { return at<1>().as_uint32(); } |
| bool has_timestamp() const { return at<2>().valid(); } |
| uint64_t timestamp() const { return at<2>().as_uint64(); } |
| bool has_is_incremental() const { return at<3>().valid(); } |
| bool is_incremental() const { return at<3>().as_bool(); } |
| bool has_unit_multiplier_ns() const { return at<4>().valid(); } |
| uint64_t unit_multiplier_ns() const { return at<4>().as_uint64(); } |
| }; |
| |
| class ClockSnapshot_Clock : public ::protozero::Message { |
| public: |
| using Decoder = ClockSnapshot_Clock_Decoder; |
| enum : int32_t { |
| kClockIdFieldNumber = 1, |
| kTimestampFieldNumber = 2, |
| kIsIncrementalFieldNumber = 3, |
| kUnitMultiplierNsFieldNumber = 4, |
| }; |
| using BuiltinClocks = ::perfetto::protos::pbzero::ClockSnapshot_Clock_BuiltinClocks; |
| static const BuiltinClocks UNKNOWN = ClockSnapshot_Clock_BuiltinClocks_UNKNOWN; |
| static const BuiltinClocks REALTIME = ClockSnapshot_Clock_BuiltinClocks_REALTIME; |
| static const BuiltinClocks REALTIME_COARSE = ClockSnapshot_Clock_BuiltinClocks_REALTIME_COARSE; |
| static const BuiltinClocks MONOTONIC = ClockSnapshot_Clock_BuiltinClocks_MONOTONIC; |
| static const BuiltinClocks MONOTONIC_COARSE = ClockSnapshot_Clock_BuiltinClocks_MONOTONIC_COARSE; |
| static const BuiltinClocks MONOTONIC_RAW = ClockSnapshot_Clock_BuiltinClocks_MONOTONIC_RAW; |
| static const BuiltinClocks BOOTTIME = ClockSnapshot_Clock_BuiltinClocks_BOOTTIME; |
| static const BuiltinClocks BUILTIN_CLOCK_MAX_ID = ClockSnapshot_Clock_BuiltinClocks_BUILTIN_CLOCK_MAX_ID; |
| void set_clock_id(uint32_t value) { |
| AppendVarInt(1, value); |
| } |
| void set_timestamp(uint64_t value) { |
| AppendVarInt(2, value); |
| } |
| void set_is_incremental(bool value) { |
| AppendTinyVarInt(3, value); |
| } |
| void set_unit_multiplier_ns(uint64_t value) { |
| AppendVarInt(4, value); |
| } |
| }; |
| |
| } // Namespace. |
| } // Namespace. |
| } // Namespace. |
| #endif // Include guard. |