dynalink.h

Go to the documentation of this file.
00001 /*
00002  * dynalink.h
00003  *
00004  * Dynamic Link Library abstraction class.
00005  *
00006  * Portable Windows Library
00007  *
00008  * Copyright (c) 1993-1998 Equivalence Pty. Ltd.
00009  *
00010  * The contents of this file are subject to the Mozilla Public License
00011  * Version 1.0 (the "License"); you may not use this file except in
00012  * compliance with the License. You may obtain a copy of the License at
00013  * http://www.mozilla.org/MPL/
00014  *
00015  * Software distributed under the License is distributed on an "AS IS"
00016  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
00017  * the License for the specific language governing rights and limitations
00018  * under the License.
00019  *
00020  * The Original Code is Portable Windows Library.
00021  *
00022  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
00023  *
00024  * Portions are Copyright (C) 1993 Free Software Foundation, Inc.
00025  * All Rights Reserved.
00026  *
00027  * Contributor(s): ______________________________________.
00028  *
00029  * $Revision: 20385 $
00030  * $Author: rjongbloed $
00031  * $Date: 2008-06-04 10:40:38 +0000 (Wed, 04 Jun 2008) $
00032  */
00033 
00034 #ifndef _PDYNALINK
00035 #define _PDYNALINK
00036 
00037 #if !defined(P_RTEMS)
00038 
00039 #ifdef P_USE_PRAGMA
00040 #pragma interface
00041 #endif
00042 
00051 class PDynaLink : public PObject
00052 {
00053   PCLASSINFO(PDynaLink, PObject);
00054 
00055   public:
00061     PDynaLink();
00065     PDynaLink(
00066       const PString & name    
00067     );
00068 
00071     ~PDynaLink();
00073 
00076     /* Open a new dyna-link, loading the specified module.
00077 
00078        @return
00079        PTrue if the library was loaded.
00080      */
00081     virtual PBoolean Open(
00082       const PString & name    
00083     );
00084 
00087     virtual void Close();
00088 
00091     virtual PBoolean IsLoaded() const;
00092 
00102     virtual PString GetName(
00103       PBoolean full = PFalse  
00104     ) const;
00105 
00111     static PString GetExtension();
00113 
00116 
00117     typedef void (*Function)();
00118 
00119 
00125     PBoolean GetFunction(
00126       PINDEX index,    
00127       Function & func  
00128     );
00129 
00135     PBoolean GetFunction(
00136       const PString & name,  
00137       Function & func        
00138     );
00140 
00141 
00142 // Include platform dependent part of class
00143 #ifdef _WIN32
00144 #include "msos/ptlib/dynalink.h"
00145 #else
00146 #include "unix/ptlib/dynalink.h"
00147 #endif
00148 };
00149 
00150 #endif // !defined(P_RTEMS)
00151 
00152 #endif
00153 
00154 // End Of File ///////////////////////////////////////////////////////////////

Generated on Mon Feb 23 01:57:54 2009 for PTLib by  doxygen 1.5.1