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 
64  unsigned int RegisterAvailablePlugin(const char* filename);
65 
67 
83  void LoadPluginConfigurationXMLs(const char* appname);
84  void LoadPluginConfigurationXML(const char* filename, bool forceLoad = false);
85  void LoadPluginConfigurationXML(vtkPVXMLElement*, bool forceLoad = false);
86  void LoadPluginConfigurationXMLFromString(const char* xmlcontents, bool forceLoad = false);
88 
92  unsigned int GetNumberOfPlugins();
93 
99  vtkPVPlugin* GetPlugin(unsigned int index);
100 
102 
106  const char* GetPluginName(unsigned int index);
107  const char* GetPluginFileName(unsigned int index);
108  bool GetPluginLoaded(unsigned int index);
109  bool GetPluginAutoLoad(unsigned int index);
111 
113 
116  static void RegisterStaticPluginSearchFunction(vtkPluginSearchFunction function);
117  static void RegisterStaticPluginListFunction(vtkPluginListFunction function);
119 
120  enum
121  {
122  RegisterAvailablePluginEvent = vtkCommand::UserEvent + 91
123  };
124 
125 protected:
127  ~vtkPVPluginTracker() override;
128 
129 private:
130  vtkPVPluginTracker(const vtkPVPluginTracker&) = delete;
131  void operator=(const vtkPVPluginTracker&) = delete;
132 
133  class vtkPluginsList;
134  vtkPluginsList* PluginsList;
135 
136  void LoadPluginConfigurationXMLConf(std::string const& exe_dir, std::string const& conf);
137  void LoadPluginConfigurationXMLHinted(vtkPVXMLElement*, const char* hint, bool forceLoad);
138 };
139 
140 #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 &)