Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkDynamicLoader.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkDynamicLoader.h,v $
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 =========================================================================*/
00036 #ifndef __vtkDynamicLoader_h
00037 #define __vtkDynamicLoader_h
00038 #include "vtkObject.h"
00039 
00040 //BTX
00041 // Ugly stuff for library handles
00042 // They are different on several different OS's
00043 #if defined(__hpux)
00044 # include <dl.h> // Needed for special dynamic loading on hp
00045   typedef shl_t vtkLibHandle;
00046 #elif defined(_WIN32)
00047   typedef HMODULE vtkLibHandle;
00048 #else
00049   typedef void* vtkLibHandle;
00050 #endif
00051 //ETX
00052 
00053 
00054 
00055 class VTK_COMMON_EXPORT vtkDynamicLoader : public vtkObject
00056 {
00057 public:
00058   static vtkDynamicLoader* New();
00059   vtkTypeRevisionMacro(vtkDynamicLoader,vtkObject);
00060 
00061   //BTX
00064   static vtkLibHandle OpenLibrary(const char*);
00065 
00067 
00069   static int CloseLibrary(vtkLibHandle);
00070   //ETX
00072   
00074   static void* GetSymbolAddress(vtkLibHandle, const char*);
00075 
00077   static const char* LibPrefix();
00078 
00080   static const char* LibExtension();
00081 
00083   static const char* LastError();
00084   
00085 protected:
00086   vtkDynamicLoader() {};
00087   ~vtkDynamicLoader() {};
00088 
00089   
00090 private:
00091   vtkDynamicLoader(const vtkDynamicLoader&);  // Not implemented.
00092   void operator=(const vtkDynamicLoader&);  // Not implemented.
00093 };
00094 
00095 #endif