Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PluginLoader.h
Go to the documentation of this file.
1 #ifndef OMNI_PLUGINLOADER_H_
2 #define OMNI_PLUGINLOADER_H_
3 
4 #include <vector>
5 #include <QDir>
6 #include <QString>
7 #include <omni/PluginInfo.h>
8 
9 namespace omni {
10  /**@brief PluginLoader singleton to load plugins from multiple directories
11  @detail Plugins have the extension omnix
12  **/
13  class PluginLoader {
14  public:
16  std::vector<QDir>const& _paths = std::vector<QDir>(),
17  bool _defaultPaths = true);
18 
19  /// Load plugins from list of paths
20  static void load(std::vector<QDir>const& _paths);
21 
22  /// Load plugins from single path
23  static void load(QDir const& _path);
24 
25  /// Return default plugin path
26  static std::vector<QDir> defaultPaths();
27 
28  /// Return list of information about loaded plugins
29  static std::vector<PluginInfo>const& loadedPlugins();
30 
31  private:
32  /// Kept list of loaded plugins
33  static std::vector<PluginInfo> loadedPlugins_;
34 
35  /// Load a single plugin from file
36  static void loadPlugin(QString const& _file);
37  };
38 }
39 
40 #endif /* OMNI_PLUGINLOADER_H_ */
PluginLoader singleton to load plugins from multiple directories Plugins have the extension omnix...
Definition: PluginLoader.h:13
static std::vector< QDir > defaultPaths()
Return default plugin path.
Definition: PluginLoader.cpp:83
static std::vector< PluginInfo > loadedPlugins_
Kept list of loaded plugins.
Definition: PluginLoader.h:33
static void loadPlugin(QString const &_file)
Load a single plugin from file.
Definition: PluginLoader.cpp:45
static void load(std::vector< QDir >const &_paths)
Load plugins from list of paths.
Definition: PluginLoader.cpp:38
PluginLoader(std::vector< QDir >const &_paths=std::vector< QDir >(), bool _defaultPaths=true)
Definition: PluginLoader.cpp:16
static std::vector< PluginInfo > const & loadedPlugins()
Return list of information about loaded plugins.
Definition: PluginLoader.cpp:79