blob: 8786324e4e6471142c1abb698865f5a208000007 [file] [log] [blame]
// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_PACKAGES_LIST_PROTO_H_
#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_PACKAGES_LIST_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 PackagesList_PackageInfo;
class PackagesList_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
public:
PackagesList_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
explicit PackagesList_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
explicit PackagesList_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
bool has_packages() const { return at<1>().valid(); }
::protozero::RepeatedFieldIterator<::protozero::ConstBytes> packages() const { return GetRepeated<::protozero::ConstBytes>(1); }
bool has_parse_error() const { return at<2>().valid(); }
bool parse_error() const { return at<2>().as_bool(); }
bool has_read_error() const { return at<3>().valid(); }
bool read_error() const { return at<3>().as_bool(); }
};
class PackagesList : public ::protozero::Message {
public:
using Decoder = PackagesList_Decoder;
enum : int32_t {
kPackagesFieldNumber = 1,
kParseErrorFieldNumber = 2,
kReadErrorFieldNumber = 3,
};
using PackageInfo = ::perfetto::protos::pbzero::PackagesList_PackageInfo;
using FieldMetadata_Packages =
::protozero::proto_utils::FieldMetadata<
1,
::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
::protozero::proto_utils::ProtoSchemaType::kMessage,
PackagesList_PackageInfo,
PackagesList>;
// 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_Packages kPackages() { return {}; }
template <typename T = PackagesList_PackageInfo> T* add_packages() {
return BeginNestedMessage<T>(1);
}
using FieldMetadata_ParseError =
::protozero::proto_utils::FieldMetadata<
2,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kBool,
bool,
PackagesList>;
// 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_ParseError kParseError() { return {}; }
void set_parse_error(bool value) {
static constexpr uint32_t field_id = FieldMetadata_ParseError::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);
}
using FieldMetadata_ReadError =
::protozero::proto_utils::FieldMetadata<
3,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kBool,
bool,
PackagesList>;
// 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_ReadError kReadError() { return {}; }
void set_read_error(bool value) {
static constexpr uint32_t field_id = FieldMetadata_ReadError::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);
}
};
class PackagesList_PackageInfo_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
public:
PackagesList_PackageInfo_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
explicit PackagesList_PackageInfo_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
explicit PackagesList_PackageInfo_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
bool has_name() const { return at<1>().valid(); }
::protozero::ConstChars name() const { return at<1>().as_string(); }
bool has_uid() const { return at<2>().valid(); }
uint64_t uid() const { return at<2>().as_uint64(); }
bool has_debuggable() const { return at<3>().valid(); }
bool debuggable() const { return at<3>().as_bool(); }
bool has_profileable_from_shell() const { return at<4>().valid(); }
bool profileable_from_shell() const { return at<4>().as_bool(); }
bool has_version_code() const { return at<5>().valid(); }
int64_t version_code() const { return at<5>().as_int64(); }
};
class PackagesList_PackageInfo : public ::protozero::Message {
public:
using Decoder = PackagesList_PackageInfo_Decoder;
enum : int32_t {
kNameFieldNumber = 1,
kUidFieldNumber = 2,
kDebuggableFieldNumber = 3,
kProfileableFromShellFieldNumber = 4,
kVersionCodeFieldNumber = 5,
};
using FieldMetadata_Name =
::protozero::proto_utils::FieldMetadata<
1,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kString,
std::string,
PackagesList_PackageInfo>;
// 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_Name kName() { return {}; }
void set_name(const char* data, size_t size) {
AppendBytes(FieldMetadata_Name::kFieldId, data, size);
}
void set_name(std::string value) {
static constexpr uint32_t field_id = FieldMetadata_Name::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_Uid =
::protozero::proto_utils::FieldMetadata<
2,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kUint64,
uint64_t,
PackagesList_PackageInfo>;
// 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_Uid kUid() { return {}; }
void set_uid(uint64_t value) {
static constexpr uint32_t field_id = FieldMetadata_Uid::kFieldId;
// Call the appropriate protozero::Message::Append(field_id, ...)
// method based on the type of the field.
::protozero::internal::FieldWriter<
::protozero::proto_utils::ProtoSchemaType::kUint64>
::Append(*this, field_id, value);
}
using FieldMetadata_Debuggable =
::protozero::proto_utils::FieldMetadata<
3,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kBool,
bool,
PackagesList_PackageInfo>;
// 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_Debuggable kDebuggable() { return {}; }
void set_debuggable(bool value) {
static constexpr uint32_t field_id = FieldMetadata_Debuggable::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);
}
using FieldMetadata_ProfileableFromShell =
::protozero::proto_utils::FieldMetadata<
4,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kBool,
bool,
PackagesList_PackageInfo>;
// 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_ProfileableFromShell kProfileableFromShell() { return {}; }
void set_profileable_from_shell(bool value) {
static constexpr uint32_t field_id = FieldMetadata_ProfileableFromShell::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);
}
using FieldMetadata_VersionCode =
::protozero::proto_utils::FieldMetadata<
5,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kInt64,
int64_t,
PackagesList_PackageInfo>;
// 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_VersionCode kVersionCode() { return {}; }
void set_version_code(int64_t value) {
static constexpr uint32_t field_id = FieldMetadata_VersionCode::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);
}
};
} // Namespace.
} // Namespace.
} // Namespace.
#endif // Include guard.