| 293 | // Register the ModuleFactories to the existing Runtimes |
| 294 | for (const auto& runtime : runtimes) { |
| 295 | for (const auto& moduleFactory : moduleFactories) { |
| 296 | runtime->registerNativeModuleFactory(moduleFactory); |
| 297 | } |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | void RuntimeManager::registerTypeConverter(const StringBox& className, const StringBox& functionPath) { |
| 302 | std::vector<SharedRuntime> runtimes; |
| 303 | { |
| 304 | std::lock_guard<Mutex> guard(_mutex); |
| 305 | auto& it = _registeredTypeConverters.emplace_back(); |
| 306 | it.className = className; |
| 307 | it.functionPath = functionPath; |
| 308 | runtimes = getAllRuntimes(guard); |
| 309 | } |
| 310 | |
| 311 | // Register the TypeConverter to the existing Runtimes |
| 312 | for (const auto& runtime : runtimes) { |