/* * Copyright (c) 2017 Samsung Electronics Co., Ltd. * * 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. */ #ifndef IDLC_C_GEN_C_PROXY_BODY_GEN_H_ #define IDLC_C_GEN_C_PROXY_BODY_GEN_H_ #include #include #include "idlc/c_gen/c_body_gen_base.h" namespace tidl { class CProxyBodyGen : public CBodyGeneratorBase { public: explicit CProxyBodyGen(std::shared_ptr doc); virtual ~CProxyBodyGen() = default; void OnInitGen(std::ofstream& stream) override; void OnFiniGen(std::ofstream& stream) override; private: void GenTypedefProxyDelegate(std::ofstream& stream); void GenInterfaces(std::ofstream& stream); private: void GenInterface(std::ofstream& stream, const Interface& inf); void GenInterfaceDeclaration(std::ofstream& stream, const Interface& inf); void GenInterfaceDelegators(std::ofstream& stream, const Interface& inf); void GenInterfaceDelegatorTable(std::ofstream& stream, const Interface& inf); void GenInterfaceDelegatorHandler(std::ofstream& stream, const Interface& inf); void GenInterfaceConsumeCommand(std::ofstream& stream, const Interface& inf); void GenInterfaceOnConnectedEventCB(std::ofstream& stream, const Interface& inf); void GenInterfaceOnDisconnectedEventCB(std::ofstream& stream, const Interface& inf); void GenInterfaceOnRejectedEventCB(std::ofstream& stream, const Interface& inf); void GenInterfaceOnReceivedEventCB(std::ofstream& stream, const Interface& inf); void GenInterfaceMethods(std::ofstream& stream, const Interface& inf); void GenInterfaceHandleCtor(std::ofstream& stream, const Interface& inf); void GenInterfaceHandleDtor(std::ofstream& stream, const Interface& inf); void GenInterfaceCtor(std::ofstream& stream, const Interface& inf); void GenInterfaceConnect(std::ofstream& stream, const Interface& inf); void GenInterfaceDtor(std::ofstream& stream, const Interface& inf); private: void GenInterfaceDelegator(std::ofstream& stream, const std::string& id, const Declaration& decl); void GenInterfaceDelegatorDeclaration(std::ofstream& stream, const std::string& id, const Declaration& decl); void GenInterfaceDelegatorSerializer(std::ofstream& stream, const std::string& id, const Declaration& decl); void GenInterfaceDelegatorDeserializer(std::ofstream& stream, const std::string& id, const Declaration& decl); void GenInterfaceDelegatorConstructor(std::ofstream& stream, const std::string& id, const Declaration& decl); void GenInterfaceDelegatorDisposer(std::ofstream& stream, const std::string& id, const Declaration& decl); void GenInterfaceDelegatorInvoker(std::ofstream& stream, const std::string& id, const Declaration& decl); private: std::string GetMethodWriteString(const Interface& inf, const Declaration& decl); std::string GetMethodReadString(const Interface& inf, const Declaration& decl); }; } // namespace tidl #endif // IDLC_C_GEN_C_PROXY_BODY_GEN_H_