1 /**
2  * Autogenerated by Thrift for src/include1.thrift
3  *
4  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5  *  @generated @nocommit
6  */
7 #include <thrift/lib/cpp2/gen/module_metadata_cpp.h>
8 #include "thrift/compiler/test/fixtures/frozen-struct/gen-cpp2/include1_metadata.h"
9 
10 namespace apache {
11 namespace thrift {
12 namespace detail {
13 namespace md {
14 using ThriftMetadata = ::apache::thrift::metadata::ThriftMetadata;
15 using ThriftPrimitiveType = ::apache::thrift::metadata::ThriftPrimitiveType;
16 using ThriftType = ::apache::thrift::metadata::ThriftType;
17 using ThriftService = ::apache::thrift::metadata::ThriftService;
18 using ThriftServiceContext = ::apache::thrift::metadata::ThriftServiceContext;
19 using ThriftFunctionGenerator = void (*)(ThriftMetadata&, ThriftService&);
20 
21 
22 const ::apache::thrift::metadata::ThriftStruct&
gen(ThriftMetadata & metadata)23 StructMetadata<::some::ns::IncludedA>::gen(ThriftMetadata& metadata) {
24   auto res = metadata.structs_ref()->emplace("include1.IncludedA", ::apache::thrift::metadata::ThriftStruct{});
25   if (!res.second) {
26     return res.first->second;
27   }
28   ::apache::thrift::metadata::ThriftStruct& include1_IncludedA = res.first->second;
29   include1_IncludedA.name_ref() = "include1.IncludedA";
30   include1_IncludedA.is_union_ref() = false;
31   static const EncodedThriftField
32   include1_IncludedA_fields[] = {
33     {1, "i32Field", false, std::make_unique<Primitive>(ThriftPrimitiveType::THRIFT_I32_TYPE), std::vector<ThriftConstStruct>{}},
34     {2, "strField", false, std::make_unique<Primitive>(ThriftPrimitiveType::THRIFT_STRING_TYPE), std::vector<ThriftConstStruct>{}},
35   };
36   for (const auto& f : include1_IncludedA_fields) {
37     ::apache::thrift::metadata::ThriftField field;
38     field.id_ref() = f.id;
39     field.name_ref() = f.name;
40     field.is_optional_ref() = f.is_optional;
41     f.metadata_type_interface->writeAndGenType(*field.type_ref(), metadata);
42     field.structured_annotations_ref() = f.structured_annotations;
43     include1_IncludedA.fields_ref()->push_back(std::move(field));
44   }
45   return res.first->second;
46 }
47 
48 } // namespace md
49 } // namespace detail
50 } // namespace thrift
51 } // namespace apache
52