vtkPVPluginTracker.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkPVPluginTracker.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
28 #ifndef vtkPVPluginTracker_h
29 #define vtkPVPluginTracker_h
30 
31 #include "vtkCommand.h" // needed for vtkCommand
32 #include "vtkObject.h"
33 #include "vtkRemotingCoreModule.h" // needed for exports
34 #include "vtkSmartPointer.h" // needed for vtkSmartPointer
35 
36 class vtkPVPlugin;
37 class vtkPVXMLElement;
38 
39 typedef bool (*vtkPluginSearchFunction)(const char*);
40 
41 class VTKREMOTINGCORE_EXPORT vtkPVPluginTracker : public vtkObject
42 {
43 public:
44  static vtkPVPluginTracker* New();
45  vtkTypeMacro(vtkPVPluginTracker, vtkObject);
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
52  static vtkPVPluginTracker* GetInstance();
53 
64  void RegisterPlugin(vtkPVPlugin*);
65 
73  unsigned int RegisterAvailablePlugin(const char* filename);
74 
76 
92  void LoadPluginConfigurationXMLs(const char* appname);
93  void LoadPluginConfigurationXML(const char* filename, bool forceLoad = false);
94  void LoadPluginConfigurationXML(vtkPVXMLElement*, bool forceLoad = false);
95  void LoadPluginConfigurationXMLFromString(const char* xmlcontents, bool forceLoad = false);
97 
101  unsigned int GetNumberOfPlugins();
102 
108  vtkPVPlugin* GetPlugin(unsigned int index);
109 
111 
115  const char* GetPluginName(unsigned int index);
116  const char* GetPluginFileName(unsigned int index);
117  bool GetPluginLoaded(unsigned int index);
118  bool GetPluginAutoLoad(unsigned int index);
120 
124  static void RegisterStaticPluginSearchFunction(vtkPluginSearchFunction function);
125 #ifndef VTK_LEGACY_REMOVE
126  static VTK_LEGACY(void SetStaticPluginSearchFunction(vtkPluginSearchFunction function));
127 #endif
128 
129  enum
130  {
131  RegisterAvailablePluginEvent = vtkCommand::UserEvent + 91
132  };
133 
134 protected:
136  ~vtkPVPluginTracker() override;
137 
138 private:
139  vtkPVPluginTracker(const vtkPVPluginTracker&) = delete;
140  void operator=(const vtkPVPluginTracker&) = delete;
141 
142  class vtkPluginsList;
143  vtkPluginsList* PluginsList;
144 
145  void LoadPluginConfigurationXMLConf(std::string const& exe_dir, std::string const& conf);
146  void LoadPluginConfigurationXMLHinted(vtkPVXMLElement*, const char* hint, bool forceLoad);
147 };
148 
149 #endif
150 
151 // VTK-HeaderTest-Exclude: vtkPVPluginTracker.h
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:52
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
static vtkObject * New()
void operator=(const vtkObjectBase &)