VTK  9.3.20240329
vtkDynamicLoader.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
13 #ifndef vtkDynamicLoader_h
14 #define vtkDynamicLoader_h
15 
16 #include "vtkCommonCoreModule.h" // For export macro
17 #include "vtkObject.h"
18 #include <vtksys/DynamicLoader.hxx> // Implementation
19 
20 typedef vtksys::DynamicLoader::LibraryHandle vtkLibHandle;
21 typedef vtksys::DynamicLoader::SymbolPointer vtkSymbolPointer;
22 
23 VTK_ABI_NAMESPACE_BEGIN
24 class VTKCOMMONCORE_EXPORT vtkDynamicLoader : public vtkObject
25 {
26 public:
27  static vtkDynamicLoader* New();
28  vtkTypeMacro(vtkDynamicLoader, vtkObject);
29  void PrintSelf(ostream& os, vtkIndent indent) override;
30 
36  static vtkLibHandle OpenLibrary(VTK_FILEPATH const char*);
37  static vtkLibHandle OpenLibrary(VTK_FILEPATH const char*, int);
38 
44 
49 
53  static const char* LibPrefix();
54 
58  static const char* LibExtension();
59 
63  static const char* LastError();
64 
65 protected:
66  vtkDynamicLoader() = default;
67  ~vtkDynamicLoader() override = default;
68 
69 private:
70  vtkDynamicLoader(const vtkDynamicLoader&) = delete;
71  void operator=(const vtkDynamicLoader&) = delete;
72 };
73 
74 VTK_ABI_NAMESPACE_END
75 #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:108
abstract base class for most VTK objects
Definition: vtkObject.h:162
vtksys::DynamicLoader::SymbolPointer vtkSymbolPointer
vtksys::DynamicLoader::LibraryHandle vtkLibHandle
#define VTK_FILEPATH