/** * Autogenerated by Thrift for thrift/compiler/test/fixtures/any/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/any/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&); const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::facebook::thrift::compiler::test::fixtures::any::detail::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, "myString", false, std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), 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)); } module_MyStruct.structured_annotations()->push_back(*cvStruct("cpp.Adapter", { {"name", cvString("::my::Adapter1") } }).cv_struct_ref()); return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::facebook::thrift::compiler::test::fixtures::any::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, "myString", false, std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), 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<::facebook::thrift::compiler::test::fixtures::any::MyException>::gen(ThriftMetadata& metadata) { auto res = metadata.structs()->emplace("module.MyException", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } ::apache::thrift::metadata::ThriftStruct& module_MyException = res.first->second; module_MyException.name() = "module.MyException"; module_MyException.is_union() = false; static const auto* const module_MyException_fields = new std::array{ { { 1, "myString", false, std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::vector{ }}, }}; for (const auto& f : *module_MyException_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_MyException.fields()->push_back(std::move(field)); } return res.first->second; } void ExceptionMetadata<::facebook::thrift::compiler::test::fixtures::any::MyException>::gen(ThriftMetadata& metadata) { auto res = metadata.exceptions()->emplace("module.MyException", ::apache::thrift::metadata::ThriftException{}); if (!res.second) { return; } ::apache::thrift::metadata::ThriftException& module_MyException = res.first->second; module_MyException.name() = "module.MyException"; static const auto* const module_MyException_fields = new std::array{ { { 1, "myString", false, std::make_unique(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::vector{ }}, }}; for (const auto& f : *module_MyException_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); module_MyException.fields()->push_back(std::move(field)); } } } // namespace md } // namespace detail } // namespace thrift } // namespace apache