Checks all paths in $FIELD3D_DSO_PATH and loads the plugins it finds.
253{
254
255 char *cptr = getenv("FIELD3D_DSO_PATH");
256 if (!cptr)
257 return;
258
259 std::string path = cptr;
260
261
262 std::vector<std::string> paths;
263 const std::string delimiters = ":";
264
265 tokenize(path, delimiters, paths);
266
267
268 for (unsigned int i = 0; i < paths.size(); i++) {
269
270
271 std::vector<std::string> sos;
273 continue;
274 }
275
276
277 for (unsigned int j = 0; j < sos.size(); j++) {
278 std::string sofile = sos[j];
279
280
281 const std::string pathDelimiter = "/";
282 std::vector<std::string> pluginName;
283 tokenize(sofile, pathDelimiter, pluginName);
284
285 bool pluginAlreadyLoaded = false;
286
288 if (pluginName.size() > 0) {
290
291
292 pluginAlreadyLoaded = true;
293 break;
294 }
295 }
296 }
297
298 if (pluginAlreadyLoaded) {
299 continue;
300 }
301
302 if (pluginName.size() > 0) {
303 std::string lastName = pluginName[pluginName.size() -1];
305 }
306
308
310 if (fptr) {
311
313 if (!res) {
315 "failed to init Field3D plugin " + sofile);
316 } else {
317 Msg::print(
"Initialized Field3D Plugin " + sofile);
318 }
319 }
320 }
321 }
322}
static RegistrationFunc findRegistrationFunc(const std::string &sofile)
FIELD3D_NAMESPACE_OPEN typedef int(* RegistrationFunc)(ClassFactory &)
bool getDirSos(std::vector< std::string > &sos, std::string &dir)
static ClassFactory & singleton()
}
static std::vector< std::string > ms_pluginsLoaded
List of plugins loaded.
FIELD3D_API void print(Severity severity, const std::string &message)
Sends the string to the assigned output, prefixing the message with the severity.