00001 #ifndef PLUGIN_LOADER_H 00002 #define PLUGIN_LOADER_H 00003 00004 #include <string> 00005 #include <boost/filesystem.hpp> 00006 #include "../mesh/object.h" 00007 00027 class PluginLoader { 00028 00029 protected: 00035 PluginLoader(const std::string& ext ) { 00036 } 00037 std::string _path; 00038 MeshNS::SimpleMesh * _result; 00039 std::string _ext; 00040 00041 public: 00047 virtual void run()=0; 00048 00054 void setPath(const std::string& path) { 00055 boost::filesystem::path tpath(path); 00056 if (!boost::filesystem::exists(tpath) && boost::filesystem::is_regular(tpath)) 00057 abort(); 00058 _path= path; 00059 } 00060 00065 std::string getPath() const { 00066 return _path; 00067 } 00068 00074 std::string getExt() { 00075 return _ext; 00076 } 00077 00084 MeshNS::SimpleMesh* getResult() const { 00085 return _result; 00086 } 00087 00088 virtual ~PluginLoader() { 00089 } 00090 }; 00091 00092 #endif