Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
trace.pbzero.h
Go to the documentation of this file.
1// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5// IMPORTANT: This file should only ever be modified by modifying the
6// corresponding .proto file and then running
7// `dart runtime/vm/protos/tools/compile_perfetto_protos.dart` from the SDK root
8// directory.
9// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
10
11#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACE_PROTO_H_
12#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACE_PROTO_H_
13
14#include <stddef.h>
15#include <stdint.h>
16
17#include "perfetto/protozero/field_writer.h"
18#include "perfetto/protozero/message.h"
19#include "perfetto/protozero/packed_repeated_fields.h"
20#include "perfetto/protozero/proto_decoder.h"
21#include "perfetto/protozero/proto_utils.h"
22
23namespace perfetto {
24namespace protos {
25namespace pbzero {
26
27class TracePacket;
28
29class Trace_Decoder : public ::protozero::TypedProtoDecoder<
30 /*MAX_FIELD_ID=*/1,
31 /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
32 public:
33 Trace_Decoder(const uint8_t* data, size_t len)
34 : TypedProtoDecoder(data, len) {}
35 explicit Trace_Decoder(const std::string& raw)
36 : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()),
37 raw.size()) {}
38 explicit Trace_Decoder(const ::protozero::ConstBytes& raw)
39 : TypedProtoDecoder(raw.data, raw.size) {}
40 bool has_packet() const { return at<1>().valid(); }
41 ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> packet() const {
42 return GetRepeated<::protozero::ConstBytes>(1);
43 }
44};
45
46class Trace : public ::protozero::Message {
47 public:
49 enum : int32_t {
51 };
52 static constexpr const char* GetName() { return ".perfetto.protos.Trace"; }
53
54 using FieldMetadata_Packet = ::protozero::proto_utils::FieldMetadata<
55 1,
56 ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
57 ::protozero::proto_utils::ProtoSchemaType::kMessage,
59 Trace>;
60
61 // Ceci n'est pas une pipe.
62 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
63 // type (and users are expected to use it as such, hence kCamelCase name).
64 // It is declared as a function to keep protozero bindings header-only as
65 // inline constexpr variables are not available until C++17 (while inline
66 // functions are).
67 // TODO(altimin): Use inline variable instead after adopting C++17.
68 static constexpr FieldMetadata_Packet kPacket() { return {}; }
69 template <typename T = TracePacket>
71 return BeginNestedMessage<T>(1);
72 }
73};
74
75} // namespace pbzero
76} // namespace protos
77} // namespace perfetto
78#endif // Include guard.
Trace_Decoder(const std::string &raw)
Trace_Decoder(const ::protozero::ConstBytes &raw)
Trace_Decoder(const uint8_t *data, size_t len)
::protozero::RepeatedFieldIterator<::protozero::ConstBytes > packet() const
::protozero::proto_utils::FieldMetadata< 1, ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, ::protozero::proto_utils::ProtoSchemaType::kMessage, TracePacket, Trace > FieldMetadata_Packet
static constexpr FieldMetadata_Packet kPacket()
static constexpr const char * GetName()
#define T