// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.

#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_GPU_GPU_LOG_PROTO_H_
#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_GPU_GPU_LOG_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 {
namespace perfetto_pbzero_enum_GpuLog {
enum Severity : int32_t;
}  // namespace perfetto_pbzero_enum_GpuLog
using GpuLog_Severity = perfetto_pbzero_enum_GpuLog::Severity;
} // Namespace pbzero.
} // Namespace protos.
} // Namespace perfetto.

namespace perfetto {
namespace protos {
namespace pbzero {

namespace perfetto_pbzero_enum_GpuLog {
enum Severity : int32_t {
  LOG_SEVERITY_UNSPECIFIED = 0,
  LOG_SEVERITY_VERBOSE = 1,
  LOG_SEVERITY_DEBUG = 2,
  LOG_SEVERITY_INFO = 3,
  LOG_SEVERITY_WARNING = 4,
  LOG_SEVERITY_ERROR = 5,
};
} // namespace perfetto_pbzero_enum_GpuLog
using GpuLog_Severity = perfetto_pbzero_enum_GpuLog::Severity;


constexpr GpuLog_Severity GpuLog_Severity_MIN = GpuLog_Severity::LOG_SEVERITY_UNSPECIFIED;
constexpr GpuLog_Severity GpuLog_Severity_MAX = GpuLog_Severity::LOG_SEVERITY_ERROR;


PERFETTO_PROTOZERO_CONSTEXPR14_OR_INLINE
const char* GpuLog_Severity_Name(::perfetto::protos::pbzero::GpuLog_Severity value) {
  switch (value) {
  case ::perfetto::protos::pbzero::GpuLog_Severity::LOG_SEVERITY_UNSPECIFIED:
    return "LOG_SEVERITY_UNSPECIFIED";

  case ::perfetto::protos::pbzero::GpuLog_Severity::LOG_SEVERITY_VERBOSE:
    return "LOG_SEVERITY_VERBOSE";

  case ::perfetto::protos::pbzero::GpuLog_Severity::LOG_SEVERITY_DEBUG:
    return "LOG_SEVERITY_DEBUG";

  case ::perfetto::protos::pbzero::GpuLog_Severity::LOG_SEVERITY_INFO:
    return "LOG_SEVERITY_INFO";

  case ::perfetto::protos::pbzero::GpuLog_Severity::LOG_SEVERITY_WARNING:
    return "LOG_SEVERITY_WARNING";

  case ::perfetto::protos::pbzero::GpuLog_Severity::LOG_SEVERITY_ERROR:
    return "LOG_SEVERITY_ERROR";
  }
  return "PBZERO_UNKNOWN_ENUM_VALUE";
}

class GpuLog_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
 public:
  GpuLog_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
  explicit GpuLog_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
  explicit GpuLog_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
  bool has_severity() const { return at<1>().valid(); }
  int32_t severity() const { return at<1>().as_int32(); }
  bool has_tag() const { return at<2>().valid(); }
  ::protozero::ConstChars tag() const { return at<2>().as_string(); }
  bool has_log_message() const { return at<3>().valid(); }
  ::protozero::ConstChars log_message() const { return at<3>().as_string(); }
};

class GpuLog : public ::protozero::Message {
 public:
  using Decoder = GpuLog_Decoder;
  enum : int32_t {
    kSeverityFieldNumber = 1,
    kTagFieldNumber = 2,
    kLogMessageFieldNumber = 3,
  };
  static constexpr const char* GetName() { return ".perfetto.protos.GpuLog"; }


  using Severity = ::perfetto::protos::pbzero::GpuLog_Severity;
  static inline const char* Severity_Name(Severity value) {
    return ::perfetto::protos::pbzero::GpuLog_Severity_Name(value);
  }
  static inline const Severity LOG_SEVERITY_UNSPECIFIED = Severity::LOG_SEVERITY_UNSPECIFIED;
  static inline const Severity LOG_SEVERITY_VERBOSE = Severity::LOG_SEVERITY_VERBOSE;
  static inline const Severity LOG_SEVERITY_DEBUG = Severity::LOG_SEVERITY_DEBUG;
  static inline const Severity LOG_SEVERITY_INFO = Severity::LOG_SEVERITY_INFO;
  static inline const Severity LOG_SEVERITY_WARNING = Severity::LOG_SEVERITY_WARNING;
  static inline const Severity LOG_SEVERITY_ERROR = Severity::LOG_SEVERITY_ERROR;

  using FieldMetadata_Severity =
    ::protozero::proto_utils::FieldMetadata<
      1,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kEnum,
      GpuLog_Severity,
      GpuLog>;

  static constexpr FieldMetadata_Severity kSeverity{};
  void set_severity(GpuLog_Severity value) {
    static constexpr uint32_t field_id = FieldMetadata_Severity::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_Tag =
    ::protozero::proto_utils::FieldMetadata<
      2,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kString,
      std::string,
      GpuLog>;

  static constexpr FieldMetadata_Tag kTag{};
  void set_tag(const char* data, size_t size) {
    AppendBytes(FieldMetadata_Tag::kFieldId, data, size);
  }
  void set_tag(::protozero::ConstChars chars) {
    AppendBytes(FieldMetadata_Tag::kFieldId, chars.data, chars.size);
  }
  void set_tag(std::string value) {
    static constexpr uint32_t field_id = FieldMetadata_Tag::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_LogMessage =
    ::protozero::proto_utils::FieldMetadata<
      3,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kString,
      std::string,
      GpuLog>;

  static constexpr FieldMetadata_LogMessage kLogMessage{};
  void set_log_message(const char* data, size_t size) {
    AppendBytes(FieldMetadata_LogMessage::kFieldId, data, size);
  }
  void set_log_message(::protozero::ConstChars chars) {
    AppendBytes(FieldMetadata_LogMessage::kFieldId, chars.data, chars.size);
  }
  void set_log_message(std::string value) {
    static constexpr uint32_t field_id = FieldMetadata_LogMessage::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.
