{{! Copyright (c) Meta Platforms, Inc. and affiliates. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. }}{{! Header file for ServicesWrapper.Cpp. It's a subclass of the service interface created by the thrift compiler for generated cpp2 code. }} {{> common/auto_generated_c}} #pragma once {{#program:services}} #if __has_include(<{{program:includePrefix}}{{program:cpp_gen_path}}/{{service:name}}.h>) #include <{{program:includePrefix}}{{program:cpp_gen_path}}/{{service:name}}.h> #else #include <{{program:includePrefix}}{{program:cpp_gen_path}}/{{program:name}}_handlers.h> #endif {{#service:extends}} {{#service:externalProgram?}} #include <{{service:includePrefix}}gen-py3/{{service:programName}}/services_wrapper.h> {{/service:externalProgram?}} {{/service:extends}} {{/program:services}} #include #include #include {{#program:cppNamespaces}}namespace {{value}} { {{/program:cppNamespaces}} {{#program:services}} class {{service:name}}Wrapper : {{! }}{{#service:extends}}public ::{{#service:cppNamespaces}}{{value}}::{{/service:cppNamespaces}}{{service:name}}Wrapper, {{/service:extends}}{{! }}virtual public {{service:cpp_name}}SvIf{{! }} { {{^service:extends?}} protected: PyObject *if_object; folly::Executor *executor; {{/service:extends?}} public: explicit {{service:name}}Wrapper(PyObject *if_object, folly::Executor *exc); {{#service:supportedFunctions}} void async_{{#function:eb}}eb{{/function:eb}}{{^function:eb}}tm{{/function:eb}}_{{function:cppName}}({{> services/cpp_handler_callback_type}} callback{{#function:args}} , {{#field:type}}{{! }}{{^function:stack_arguments?}}{{> types/cpp_arg_type}}{{/function:stack_arguments?}}{{! }}{{#function:stack_arguments?}}{{> types/cpp_stack_arg_type}}{{/function:stack_arguments?}}{{! }}{{/field:type}} {{field:cppName}}{{#last?}} {{/last?}}{{/function:args}}) override; {{/service:supportedFunctions}} {{#service:interactions}} std::unique_ptr<{{service:name}}If> create{{service:name}}() override; {{/service:interactions}} {{#service:lifecycleFunctions}} folly::SemiFuture semifuture_{{function:cppName}}() override; {{/service:lifecycleFunctions}} }; std::shared_ptr {{service:name}}Interface(PyObject *if_object, folly::Executor *exc); {{^last?}} {{/last?}} {{/program:services}}{{! }}{{#program:cppNamespaces}} } // namespace {{value}} {{/program:cppNamespaces}}