blob: c13fddb6e42da8057a37ada97123e01a22e01629 [file] [log] [blame]
// WARNING: This file is machine generated by fidlgen.
#pragma once
#include "lib/fidl/cpp/internal/header.h"
namespace example {
class ByteAndBytes;
class ByteAndBytes final {
public:
static const fidl_type_t* FidlType;
uint8_t single_byte{};
::std::vector<uint8_t> many_bytes{};
::std::vector<uint8_t> only_one_k_bytes{};
::fidl::VectorPtr<uint8_t> opt_only_one_k_bytes{};
static inline ::std::unique_ptr<ByteAndBytes> New() {
return ::std::make_unique<ByteAndBytes>();
}
void Encode(::fidl::Encoder* _encoder, size_t _offset);
static void Decode(::fidl::Decoder* _decoder, ByteAndBytes* value,
size_t _offset);
zx_status_t Clone(ByteAndBytes* result) const;
};
inline zx_status_t Clone(const ::example::ByteAndBytes& _value,
::example::ByteAndBytes* _result) {
return _value.Clone(_result);
}
using ByteAndBytesPtr = ::std::unique_ptr<ByteAndBytes>;
} // namespace example
namespace fidl {
template <>
struct CodingTraits<::example::ByteAndBytes>
: public EncodableCodingTraits<::example::ByteAndBytes, 56> {};
inline zx_status_t Clone(const ::example::ByteAndBytes& value,
::example::ByteAndBytes* result) {
return ::example::Clone(value, result);
}
template <>
struct Equality<::example::ByteAndBytes> {
bool operator()(const ::example::ByteAndBytes& _lhs,
const ::example::ByteAndBytes& _rhs) const {
if (!::fidl::Equals(_lhs.single_byte, _rhs.single_byte)) {
return false;
}
if (!::fidl::Equals(_lhs.many_bytes, _rhs.many_bytes)) {
return false;
}
if (!::fidl::Equals(_lhs.only_one_k_bytes, _rhs.only_one_k_bytes)) {
return false;
}
if (!::fidl::Equals(_lhs.opt_only_one_k_bytes, _rhs.opt_only_one_k_bytes)) {
return false;
}
return true;
}
};
} // namespace fidl