blob: cc49322b434ce2943a23b0cff6def7802587e55b [file] [log] [blame]
// WARNING: This file is machine generated by fidlgen.
#pragma once
#include <fidl/test.vectors/cpp/common_types.h>
#include <fidl/test.vectors/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__
namespace test_vectors {
class ExampleUseOfVectors;
extern "C" const fidl_type_t test_vectors_ExampleUseOfVectorsTable;
class ExampleUseOfVectors {
private:
struct Storage_;
public:
ExampleUseOfVectors(Storage_ storage) noexcept
: storage_(std::move(storage)) {}
ExampleUseOfVectors(
::std::vector<uint8_t> vector_of_uint8,
::std::vector<::std::vector<bool>> vector_of_vector_of_bool) noexcept
: storage_({.vector_of_uint8 = std::move(vector_of_uint8),
.vector_of_vector_of_bool =
std::move(vector_of_vector_of_bool)}) {}
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdefaulted-function-deleted"
// Default constructs a |ExampleUseOfVectors| only if all of its members are
// default constructible.
ExampleUseOfVectors() = default;
#pragma clang diagnostic pop
ExampleUseOfVectors(ExampleUseOfVectors&&) noexcept = default;
ExampleUseOfVectors& operator=(ExampleUseOfVectors&&) noexcept = default;
ExampleUseOfVectors(const ExampleUseOfVectors& other) noexcept
: ExampleUseOfVectors(other.CloneStorage_()) {}
ExampleUseOfVectors& operator=(const ExampleUseOfVectors& other) noexcept {
storage_ = other.CloneStorage_();
return *this;
}
bool operator==(const ExampleUseOfVectors& other) const noexcept {
return ::fidl::internal::NaturalStructCodingTraits<
::test_vectors::ExampleUseOfVectors, 32>::Equal(this, &other);
}
bool operator!=(const ExampleUseOfVectors& other) const noexcept {
return !::fidl::internal::NaturalStructCodingTraits<
::test_vectors::ExampleUseOfVectors, 32>::Equal(this, &other);
}
const ::std::vector<uint8_t>& vector_of_uint8() const {
return storage_.vector_of_uint8;
}
::std::vector<uint8_t>& vector_of_uint8() { return storage_.vector_of_uint8; }
const ::std::vector<::std::vector<bool>>& vector_of_vector_of_bool() const {
return storage_.vector_of_vector_of_bool;
}
::std::vector<::std::vector<bool>>& vector_of_vector_of_bool() {
return storage_.vector_of_vector_of_bool;
}
ExampleUseOfVectors(
::fidl::internal::DefaultConstructPossiblyInvalidObjectTag)
: ExampleUseOfVectors(Storage_{
.vector_of_uint8 = {},
.vector_of_vector_of_bool = {},
}) {}
private:
struct Storage_ final {
::std::vector<uint8_t> vector_of_uint8;
::std::vector<::std::vector<bool>> vector_of_vector_of_bool;
};
Storage_ storage_;
Storage_ CloneStorage_() const;
friend struct ::fidl::internal::NaturalStructCodingTraits<
::test_vectors::ExampleUseOfVectors, 32>;
friend struct ::fidl::internal::MemberVisitor<
::test_vectors::ExampleUseOfVectors>;
static constexpr auto kMembers = std::make_tuple(
::fidl::internal::NaturalStructMember<
Storage_, ::std::vector<uint8_t>,
fidl::internal::NaturalCodingConstraintVector<
fidl::internal::NaturalCodingConstraintEmpty>>{
&Storage_::vector_of_uint8, 0},
::fidl::internal::NaturalStructMember<
Storage_, ::std::vector<::std::vector<bool>>,
fidl::internal::NaturalCodingConstraintVector<
fidl::internal::NaturalCodingConstraintVector<
fidl::internal::NaturalCodingConstraintEmpty>>>{
&Storage_::vector_of_vector_of_bool, 16});
static constexpr auto kPadding = std::make_tuple();
};
} // namespace test_vectors
namespace fidl {
extern "C" const fidl_type_t test_vectors_ExampleUseOfVectorsTable;
template <>
struct IsFidlType<::test_vectors::ExampleUseOfVectors> : public std::true_type {
};
template <>
struct ::fidl::internal::TypeTraits<::test_vectors::ExampleUseOfVectors> final {
public:
static constexpr const fidl_type_t* kCodingTable =
&test_vectors_ExampleUseOfVectorsTable;
};
template <>
struct internal::NaturalCodingTraits<
::test_vectors::ExampleUseOfVectors,
::fidl::internal::NaturalCodingConstraintEmpty>
final : public ::fidl::internal::NaturalStructCodingTraits<
::test_vectors::ExampleUseOfVectors, 32> {};
} // namespace fidl