blob: 2703aa8c3c81f2a0c29525ad4ea179ed8626ddd5 [file] [log] [blame]
// WARNING: This file is machine generated by fidlgen.
// fidl_experiment = output_index_json
#pragma once
#include <fidl/test.aliases/cpp/common_types.h>
#include <fidl/test.aliases/cpp/markers.h>
#include <lib/fidl/cpp/natural_coding_traits.h>
#include <lib/fidl/cpp/natural_types.h>
#include <cinttypes>
#include <string>
#ifdef __Fuchsia__
#include <lib/zx/channel.h>
#endif // __Fuchsia__
#include <fidl/test.someotherlibrary/cpp/natural_types.h>
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wshadow"
namespace test_aliases {
class ExampleOfUseOfAliases;
using U32 = uint32_t;
using VecOfStrings = ::std::vector<::std::string>;
using VecOfStringsAtMost5 = ::std::vector<::std::string>;
#ifdef __Fuchsia__
using Channel = ::zx::channel;
#endif // __Fuchsia__
#ifdef __Fuchsia__
using AliasOfChannel = ::zx::channel;
#endif // __Fuchsia__
using ReferenceMe = ::test_someotherlibrary::ReferenceMe;
#ifdef __Fuchsia__
class ExampleOfUseOfAliases {
private:
struct Storage_;
public:
ExampleOfUseOfAliases(Storage_ storage) noexcept;
ExampleOfUseOfAliases(uint32_t field_of_u32, ::std::vector<::std::string> field_of_vec_of_strings, ::std::vector<::std::string> field_of_vec_of_strings_at_most_nine, ::std::vector<::std::string> field_of_vec_of_strings_at_most_5, ::std::vector<::test_someotherlibrary::ReferenceMe> field_of_vec_of_ref_me_at_most_5, ::zx::channel field_of_channel, ::zx::channel field_of_client_end, ::zx::channel field_of_nullable_client_end) noexcept;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdefaulted-function-deleted"
// Default constructs a |ExampleOfUseOfAliases| only if all of its members are default constructible.
ExampleOfUseOfAliases() = default;
#pragma clang diagnostic pop
ExampleOfUseOfAliases(ExampleOfUseOfAliases&&) noexcept = default;
ExampleOfUseOfAliases& operator=(ExampleOfUseOfAliases&&) noexcept = default;
uint32_t
field_of_u32() const {
return storage_.field_of_u32;
}
uint32_t& field_of_u32() {
return storage_.field_of_u32;
}
// Setter for field_of_u32.
//
ExampleOfUseOfAliases& field_of_u32(uint32_t value);
const ::std::vector<::std::string>&
field_of_vec_of_strings() const {
return storage_.field_of_vec_of_strings;
}
::std::vector<::std::string>& field_of_vec_of_strings() {
return storage_.field_of_vec_of_strings;
}
// Setter for field_of_vec_of_strings.
//
ExampleOfUseOfAliases& field_of_vec_of_strings(::std::vector<::std::string> value);
const ::std::vector<::std::string>&
field_of_vec_of_strings_at_most_nine() const {
return storage_.field_of_vec_of_strings_at_most_nine;
}
::std::vector<::std::string>& field_of_vec_of_strings_at_most_nine() {
return storage_.field_of_vec_of_strings_at_most_nine;
}
// Setter for field_of_vec_of_strings_at_most_nine.
//
ExampleOfUseOfAliases& field_of_vec_of_strings_at_most_nine(::std::vector<::std::string> value);
const ::std::vector<::std::string>&
field_of_vec_of_strings_at_most_5() const {
return storage_.field_of_vec_of_strings_at_most_5;
}
::std::vector<::std::string>& field_of_vec_of_strings_at_most_5() {
return storage_.field_of_vec_of_strings_at_most_5;
}
// Setter for field_of_vec_of_strings_at_most_5.
//
ExampleOfUseOfAliases& field_of_vec_of_strings_at_most_5(::std::vector<::std::string> value);
const ::std::vector<::test_someotherlibrary::ReferenceMe>&
field_of_vec_of_ref_me_at_most_5() const {
return storage_.field_of_vec_of_ref_me_at_most_5;
}
::std::vector<::test_someotherlibrary::ReferenceMe>& field_of_vec_of_ref_me_at_most_5() {
return storage_.field_of_vec_of_ref_me_at_most_5;
}
// Setter for field_of_vec_of_ref_me_at_most_5.
//
ExampleOfUseOfAliases& field_of_vec_of_ref_me_at_most_5(::std::vector<::test_someotherlibrary::ReferenceMe> value);
const ::zx::channel&
field_of_channel() const {
return storage_.field_of_channel;
}
::zx::channel& field_of_channel() {
return storage_.field_of_channel;
}
// Setter for field_of_channel.
//
ExampleOfUseOfAliases& field_of_channel(::zx::channel value);
const ::zx::channel&
field_of_client_end() const {
return storage_.field_of_client_end;
}
::zx::channel& field_of_client_end() {
return storage_.field_of_client_end;
}
// Setter for field_of_client_end.
//
ExampleOfUseOfAliases& field_of_client_end(::zx::channel value);
const ::zx::channel&
field_of_nullable_client_end() const {
return storage_.field_of_nullable_client_end;
}
::zx::channel& field_of_nullable_client_end() {
return storage_.field_of_nullable_client_end;
}
// Setter for field_of_nullable_client_end.
//
ExampleOfUseOfAliases& field_of_nullable_client_end(::zx::channel value);
ExampleOfUseOfAliases(::fidl::internal::DefaultConstructPossiblyInvalidObjectTag);
private:
struct Storage_ final {
uint32_t field_of_u32 = {};
::std::vector<::std::string> field_of_vec_of_strings;
::std::vector<::std::string> field_of_vec_of_strings_at_most_nine;
::std::vector<::std::string> field_of_vec_of_strings_at_most_5;
::std::vector<::test_someotherlibrary::ReferenceMe> field_of_vec_of_ref_me_at_most_5;
::zx::channel field_of_channel;
::zx::channel field_of_client_end;
::zx::channel field_of_nullable_client_end;
};
Storage_ storage_;
friend struct ::fidl::internal::NaturalStructCodingTraits<::test_aliases::ExampleOfUseOfAliases, 88>;
friend struct ::fidl::internal::MemberVisitor<::test_aliases::ExampleOfUseOfAliases>;
static constexpr auto kMembers = std::make_tuple(::fidl::internal::NaturalStructMember<Storage_, uint32_t, fidl::internal::NaturalCodingConstraintEmpty>{
&Storage_::field_of_u32, 0},
::fidl::internal::NaturalStructMember<Storage_, ::std::vector<::std::string>, fidl::internal::NaturalCodingConstraintVector<fidl::internal::NaturalCodingConstraintString<>>>{&Storage_::field_of_vec_of_strings, 8}, ::fidl::internal::NaturalStructMember<Storage_, ::std::vector<::std::string>, fidl::internal::NaturalCodingConstraintVector<fidl::internal::NaturalCodingConstraintString<>, 9>>{&Storage_::field_of_vec_of_strings_at_most_nine, 24}, ::fidl::internal::NaturalStructMember<Storage_, ::std::vector<::std::string>, fidl::internal::NaturalCodingConstraintVector<fidl::internal::NaturalCodingConstraintString<>, 5>>{&Storage_::field_of_vec_of_strings_at_most_5, 40}, ::fidl::internal::NaturalStructMember<Storage_, ::std::vector<::test_someotherlibrary::ReferenceMe>, fidl::internal::NaturalCodingConstraintVector<fidl::internal::NaturalCodingConstraintEmpty, 5>>{&Storage_::field_of_vec_of_ref_me_at_most_5, 56}, ::fidl::internal::NaturalStructMember<Storage_, ::zx::channel, fidl::internal::NaturalCodingConstraintHandle<ZX_OBJ_TYPE_CHANNEL, 0x80000000, false>>{&Storage_::field_of_channel, 72}, ::fidl::internal::NaturalStructMember<Storage_, ::zx::channel, fidl::internal::NaturalCodingConstraintHandle<ZX_OBJ_TYPE_CHANNEL, 0x80000000, false>>{&Storage_::field_of_client_end, 76}, ::fidl::internal::NaturalStructMember<Storage_, ::zx::channel, fidl::internal::NaturalCodingConstraintHandle<ZX_OBJ_TYPE_CHANNEL, 0x80000000, true>>{&Storage_::field_of_nullable_client_end, 80});
static constexpr auto kPadding = std::make_tuple(::fidl::internal::NaturalStructPadding<uint64_t>{
.offset = 0,
.mask = 0xffffffff00000000,
},
::fidl::internal::NaturalStructPadding<uint64_t>{
.offset = 80,
.mask = 0xffffffff00000000,
});
};
#endif // __Fuchsia__
#ifdef __Fuchsia__
inline ExampleOfUseOfAliases::ExampleOfUseOfAliases(Storage_ storage) noexcept : storage_(std::move(storage)) {}
inline ExampleOfUseOfAliases::ExampleOfUseOfAliases(uint32_t field_of_u32, ::std::vector<::std::string> field_of_vec_of_strings, ::std::vector<::std::string> field_of_vec_of_strings_at_most_nine, ::std::vector<::std::string> field_of_vec_of_strings_at_most_5, ::std::vector<::test_someotherlibrary::ReferenceMe> field_of_vec_of_ref_me_at_most_5, ::zx::channel field_of_channel, ::zx::channel field_of_client_end, ::zx::channel field_of_nullable_client_end) noexcept
: storage_({.field_of_u32 = std::move(field_of_u32),
.field_of_vec_of_strings = std::move(field_of_vec_of_strings),
.field_of_vec_of_strings_at_most_nine = std::move(field_of_vec_of_strings_at_most_nine),
.field_of_vec_of_strings_at_most_5 = std::move(field_of_vec_of_strings_at_most_5),
.field_of_vec_of_ref_me_at_most_5 = std::move(field_of_vec_of_ref_me_at_most_5),
.field_of_channel = std::move(field_of_channel),
.field_of_client_end = std::move(field_of_client_end),
.field_of_nullable_client_end = std::move(field_of_nullable_client_end)}) {}
inline ExampleOfUseOfAliases::ExampleOfUseOfAliases(::fidl::internal::DefaultConstructPossiblyInvalidObjectTag) : ExampleOfUseOfAliases(Storage_{
.field_of_u32 = {},
.field_of_vec_of_strings = {},
.field_of_vec_of_strings_at_most_nine = {},
.field_of_vec_of_strings_at_most_5 = {},
.field_of_vec_of_ref_me_at_most_5 = {},
.field_of_channel = {},
.field_of_client_end = {},
.field_of_nullable_client_end = {},
}) {}
inline ExampleOfUseOfAliases& ExampleOfUseOfAliases::field_of_u32(uint32_t value) {
storage_.field_of_u32 = std::move(value);
return *this;
}
inline ExampleOfUseOfAliases& ExampleOfUseOfAliases::field_of_vec_of_strings(::std::vector<::std::string> value) {
storage_.field_of_vec_of_strings = std::move(value);
return *this;
}
inline ExampleOfUseOfAliases& ExampleOfUseOfAliases::field_of_vec_of_strings_at_most_nine(::std::vector<::std::string> value) {
storage_.field_of_vec_of_strings_at_most_nine = std::move(value);
return *this;
}
inline ExampleOfUseOfAliases& ExampleOfUseOfAliases::field_of_vec_of_strings_at_most_5(::std::vector<::std::string> value) {
storage_.field_of_vec_of_strings_at_most_5 = std::move(value);
return *this;
}
inline ExampleOfUseOfAliases& ExampleOfUseOfAliases::field_of_vec_of_ref_me_at_most_5(::std::vector<::test_someotherlibrary::ReferenceMe> value) {
storage_.field_of_vec_of_ref_me_at_most_5 = std::move(value);
return *this;
}
inline ExampleOfUseOfAliases& ExampleOfUseOfAliases::field_of_channel(::zx::channel value) {
storage_.field_of_channel = std::move(value);
return *this;
}
inline ExampleOfUseOfAliases& ExampleOfUseOfAliases::field_of_client_end(::zx::channel value) {
storage_.field_of_client_end = std::move(value);
return *this;
}
inline ExampleOfUseOfAliases& ExampleOfUseOfAliases::field_of_nullable_client_end(::zx::channel value) {
storage_.field_of_nullable_client_end = std::move(value);
return *this;
}
#endif // __Fuchsia__
} // namespace test_aliases
namespace fidl {
#ifdef __Fuchsia__
template <>
struct IsResource<::test_aliases::ExampleOfUseOfAliases> : public std::true_type {};
template <>
struct IsFidlType<::test_aliases::ExampleOfUseOfAliases> : public std::true_type {};
template <>
struct TypeTraits<::test_aliases::ExampleOfUseOfAliases> {
static constexpr uint32_t kMaxNumHandles = 3;
static constexpr uint32_t kMaxDepth = 2;
static constexpr uint32_t kPrimarySize = 88;
static constexpr uint32_t kMaxOutOfLine = 4294967295;
static constexpr bool kHasPointer = true;
};
template <>
struct IsStruct<::test_aliases::ExampleOfUseOfAliases> : public std::true_type {};
template <>
struct internal::NaturalCodingTraits<::test_aliases::ExampleOfUseOfAliases, ::fidl::internal::NaturalCodingConstraintEmpty> final
: public ::fidl::internal::NaturalStructCodingTraits<::test_aliases::ExampleOfUseOfAliases, 88> {};
#endif // __Fuchsia__
template <>
struct internal::NaturalCodingTraits<::test_aliases::ObjType, ::fidl::internal::NaturalCodingConstraintEmpty> {
static constexpr size_t kInlineSize = sizeof(uint32_t);
static constexpr bool kIsMemcpyCompatible = false;
static void Encode(internal::NaturalEncoder* encoder, ::test_aliases::ObjType* value, size_t offset, size_t recursion_depth) {
switch (*value) {
case ::test_aliases::ObjType::kNone:
case ::test_aliases::ObjType::kChannel:
break;
default:
encoder->SetError(::fidl::internal::kCodingErrorUnknownEnumValue);
return;
}
*encoder->template GetPtr<::test_aliases::ObjType>(offset) = *value;
}
static void Decode(internal::NaturalDecoder* decoder, ::test_aliases::ObjType* value, size_t offset, size_t recursion_depth) {
*value = *decoder->template GetPtr<::test_aliases::ObjType>(offset);
switch (*value) {
case ::test_aliases::ObjType::kNone:
case ::test_aliases::ObjType::kChannel:
break;
default:
decoder->SetError(::fidl::internal::kCodingErrorUnknownEnumValue);
return;
}
}
};
#pragma clang diagnostic pop
} // namespace fidl