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);
131 
132  enum
133  {
134  RegisterAvailablePluginEvent = vtkCommand::UserEvent + 91
135  };
136 
137 protected:
139  ~vtkPVPluginTracker() override;
140 
141 private:
142  vtkPVPluginTracker(const vtkPVPluginTracker&) = delete;
143  void operator=(const vtkPVPluginTracker&) = delete;
144 
145  class vtkPluginsList;
146  vtkPluginsList* PluginsList;
147 
148  void LoadPluginConfigurationXMLConf(std::string const& exe_dir, std::string const& conf);
149  void LoadPluginConfigurationXMLHinted(vtkPVXMLElement*, const char* hint, bool forceLoad);
150 };
151 
152 #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:51
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 &)