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: 2002/01/15 18:56:33 $
00007   Version:   $Revision: 1.19 $
00008 
00009   Copyright (c) 2002 Insight 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 #elif defined(__powerpc)
00038 namespace itk
00039 {
00040 typedef ConnectionID LibHandle;
00041 } // end namespace itk
00042 #else
00043 namespace itk
00044 {
00045 typedef void* LibHandle;
00046 } // end namespace itk
00047 #endif
00048 
00049 #include "itkObject.h"
00050 #include "itkObjectFactory.h"
00051 
00052 namespace itk
00053 {
00054 
00065 class ITK_EXPORT DynamicLoader : public Object
00066 {
00067 public:
00069   typedef DynamicLoader       Self;
00070   typedef Object  Superclass;
00071   typedef SmartPointer<Self>  Pointer;
00072   typedef SmartPointer<const Self>  ConstPointer;
00073     
00075   itkNewMacro(Self);
00076   
00078   itkTypeMacro(DynamicLoader,Object);
00079 
00083   static LibHandle OpenLibrary(const char*);
00084 
00087   static int CloseLibrary(LibHandle);
00088   
00090   static void* GetSymbolAddress(LibHandle, const char*);
00091 
00093   static const char* LibPrefix();
00094 
00096   static const char* LibExtension();
00097 
00099   static const char* LastError();
00100   
00101 protected:
00102   DynamicLoader() {};
00103   ~DynamicLoader() {};
00104 
00105 private:
00106   DynamicLoader(const Self&); //purposely not implemented
00107   void operator=(const Self&); //purposely not implemented
00108 
00109 };
00110 
00111 } // end namespace itk
00112   
00113 #endif

Generated at Wed Mar 12 01:12:53 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000