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 #include <vector> // for std::vector
37 
38 class vtkPVPlugin;
39 class vtkPVXMLElement;
40 
41 typedef bool (*vtkPluginSearchFunction)(const char*);
42 typedef void (*vtkPluginListFunction)(const char* appname, std::vector<std::string>& names);
43 
45 {
46 public:
47  static vtkPVPluginTracker* New();
48  vtkTypeMacro(vtkPVPluginTracker, vtkObject);
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
55  static vtkPVPluginTracker* GetInstance();
56 
67  void RegisterPlugin(vtkPVPlugin*);
68 
76  unsigned int RegisterAvailablePlugin(const char* filename);
77 
79 
95  void LoadPluginConfigurationXMLs(const char* appname);
96  void LoadPluginConfigurationXML(const char* filename, bool forceLoad = false);
97  void LoadPluginConfigurationXML(vtkPVXMLElement*, bool forceLoad = false);
98  void LoadPluginConfigurationXMLFromString(const char* xmlcontents, bool forceLoad = false);
100 
104  unsigned int GetNumberOfPlugins();
105 
111  vtkPVPlugin* GetPlugin(unsigned int index);
112 
114 
118  const char* GetPluginName(unsigned int index);
119  const char* GetPluginFileName(unsigned int index);
120  bool GetPluginLoaded(unsigned int index);
121  bool GetPluginAutoLoad(unsigned int index);
123 
125 
128  static void RegisterStaticPluginSearchFunction(vtkPluginSearchFunction function);
129  static void RegisterStaticPluginListFunction(vtkPluginListFunction function);
130 #ifndef VTK_LEGACY_REMOVE
131  static VTK_LEGACY(void SetStaticPluginSearchFunction(vtkPluginSearchFunction function));
132 #endif
133 
134 
135  enum
136  {
137  RegisterAvailablePluginEvent = vtkCommand::UserEvent + 91
138  };
139 
140 protected:
142  ~vtkPVPluginTracker() override;
143 
144 private:
145  vtkPVPluginTracker(const vtkPVPluginTracker&) = delete;
146  void operator=(const vtkPVPluginTracker&) = delete;
147 
148  class vtkPluginsList;
149  vtkPluginsList* PluginsList;
150 
151  void LoadPluginConfigurationXMLConf(std::string const& exe_dir, std::string const& conf);
152  void LoadPluginConfigurationXMLHinted(vtkPVXMLElement*, const char* hint, bool forceLoad);
153 };
154 
155 #endif
156 
157 // 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
#define VTK_LEGACY(method)
Definition: vtkLegacy.h:52
bool(* vtkPluginSearchFunction)(const char *)
defines the core interface for any ParaView plugin.
Definition: vtkPVPlugin.h:52
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 &)