00001 #ifndef __MODULES_H__ 00002 #define __MODULES_H__ 00003 00004 #include <string> 00005 #include <map> 00006 #include <set> 00007 00008 00009 #ifdef _WIN32 00010 #include <windows.h> 00011 typedef HMODULE MODULE_HANDLE; 00012 #else 00013 typedef void* MODULE_HANDLE; 00014 #endif 00015 00016 #include "stm_export.h" 00017 00018 namespace spectral { 00019 00021 class STM_EXPORT Modules 00022 { 00023 public: 00024 Modules(); 00025 ~Modules(); 00026 00027 bool LoadModule(std::string, std::string); 00028 void *CreateObject(const std::string) const; 00029 00030 void GetLoaders(std::map<std::string, std::string> &) const; 00031 void GetSavers(std::map<std::string, std::string> &) const; 00032 void GetProcessors(std::set<std::string> &) const; 00033 bool GetModuleDesc(const std::string &, std::string &) const; 00034 00035 private: 00036 void NextExt(char **str); 00037 00038 class ModuleData 00039 { 00040 public: 00041 MODULE_HANDLE m_module; 00042 std::string m_name; 00043 int m_type; 00044 void *(*m_createFunction)(void); 00045 }; 00046 00047 std::map<std::string, ModuleData> m_modules; 00048 std::map<std::string, std::string> m_fileLoaders; 00049 std::map<std::string, std::string> m_fileSavers; 00050 std::set<std::string> m_processors; 00051 }; 00052 00053 } 00054 00055 #endif