VTK
dox/Common/Core/vtkDynamicLoader.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkDynamicLoader.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00024 #ifndef __vtkDynamicLoader_h
00025 #define __vtkDynamicLoader_h
00026 
00027 #include "vtkCommonCoreModule.h" // For export macro
00028 #include "vtkObject.h"
00029 #include <vtksys/DynamicLoader.hxx>
00030 
00031 //BTX
00032 typedef vtksys::DynamicLoader::LibraryHandle vtkLibHandle;
00033 // Cannot use this as this is a void (*)() but VTK old API used to be void*
00034 typedef vtksys::DynamicLoader::SymbolPointer vtkSymbolPointer;
00035 //ETX
00036 
00037 class VTKCOMMONCORE_EXPORT vtkDynamicLoader : public vtkObject
00038 {
00039 public:
00040   static vtkDynamicLoader* New();
00041   vtkTypeMacro(vtkDynamicLoader,vtkObject);
00042 
00043   //BTX
00046   static vtkLibHandle OpenLibrary(const char*);
00047 
00050   static int CloseLibrary(vtkLibHandle);
00051 
00053 
00055   static void* GetSymbolAddress(vtkLibHandle, const char*);
00056   //ETX
00058 
00060   static const char* LibPrefix();
00061 
00063   static const char* LibExtension();
00064 
00066   static const char* LastError();
00067 
00068 protected:
00069   vtkDynamicLoader() {}
00070   ~vtkDynamicLoader() {}
00071 
00072 private:
00073   vtkDynamicLoader(const vtkDynamicLoader&);  // Not implemented.
00074   void operator=(const vtkDynamicLoader&);  // Not implemented.
00075 };
00076 
00077 #endif
00078 // VTK-HeaderTest-Exclude: vtkDynamicLoader.h