00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 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 }
00087 #endif //BASIC_DYN_LIB_HEADER