Choreonoid  1.8
PluginManager.h
Go to the documentation of this file.
1 
5 #ifndef CNOID_BASE_PLUGIN_MANAGER_H
6 #define CNOID_BASE_PLUGIN_MANAGER_H
7 
8 #include <string>
9 #include "exportdecl.h"
10 
11 namespace cnoid {
12 
13 class Plugin;
14 class ExtensionManager;
15 
16 class CNOID_EXPORT PluginManager
17 {
18 public:
19 
20  static void initialize(ExtensionManager* ext);
21  static PluginManager* instance();
22  static void finalize();
23 
24  ~PluginManager();
25 
26  void doStartupLoading(const char* pluginPathList);
27  void scanPluginFilesInPathList(const std::string& pathList);
28  void scanPluginFilesInDirectoyOfExecFile();
29  void scanPluginFiles(const std::string& pathString);
30  void clearUnusedPlugins();
31  void loadPlugins();
32  bool finalizePlugins();
33 
34  int numPlugins() const;
35 
36  const std::string& pluginPath(int index) const;
37  const std::string& pluginName(int index) const;
38 
39  enum PluginStatus { NOT_LOADED, LOADED, ACTIVE, FINALIZED, UNLOADED, INVALID, CONFLICT };
40  int pluginStatus(int index) const;
41 
42  Plugin* findPlugin(const std::string& name);
43  const std::string& getErrorMessage(const std::string& name);
44 
45  bool loadPlugin(int index);
46  bool unloadPlugin(int index);
47  bool unloadPlugin(const std::string& name);
48  bool reloadPlugin(const std::string& name);
49 
50  const char* guessActualPluginName(const std::string& name);
51 
52 private:
54 
55  class Impl;
56  Impl* impl;
57 };
58 
59 }
60 
61 #endif
cnoid::PluginManager::UNLOADED
@ UNLOADED
Definition: PluginManager.h:39
cnoid::ExtensionManager
Definition: ExtensionManager.h:23
cnoid::Plugin
Definition: Plugin.h:20
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::PluginManager::PluginStatus
PluginStatus
Definition: PluginManager.h:39
cnoid::PluginManager
Definition: PluginManager.h:16