{{! Copyright (c) Meta Platforms, Inc. and its 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. }}{{ > Autogen}} #pragma once #include #include #include "{{program:include_prefix}}{{program:name}}_types.h" {{#program:thrift_includes}} #include "{{program:include_prefix}}{{program:name}}_metadata.h" {{/program:thrift_includes}} {{#program:services}} {{ > common/service_namespace_cpp2_begin }} class {{service:cpp_name}}; {{ > common/service_namespace_cpp2_end }} {{/program:services}} namespace apache { namespace thrift { namespace detail { namespace md { {{#program:enums}} {{^program:no_metadata?}} template <> class EnumMetadata<{{ > common/namespace_cpp2}}{{enum:cpp_name}}> { public: static void gen(ThriftMetadata& metadata); }; {{/program:no_metadata?}} {{#program:no_metadata?}} template <> class EnumMetadata<{{ > common/namespace_cpp2}}{{enum:cpp_name}}> : private EmptyMetadata { public: using EmptyMetadata::gen; }; {{/program:no_metadata?}} {{/program:enums}} {{#program:structs}} {{^program:no_metadata?}} template <> class StructMetadata<{{struct:cpp_fullname}}> { public: static const ::apache::thrift::metadata::ThriftStruct& gen(ThriftMetadata& metadata); {{#program:unstructured_annotations_in_metadata?}} private: static void unstructured_annotations(::apache::thrift::metadata::ThriftStruct& thriftStruct); {{/program:unstructured_annotations_in_metadata?}} }; {{/program:no_metadata?}} {{#program:no_metadata?}} template <> class StructMetadata<{{struct:cpp_fullname}}> : private EmptyMetadata { public: using EmptyMetadata::gen; }; {{/program:no_metadata?}} {{/program:structs}} {{#program:structs}} {{#struct:exception?}} {{^program:no_metadata?}} template <> class ExceptionMetadata<{{struct:cpp_fullname}}> { public: static void gen(ThriftMetadata& metadata); }; {{/program:no_metadata?}} {{#program:no_metadata?}} template <> class ExceptionMetadata<{{struct:cpp_fullname}}> : private EmptyMetadata { public: using EmptyMetadata::gen; }; {{/program:no_metadata?}} {{/struct:exception?}} {{/program:structs}} {{#program:services}} {{^program:no_metadata?}} template <> class ServiceMetadata<::{{ > service_common/service_class_name}}> { public: static void gen(ThriftServiceMetadataResponse& response); private: static const ThriftServiceContextRef* genRecurse(ThriftMetadata& metadata, std::vector& services); template friend class ServiceMetadata; {{#service:functions}}{{^function:starts_interaction?}} static void gen_{{function:cpp_name}}(ThriftMetadata& metadata, ThriftService& context); {{/function:starts_interaction?}}{{/service:functions}} }; {{/program:no_metadata?}} {{#program:no_metadata?}} template <> class ServiceMetadata<::{{ > service_common/service_class_name}}> : private EmptyServiceMetadata { public: using EmptyServiceMetadata::gen; private: using EmptyServiceMetadata::genRecurse; template friend class ServiceMetadata; }; {{/program:no_metadata?}} {{/program:services}} } // namespace md } // namespace detail } // namespace thrift } // namespace apache