41 #ifndef telPluginManagerH
42 #define telPluginManagerH
47 #include "telCoreExporter.h"
48 #include "telConstants.h"
49 #include "telStringList.h"
50 #include "Poco/SharedLibrary.h"
58 using std::stringstream;
63 using tlp::gEmptyString;
66 using Poco::SharedLibrary;
73 typedef pair< Poco::SharedLibrary*, Plugin* > telPlugin;
105 string getInfo()
const;
112 bool setPluginDir(
const string& dir);
118 string getPluginDir()
const;
124 int load(
const string& pluginName = gEmptyString);
130 bool unload(
Plugin* plugin = NULL);
135 int getNumberOfPlugins()
const;
141 int getNumberOfCategories()
const;
149 Plugin* getFirstPlugin()
const;
156 Plugin* getNextPlugin()
const;
163 Plugin* getPreviousPlugin()
const;
169 Plugin* getCurrentPlugin()
const;
176 Plugin* getPlugin(
const string& name)
const;
182 tlp::StringList getPluginNames()
const;
188 tlp::StringList getPluginLibraryNames()
const;
199 Plugin* operator[](
const int& i);
201 bool hasLoadErrors()
const;
202 string getLoadErrors()
const;
205 string mPluginFolder;
206 string mPluginExtension;
207 string mPluginPrefix;
208 stringstream mLoadPluginErrors;
209 mutable vector< telPlugin > mPlugins;
210 mutable vector< telPlugin >::iterator mPluginsIter;
212 bool loadPlugin(
const string& sharedLib);
213 bool checkImplementationLanguage(SharedLibrary* plugin);
214 const char* getImplementationLanguage(SharedLibrary* plugin);
215 Plugin* createCPlugin(SharedLibrary *libHandle);
216 Plugin* getPlugin(
const int& i);
218 void clearLoadErrors();