vtkPVPluginTracker.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
16 #ifndef vtkPVPluginTracker_h
17 #define vtkPVPluginTracker_h
18 
19 #include "vtkCommand.h" // needed for vtkCommand
20 #include "vtkObject.h"
21 #include "vtkRemotingCoreModule.h" // needed for exports
22 #include "vtkSmartPointer.h" // needed for vtkSmartPointer
23 
24 #include <vector> // for std::vector
25 
26 class vtkPVPlugin;
27 class vtkPVXMLElement;
28 
29 typedef bool (*vtkPluginSearchFunction)(const char*);
30 typedef void (*vtkPluginListFunction)(const char* appname, std::vector<std::string>& names);
31 
33 {
34 public:
35  static vtkPVPluginTracker* New();
36  vtkTypeMacro(vtkPVPluginTracker, vtkObject);
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
43  static vtkPVPluginTracker* GetInstance();
44 
55  void RegisterPlugin(vtkPVPlugin*);
56 
58 
74  void LoadPluginConfigurationXMLs(const char* appname);
75  void LoadPluginConfigurationXML(const char* filename, bool forceLoad = false);
76  void LoadPluginConfigurationXML(vtkPVXMLElement*, bool forceLoad = false);
77  void LoadPluginConfigurationXMLFromString(const char* xmlcontents, bool forceLoad = false);
79 
83  unsigned int GetNumberOfPlugins();
84 
90  vtkPVPlugin* GetPlugin(unsigned int index);
91 
93 
98  const char* GetPluginName(unsigned int index);
99  const char* GetPluginFileName(unsigned int index);
100  bool GetPluginLoaded(unsigned int index);
101  bool GetPluginAutoLoad(unsigned int index);
102  bool GetPluginDelayedLoad(unsigned int index);
103  std::vector<std::string> GetPluginXMLs(unsigned int index);
104  std::string GetPluginVersion(unsigned int index);
105  std::string GetPluginDescription(unsigned int index);
107 
109 
112  static void RegisterStaticPluginSearchFunction(vtkPluginSearchFunction function);
113  static void RegisterStaticPluginListFunction(vtkPluginListFunction function);
115 
116  enum
117  {
118  RegisterAvailablePluginEvent = vtkCommand::UserEvent + 91
119  };
120 
121 protected:
123  ~vtkPVPluginTracker() override;
124 
125 private:
126  vtkPVPluginTracker(const vtkPVPluginTracker&) = delete;
127  void operator=(const vtkPVPluginTracker&) = delete;
128 
129  class vtkPluginsList;
130  vtkPluginsList* PluginsList;
131 
132  void LoadPluginConfigurationXMLConf(std::string const& exe_dir, std::string const& conf);
133  void LoadPluginConfigurationXMLHinted(vtkPVXMLElement*, const char* hint, bool forceLoad);
134 };
135 
136 #endif
a global manager for each processes to keep track of plugins loaded on that process.
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
bool(* vtkPluginSearchFunction)(const char *)
defines the core interface for any ParaView plugin.
Definition: vtkPVPlugin.h:38
void(* vtkPluginListFunction)(const char *appname, std::vector< std::string > &names)
#define VTKREMOTINGCORE_EXPORT
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
static vtkObject * New()
void operator=(const vtkObjectBase &)