VTK
dox/Common/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 "vtkObject.h"
00028 #include <vtksys/DynamicLoader.hxx>
00029 
00030 //BTX
00031 typedef vtksys::DynamicLoader::LibraryHandle vtkLibHandle;
00032 // Cannot use this as this is a void (*)() but VTK old API used to be void*
00033 typedef vtksys::DynamicLoader::SymbolPointer vtkSymbolPointer;
00034 //ETX
00035 
00036 class VTK_COMMON_EXPORT vtkDynamicLoader : public vtkObject
00037 {
00038 public:
00039   static vtkDynamicLoader* New();
00040   vtkTypeMacro(vtkDynamicLoader,vtkObject);
00041 
00042   //BTX
00045   static vtkLibHandle OpenLibrary(const char*);
00046 
00049   static int CloseLibrary(vtkLibHandle);
00050 
00052 
00054   static void* GetSymbolAddress(vtkLibHandle, const char*);
00055   //ETX
00057 
00059   static const char* LibPrefix();
00060 
00062   static const char* LibExtension();
00063 
00065   static const char* LastError();
00066 
00067 protected:
00068   vtkDynamicLoader() {};
00069   ~vtkDynamicLoader() {};
00070 
00071 private:
00072   vtkDynamicLoader(const vtkDynamicLoader&);  // Not implemented.
00073   void operator=(const vtkDynamicLoader&);  // Not implemented.
00074 };
00075 
00076 #endif