blob: 7e7965f84a9b33b5ae351d4883445647f341d259 [file] [log] [blame]
// WARNING: This file is machine generated by fidlgen.
// fidl_experiment = output_index_json
#pragma once
#include <fidl/test.byteandbytes/cpp/common_types.h>
#include <fidl/test.byteandbytes/cpp/markers.h>
#include <lib/fidl/cpp/natural_coding_traits.h>
#include <lib/fidl/cpp/natural_types.h>
#include <cinttypes>
#include <string>
#ifdef __Fuchsia__
#endif // __Fuchsia__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wshadow"
namespace test_byteandbytes {
class ByteAndBytes;
class ByteAndBytes {
private:
struct Storage_;
public:
ByteAndBytes(Storage_ storage) noexcept;
ByteAndBytes(uint8_t single_byte) noexcept;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdefaulted-function-deleted"
// Default constructs a |ByteAndBytes| only if all of its members are default constructible.
ByteAndBytes() = default;
#pragma clang diagnostic pop
ByteAndBytes(ByteAndBytes&&) noexcept = default;
ByteAndBytes& operator=(ByteAndBytes&&) noexcept = default;
ByteAndBytes(const ByteAndBytes& other) noexcept;
ByteAndBytes& operator=(const ByteAndBytes& other) noexcept;
bool operator==(const ByteAndBytes& other) const noexcept {
return ::fidl::internal::NaturalStructCodingTraits<::test_byteandbytes::ByteAndBytes, 1>::Equal(this, &other);
}
bool operator!=(const ByteAndBytes& other) const noexcept {
return !::fidl::internal::NaturalStructCodingTraits<::test_byteandbytes::ByteAndBytes, 1>::Equal(this, &other);
}
uint8_t
single_byte() const {
return storage_.single_byte;
}
uint8_t& single_byte() {
return storage_.single_byte;
}
// Setter for single_byte.
//
ByteAndBytes& single_byte(uint8_t value);
ByteAndBytes(::fidl::internal::DefaultConstructPossiblyInvalidObjectTag);
private:
struct Storage_ final {
uint8_t single_byte = {};
};
Storage_ storage_;
Storage_ CloneStorage_() const;
friend struct ::fidl::internal::NaturalStructCodingTraits<::test_byteandbytes::ByteAndBytes, 1>;
friend struct ::fidl::internal::MemberVisitor<::test_byteandbytes::ByteAndBytes>;
static constexpr auto kMembers = std::make_tuple(::fidl::internal::NaturalStructMember<Storage_, uint8_t, fidl::internal::NaturalCodingConstraintEmpty>{
&Storage_::single_byte, 0});
static constexpr auto kPadding = std::make_tuple();
};
inline ByteAndBytes::ByteAndBytes(Storage_ storage) noexcept : storage_(std::move(storage)) {}
inline ByteAndBytes::ByteAndBytes(uint8_t single_byte) noexcept
: storage_({.single_byte = std::move(single_byte)}) {}
inline ByteAndBytes::ByteAndBytes(const ::test_byteandbytes::ByteAndBytes& other) noexcept : ::test_byteandbytes::ByteAndBytes(other.CloneStorage_()) {}
inline ByteAndBytes& ::test_byteandbytes::ByteAndBytes::operator=(const ::test_byteandbytes::ByteAndBytes & other) noexcept {
storage_ = other.CloneStorage_();
return *this;
}
inline ByteAndBytes::ByteAndBytes(::fidl::internal::DefaultConstructPossiblyInvalidObjectTag) : ByteAndBytes(Storage_{
.single_byte = {},
}) {}
inline ByteAndBytes& ByteAndBytes::single_byte(uint8_t value) {
storage_.single_byte = std::move(value);
return *this;
}
} // namespace test_byteandbytes
namespace fidl {
template <>
struct IsFidlType<::test_byteandbytes::ByteAndBytes> : public std::true_type {};
template <>
struct TypeTraits<::test_byteandbytes::ByteAndBytes> {
static constexpr uint32_t kMaxNumHandles = 0;
static constexpr uint32_t kMaxDepth = 0;
static constexpr uint32_t kPrimarySize = 1;
static constexpr uint32_t kMaxOutOfLine = 0;
static constexpr bool kHasPointer = false;
};
template <>
struct IsStruct<::test_byteandbytes::ByteAndBytes> : public std::true_type {};
template <>
struct internal::NaturalCodingTraits<::test_byteandbytes::ByteAndBytes, ::fidl::internal::NaturalCodingConstraintEmpty> final
: public ::fidl::internal::NaturalStructCodingTraits<::test_byteandbytes::ByteAndBytes, 1> {};
#pragma clang diagnostic pop
} // namespace fidl