/** * Autogenerated by Thrift for thrift/compiler/test/fixtures/deprecated-clear/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/deprecated-clear/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<::apache::thrift::test::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<::apache::thrift::test::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<::apache::thrift::test::StructWithDefaultStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.StructWithDefaultStruct", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_StructWithDefaultStruct = res.first->second; module_StructWithDefaultStruct.name() = "module.StructWithDefaultStruct"; module_StructWithDefaultStruct.is_union() = false; static const auto* const module_StructWithDefaultStruct_fields = new std::array{ { { 1, "bool_field", false, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{ }}, { 2, "byte_field", false, std::make_unique(ThriftPrimitiveType::THRIFT_BYTE_TYPE), std::vector{ }}, { 3, "short_field", false, std::make_unique(ThriftPrimitiveType::THRIFT_I16_TYPE), std::vector{ }}, { 4, "int_field", false, std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE), std::vector{ }}, { 5, "long_field", false, std::make_unique(ThriftPrimitiveType::THRIFT_I64_TYPE), std::vector{ }}, { 6, "float_field", false, std::make_unique(ThriftPrimitiveType::THRIFT_FLOAT_TYPE), std::vector{ }}, { 7, "double_field", false, std::make_unique(ThriftPrimitiveType::THRIFT_DOUBLE_TYPE), std::vector{ }}, { 8, "string_field", false, std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::vector{ }}, { 9, "binary_field", false, std::make_unique(ThriftPrimitiveType::THRIFT_BINARY_TYPE), std::vector{ }}, { 10, "enum_field", false, std::make_unique>("module.MyEnum"), std::vector{ }}, { 11, "list_field", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I16_TYPE)), std::vector{ }}, { 12, "set_field", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I16_TYPE)), std::vector{ }}, { 13, "map_field", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I16_TYPE), std::make_unique(ThriftPrimitiveType::THRIFT_I16_TYPE)), std::vector{ }}, }}; for (const auto& f : *module_StructWithDefaultStruct_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_StructWithDefaultStruct.fields()->push_back(std::move(field)); } return res.first->second; } } // namespace md } // namespace detail } // namespace thrift } // namespace apache