Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

/home/jeroen/FOX/fox/fox-1.7.33/include/FXDLL.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *             D y n a m i c   L i n k   L i b r a r y   S u p p o r t           *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 2002,2012 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or modify          *
00009 * it under the terms of the GNU Lesser General Public License as published by   *
00010 * the Free Software Foundation; either version 3 of the License, or             *
00011 * (at your option) any later version.                                           *
00012 *                                                                               *
00013 * This library is distributed in the hope that it will be useful,               *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                 *
00016 * GNU Lesser General Public License for more details.                           *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public License      *
00019 * along with this program.  If not, see <http://www.gnu.org/licenses/>          *
00020 ********************************************************************************/
00021 #ifndef FXDLL_H
00022 #define FXDLL_H
00023 
00024 namespace FX {
00025 
00026 
00031 class FXAPI FXDLL {
00032 private:
00033   void *hnd;
00034 public:
00035 
00037   FXDLL():hnd(NULL){}
00038 
00040   FXDLL(void *h):hnd(h){}
00041 
00043   FXDLL(const FXDLL& org):hnd(org.hnd){}
00044 
00046   FXString name() const;
00047 
00049   void* handle() const { return hnd; }
00050 
00052   FXbool loaded() const { return hnd!=NULL; }
00053 
00055   FXbool load(const FXString& nm);
00056 
00058   void unload();
00059 
00061   void* address(const FXchar* sym) const;
00062   void* address(const FXString& sym) const;
00063 
00065   static FXString symbol(void *addr);
00066 
00068   static FXString name(void *addr);
00069 
00071   static FXDLL dll(void* addr);
00072 
00074   static FXDLL dll();
00075 
00077   static FXString error();
00078   };
00079 
00080 
00085 class FXAPI FXAUTODLL : public FXDLL {
00086 private:
00087   FXAUTODLL(const FXAUTODLL&);
00088   FXAUTODLL &operator=(const FXAUTODLL&);
00089 public:
00090 
00092   FXAUTODLL(const FXString& nm);
00093 
00095   ~FXAUTODLL();
00096   };
00097 
00098 }
00099 
00100 #endif

Copyright © 1997-2011 Jeroen van der Zijp