MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / load

Method load

Examples/SCExample/HotReloadSystem.h:149–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147 }
148 }
149 }
150 eventLoop = nullptr;
151 preserveFirstError(registry.close());
152 return result;
153 }
154
155 Result syncRegistry()
156 {
157 PluginDefinition definitions[16];
158 Span<PluginDefinition> definitionSpan;
159 Buffer fileBuffer;
160 SC_TRY(PluginScanner::scanDirectory(state.examplesPath.view(), definitions, fileBuffer, definitionSpan))
161 SC_TRY(registry.replaceDefinitions(move(definitionSpan)));
162 return Result(true);
163 }
164
165 Result load(StringView identifier)
166 {
167 const PluginDynamicLibrary* exampleLibrary = registry.findPlugin(identifier);
168
169 Buffer serializedModelState, serializedViewState;
170 if (exampleLibrary)
171 {
172 ISCExample* example = nullptr;
173 if (exampleLibrary->queryInterface(example) and example->serialize.isValid())
174 {
175 SC_TRY(example->serialize(serializedModelState, serializedViewState));
176 }
177 if (example and example->closeAsync.isValid())
178 {
179 SC_TRY(example->closeAsync(*eventLoop));
180 }
181 }
182
183 SC_TRY(registry.loadPlugin(identifier, compiler, sysroot, state.executablePath.view(),
184 PluginRegistry::LoadMode::Reload));
185
186 ISCExample* example = nullptr;
187 SC_TRY(exampleLibrary->queryInterface(example));

Callers 2

drawInternalMethod · 0.45
drawToolbarMethod · 0.45

Calls 11

findPluginMethod · 0.80
queryInterfaceMethod · 0.80
loadPluginMethod · 0.80
ResultClass · 0.50
isValidMethod · 0.45
serializeMethod · 0.45
closeAsyncMethod · 0.45
viewMethod · 0.45
isEmptyMethod · 0.45
deserializeMethod · 0.45
initAsyncMethod · 0.45

Tested by

no test coverage detected