Skip to content

Commit

Permalink
add containers to converters
Browse files Browse the repository at this point in the history
Summary:
Add python to cpp fn `{{type:flat_name}}__make_instance` to `converter.pyx`. This is hidden behind a `gen_legacy_container_converters` flag that will only be enabled for a small number of use cases.

On trunk / non-auto-migrate, it just calls `types.{{type:flat_name}}__make_instance`. In auto-migrate, it just returns default initialization, but later up in the stack, we use mustache to paste the same implementation as `types.pyx` into `converter.pyx`.

Reviewed By: yoney

Differential Revision: D67999499

fbshipit-source-id: 6de114714114e02726d92006e0d489932139fb4b
  • Loading branch information
ahilger authored and facebook-github-bot committed Jan 13, 2025
1 parent 67461c8 commit d8f2650
Show file tree
Hide file tree
Showing 119 changed files with 18,397 additions and 0 deletions.
6 changes: 6 additions & 0 deletions thrift/compiler/generate/t_mstch_py3_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ class py3_mstch_program : public mstch_program {
&py3_mstch_program::capi_converter},
{"program:intercompatible?", &py3_mstch_program::intercompatible},
{"program:auto_migrate?", &py3_mstch_program::auto_migrate},
{"program:gen_legacy_container_converters?",
&py3_mstch_program::legacy_container_converters},
{"program:stream_types", &py3_mstch_program::getStreamTypes},
{"program:response_and_stream_functions",
&py3_mstch_program::response_and_stream_functions},
Expand Down Expand Up @@ -290,6 +292,10 @@ class py3_mstch_program : public mstch_program {

mstch::node auto_migrate() { return has_option("auto_migrate"); }

mstch::node legacy_container_converters() {
return has_option("gen_legacy_container_converters");
}

mstch::node py_deprecated_module_path() {
const std::string& module_path = program_->get_namespace("py");
if (module_path.empty()) {
Expand Down
17 changes: 17 additions & 0 deletions thrift/compiler/generate/templates/py3/converter.pxd.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,19 @@
}}
{{> common/auto_generated_py}}

{{#program:gen_legacy_container_converters?}}
{{> types/cimport_std }}

cimport {{#program:py3Namespaces}}{{value}}.{{/program:py3Namespaces}}{{program:name}}.cbindings as {{> types/current_module_cbindings}}
{{#program:includeNamespaces}}
{{#hasTypes?}}
cimport {{#includeNamespace}}{{value}}.{{/includeNamespace}}cbindings as _{{#includeNamespace}}{{value}}_{{/includeNamespace}}cbindings
{{/hasTypes?}}
{{/program:includeNamespaces}}
{{/program:gen_legacy_container_converters?}}
{{^program:gen_legacy_container_converters?}}
from libcpp.memory cimport shared_ptr
{{/program:gen_legacy_container_converters?}}

cimport {{#program:py3Namespaces}}{{value}}.{{/program:py3Namespaces}}{{program:name}}.cbindings as _fbthrift_cbindings

Expand All @@ -27,3 +39,8 @@ cdef shared_ptr[_fbthrift_cbindings.{{> types/c_struct }}] {{struct:name}}_conve
cdef object {{struct:name}}_from_cpp(const shared_ptr[_fbthrift_cbindings.{{> types/c_struct }}]& c_struct)

{{/program:filtered_structs}}
{{#program:gen_legacy_container_converters?}}
{{#program:containerTypes}}
cdef {{> types/cython_cpp_type}} {{type:flat_name}}__make_instance(object items) except *
{{/program:containerTypes}}
{{/program:gen_legacy_container_converters?}}
14 changes: 14 additions & 0 deletions thrift/compiler/generate/templates/py3/converter.pyx.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,17 @@ cdef object {{struct:name}}_from_cpp(const shared_ptr[_fbthrift_cbindings.{{> ty
{{/program:auto_migrate?}}

{{/program:filtered_structs}}

{{#program:gen_legacy_container_converters?}}
{{#program:containerTypes}}
cdef {{> types/cython_cpp_type}} {{type:flat_name}}__make_instance(object items) except *:
{{^program:auto_migrate?}}
return _fbthrift_ctypes.{{type:flat_name}}__make_instance(items)
{{/program:auto_migrate?}}
{{#program:auto_migrate?}}
cdef {{> types/cython_cpp_type}} ret
return ret
{{/program:auto_migrate?}}

{{/program:containerTypes}}
{{/program:gen_legacy_container_converters?}}
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ cdef shared_ptr[_fbthrift_cbindings.cSecretStruct] SecretStruct_convert_to_cpp(o
cdef object SecretStruct_from_cpp(const shared_ptr[_fbthrift_cbindings.cSecretStruct]& c_struct):
return _fbthrift_ctypes.SecretStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ cdef shared_ptr[_fbthrift_cbindings.cMyStruct] MyStruct_convert_to_cpp(object in
cdef object MyStruct_from_cpp(const shared_ptr[_fbthrift_cbindings.cMyStruct]& c_struct):
return _fbthrift_ctypes.MyStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ cdef shared_ptr[_fbthrift_cbindings.cMyStruct] MyStruct_convert_to_cpp(object in
cdef object MyStruct_from_cpp(const shared_ptr[_fbthrift_cbindings.cMyStruct]& c_struct):
return _fbthrift_ctypes.MyStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ cdef shared_ptr[_fbthrift_cbindings.cUnionToBeRenamed] UnionToBeRenamed_convert_
cdef object UnionToBeRenamed_from_cpp(const shared_ptr[_fbthrift_cbindings.cUnionToBeRenamed]& c_struct):
return _fbthrift_ctypes.UnionToBeRenamed._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ cdef shared_ptr[_fbthrift_cbindings.cNonCopyableUnion] NonCopyableUnion_convert_
cdef object NonCopyableUnion_from_cpp(const shared_ptr[_fbthrift_cbindings.cNonCopyableUnion]& c_struct):
return _fbthrift_ctypes.NonCopyableUnion._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ cdef shared_ptr[_fbthrift_cbindings.cunion2] union2_convert_to_cpp(object inst)
cdef object union2_from_cpp(const shared_ptr[_fbthrift_cbindings.cunion2]& c_struct):
return _fbthrift_ctypes.union2._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ cdef shared_ptr[_fbthrift_cbindings.cNada] Nada_convert_to_cpp(object inst) exce
cdef object Nada_from_cpp(const shared_ptr[_fbthrift_cbindings.cNada]& c_struct):
return _fbthrift_ctypes.Nada._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ cdef shared_ptr[_fbthrift_cbindings.cMyStruct] MyStruct_convert_to_cpp(object in
cdef object MyStruct_from_cpp(const shared_ptr[_fbthrift_cbindings.cMyStruct]& c_struct):
return _fbthrift_ctypes.MyStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ cdef shared_ptr[_fbthrift_cbindings.cBanal] Banal_convert_to_cpp(object inst) ex
cdef object Banal_from_cpp(const shared_ptr[_fbthrift_cbindings.cBanal]& c_struct):
return _fbthrift_ctypes.Banal._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ cdef shared_ptr[_fbthrift_cbindings.cIncluded] Included_convert_to_cpp(object in
cdef object Included_from_cpp(const shared_ptr[_fbthrift_cbindings.cIncluded]& c_struct):
return cpp_to_python[_fbthrift_cbindings.cIncluded](deref(c_struct))


Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ cdef shared_ptr[_fbthrift_cbindings.cMyStruct] MyStruct_convert_to_cpp(object in
cdef object MyStruct_from_cpp(const shared_ptr[_fbthrift_cbindings.cMyStruct]& c_struct):
return cpp_to_python[_fbthrift_cbindings.cMyStruct](deref(c_struct))


Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ cdef shared_ptr[_fbthrift_cbindings.cFoo] Foo_convert_to_cpp(object inst) except
cdef object Foo_from_cpp(const shared_ptr[_fbthrift_cbindings.cFoo]& c_struct):
return cpp_to_python[_fbthrift_cbindings.cFoo](deref(c_struct))


Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ cdef shared_ptr[_fbthrift_cbindings.cIncluded] Included_convert_to_cpp(object in
cdef object Included_from_cpp(const shared_ptr[_fbthrift_cbindings.cIncluded]& c_struct):
return cpp_to_python[_fbthrift_cbindings.cIncluded](deref(c_struct))


Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ cdef shared_ptr[_fbthrift_cbindings.cFoo] Foo_convert_to_cpp(object inst) except
cdef object Foo_from_cpp(const shared_ptr[_fbthrift_cbindings.cFoo]& c_struct):
return cpp_to_python[_fbthrift_cbindings.cFoo](deref(c_struct))


Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ cdef shared_ptr[_fbthrift_cbindings.cIncluded] Included_convert_to_cpp(object in
cdef object Included_from_cpp(const shared_ptr[_fbthrift_cbindings.cIncluded]& c_struct):
return cpp_to_python[_fbthrift_cbindings.cIncluded](deref(c_struct))


Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ cdef shared_ptr[_fbthrift_cbindings.cMyStruct] MyStruct_convert_to_cpp(object in
cdef object MyStruct_from_cpp(const shared_ptr[_fbthrift_cbindings.cMyStruct]& c_struct):
return cpp_to_python[_fbthrift_cbindings.cMyStruct](deref(c_struct))


Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ from cython.operator cimport dereference as deref
cdef extern from "thrift/compiler/test/fixtures/includes/gen-python-capi/service/thrift_types_capi.h":
pass


Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ cdef shared_ptr[_fbthrift_cbindings.cFoo] Foo_convert_to_cpp(object inst) except
cdef object Foo_from_cpp(const shared_ptr[_fbthrift_cbindings.cFoo]& c_struct):
return cpp_to_python[_fbthrift_cbindings.cFoo](deref(c_struct))


Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ cdef shared_ptr[_fbthrift_cbindings.cFoo] Foo_convert_to_cpp(object inst) except
cdef object Foo_from_cpp(const shared_ptr[_fbthrift_cbindings.cFoo]& c_struct):
return cpp_to_python[_fbthrift_cbindings.cFoo](deref(c_struct))


Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ cdef shared_ptr[_fbthrift_cbindings.cIncluded] Included_convert_to_cpp(object in
cdef object Included_from_cpp(const shared_ptr[_fbthrift_cbindings.cIncluded]& c_struct):
return _fbthrift_ctypes.Included._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ cdef shared_ptr[_fbthrift_cbindings.cCombo] Combo_convert_to_cpp(object inst) ex
cdef object Combo_from_cpp(const shared_ptr[_fbthrift_cbindings.cCombo]& c_struct):
return _fbthrift_ctypes.Combo._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ cdef shared_ptr[_fbthrift_cbindings.cMyStruct] MyStruct_convert_to_cpp(object in
cdef object MyStruct_from_cpp(const shared_ptr[_fbthrift_cbindings.cMyStruct]& c_struct):
return _fbthrift_ctypes.MyStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ cdef shared_ptr[_fbthrift_cbindings.cFoo] Foo_convert_to_cpp(object inst) except
cdef object Foo_from_cpp(const shared_ptr[_fbthrift_cbindings.cFoo]& c_struct):
return _fbthrift_ctypes.Foo._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ cdef shared_ptr[_fbthrift_cbindings.cIncluded] Included_convert_to_cpp(object in
cdef object Included_from_cpp(const shared_ptr[_fbthrift_cbindings.cIncluded]& c_struct):
return _fbthrift_ctypes.Included._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ cdef shared_ptr[_fbthrift_cbindings.cMyStruct] MyStruct_convert_to_cpp(object in
cdef object MyStruct_from_cpp(const shared_ptr[_fbthrift_cbindings.cMyStruct]& c_struct):
return _fbthrift_ctypes.MyStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
cimport service.types as _fbthrift_ctypes



Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ cdef shared_ptr[_fbthrift_cbindings.cFoo] Foo_convert_to_cpp(object inst) except
cdef object Foo_from_cpp(const shared_ptr[_fbthrift_cbindings.cFoo]& c_struct):
return _fbthrift_ctypes.Foo._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
cimport module.types as _fbthrift_ctypes



Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ cdef shared_ptr[_fbthrift_cbindings.cFields] Fields_convert_to_cpp(object inst)
cdef object Fields_from_cpp(const shared_ptr[_fbthrift_cbindings.cFields]& c_struct):
return _fbthrift_ctypes.Fields._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ cdef shared_ptr[_fbthrift_cbindings.cFieldsInjectedWithIncludedStruct] FieldsInj
cdef object FieldsInjectedWithIncludedStruct_from_cpp(const shared_ptr[_fbthrift_cbindings.cFieldsInjectedWithIncludedStruct]& c_struct):
return _fbthrift_ctypes.FieldsInjectedWithIncludedStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ cdef shared_ptr[_fbthrift_cbindings.cLimits] Limits_convert_to_cpp(object inst)
cdef object Limits_from_cpp(const shared_ptr[_fbthrift_cbindings.cLimits]& c_struct):
return _fbthrift_ctypes.Limits._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ cdef shared_ptr[_fbthrift_cbindings.cDoSomethingResult] DoSomethingResult_conver
cdef object DoSomethingResult_from_cpp(const shared_ptr[_fbthrift_cbindings.cDoSomethingResult]& c_struct):
return _fbthrift_ctypes.DoSomethingResult._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ cdef shared_ptr[_fbthrift_cbindings.cShouldBeBoxed] ShouldBeBoxed_convert_to_cpp
cdef object ShouldBeBoxed_from_cpp(const shared_ptr[_fbthrift_cbindings.cShouldBeBoxed]& c_struct):
return _fbthrift_ctypes.ShouldBeBoxed._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
cimport module.types as _fbthrift_ctypes



Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ cdef shared_ptr[_fbthrift_cbindings.cAStructB] AStructB_convert_to_cpp(object in
cdef object AStructB_from_cpp(const shared_ptr[_fbthrift_cbindings.cAStructB]& c_struct):
return _fbthrift_ctypes.AStructB._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,4 @@ cdef shared_ptr[_fbthrift_cbindings.cAllRequiredNoExceptMoveCtrStruct] AllRequir
cdef object AllRequiredNoExceptMoveCtrStruct_from_cpp(const shared_ptr[_fbthrift_cbindings.cAllRequiredNoExceptMoveCtrStruct]& c_struct):
return _fbthrift_ctypes.AllRequiredNoExceptMoveCtrStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ cdef shared_ptr[_fbthrift_cbindings.cFoo] Foo_convert_to_cpp(object inst) except
cdef object Foo_from_cpp(const shared_ptr[_fbthrift_cbindings.cFoo]& c_struct):
return _fbthrift_ctypes.Foo._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ cdef shared_ptr[_fbthrift_cbindings.cFoo] Foo_convert_to_cpp(object inst) except
cdef object Foo_from_cpp(const shared_ptr[_fbthrift_cbindings.cFoo]& c_struct):
return _fbthrift_ctypes.Foo._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ cdef shared_ptr[_fbthrift_cbindings.cFoo] Foo_convert_to_cpp(object inst) except
cdef object Foo_from_cpp(const shared_ptr[_fbthrift_cbindings.cFoo]& c_struct):
return _fbthrift_ctypes.Foo._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
cimport my.namespacing.extend.test.extend.types as _fbthrift_ctypes



Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ cdef shared_ptr[_fbthrift_cbindings.cHsFoo] HsFoo_convert_to_cpp(object inst) ex
cdef object HsFoo_from_cpp(const shared_ptr[_fbthrift_cbindings.cHsFoo]& c_struct):
return _fbthrift_ctypes.HsFoo._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ cdef shared_ptr[_fbthrift_cbindings.cFoo] Foo_convert_to_cpp(object inst) except
cdef object Foo_from_cpp(const shared_ptr[_fbthrift_cbindings.cFoo]& c_struct):
return _fbthrift_ctypes.Foo._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ cdef shared_ptr[_fbthrift_cbindings.cFoo] Foo_convert_to_cpp(object inst) except
cdef object Foo_from_cpp(const shared_ptr[_fbthrift_cbindings.cFoo]& c_struct):
return _fbthrift_ctypes.Foo._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ cdef shared_ptr[_fbthrift_cbindings.cPerson] Person_convert_to_cpp(object inst)
cdef object Person_from_cpp(const shared_ptr[_fbthrift_cbindings.cPerson]& c_struct):
return _fbthrift_ctypes.Person._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
cimport module.types as _fbthrift_ctypes



1 change: 1 addition & 0 deletions thrift/compiler/test/fixtures/py3/cmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ python_capi: mstch_python_capi src/module.thrift
python_capi_empty: mstch_python_capi src/empty.thrift
python: mstch_python:auto_migrate,base_library_package=fbcode.thrift.python,import_static src/module.thrift
py3_auto_migrate: mstch_py3:auto_migrate src/module.thrift
py3_legacy_container_converters: mstch_py3:gen_legacy_container_converters src/module.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,4 @@ cdef shared_ptr[_fbthrift_cbindings.cAdaptedTypedefFields] AdaptedTypedefFields_
cdef object AdaptedTypedefFields_from_cpp(const shared_ptr[_fbthrift_cbindings.cAdaptedTypedefFields]& c_struct):
return _fbthrift_ctypes.AdaptedTypedefFields._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)


Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,4 @@ cdef shared_ptr[_fbthrift_cbindings.cAdaptedTypedefFields] AdaptedTypedefFields_
cdef object AdaptedTypedefFields_from_cpp(const shared_ptr[_fbthrift_cbindings.cAdaptedTypedefFields]& c_struct):
return cpp_to_python[_fbthrift_cbindings.cAdaptedTypedefFields](deref(c_struct))


Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
cimport empty.types as _fbthrift_ctypes



Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**
* Autogenerated by Thrift for thrift/annotation/cpp.thrift
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/

#include "thrift/compiler/test/fixtures/py3/gen-py3/cpp/metadata.h"

namespace facebook {
namespace thrift {
namespace annotation {
namespace cpp {
::apache::thrift::metadata::ThriftMetadata cpp_getThriftModuleMetadata() {
::apache::thrift::metadata::ThriftServiceMetadataResponse response;
::apache::thrift::metadata::ThriftMetadata& metadata = *response.metadata_ref();
::apache::thrift::detail::md::EnumMetadata<RefType>::gen(metadata);
::apache::thrift::detail::md::EnumMetadata<EnumUnderlyingType>::gen(metadata);
::apache::thrift::detail::md::StructMetadata<Name>::gen(metadata);
::apache::thrift::detail::md::StructMetadata<Type>::gen(metadata);
::apache::thrift::detail::md::StructMetadata<Ref>::gen(metadata);
::apache::thrift::detail::md::StructMetadata<Lazy>::gen(metadata);
::apache::thrift::detail::md::StructMetadata<DisableLazyChecksum>::gen(metadata);
::apache::thrift::detail::md::StructMetadata<Adapter>::gen(metadata);
::apache::thrift::detail::md::StructMetadata<PackIsset>::gen(metadata);
::apache::thrift::detail::md::StructMetadata<MinimizePadding>::gen(metadata);
::apache::thrift::detail::md::StructMetadata<ScopedEnumAsUnionType>::gen(metadata);
::apache::thrift::detail::md::StructMetadata<FieldInterceptor>::gen(metadata);
::apache::thrift::detail::md::StructMetadata<UseOpEncode>::gen(metadata);
::apache::thrift::detail::md::StructMetadata<EnumType>::gen(metadata);
::apache::thrift::detail::md::StructMetadata<Frozen2Exclude>::gen(metadata);
::apache::thrift::detail::md::StructMetadata<Frozen2RequiresCompleteContainerParams>::gen(metadata);
::apache::thrift::detail::md::StructMetadata<ProcessInEbThreadUnsafe>::gen(metadata);
::apache::thrift::detail::md::StructMetadata<RuntimeAnnotation>::gen(metadata);
::apache::thrift::detail::md::StructMetadata<UseCursorSerialization>::gen(metadata);
::apache::thrift::detail::md::StructMetadata<GenerateDeprecatedHeaderClientMethods>::gen(metadata);
::apache::thrift::detail::md::StructMetadata<AllowLegacyNonOptionalRef>::gen(metadata);
return metadata;
}
} // namespace facebook
} // namespace thrift
} // namespace annotation
} // namespace cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Autogenerated by Thrift for thrift/annotation/cpp.thrift
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/

#pragma once

#include <thrift/lib/thrift/gen-cpp2/metadata_types.h>

#include "thrift/compiler/test/fixtures/py3/gen-cpp2/cpp_metadata.h"

namespace facebook {
namespace thrift {
namespace annotation {
namespace cpp {
::apache::thrift::metadata::ThriftMetadata cpp_getThriftModuleMetadata();
} // namespace facebook
} // namespace thrift
} // namespace annotation
} // namespace cpp
Loading

0 comments on commit d8f2650

Please sign in to comment.