45#define WIN32_LEAN_AND_MEAN
60#include <boost/tokenizer.hpp>
78 typedef boost::tokenizer<boost::char_separator<char> >
Tokenizer;
81 for (Tokenizer::iterator
i =
tok.begin();
i !=
tok.end(); ++
i) {
108 std::vector <std::string>
items;
112 if (
items.size() == 0) {
128 const char *
ds =
dir.c_str();
135 std::string name =
fd.cFileName;
141 name =
dir +
"/" + name;
154 const char *
ds =
dir.c_str();
158 "Field3D_plugin loader: could not open directory " +
dir +
"\n";
166 std::string name =
dirent->d_name;
169 name =
dir +
"/" + name;
209 "Field3D Plugin loader: failed to load plugin: " <<
errmsg <<
"\n";
228 "Field3D plugin loader: failed to load "
229 "the symbol registerField3DPlugin");
262 std::vector<std::string>
paths;
268 for (
unsigned int i = 0;
i <
paths.size();
i++) {
271 std::vector<std::string>
sos;
277 for (
unsigned int j = 0;
j <
sos.size();
j++) {
315 "failed to init Field3D plugin " +
sofile);
328bool PluginLoader::getDso(
char *
cptr,
const char *
dso,
335 std::vector<std::string>
paths;
341 for (
unsigned int i=0;
i <
paths.size();
i++) {
345 const char *
ds =
dir.c_str();
354 std::string name =
dirent->d_name;
374bool PluginLoader::resolveGlobalsForPlugins(
const char *
dso) {
391 std::cout <<
"Field3D Plugin loader: failed to load Houdini plugin: "
397 Msg::print(
"---------------------------------------------------------");
399 Msg::print(
"---------------------------------------------------------");
Contains the ClassFactory class for registering Field3D classes.
bool getDirSos(std::vector< std::string > &sos, std::string &dir)
static RegistrationFunc findRegistrationFunc(const std::string &sofile)
static int filter(std::string &name, const char *suffix)
FIELD3D_NAMESPACE_OPEN typedef int(* RegistrationFunc)(ClassFactory &)
Contains the PluginLoader class.
bool getDirSos(std::vector< std::string > &sos, std::string &dir)
static ClassFactory & singleton()
}
PluginLoader()
Default constructor.
~PluginLoader()
Destructor.
static std::vector< std::string > ms_pluginsLoaded
List of plugins loaded.
static void loadPlugins()
Checks all paths in $FIELD3D_DSO_PATH and loads the plugins it finds.
FIELD3D_API void print(Severity severity, const std::string &message)
Sends the string to the assigned output, prefixing the message with the severity.
#define FIELD3D_NAMESPACE_SOURCE_CLOSE