00001 /********************************************************************
00002 ** Copyright (C) 2000 SOMELib Project
00003 **
00004 ** This library is free software; you can redistribute it and/or
00005 ** modify it under the terms of the GNU Library General Public
00006 ** License as published by the Free Software Foundation; either
00007 ** version 2 of the License, or (at your option) any later version.
00008 **
00009 ** This library is distributed in the hope that it will be useful,
00010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00012 ** Library General Public License for more details.
00013 **
00014 ** You should have received a copy of the GNU Library General Public
00015 ** License along with this library; if not, write to the
00016 ** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017 ** Boston, MA 02111-1307, USA.
00018 **
00019 *******************************************************************/
00020 #ifndef BASIC_DYN_LIB_HEADER
00021 #define BASIC_DYN_LIB_HEADER
00022
00023 #include "UserConfig.h"
00024 #include <string>
00025 #include <list>
00026
00027 namespace SOME
00028 {
00029
00039 class BasicDynLib
00040 {
00041 protected:
00042 BasicDynLib();
00043
00044 public:
00045 virtual ~BasicDynLib();
00046
00047 public:
00049 bool isValid() const
00050 {
00051 return valid_lib;
00052 }
00054 virtual bool loadLibrary(const char* filepath) = 0;
00056 virtual void* getFunction(const char* func) = 0;
00057
00060 std::list < std::string > enumDirectory( std::string path );
00061
00063 const std::string& getFilePath()
00064 {
00065 return file_path;
00066 }
00067
00068 private:
00069 virtual void unloadLibrary() = 0;
00070
00071 protected:
00072 bool valid_lib;
00073 std::string file_path;
00074 };
00075
00076
00078
00084 BasicDynLib* newDynLib();
00085
00086 } //namespace SOME
00087 #endif //BASIC_DYN_LIB_HEADER
1.2.1 written by Dimitri van Heesch,
© 1997-2000