2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
8 #include "IBackendInternal.hpp"
19 using HandleCloser = std::function<void(const void*)>;
20 using HandlePtr = std::unique_ptr<void, HandleCloser>;
22 explicit DynamicBackend(const void* sharedObjectHandle);
24 /// Public dynamic backend functions
25 BackendId GetBackendId();
26 BackendVersion GetBackendVersion();
27 IBackendInternalUniquePtr GetBackend();
30 template<typename BackendFunctionType>
31 BackendFunctionType SetFunctionPointer(const std::string& backendFunctionName);
33 /// Backend function pointer types
34 using IdFunctionType = const char*(*)();
35 using VersionFunctionType = void(*)(uint32_t*, uint32_t*);
36 using FactoryFunctionType = void*(*)();
38 /// Backend function pointers
39 IdFunctionType m_BackendIdFunction;
40 VersionFunctionType m_BackendVersionFunction;
41 FactoryFunctionType m_BackendFactoryFunction;
43 /// Shared object handle
47 using DynamicBackendPtr = std::unique_ptr<DynamicBackend>;