| 76 | } |
| 77 | |
| 78 | BackendRegistry::FactoryFunction DynamicBackend::GetFactoryFunction() |
| 79 | { |
| 80 | if (m_BackendFactoryFunction == nullptr) |
| 81 | { |
| 82 | throw RuntimeException("GetFactoryFunction error: invalid function pointer"); |
| 83 | } |
| 84 | |
| 85 | return [this]() -> IBackendInternalUniquePtr |
| 86 | { |
| 87 | // This call throws in case of error |
| 88 | return CreateBackend(); |
| 89 | }; |
| 90 | } |
| 91 | |
| 92 | template<typename BackendFunctionType> |
| 93 | BackendFunctionType DynamicBackend::SetFunctionPointer(const std::string& backendFunctionName) |