// Copyright (C) 2013-2020 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. #if !defined (COMMONAPI_INTERNAL_COMPILATION) #error "Only can be included directly, this file may disappear or change contents." #endif #ifndef COMMONAPI_FACTORY_HPP_ #define COMMONAPI_FACTORY_HPP_ #include #include #include #include #include namespace CommonAPI { class MainLoopContext; class Proxy; class StubBase; class COMMONAPI_EXPORT Factory { public: typedef std::function &)> AvailableInstancesCbk_t; typedef std::function InstanceAliveCbk_t; virtual ~Factory() {}; virtual void init() = 0; virtual std::shared_ptr createProxy(const std::string &_domain, const std::string &_interface, const std::string &_instance, const ConnectionId_t &_connectionId) = 0; virtual std::shared_ptr createProxy(const std::string &_domain, const std::string &_interface, const std::string &_instance, std::shared_ptr mainLoopContext) = 0; virtual bool registerStub(const std::string &_domain, const std::string &_interface, const std::string &_instance, std::shared_ptr _stub, const ConnectionId_t &_connectionId) = 0; virtual bool registerStub(const std::string &_domain, const std::string &_interface, const std::string &_instance, std::shared_ptr _stub, std::shared_ptr mainLoopContext) = 0; virtual bool unregisterStub(const std::string &_domain, const std::string &_interface, const std::string &_instance) = 0; }; } // namespace CommonAPI #endif // COMMONAPI_FACTORY_HPP_