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 
107  const char* GetPluginName(unsigned int index);
108  const char* GetPluginFileName(unsigned int index);
109  bool GetPluginLoaded(unsigned int index);
110  bool GetPluginAutoLoad(unsigned int index);
111  bool GetPluginDelayedLoad(unsigned int index);
112  std::vector<std::string> GetPluginXMLs(unsigned int index);
114 
116 
119  static void RegisterStaticPluginSearchFunction(vtkPluginSearchFunction function);
120  static void RegisterStaticPluginListFunction(vtkPluginListFunction function);
122 
123  enum
124  {
125  RegisterAvailablePluginEvent = vtkCommand::UserEvent + 91
126  };
127 
128 protected:
130  ~vtkPVPluginTracker() override;
131 
132 private:
133  vtkPVPluginTracker(const vtkPVPluginTracker&) = delete;
134  void operator=(const vtkPVPluginTracker&) = delete;
135 
136  class vtkPluginsList;
137  vtkPluginsList* PluginsList;
138 
139  void LoadPluginConfigurationXMLConf(std::string const& exe_dir, std::string const& conf);
140  void LoadPluginConfigurationXMLHinted(vtkPVXMLElement*, const char* hint, bool forceLoad);
141 };
142 
143 #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 &)