/** * Autogenerated by Thrift for thrift/compiler/test/fixtures/patch/src/module.thrift * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @nocommit */ #include #include "thrift/compiler/test/fixtures/patch/gen-cpp2/module_metadata.h" // some of these functions can be so large that the compiler gives up optimizing // them - and issues a warning which may be treated as an error! // // these functions are so rarely called that it is probably okay for them not to // be optimized in practice FOLLY_CLANG_DISABLE_WARNING("-Wignored-optimization-argument") namespace apache { namespace thrift { namespace detail { namespace md { using ThriftMetadata = ::apache::thrift::metadata::ThriftMetadata; using ThriftPrimitiveType = ::apache::thrift::metadata::ThriftPrimitiveType; using ThriftType = ::apache::thrift::metadata::ThriftType; using ThriftService = ::apache::thrift::metadata::ThriftService; using ThriftServiceContext = ::apache::thrift::metadata::ThriftServiceContext; using ThriftFunctionGenerator = void (*)(ThriftMetadata&, ThriftService&); void EnumMetadata<::test::fixtures::patch::MyEnum>::gen(ThriftMetadata& metadata) { auto res = metadata.enums()->emplace("module.MyEnum", ::apache::thrift::metadata::ThriftEnum{}); if (!res.second) { return; } ::apache::thrift::metadata::ThriftEnum& enum_metadata = res.first->second; enum_metadata.name() = "module.MyEnum"; using EnumTraits = TEnumTraits<::test::fixtures::patch::MyEnum>; for (std::size_t i = 0; i != EnumTraits::size; ++i) { enum_metadata.elements()->emplace(static_cast(EnumTraits::values[i]), EnumTraits::names[i]); } } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::MyData>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.MyData", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_MyData = res.first->second; module_MyData.name() = "module.MyData"; module_MyData.is_union() = false; static const auto* const module_MyData_fields = new std::array{ { { 1, "data1", false, std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::vector{ }}, { 2, "data2", false, std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE), std::vector{ }}, }}; for (const auto& f : *module_MyData_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_MyData.fields()->push_back(std::move(field)); } return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::MyDataWithCustomDefault>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.MyDataWithCustomDefault", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_MyDataWithCustomDefault = res.first->second; module_MyDataWithCustomDefault.name() = "module.MyDataWithCustomDefault"; module_MyDataWithCustomDefault.is_union() = false; static const auto* const module_MyDataWithCustomDefault_fields = new std::array{ { { 1, "data1", false, std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::vector{ }}, { 2, "data2", false, std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE), std::vector{ }}, }}; for (const auto& f : *module_MyDataWithCustomDefault_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_MyDataWithCustomDefault.fields()->push_back(std::move(field)); } return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::InnerUnion>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.InnerUnion", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_InnerUnion = res.first->second; module_InnerUnion.name() = "module.InnerUnion"; module_InnerUnion.is_union() = true; static const auto* const module_InnerUnion_fields = new std::array{ { { 1, "innerOption", false, std::make_unique(ThriftPrimitiveType::THRIFT_BINARY_TYPE), std::vector{ }}, }}; for (const auto& f : *module_InnerUnion_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_InnerUnion.fields()->push_back(std::move(field)); } return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::MyUnion>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.MyUnion", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_MyUnion = res.first->second; module_MyUnion.name() = "module.MyUnion"; module_MyUnion.is_union() = true; static const auto* const module_MyUnion_fields = new std::array{ { { 1, "option1", false, std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::vector{ }}, { 2, "option2", false, std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE), std::vector{ }}, { 3, "option3", false, std::make_unique>("module.InnerUnion"), std::vector{ }}, }}; for (const auto& f : *module_MyUnion_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_MyUnion.fields()->push_back(std::move(field)); } return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::MyStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.MyStruct", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_MyStruct = res.first->second; module_MyStruct.name() = "module.MyStruct"; module_MyStruct.is_union() = false; static const auto* const module_MyStruct_fields = new std::array{ { { -1, "boolVal", false, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{ }}, { -2, "byteVal", false, std::make_unique(ThriftPrimitiveType::THRIFT_BYTE_TYPE), std::vector{ }}, { -3, "i16Val", false, std::make_unique(ThriftPrimitiveType::THRIFT_I16_TYPE), std::vector{ }}, { -4, "i32Val", false, std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE), std::vector{ }}, { -5, "i64Val", false, std::make_unique(ThriftPrimitiveType::THRIFT_I64_TYPE), std::vector{ }}, { -6, "floatVal", false, std::make_unique(ThriftPrimitiveType::THRIFT_FLOAT_TYPE), std::vector{ }}, { -7, "doubleVal", false, std::make_unique(ThriftPrimitiveType::THRIFT_DOUBLE_TYPE), std::vector{ }}, { -8, "stringVal", false, std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::vector{ }}, { -9, "binaryVal", false, std::make_unique(ThriftPrimitiveType::THRIFT_BINARY_TYPE), std::vector{ *cvStruct("cpp.Type", { {"name", cvString("folly::IOBuf") } }).cv_struct_ref(), }}, { -10, "enumVal", false, std::make_unique>("module.MyEnum"), std::vector{ }}, { -11, "structVal", false, std::make_unique>("module.MyData"), std::vector{ }}, { -12, "unionVal", false, std::make_unique>("module.MyUnion"), std::vector{ }}, { -13, "lateStructVal", false, std::make_unique>("module.LateDefStruct"), std::vector{ }}, { -14, "optBoolVal", true, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{ }}, { -15, "optByteVal", true, std::make_unique(ThriftPrimitiveType::THRIFT_BYTE_TYPE), std::vector{ }}, { -16, "optI16Val", true, std::make_unique(ThriftPrimitiveType::THRIFT_I16_TYPE), std::vector{ }}, { -17, "optI32Val", true, std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE), std::vector{ }}, { -18, "optI64Val", true, std::make_unique(ThriftPrimitiveType::THRIFT_I64_TYPE), std::vector{ }}, { -19, "optFloatVal", true, std::make_unique(ThriftPrimitiveType::THRIFT_FLOAT_TYPE), std::vector{ }}, { -20, "optDoubleVal", true, std::make_unique(ThriftPrimitiveType::THRIFT_DOUBLE_TYPE), std::vector{ }}, { -21, "optStringVal", true, std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::vector{ }}, { -22, "optBinaryVal", true, std::make_unique(ThriftPrimitiveType::THRIFT_BINARY_TYPE), std::vector{ *cvStruct("cpp.Type", { {"name", cvString("folly::IOBuf") } }).cv_struct_ref(), }}, { -23, "optEnumVal", true, std::make_unique>("module.MyEnum"), std::vector{ }}, { -24, "optStructVal", true, std::make_unique>("module.MyData"), std::vector{ }}, { -25, "optLateStructVal", true, std::make_unique>("module.LateDefStruct"), std::vector{ }}, { -26, "optListVal", true, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I16_TYPE)), std::vector{ }}, { -27, "optSetVal", true, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE)), std::vector{ }}, { -28, "optMapVal", true, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE)), std::vector{ }}, { -29, "listMap", false, std::make_unique(std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE))), std::vector{ }}, { -30, "mapMap", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE))), std::vector{ }}, { -31, "i32WithCustomDefault", false, std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE), std::vector{ }}, { -32, "structWithCustomDefault", false, std::make_unique>("module.MyDataWithCustomDefault"), std::vector{ }}, { 1, "structWithFieldCustomDefault", false, std::make_unique>("module.MyData"), std::vector{ }}, }}; for (const auto& f : *module_MyStruct_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_MyStruct.fields()->push_back(std::move(field)); } return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::LateDefStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.LateDefStruct", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_LateDefStruct = res.first->second; module_LateDefStruct.name() = "module.LateDefStruct"; module_LateDefStruct.is_union() = false; return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::Recursive>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.Recursive", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_Recursive = res.first->second; module_Recursive.name() = "module.Recursive"; module_Recursive.is_union() = false; static const auto* const module_Recursive_fields = new std::array{ { { -1, "nodes", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique>("module.Recursive")), std::vector{ *cvStruct("patch.AssignOnlyPatch", { }).cv_struct_ref(), }}, }}; for (const auto& f : *module_Recursive_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_Recursive.fields()->push_back(std::move(field)); } return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::Bar>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.Bar", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_Bar = res.first->second; module_Bar.name() = "module.Bar"; module_Bar.is_union() = false; static const auto* const module_Bar_fields = new std::array{ { { -1, "loop", false, std::make_unique>("module.Loop"), std::vector{ *cvStruct("cpp.Ref", { {"type", cvInteger(0) } }).cv_struct_ref(), }}, }}; for (const auto& f : *module_Bar_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_Bar.fields()->push_back(std::move(field)); } return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::Loop>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.Loop", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_Loop = res.first->second; module_Loop.name() = "module.Loop"; module_Loop.is_union() = false; static const auto* const module_Loop_fields = new std::array{ { { -1, "bar", false, std::make_unique>("module.Bar"), std::vector{ *cvStruct("patch.AssignOnlyPatch", { }).cv_struct_ref(), }}, }}; for (const auto& f : *module_Loop_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_Loop.fields()->push_back(std::move(field)); } module_Loop.structured_annotations()->push_back(*cvStruct("patch.AssignOnlyPatch", { }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::RefFields>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.RefFields", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_RefFields = res.first->second; module_RefFields.name() = "module.RefFields"; module_RefFields.is_union() = false; static const auto* const module_RefFields_fields = new std::array{ { { 1, "unique", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE)), std::vector{ *cvStruct("cpp.Ref", { {"type", cvInteger(0) } }).cv_struct_ref(), }}, { 2, "shared_const", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE)), std::vector{ *cvStruct("cpp.Ref", { {"type", cvInteger(1) } }).cv_struct_ref(), }}, { 3, "shared_mustable", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE)), std::vector{ *cvStruct("cpp.Ref", { {"type", cvInteger(2) } }).cv_struct_ref(), }}, { 4, "opt_unique", true, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE)), std::vector{ *cvStruct("cpp.Ref", { {"type", cvInteger(0) } }).cv_struct_ref(), }}, { 5, "opt_shared_const", true, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE)), std::vector{ *cvStruct("cpp.Ref", { {"type", cvInteger(1) } }).cv_struct_ref(), }}, { 6, "opt_shared_mustable", true, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE)), std::vector{ *cvStruct("cpp.Ref", { {"type", cvInteger(2) } }).cv_struct_ref(), }}, { 7, "opt_box", true, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE)), std::vector{ *cvStruct("thrift.Box", { }).cv_struct_ref(), }}, }}; for (const auto& f : *module_RefFields_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_RefFields.fields()->push_back(std::move(field)); } return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::MyDataPatchStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.MyDataPatch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_MyDataPatch = res.first->second; module_MyDataPatch.name() = "module.MyDataPatch"; module_MyDataPatch.is_union() = false; static const auto* const module_MyDataPatch_fields = new std::array{ { { 1, "assign", true, std::make_unique>("module.MyData"), std::vector{ *cvStruct("thrift.Box", { }).cv_struct_ref(), }}, { 2, "clear", false, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{ }}, { 3, "patchPrior", false, std::make_unique>("module.MyDataFieldPatch"), std::vector{ }}, { 5, "ensure", false, std::make_unique>("module.MyDataEnsureStruct"), std::vector{ }}, { 6, "patch", false, std::make_unique>("module.MyDataFieldPatch"), std::vector{ }}, { 7, "remove", false, std::make_unique("patch.FieldIdList", std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I16_TYPE)), std::vector{ *cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::FieldIdListToSetAdapter") } }).cv_struct_ref(), }), std::vector{ }}, }}; for (const auto& f : *module_MyDataPatch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_MyDataPatch.fields()->push_back(std::move(field)); } module_MyDataPatch.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::StructPatchAdapter<::test::fixtures::patch::MyDataPatchStruct>") }, {"underlyingName", cvString("MyDataPatchStruct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::MyDataFieldPatchStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.MyDataFieldPatch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_MyDataFieldPatch = res.first->second; module_MyDataFieldPatch.name() = "module.MyDataFieldPatch"; module_MyDataFieldPatch.is_union() = false; static const auto* const module_MyDataFieldPatch_fields = new std::array{ { { 1, "data1", false, std::make_unique>("patch.StringPatch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { 2, "data2", false, std::make_unique>("patch.I32Patch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, }}; for (const auto& f : *module_MyDataFieldPatch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_MyDataFieldPatch.fields()->push_back(std::move(field)); } module_MyDataFieldPatch.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::MyDataFieldPatchStruct>") }, {"underlyingName", cvString("MyDataFieldPatchStruct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::MyDataEnsureStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.MyDataEnsureStruct", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_MyDataEnsureStruct = res.first->second; module_MyDataEnsureStruct.name() = "module.MyDataEnsureStruct"; module_MyDataEnsureStruct.is_union() = false; static const auto* const module_MyDataEnsureStruct_fields = new std::array{ { { 1, "data1", true, std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::vector{ }}, { 2, "data2", true, std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE), std::vector{ }}, }}; for (const auto& f : *module_MyDataEnsureStruct_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_MyDataEnsureStruct.fields()->push_back(std::move(field)); } module_MyDataEnsureStruct.structured_annotations()->push_back(*cvStruct("cpp.Frozen2Exclude", { }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::MyDataSafePatch>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.MyDataSafePatch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_MyDataSafePatch = res.first->second; module_MyDataSafePatch.name() = "module.MyDataSafePatch"; module_MyDataSafePatch.is_union() = false; static const auto* const module_MyDataSafePatch_fields = new std::array{ { { 1, "version", false, std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE), std::vector{ }}, { 2, "data", false, std::make_unique(ThriftPrimitiveType::THRIFT_BINARY_TYPE), std::vector{ }}, }}; for (const auto& f : *module_MyDataSafePatch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_MyDataSafePatch.fields()->push_back(std::move(field)); } module_MyDataSafePatch.structured_annotations()->push_back(*cvStruct("cpp.Frozen2Exclude", { }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::MyDataWithCustomDefaultPatchStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.MyDataWithCustomDefaultPatch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_MyDataWithCustomDefaultPatch = res.first->second; module_MyDataWithCustomDefaultPatch.name() = "module.MyDataWithCustomDefaultPatch"; module_MyDataWithCustomDefaultPatch.is_union() = false; static const auto* const module_MyDataWithCustomDefaultPatch_fields = new std::array{ { { 1, "assign", true, std::make_unique>("module.MyDataWithCustomDefault"), std::vector{ *cvStruct("thrift.Box", { }).cv_struct_ref(), }}, { 2, "clear", false, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{ }}, { 3, "patchPrior", false, std::make_unique>("module.MyDataWithCustomDefaultFieldPatch"), std::vector{ }}, { 5, "ensure", false, std::make_unique>("module.MyDataWithCustomDefaultEnsureStruct"), std::vector{ }}, { 6, "patch", false, std::make_unique>("module.MyDataWithCustomDefaultFieldPatch"), std::vector{ }}, { 7, "remove", false, std::make_unique("patch.FieldIdList", std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I16_TYPE)), std::vector{ *cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::FieldIdListToSetAdapter") } }).cv_struct_ref(), }), std::vector{ }}, }}; for (const auto& f : *module_MyDataWithCustomDefaultPatch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_MyDataWithCustomDefaultPatch.fields()->push_back(std::move(field)); } module_MyDataWithCustomDefaultPatch.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::StructPatchAdapter<::test::fixtures::patch::MyDataWithCustomDefaultPatchStruct>") }, {"underlyingName", cvString("MyDataWithCustomDefaultPatchStruct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::MyDataWithCustomDefaultFieldPatchStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.MyDataWithCustomDefaultFieldPatch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_MyDataWithCustomDefaultFieldPatch = res.first->second; module_MyDataWithCustomDefaultFieldPatch.name() = "module.MyDataWithCustomDefaultFieldPatch"; module_MyDataWithCustomDefaultFieldPatch.is_union() = false; static const auto* const module_MyDataWithCustomDefaultFieldPatch_fields = new std::array{ { { 1, "data1", false, std::make_unique>("patch.StringPatch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { 2, "data2", false, std::make_unique>("patch.I32Patch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, }}; for (const auto& f : *module_MyDataWithCustomDefaultFieldPatch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_MyDataWithCustomDefaultFieldPatch.fields()->push_back(std::move(field)); } module_MyDataWithCustomDefaultFieldPatch.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::MyDataWithCustomDefaultFieldPatchStruct>") }, {"underlyingName", cvString("MyDataWithCustomDefaultFieldPatchStruct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::MyDataWithCustomDefaultEnsureStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.MyDataWithCustomDefaultEnsureStruct", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_MyDataWithCustomDefaultEnsureStruct = res.first->second; module_MyDataWithCustomDefaultEnsureStruct.name() = "module.MyDataWithCustomDefaultEnsureStruct"; module_MyDataWithCustomDefaultEnsureStruct.is_union() = false; static const auto* const module_MyDataWithCustomDefaultEnsureStruct_fields = new std::array{ { { 1, "data1", true, std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::vector{ }}, { 2, "data2", true, std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE), std::vector{ }}, }}; for (const auto& f : *module_MyDataWithCustomDefaultEnsureStruct_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_MyDataWithCustomDefaultEnsureStruct.fields()->push_back(std::move(field)); } module_MyDataWithCustomDefaultEnsureStruct.structured_annotations()->push_back(*cvStruct("cpp.Frozen2Exclude", { }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::MyDataWithCustomDefaultSafePatch>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.MyDataWithCustomDefaultSafePatch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_MyDataWithCustomDefaultSafePatch = res.first->second; module_MyDataWithCustomDefaultSafePatch.name() = "module.MyDataWithCustomDefaultSafePatch"; module_MyDataWithCustomDefaultSafePatch.is_union() = false; static const auto* const module_MyDataWithCustomDefaultSafePatch_fields = new std::array{ { { 1, "version", false, std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE), std::vector{ }}, { 2, "data", false, std::make_unique(ThriftPrimitiveType::THRIFT_BINARY_TYPE), std::vector{ }}, }}; for (const auto& f : *module_MyDataWithCustomDefaultSafePatch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_MyDataWithCustomDefaultSafePatch.fields()->push_back(std::move(field)); } module_MyDataWithCustomDefaultSafePatch.structured_annotations()->push_back(*cvStruct("cpp.Frozen2Exclude", { }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::InnerUnionPatchStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.InnerUnionPatch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_InnerUnionPatch = res.first->second; module_InnerUnionPatch.name() = "module.InnerUnionPatch"; module_InnerUnionPatch.is_union() = false; static const auto* const module_InnerUnionPatch_fields = new std::array{ { { 1, "assign", true, std::make_unique>("module.InnerUnion"), std::vector{ *cvStruct("thrift.Box", { }).cv_struct_ref(), }}, { 2, "clear", false, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{ }}, { 3, "patchPrior", false, std::make_unique>("module.InnerUnionFieldPatch"), std::vector{ }}, { 4, "ensure", false, std::make_unique>("module.InnerUnion"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { 6, "patch", false, std::make_unique>("module.InnerUnionFieldPatch"), std::vector{ }}, }}; for (const auto& f : *module_InnerUnionPatch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_InnerUnionPatch.fields()->push_back(std::move(field)); } module_InnerUnionPatch.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::UnionPatchAdapter<::test::fixtures::patch::InnerUnionPatchStruct>") }, {"underlyingName", cvString("InnerUnionPatchStruct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::InnerUnionFieldPatchStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.InnerUnionFieldPatch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_InnerUnionFieldPatch = res.first->second; module_InnerUnionFieldPatch.name() = "module.InnerUnionFieldPatch"; module_InnerUnionFieldPatch.is_union() = false; static const auto* const module_InnerUnionFieldPatch_fields = new std::array{ { { 1, "innerOption", false, std::make_unique>("patch.BinaryPatch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, }}; for (const auto& f : *module_InnerUnionFieldPatch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_InnerUnionFieldPatch.fields()->push_back(std::move(field)); } module_InnerUnionFieldPatch.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::InnerUnionFieldPatchStruct>") }, {"underlyingName", cvString("InnerUnionFieldPatchStruct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::InnerUnionSafePatch>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.InnerUnionSafePatch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_InnerUnionSafePatch = res.first->second; module_InnerUnionSafePatch.name() = "module.InnerUnionSafePatch"; module_InnerUnionSafePatch.is_union() = false; static const auto* const module_InnerUnionSafePatch_fields = new std::array{ { { 1, "version", false, std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE), std::vector{ }}, { 2, "data", false, std::make_unique(ThriftPrimitiveType::THRIFT_BINARY_TYPE), std::vector{ }}, }}; for (const auto& f : *module_InnerUnionSafePatch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_InnerUnionSafePatch.fields()->push_back(std::move(field)); } module_InnerUnionSafePatch.structured_annotations()->push_back(*cvStruct("cpp.Frozen2Exclude", { }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::MyUnionPatchStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.MyUnionPatch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_MyUnionPatch = res.first->second; module_MyUnionPatch.name() = "module.MyUnionPatch"; module_MyUnionPatch.is_union() = false; static const auto* const module_MyUnionPatch_fields = new std::array{ { { 1, "assign", true, std::make_unique>("module.MyUnion"), std::vector{ *cvStruct("thrift.Box", { }).cv_struct_ref(), }}, { 2, "clear", false, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{ }}, { 3, "patchPrior", false, std::make_unique>("module.MyUnionFieldPatch"), std::vector{ }}, { 4, "ensure", false, std::make_unique>("module.MyUnion"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { 6, "patch", false, std::make_unique>("module.MyUnionFieldPatch"), std::vector{ }}, }}; for (const auto& f : *module_MyUnionPatch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_MyUnionPatch.fields()->push_back(std::move(field)); } module_MyUnionPatch.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::UnionPatchAdapter<::test::fixtures::patch::MyUnionPatchStruct>") }, {"underlyingName", cvString("MyUnionPatchStruct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::MyUnionFieldPatchStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.MyUnionFieldPatch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_MyUnionFieldPatch = res.first->second; module_MyUnionFieldPatch.name() = "module.MyUnionFieldPatch"; module_MyUnionFieldPatch.is_union() = false; static const auto* const module_MyUnionFieldPatch_fields = new std::array{ { { 1, "option1", false, std::make_unique>("patch.StringPatch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { 2, "option2", false, std::make_unique>("patch.I32Patch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { 3, "option3", false, std::make_unique>("module.InnerUnionPatch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, }}; for (const auto& f : *module_MyUnionFieldPatch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_MyUnionFieldPatch.fields()->push_back(std::move(field)); } module_MyUnionFieldPatch.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::MyUnionFieldPatchStruct>") }, {"underlyingName", cvString("MyUnionFieldPatchStruct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::MyUnionSafePatch>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.MyUnionSafePatch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_MyUnionSafePatch = res.first->second; module_MyUnionSafePatch.name() = "module.MyUnionSafePatch"; module_MyUnionSafePatch.is_union() = false; static const auto* const module_MyUnionSafePatch_fields = new std::array{ { { 1, "version", false, std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE), std::vector{ }}, { 2, "data", false, std::make_unique(ThriftPrimitiveType::THRIFT_BINARY_TYPE), std::vector{ }}, }}; for (const auto& f : *module_MyUnionSafePatch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_MyUnionSafePatch.fields()->push_back(std::move(field)); } module_MyUnionSafePatch.structured_annotations()->push_back(*cvStruct("cpp.Frozen2Exclude", { }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::MyStructPatchStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.MyStructPatch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_MyStructPatch = res.first->second; module_MyStructPatch.name() = "module.MyStructPatch"; module_MyStructPatch.is_union() = false; static const auto* const module_MyStructPatch_fields = new std::array{ { { 1, "assign", true, std::make_unique>("module.MyStruct"), std::vector{ *cvStruct("thrift.Box", { }).cv_struct_ref(), }}, { 2, "clear", false, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{ }}, { 3, "patchPrior", false, std::make_unique>("module.MyStructFieldPatch"), std::vector{ }}, { 5, "ensure", false, std::make_unique>("module.MyStructEnsureStruct"), std::vector{ }}, { 6, "patch", false, std::make_unique>("module.MyStructFieldPatch"), std::vector{ }}, { 7, "remove", false, std::make_unique("patch.FieldIdList", std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I16_TYPE)), std::vector{ *cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::FieldIdListToSetAdapter") } }).cv_struct_ref(), }), std::vector{ }}, }}; for (const auto& f : *module_MyStructPatch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_MyStructPatch.fields()->push_back(std::move(field)); } module_MyStructPatch.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::StructPatchAdapter<::test::fixtures::patch::MyStructPatchStruct>") }, {"underlyingName", cvString("MyStructPatchStruct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::MyStructField10PatchStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.MyStructField10Patch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_MyStructField10Patch = res.first->second; module_MyStructField10Patch.name() = "module.MyStructField10Patch"; module_MyStructField10Patch.is_union() = false; static const auto* const module_MyStructField10Patch_fields = new std::array{ { { 1, "assign", true, std::make_unique>("module.MyEnum"), std::vector{ }}, { 2, "clear", false, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{ }}, }}; for (const auto& f : *module_MyStructField10Patch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_MyStructField10Patch.fields()->push_back(std::move(field)); } module_MyStructField10Patch.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::AssignPatchAdapter<::test::fixtures::patch::MyStructField10PatchStruct>") }, {"underlyingName", cvString("MyStructField10PatchStruct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::MyStructField23PatchStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.MyStructField23Patch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_MyStructField23Patch = res.first->second; module_MyStructField23Patch.name() = "module.MyStructField23Patch"; module_MyStructField23Patch.is_union() = false; static const auto* const module_MyStructField23Patch_fields = new std::array{ { { 1, "assign", true, std::make_unique>("module.MyEnum"), std::vector{ }}, { 2, "clear", false, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{ }}, }}; for (const auto& f : *module_MyStructField23Patch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_MyStructField23Patch.fields()->push_back(std::move(field)); } module_MyStructField23Patch.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::AssignPatchAdapter<::test::fixtures::patch::MyStructField23PatchStruct>") }, {"underlyingName", cvString("MyStructField23PatchStruct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::MyStructField26PatchStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.MyStructField26Patch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_MyStructField26Patch = res.first->second; module_MyStructField26Patch.name() = "module.MyStructField26Patch"; module_MyStructField26Patch.is_union() = false; static const auto* const module_MyStructField26Patch_fields = new std::array{ { { 1, "assign", true, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I16_TYPE)), std::vector{ }}, { 2, "clear", false, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{ }}, { 8, "prepend", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I16_TYPE)), std::vector{ }}, { 9, "append", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I16_TYPE)), std::vector{ }}, }}; for (const auto& f : *module_MyStructField26Patch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_MyStructField26Patch.fields()->push_back(std::move(field)); } module_MyStructField26Patch.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::ListPatchAdapter<::test::fixtures::patch::MyStructField26PatchStruct>") }, {"underlyingName", cvString("MyStructField26PatchStruct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::MyStructField27PatchStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.MyStructField27Patch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_MyStructField27Patch = res.first->second; module_MyStructField27Patch.name() = "module.MyStructField27Patch"; module_MyStructField27Patch.is_union() = false; static const auto* const module_MyStructField27Patch_fields = new std::array{ { { 1, "assign", true, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE)), std::vector{ }}, { 2, "clear", false, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{ }}, { 7, "remove", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE)), std::vector{ }}, { 8, "add", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE)), std::vector{ }}, }}; for (const auto& f : *module_MyStructField27Patch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_MyStructField27Patch.fields()->push_back(std::move(field)); } module_MyStructField27Patch.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::SetPatchAdapter<::test::fixtures::patch::MyStructField27PatchStruct>") }, {"underlyingName", cvString("MyStructField27PatchStruct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::MyStructField28PatchStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.MyStructField28Patch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_MyStructField28Patch = res.first->second; module_MyStructField28Patch.name() = "module.MyStructField28Patch"; module_MyStructField28Patch.is_union() = false; static const auto* const module_MyStructField28Patch_fields = new std::array{ { { 1, "assign", true, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE)), std::vector{ }}, { 2, "clear", false, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{ }}, { 3, "patchPrior", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique>("patch.StringPatch")), std::vector{ }}, { 5, "add", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE)), std::vector{ }}, { 6, "patch", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique>("patch.StringPatch")), std::vector{ }}, { 7, "remove", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE)), std::vector{ }}, { 9, "put", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE)), std::vector{ }}, }}; for (const auto& f : *module_MyStructField28Patch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_MyStructField28Patch.fields()->push_back(std::move(field)); } module_MyStructField28Patch.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::MapPatchAdapter<::test::fixtures::patch::MyStructField28PatchStruct>") }, {"underlyingName", cvString("MyStructField28PatchStruct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::MyStructField29PatchStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.MyStructField29Patch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_MyStructField29Patch = res.first->second; module_MyStructField29Patch.name() = "module.MyStructField29Patch"; module_MyStructField29Patch.is_union() = false; static const auto* const module_MyStructField29Patch_fields = new std::array{ { { 1, "assign", true, std::make_unique(std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE))), std::vector{ }}, { 2, "clear", false, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{ }}, { 8, "prepend", false, std::make_unique(std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE))), std::vector{ }}, { 9, "append", false, std::make_unique(std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE))), std::vector{ }}, }}; for (const auto& f : *module_MyStructField29Patch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_MyStructField29Patch.fields()->push_back(std::move(field)); } module_MyStructField29Patch.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::ListPatchAdapter<::test::fixtures::patch::MyStructField29PatchStruct>") }, {"underlyingName", cvString("MyStructField29PatchStruct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::MyStructField30PatchStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.MyStructField30Patch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_MyStructField30Patch = res.first->second; module_MyStructField30Patch.name() = "module.MyStructField30Patch"; module_MyStructField30Patch.is_union() = false; static const auto* const module_MyStructField30Patch_fields = new std::array{ { { 1, "assign", true, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE))), std::vector{ }}, { 2, "clear", false, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{ }}, { 3, "patchPrior", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique>("module.MyStructField30Patch1")), std::vector{ }}, { 5, "add", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE))), std::vector{ }}, { 6, "patch", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique>("module.MyStructField30Patch1")), std::vector{ }}, { 7, "remove", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE)), std::vector{ }}, { 9, "put", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE))), std::vector{ }}, }}; for (const auto& f : *module_MyStructField30Patch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_MyStructField30Patch.fields()->push_back(std::move(field)); } module_MyStructField30Patch.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::MapPatchAdapter<::test::fixtures::patch::MyStructField30PatchStruct>") }, {"underlyingName", cvString("MyStructField30PatchStruct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::MyStructField30Patch1Struct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.MyStructField30Patch1", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_MyStructField30Patch1 = res.first->second; module_MyStructField30Patch1.name() = "module.MyStructField30Patch1"; module_MyStructField30Patch1.is_union() = false; static const auto* const module_MyStructField30Patch1_fields = new std::array{ { { 1, "assign", true, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE)), std::vector{ }}, { 2, "clear", false, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{ }}, { 3, "patchPrior", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique>("patch.I32Patch")), std::vector{ }}, { 5, "add", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE)), std::vector{ }}, { 6, "patch", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique>("patch.I32Patch")), std::vector{ }}, { 7, "remove", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE)), std::vector{ }}, { 9, "put", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE)), std::vector{ }}, }}; for (const auto& f : *module_MyStructField30Patch1_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_MyStructField30Patch1.fields()->push_back(std::move(field)); } module_MyStructField30Patch1.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::MapPatchAdapter<::test::fixtures::patch::MyStructField30Patch1Struct>") }, {"underlyingName", cvString("MyStructField30Patch1Struct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::MyStructFieldPatchStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.MyStructFieldPatch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_MyStructFieldPatch = res.first->second; module_MyStructFieldPatch.name() = "module.MyStructFieldPatch"; module_MyStructFieldPatch.is_union() = false; static const auto* const module_MyStructFieldPatch_fields = new std::array{ { { -32, "structWithCustomDefault", false, std::make_unique>("module.MyDataWithCustomDefaultPatch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -31, "i32WithCustomDefault", false, std::make_unique>("patch.I32Patch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -30, "mapMap", false, std::make_unique>("module.MyStructField30Patch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -29, "listMap", false, std::make_unique>("module.MyStructField29Patch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -28, "optMapVal", false, std::make_unique>("module.MyStructField28Patch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -27, "optSetVal", false, std::make_unique>("module.MyStructField27Patch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -26, "optListVal", false, std::make_unique>("module.MyStructField26Patch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -25, "optLateStructVal", false, std::make_unique>("module.LateDefStructPatch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -24, "optStructVal", false, std::make_unique>("module.MyDataPatch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -23, "optEnumVal", false, std::make_unique>("module.MyStructField23Patch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -22, "optBinaryVal", false, std::make_unique>("patch.BinaryPatch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -21, "optStringVal", false, std::make_unique>("patch.StringPatch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -20, "optDoubleVal", false, std::make_unique>("patch.DoublePatch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -19, "optFloatVal", false, std::make_unique>("patch.FloatPatch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -18, "optI64Val", false, std::make_unique>("patch.I64Patch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -17, "optI32Val", false, std::make_unique>("patch.I32Patch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -16, "optI16Val", false, std::make_unique>("patch.I16Patch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -15, "optByteVal", false, std::make_unique>("patch.BytePatch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -14, "optBoolVal", false, std::make_unique>("patch.BoolPatch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -13, "lateStructVal", false, std::make_unique>("module.LateDefStructPatch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -12, "unionVal", false, std::make_unique>("module.MyUnionPatch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -11, "structVal", false, std::make_unique>("module.MyDataPatch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -10, "enumVal", false, std::make_unique>("module.MyStructField10Patch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -9, "binaryVal", false, std::make_unique>("patch.BinaryPatch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -8, "stringVal", false, std::make_unique>("patch.StringPatch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -7, "doubleVal", false, std::make_unique>("patch.DoublePatch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -6, "floatVal", false, std::make_unique>("patch.FloatPatch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -5, "i64Val", false, std::make_unique>("patch.I64Patch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -4, "i32Val", false, std::make_unique>("patch.I32Patch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -3, "i16Val", false, std::make_unique>("patch.I16Patch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -2, "byteVal", false, std::make_unique>("patch.BytePatch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { -1, "boolVal", false, std::make_unique>("patch.BoolPatch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { 1, "structWithFieldCustomDefault", false, std::make_unique>("module.MyDataPatch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, }}; for (const auto& f : *module_MyStructFieldPatch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_MyStructFieldPatch.fields()->push_back(std::move(field)); } module_MyStructFieldPatch.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::MyStructFieldPatchStruct>") }, {"underlyingName", cvString("MyStructFieldPatchStruct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::MyStructEnsureStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.MyStructEnsureStruct", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_MyStructEnsureStruct = res.first->second; module_MyStructEnsureStruct.name() = "module.MyStructEnsureStruct"; module_MyStructEnsureStruct.is_union() = false; static const auto* const module_MyStructEnsureStruct_fields = new std::array{ { { -32, "structWithCustomDefault", true, std::make_unique>("module.MyDataWithCustomDefault"), std::vector{ *cvStruct("thrift.Box", { }).cv_struct_ref(), }}, { -31, "i32WithCustomDefault", true, std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE), std::vector{ }}, { -30, "mapMap", true, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE))), std::vector{ }}, { -29, "listMap", true, std::make_unique(std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE))), std::vector{ }}, { -28, "optMapVal", true, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE)), std::vector{ }}, { -27, "optSetVal", true, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE)), std::vector{ }}, { -26, "optListVal", true, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I16_TYPE)), std::vector{ }}, { -25, "optLateStructVal", true, std::make_unique>("module.LateDefStruct"), std::vector{ *cvStruct("thrift.Box", { }).cv_struct_ref(), }}, { -24, "optStructVal", true, std::make_unique>("module.MyData"), std::vector{ *cvStruct("thrift.Box", { }).cv_struct_ref(), }}, { -23, "optEnumVal", true, std::make_unique>("module.MyEnum"), std::vector{ }}, { -22, "optBinaryVal", true, std::make_unique(ThriftPrimitiveType::THRIFT_BINARY_TYPE), std::vector{ }}, { -21, "optStringVal", true, std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::vector{ }}, { -20, "optDoubleVal", true, std::make_unique(ThriftPrimitiveType::THRIFT_DOUBLE_TYPE), std::vector{ }}, { -19, "optFloatVal", true, std::make_unique(ThriftPrimitiveType::THRIFT_FLOAT_TYPE), std::vector{ }}, { -18, "optI64Val", true, std::make_unique(ThriftPrimitiveType::THRIFT_I64_TYPE), std::vector{ }}, { -17, "optI32Val", true, std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE), std::vector{ }}, { -16, "optI16Val", true, std::make_unique(ThriftPrimitiveType::THRIFT_I16_TYPE), std::vector{ }}, { -15, "optByteVal", true, std::make_unique(ThriftPrimitiveType::THRIFT_BYTE_TYPE), std::vector{ }}, { -14, "optBoolVal", true, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{ }}, { -13, "lateStructVal", true, std::make_unique>("module.LateDefStruct"), std::vector{ *cvStruct("thrift.Box", { }).cv_struct_ref(), }}, { -12, "unionVal", true, std::make_unique>("module.MyUnion"), std::vector{ *cvStruct("thrift.Box", { }).cv_struct_ref(), }}, { -11, "structVal", true, std::make_unique>("module.MyData"), std::vector{ *cvStruct("thrift.Box", { }).cv_struct_ref(), }}, { -10, "enumVal", true, std::make_unique>("module.MyEnum"), std::vector{ }}, { -9, "binaryVal", true, std::make_unique(ThriftPrimitiveType::THRIFT_BINARY_TYPE), std::vector{ }}, { -8, "stringVal", true, std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::vector{ }}, { -7, "doubleVal", true, std::make_unique(ThriftPrimitiveType::THRIFT_DOUBLE_TYPE), std::vector{ }}, { -6, "floatVal", true, std::make_unique(ThriftPrimitiveType::THRIFT_FLOAT_TYPE), std::vector{ }}, { -5, "i64Val", true, std::make_unique(ThriftPrimitiveType::THRIFT_I64_TYPE), std::vector{ }}, { -4, "i32Val", true, std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE), std::vector{ }}, { -3, "i16Val", true, std::make_unique(ThriftPrimitiveType::THRIFT_I16_TYPE), std::vector{ }}, { -2, "byteVal", true, std::make_unique(ThriftPrimitiveType::THRIFT_BYTE_TYPE), std::vector{ }}, { -1, "boolVal", true, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{ }}, { 1, "structWithFieldCustomDefault", true, std::make_unique>("module.MyData"), std::vector{ *cvStruct("thrift.Box", { }).cv_struct_ref(), }}, }}; for (const auto& f : *module_MyStructEnsureStruct_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_MyStructEnsureStruct.fields()->push_back(std::move(field)); } module_MyStructEnsureStruct.structured_annotations()->push_back(*cvStruct("cpp.Frozen2Exclude", { }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::MyStructSafePatch>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.MyStructSafePatch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_MyStructSafePatch = res.first->second; module_MyStructSafePatch.name() = "module.MyStructSafePatch"; module_MyStructSafePatch.is_union() = false; static const auto* const module_MyStructSafePatch_fields = new std::array{ { { 1, "version", false, std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE), std::vector{ }}, { 2, "data", false, std::make_unique(ThriftPrimitiveType::THRIFT_BINARY_TYPE), std::vector{ }}, }}; for (const auto& f : *module_MyStructSafePatch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_MyStructSafePatch.fields()->push_back(std::move(field)); } module_MyStructSafePatch.structured_annotations()->push_back(*cvStruct("cpp.Frozen2Exclude", { }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::LateDefStructPatchStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.LateDefStructPatch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_LateDefStructPatch = res.first->second; module_LateDefStructPatch.name() = "module.LateDefStructPatch"; module_LateDefStructPatch.is_union() = false; static const auto* const module_LateDefStructPatch_fields = new std::array{ { { 1, "assign", true, std::make_unique>("module.LateDefStruct"), std::vector{ *cvStruct("thrift.Box", { }).cv_struct_ref(), }}, { 2, "clear", false, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{ }}, { 3, "patchPrior", false, std::make_unique>("module.LateDefStructFieldPatch"), std::vector{ }}, { 5, "ensure", false, std::make_unique>("module.LateDefStructEnsureStruct"), std::vector{ }}, { 6, "patch", false, std::make_unique>("module.LateDefStructFieldPatch"), std::vector{ }}, { 7, "remove", false, std::make_unique("patch.FieldIdList", std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I16_TYPE)), std::vector{ *cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::FieldIdListToSetAdapter") } }).cv_struct_ref(), }), std::vector{ }}, }}; for (const auto& f : *module_LateDefStructPatch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_LateDefStructPatch.fields()->push_back(std::move(field)); } module_LateDefStructPatch.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::StructPatchAdapter<::test::fixtures::patch::LateDefStructPatchStruct>") }, {"underlyingName", cvString("LateDefStructPatchStruct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::LateDefStructFieldPatchStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.LateDefStructFieldPatch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_LateDefStructFieldPatch = res.first->second; module_LateDefStructFieldPatch.name() = "module.LateDefStructFieldPatch"; module_LateDefStructFieldPatch.is_union() = false; module_LateDefStructFieldPatch.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::LateDefStructFieldPatchStruct>") }, {"underlyingName", cvString("LateDefStructFieldPatchStruct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::LateDefStructEnsureStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.LateDefStructEnsureStruct", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_LateDefStructEnsureStruct = res.first->second; module_LateDefStructEnsureStruct.name() = "module.LateDefStructEnsureStruct"; module_LateDefStructEnsureStruct.is_union() = false; module_LateDefStructEnsureStruct.structured_annotations()->push_back(*cvStruct("cpp.Frozen2Exclude", { }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::LateDefStructSafePatch>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.LateDefStructSafePatch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_LateDefStructSafePatch = res.first->second; module_LateDefStructSafePatch.name() = "module.LateDefStructSafePatch"; module_LateDefStructSafePatch.is_union() = false; static const auto* const module_LateDefStructSafePatch_fields = new std::array{ { { 1, "version", false, std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE), std::vector{ }}, { 2, "data", false, std::make_unique(ThriftPrimitiveType::THRIFT_BINARY_TYPE), std::vector{ }}, }}; for (const auto& f : *module_LateDefStructSafePatch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_LateDefStructSafePatch.fields()->push_back(std::move(field)); } module_LateDefStructSafePatch.structured_annotations()->push_back(*cvStruct("cpp.Frozen2Exclude", { }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::RecursivePatchStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.RecursivePatch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_RecursivePatch = res.first->second; module_RecursivePatch.name() = "module.RecursivePatch"; module_RecursivePatch.is_union() = false; static const auto* const module_RecursivePatch_fields = new std::array{ { { 1, "assign", true, std::make_unique>("module.Recursive"), std::vector{ *cvStruct("thrift.Box", { }).cv_struct_ref(), }}, { 2, "clear", false, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{ }}, { 3, "patchPrior", false, std::make_unique>("module.RecursiveFieldPatch"), std::vector{ }}, { 5, "ensure", false, std::make_unique>("module.RecursiveEnsureStruct"), std::vector{ }}, { 6, "patch", false, std::make_unique>("module.RecursiveFieldPatch"), std::vector{ }}, { 7, "remove", false, std::make_unique("patch.FieldIdList", std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I16_TYPE)), std::vector{ *cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::FieldIdListToSetAdapter") } }).cv_struct_ref(), }), std::vector{ }}, }}; for (const auto& f : *module_RecursivePatch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_RecursivePatch.fields()->push_back(std::move(field)); } module_RecursivePatch.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::StructPatchAdapter<::test::fixtures::patch::RecursivePatchStruct>") }, {"underlyingName", cvString("RecursivePatchStruct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::RecursiveField1PatchStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.RecursiveField1Patch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_RecursiveField1Patch = res.first->second; module_RecursiveField1Patch.name() = "module.RecursiveField1Patch"; module_RecursiveField1Patch.is_union() = false; static const auto* const module_RecursiveField1Patch_fields = new std::array{ { { 1, "assign", true, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique>("module.Recursive")), std::vector{ }}, { 2, "clear", false, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{ }}, }}; for (const auto& f : *module_RecursiveField1Patch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_RecursiveField1Patch.fields()->push_back(std::move(field)); } module_RecursiveField1Patch.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::AssignPatchAdapter<::test::fixtures::patch::RecursiveField1PatchStruct>") }, {"underlyingName", cvString("RecursiveField1PatchStruct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::RecursiveFieldPatchStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.RecursiveFieldPatch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_RecursiveFieldPatch = res.first->second; module_RecursiveFieldPatch.name() = "module.RecursiveFieldPatch"; module_RecursiveFieldPatch.is_union() = false; static const auto* const module_RecursiveFieldPatch_fields = new std::array{ { { -1, "nodes", false, std::make_unique>("module.RecursiveField1Patch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, }}; for (const auto& f : *module_RecursiveFieldPatch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_RecursiveFieldPatch.fields()->push_back(std::move(field)); } module_RecursiveFieldPatch.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::RecursiveFieldPatchStruct>") }, {"underlyingName", cvString("RecursiveFieldPatchStruct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::RecursiveEnsureStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.RecursiveEnsureStruct", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_RecursiveEnsureStruct = res.first->second; module_RecursiveEnsureStruct.name() = "module.RecursiveEnsureStruct"; module_RecursiveEnsureStruct.is_union() = false; static const auto* const module_RecursiveEnsureStruct_fields = new std::array{ { { -1, "nodes", true, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::make_unique>("module.Recursive")), std::vector{ }}, }}; for (const auto& f : *module_RecursiveEnsureStruct_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_RecursiveEnsureStruct.fields()->push_back(std::move(field)); } module_RecursiveEnsureStruct.structured_annotations()->push_back(*cvStruct("cpp.Frozen2Exclude", { }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::RecursiveSafePatch>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.RecursiveSafePatch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_RecursiveSafePatch = res.first->second; module_RecursiveSafePatch.name() = "module.RecursiveSafePatch"; module_RecursiveSafePatch.is_union() = false; static const auto* const module_RecursiveSafePatch_fields = new std::array{ { { 1, "version", false, std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE), std::vector{ }}, { 2, "data", false, std::make_unique(ThriftPrimitiveType::THRIFT_BINARY_TYPE), std::vector{ }}, }}; for (const auto& f : *module_RecursiveSafePatch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_RecursiveSafePatch.fields()->push_back(std::move(field)); } module_RecursiveSafePatch.structured_annotations()->push_back(*cvStruct("cpp.Frozen2Exclude", { }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::BarPatchStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.BarPatch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_BarPatch = res.first->second; module_BarPatch.name() = "module.BarPatch"; module_BarPatch.is_union() = false; static const auto* const module_BarPatch_fields = new std::array{ { { 1, "assign", true, std::make_unique>("module.Bar"), std::vector{ *cvStruct("thrift.Box", { }).cv_struct_ref(), }}, { 2, "clear", false, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{ }}, { 3, "patchPrior", false, std::make_unique>("module.BarFieldPatch"), std::vector{ }}, { 5, "ensure", false, std::make_unique>("module.BarEnsureStruct"), std::vector{ }}, { 6, "patch", false, std::make_unique>("module.BarFieldPatch"), std::vector{ }}, { 7, "remove", false, std::make_unique("patch.FieldIdList", std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I16_TYPE)), std::vector{ *cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::FieldIdListToSetAdapter") } }).cv_struct_ref(), }), std::vector{ }}, }}; for (const auto& f : *module_BarPatch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_BarPatch.fields()->push_back(std::move(field)); } module_BarPatch.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::StructPatchAdapter<::test::fixtures::patch::BarPatchStruct>") }, {"underlyingName", cvString("BarPatchStruct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::BarFieldPatchStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.BarFieldPatch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_BarFieldPatch = res.first->second; module_BarFieldPatch.name() = "module.BarFieldPatch"; module_BarFieldPatch.is_union() = false; static const auto* const module_BarFieldPatch_fields = new std::array{ { { -1, "loop", false, std::make_unique>("module.LoopPatch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, }}; for (const auto& f : *module_BarFieldPatch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_BarFieldPatch.fields()->push_back(std::move(field)); } module_BarFieldPatch.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::BarFieldPatchStruct>") }, {"underlyingName", cvString("BarFieldPatchStruct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::BarEnsureStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.BarEnsureStruct", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_BarEnsureStruct = res.first->second; module_BarEnsureStruct.name() = "module.BarEnsureStruct"; module_BarEnsureStruct.is_union() = false; static const auto* const module_BarEnsureStruct_fields = new std::array{ { { -1, "loop", true, std::make_unique>("module.Loop"), std::vector{ *cvStruct("thrift.Box", { }).cv_struct_ref(), }}, }}; for (const auto& f : *module_BarEnsureStruct_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_BarEnsureStruct.fields()->push_back(std::move(field)); } module_BarEnsureStruct.structured_annotations()->push_back(*cvStruct("cpp.Frozen2Exclude", { }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::BarSafePatch>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.BarSafePatch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_BarSafePatch = res.first->second; module_BarSafePatch.name() = "module.BarSafePatch"; module_BarSafePatch.is_union() = false; static const auto* const module_BarSafePatch_fields = new std::array{ { { 1, "version", false, std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE), std::vector{ }}, { 2, "data", false, std::make_unique(ThriftPrimitiveType::THRIFT_BINARY_TYPE), std::vector{ }}, }}; for (const auto& f : *module_BarSafePatch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_BarSafePatch.fields()->push_back(std::move(field)); } module_BarSafePatch.structured_annotations()->push_back(*cvStruct("cpp.Frozen2Exclude", { }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::LoopPatchStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.LoopPatch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_LoopPatch = res.first->second; module_LoopPatch.name() = "module.LoopPatch"; module_LoopPatch.is_union() = false; static const auto* const module_LoopPatch_fields = new std::array{ { { 1, "assign", true, std::make_unique>("module.Loop"), std::vector{ *cvStruct("thrift.Box", { }).cv_struct_ref(), }}, { 2, "clear", false, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{ }}, }}; for (const auto& f : *module_LoopPatch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_LoopPatch.fields()->push_back(std::move(field)); } module_LoopPatch.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::AssignPatchAdapter<::test::fixtures::patch::LoopPatchStruct>") }, {"underlyingName", cvString("LoopPatchStruct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::LoopSafePatch>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.LoopSafePatch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_LoopSafePatch = res.first->second; module_LoopSafePatch.name() = "module.LoopSafePatch"; module_LoopSafePatch.is_union() = false; static const auto* const module_LoopSafePatch_fields = new std::array{ { { 1, "version", false, std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE), std::vector{ }}, { 2, "data", false, std::make_unique(ThriftPrimitiveType::THRIFT_BINARY_TYPE), std::vector{ }}, }}; for (const auto& f : *module_LoopSafePatch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_LoopSafePatch.fields()->push_back(std::move(field)); } module_LoopSafePatch.structured_annotations()->push_back(*cvStruct("cpp.Frozen2Exclude", { }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::RefFieldsPatchStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.RefFieldsPatch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_RefFieldsPatch = res.first->second; module_RefFieldsPatch.name() = "module.RefFieldsPatch"; module_RefFieldsPatch.is_union() = false; static const auto* const module_RefFieldsPatch_fields = new std::array{ { { 1, "assign", true, std::make_unique>("module.RefFields"), std::vector{ *cvStruct("thrift.Box", { }).cv_struct_ref(), }}, { 2, "clear", false, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{ }}, { 3, "patchPrior", false, std::make_unique>("module.RefFieldsFieldPatch"), std::vector{ }}, { 5, "ensure", false, std::make_unique>("module.RefFieldsEnsureStruct"), std::vector{ }}, { 6, "patch", false, std::make_unique>("module.RefFieldsFieldPatch"), std::vector{ }}, { 7, "remove", false, std::make_unique("patch.FieldIdList", std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I16_TYPE)), std::vector{ *cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::FieldIdListToSetAdapter") } }).cv_struct_ref(), }), std::vector{ }}, }}; for (const auto& f : *module_RefFieldsPatch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_RefFieldsPatch.fields()->push_back(std::move(field)); } module_RefFieldsPatch.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::StructPatchAdapter<::test::fixtures::patch::RefFieldsPatchStruct>") }, {"underlyingName", cvString("RefFieldsPatchStruct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::RefFieldsField1PatchStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.RefFieldsField1Patch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_RefFieldsField1Patch = res.first->second; module_RefFieldsField1Patch.name() = "module.RefFieldsField1Patch"; module_RefFieldsField1Patch.is_union() = false; static const auto* const module_RefFieldsField1Patch_fields = new std::array{ { { 1, "assign", true, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE)), std::vector{ }}, { 2, "clear", false, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{ }}, { 8, "prepend", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE)), std::vector{ }}, { 9, "append", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE)), std::vector{ }}, }}; for (const auto& f : *module_RefFieldsField1Patch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_RefFieldsField1Patch.fields()->push_back(std::move(field)); } module_RefFieldsField1Patch.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::ListPatchAdapter<::test::fixtures::patch::RefFieldsField1PatchStruct>") }, {"underlyingName", cvString("RefFieldsField1PatchStruct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::RefFieldsField4PatchStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.RefFieldsField4Patch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_RefFieldsField4Patch = res.first->second; module_RefFieldsField4Patch.name() = "module.RefFieldsField4Patch"; module_RefFieldsField4Patch.is_union() = false; static const auto* const module_RefFieldsField4Patch_fields = new std::array{ { { 1, "assign", true, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE)), std::vector{ }}, { 2, "clear", false, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{ }}, { 8, "prepend", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE)), std::vector{ }}, { 9, "append", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE)), std::vector{ }}, }}; for (const auto& f : *module_RefFieldsField4Patch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_RefFieldsField4Patch.fields()->push_back(std::move(field)); } module_RefFieldsField4Patch.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::ListPatchAdapter<::test::fixtures::patch::RefFieldsField4PatchStruct>") }, {"underlyingName", cvString("RefFieldsField4PatchStruct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::RefFieldsField7PatchStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.RefFieldsField7Patch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_RefFieldsField7Patch = res.first->second; module_RefFieldsField7Patch.name() = "module.RefFieldsField7Patch"; module_RefFieldsField7Patch.is_union() = false; static const auto* const module_RefFieldsField7Patch_fields = new std::array{ { { 1, "assign", true, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE)), std::vector{ }}, { 2, "clear", false, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{ }}, { 8, "prepend", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE)), std::vector{ }}, { 9, "append", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE)), std::vector{ }}, }}; for (const auto& f : *module_RefFieldsField7Patch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_RefFieldsField7Patch.fields()->push_back(std::move(field)); } module_RefFieldsField7Patch.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::ListPatchAdapter<::test::fixtures::patch::RefFieldsField7PatchStruct>") }, {"underlyingName", cvString("RefFieldsField7PatchStruct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::RefFieldsFieldPatchStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.RefFieldsFieldPatch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_RefFieldsFieldPatch = res.first->second; module_RefFieldsFieldPatch.name() = "module.RefFieldsFieldPatch"; module_RefFieldsFieldPatch.is_union() = false; static const auto* const module_RefFieldsFieldPatch_fields = new std::array{ { { 1, "unique", false, std::make_unique>("module.RefFieldsField1Patch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { 4, "opt_unique", false, std::make_unique>("module.RefFieldsField4Patch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, { 7, "opt_box", false, std::make_unique>("module.RefFieldsField7Patch"), std::vector{ *cvStruct("thrift.InternBox", { }).cv_struct_ref(), }}, }}; for (const auto& f : *module_RefFieldsFieldPatch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_RefFieldsFieldPatch.fields()->push_back(std::move(field)); } module_RefFieldsFieldPatch.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::apache::thrift::op::detail::FieldPatchAdapter<::test::fixtures::patch::RefFieldsFieldPatchStruct>") }, {"underlyingName", cvString("RefFieldsFieldPatchStruct") }, {"extraNamespace", cvString("") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::RefFieldsEnsureStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.RefFieldsEnsureStruct", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_RefFieldsEnsureStruct = res.first->second; module_RefFieldsEnsureStruct.name() = "module.RefFieldsEnsureStruct"; module_RefFieldsEnsureStruct.is_union() = false; static const auto* const module_RefFieldsEnsureStruct_fields = new std::array{ { { 1, "unique", true, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE)), std::vector{ }}, { 2, "shared_const", true, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE)), std::vector{ }}, { 3, "shared_mustable", true, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE)), std::vector{ }}, { 4, "opt_unique", true, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE)), std::vector{ }}, { 5, "opt_shared_const", true, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE)), std::vector{ }}, { 6, "opt_shared_mustable", true, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE)), std::vector{ }}, { 7, "opt_box", true, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE)), std::vector{ }}, }}; for (const auto& f : *module_RefFieldsEnsureStruct_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_RefFieldsEnsureStruct.fields()->push_back(std::move(field)); } module_RefFieldsEnsureStruct.structured_annotations()->push_back(*cvStruct("cpp.Frozen2Exclude", { }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::test::fixtures::patch::RefFieldsSafePatch>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.RefFieldsSafePatch", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_RefFieldsSafePatch = res.first->second; module_RefFieldsSafePatch.name() = "module.RefFieldsSafePatch"; module_RefFieldsSafePatch.is_union() = false; static const auto* const module_RefFieldsSafePatch_fields = new std::array{ { { 1, "version", false, std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE), std::vector{ }}, { 2, "data", false, std::make_unique(ThriftPrimitiveType::THRIFT_BINARY_TYPE), std::vector{ }}, }}; for (const auto& f : *module_RefFieldsSafePatch_fields) { ::apache::thrift::metadata::ThriftField field; field.id() = f.id; field.name() = f.name; field.is_optional() = f.is_optional; f.metadata_type_interface->writeAndGenType(*field.type(), metadata); field.structured_annotations() = f.structured_annotations; module_RefFieldsSafePatch.fields()->push_back(std::move(field)); } module_RefFieldsSafePatch.structured_annotations()->push_back(*cvStruct("cpp.Frozen2Exclude", { }).cv_struct_ref()); return res.first->second; } } // namespace md } // namespace detail } // namespace thrift } // namespace apache