Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkDynamicLoader.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkDynamicLoader.h,v $
00005   Language:  C++
00006   Date:      $Date: 2005/03/22 18:25:13 $
00007   Version:   $Revision: 1.23 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkDynamicLoader_h
00018 #define __itkDynamicLoader_h
00019 
00020 #include "itkMacro.h"
00021 
00022 // Ugly stuff for library handles.
00023 // They are different on several different OS's
00024 #if defined(__hpux)
00025 # include <dl.h>
00026 namespace itk
00027 {
00028 typedef shl_t LibHandle;
00029 } // end namespace itk
00030 #elif defined(_WIN32)
00031 #include "itkWindows.h"
00032 
00033 namespace itk
00034 {
00035 typedef HMODULE LibHandle;
00036 } // end namespace itk
00037 #else
00038 namespace itk
00039 {
00040 typedef void* LibHandle;
00041 } // end namespace itk
00042 #endif
00043 
00044 #include "itkObject.h"
00045 #include "itkObjectFactory.h"
00046 
00047 namespace itk
00048 {
00049 
00060 class ITKCommon_EXPORT DynamicLoader : public Object
00061 {
00062 public:
00064   typedef DynamicLoader       Self;
00065   typedef Object  Superclass;
00066   typedef SmartPointer<Self>  Pointer;
00067   typedef SmartPointer<const Self>  ConstPointer;
00068     
00070   itkNewMacro(Self);
00071   
00073   itkTypeMacro(DynamicLoader,Object);
00074 
00078   static LibHandle OpenLibrary(const char*);
00079 
00082   static int CloseLibrary(LibHandle);
00083   
00085   static void* GetSymbolAddress(LibHandle, const char*);
00086 
00088   static const char* LibPrefix();
00089 
00091   static const char* LibExtension();
00092 
00094   static const char* LastError();
00095   
00096 protected:
00097   DynamicLoader();
00098   ~DynamicLoader();
00099 
00100 private:
00101   DynamicLoader(const Self&); //purposely not implemented
00102   void operator=(const Self&); //purposely not implemented
00103 
00104 };
00105 
00106 } // end namespace itk
00107   
00108 #endif

Generated at Wed May 24 23:03:59 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000