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 "vtkParaViewDeprecation.h" // for deprecation macro
22 #include "vtkRemotingCoreModule.h" // needed for exports
23 #include "vtkSmartPointer.h" // needed for vtkSmartPointer
24 
25 #include <vector> // for std::vector
26 
27 class vtkPVPlugin;
28 class vtkPVXMLElement;
29 
30 typedef bool (*vtkPluginSearchFunction)(const char*);
31 typedef void (*vtkPluginListFunction)(const char* appname, std::vector<std::string>& names);
32 
34 {
35 public:
36  static vtkPVPluginTracker* New();
37  vtkTypeMacro(vtkPVPluginTracker, vtkObject);
38  void PrintSelf(ostream& os, vtkIndent indent) override;
39 
44  static vtkPVPluginTracker* GetInstance();
45 
56  void RegisterPlugin(vtkPVPlugin*);
57 
65  PARAVIEW_DEPRECATED_IN_5_14_0("Use LoadPluginConfigurationXML instead.")
66  unsigned int RegisterAvailablePlugin(const char* filename);
67 
69 
85  void LoadPluginConfigurationXMLs(const char* appname);
86  void LoadPluginConfigurationXML(const char* filename, bool forceLoad = false);
87  void LoadPluginConfigurationXML(vtkPVXMLElement*, bool forceLoad = false);
88  void LoadPluginConfigurationXMLFromString(const char* xmlcontents, bool forceLoad = false);
90 
94  unsigned int GetNumberOfPlugins();
95 
101  vtkPVPlugin* GetPlugin(unsigned int index);
102 
104 
109  const char* GetPluginName(unsigned int index);
110  const char* GetPluginFileName(unsigned int index);
111  bool GetPluginLoaded(unsigned int index);
112  bool GetPluginAutoLoad(unsigned int index);
113  bool GetPluginDelayedLoad(unsigned int index);
114  std::vector<std::string> GetPluginXMLs(unsigned int index);
115  std::string GetPluginVersion(unsigned int index);
116  std::string GetPluginDescription(unsigned int index);
118 
120 
123  static void RegisterStaticPluginSearchFunction(vtkPluginSearchFunction function);
124  static void RegisterStaticPluginListFunction(vtkPluginListFunction function);
126 
127  enum
128  {
129  RegisterAvailablePluginEvent = vtkCommand::UserEvent + 91
130  };
131 
132 protected:
134  ~vtkPVPluginTracker() override;
135 
136 private:
137  vtkPVPluginTracker(const vtkPVPluginTracker&) = delete;
138  void operator=(const vtkPVPluginTracker&) = delete;
139 
140  class vtkPluginsList;
141  vtkPluginsList* PluginsList;
142 
143  void LoadPluginConfigurationXMLConf(std::string const& exe_dir, std::string const& conf);
144  void LoadPluginConfigurationXMLHinted(vtkPVXMLElement*, const char* hint, bool forceLoad);
145 };
146 
147 #endif
a global manager for each processes to keep track of plugins loaded on that process.
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
#define PARAVIEW_DEPRECATED_IN_5_14_0(reason)
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.
#define const
Definition: zconf.h:238
static vtkObject * New()
void operator=(const vtkObjectBase &)