00001 /* Crown and Cutlass 00002 * IResource Header 00003 */ 00004 00005 #if !defined ( _IRESOURCE_H_ ) 00006 #define _IRESOURCE_H_ 00007 00008 #include <string> 00009 00010 class IResource { 00011 public: 00012 IResource(std::string name) { m_name = name; }; 00013 virtual ~IResource() { }; 00014 00015 std::string GetKey() { return ConstructKey(GetType(), m_name); }; 00016 std::string GetName() { return m_name; }; 00017 virtual std::string GetType() = 0; 00018 00019 virtual void Load() = 0; 00020 virtual void Unload() = 0; 00021 00022 static std::string ConstructKey(std::string type, std::string name) { return type + ":" + name; }; 00023 00024 protected: 00025 std::string m_name; 00026 00027 private: 00028 // Disallow anyone from using the standard constructor 00029 IResource(); 00030 }; 00031 00032 #endif
1.4.7