UGDK
|
00001 00002 #ifndef UGDK_UTIL_GDD_ABSTRACTLOADER_H_ 00003 #define UGDK_UTIL_GDD_ABSTRACTLOADER_H_ 00004 00005 namespace ugdk { 00006 00007 namespace gdd { 00008 00009 template <class T> 00010 class DescriptionProtocol; 00011 00012 template <class T> 00013 class AbstractLoader { 00014 00015 public: 00016 00017 virtual ~AbstractLoader() { delete protocol_; } 00018 00019 virtual T* Load(const std::string& gddfile_path) = 0; 00020 00021 virtual void newData(T* new_data) = 0; 00022 00023 virtual T*& data() = 0; 00024 00025 virtual void cleanData() = 0; 00026 00027 protected: 00028 00029 DescriptionProtocol<T>* protocol() const { return protocol_; } 00030 00031 AbstractLoader(DescriptionProtocol<T> *protocol) : protocol_(protocol) { 00032 protocol_->set_loader(this); 00033 } 00034 00035 private: 00036 00037 DescriptionProtocol<T> *protocol_; 00038 00039 }; 00040 00041 } /* namespace gdd */ 00042 00043 } /* namespace ugdk */ 00044 00045 #endif /* UGDK_UTIL_GDD_ABSTRACTLOADER_H_ */