VTK  9.1.20211024
vtkDynamicLoader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDynamicLoader.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm 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 =========================================================================*/
25 #ifndef vtkDynamicLoader_h
26 #define vtkDynamicLoader_h
27 
28 #include "vtkCommonCoreModule.h" // For export macro
29 #include "vtkObject.h"
30 #include <vtksys/DynamicLoader.hxx> // Implementation
31 
32 typedef vtksys::DynamicLoader::LibraryHandle vtkLibHandle;
33 typedef vtksys::DynamicLoader::SymbolPointer vtkSymbolPointer;
34 
35 class VTKCOMMONCORE_EXPORT vtkDynamicLoader : public vtkObject
36 {
37 public:
38  static vtkDynamicLoader* New();
39  vtkTypeMacro(vtkDynamicLoader, vtkObject);
40  void PrintSelf(ostream& os, vtkIndent indent) override;
41 
47  static vtkLibHandle OpenLibrary(VTK_FILEPATH const char*);
48  static vtkLibHandle OpenLibrary(VTK_FILEPATH const char*, int);
49 
55 
60 
64  static const char* LibPrefix();
65 
69  static const char* LibExtension();
70 
74  static const char* LastError();
75 
76 protected:
77  vtkDynamicLoader() = default;
78  ~vtkDynamicLoader() override = default;
79 
80 private:
81  vtkDynamicLoader(const vtkDynamicLoader&) = delete;
82  void operator=(const vtkDynamicLoader&) = delete;
83 };
84 
85 #endif
class interface to system dynamic libraries
static const char * LibPrefix()
Return the library prefix for the given architecture.
vtkDynamicLoader()=default
static vtkSymbolPointer GetSymbolAddress(vtkLibHandle, const char *)
Find the address of the symbol in the given library.
static const char * LastError()
Return the last error produced from a calls made on this class.
static const char * LibExtension()
Return the library extension for the given architecture.
static vtkLibHandle OpenLibrary(VTK_FILEPATH const char *)
Load a dynamic library into the current process.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static int CloseLibrary(vtkLibHandle)
Attempt to detach a dynamic library from the process.
static vtkDynamicLoader * New()
static vtkLibHandle OpenLibrary(VTK_FILEPATH const char *, int)
~vtkDynamicLoader() override=default
a simple class to control print indentation
Definition: vtkIndent.h:113
abstract base class for most VTK objects
Definition: vtkObject.h:82
vtksys::DynamicLoader::SymbolPointer vtkSymbolPointer
vtksys::DynamicLoader::LibraryHandle vtkLibHandle
#define VTK_FILEPATH