/** * Autogenerated by Thrift for thrift/compiler/test/fixtures/qualified/src/module2.thrift * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @nocommit */ #include #include "thrift/compiler/test/fixtures/qualified/gen-cpp2/module2_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&); const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::module2::Struct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module2.Struct", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module2_Struct = res.first->second; module2_Struct.name() = "module2.Struct"; module2_Struct.is_union() = false; static const auto* const module2_Struct_fields = new std::array{ { { 1, "first", false, std::make_unique>("module0.Struct"), std::vector{ }}, { 2, "second", false, std::make_unique>("module1.Struct"), std::vector{ }}, }}; for (const auto& f : *module2_Struct_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; module2_Struct.fields()->push_back(std::move(field)); } return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::module2::BigStruct>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module2.BigStruct", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module2_BigStruct = res.first->second; module2_BigStruct.name() = "module2.BigStruct"; module2_BigStruct.is_union() = false; static const auto* const module2_BigStruct_fields = new std::array{ { { 1, "s", false, std::make_unique>("module2.Struct"), std::vector{ }}, { 2, "id", false, std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE), std::vector{ }}, }}; for (const auto& f : *module2_BigStruct_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; module2_BigStruct.fields()->push_back(std::move(field)); } return res.first->second; } } // namespace md } // namespace detail } // namespace thrift } // namespace apache