- Timestamp:
- Sep 27, 2006, 11:23:43 PM (18 years ago)
- Location:
- branches/new_class_id/src/lib
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/graphics/importer/md2/resource_md2.h
r9824 r9846 25 25 MD2ResourcePointer(const std::string& loadString, const Resources::KeepLevel& keepLevel, const MD2Data::Pointer& data); 26 26 inline const MD2Data::Pointer& ptr() const { return pointer; } 27 private: 27 virtual bool last() const { return pointer.count() == 1; } 28 private: 28 29 MD2Data::Pointer pointer; 29 30 }; -
branches/new_class_id/src/lib/graphics/importer/resource_obj.h
r9831 r9846 23 23 OBJResourcePointer(const std::string& loadString, const Resources::KeepLevel& keepLevel, const StaticModelData::Pointer& data); 24 24 inline const StaticModelData::Pointer& ptr() const { return pointer; } 25 virtual bool last() const { return pointer.count() == 1; } 25 26 private: 26 27 StaticModelData::Pointer pointer; -
branches/new_class_id/src/lib/graphics/importer/resource_texture.h
r9823 r9846 24 24 TextureResourcePointer(const std::string& loadString, const Resources::KeepLevel& keepLevel, const TextureData::Pointer& data); 25 25 inline const TextureData::Pointer& ptr() const { return pointer; } 26 private: 26 virtual bool last() const { return pointer.count() == 1; } 27 private: 27 28 TextureData::Pointer pointer; 28 29 }; -
branches/new_class_id/src/lib/graphics/resource_shader.h
r9823 r9846 24 24 ShaderResourcePointer(const std::string& loadString, const Resources::KeepLevel& keepLevel, const ShaderData::Pointer& data); 25 25 inline const ShaderData::Pointer& ptr() const { return pointer; } 26 virtual bool last() const { return pointer.count() == 1; } 26 27 private: 27 28 ShaderData::Pointer pointer; -
branches/new_class_id/src/lib/graphics/text_engine/resource_font.h
r9839 r9846 24 24 FontResourcePointer(const std::string& loadString, const Resources::KeepLevel& keepLevel, const FontData::Pointer& data); 25 25 inline const FontData::Pointer& ptr() const { return pointer; } 26 private: 26 virtual bool last() const { return pointer.count() == 1; } 27 private: 27 28 FontData::Pointer pointer; 28 29 }; -
branches/new_class_id/src/lib/sound/resource_sound_buffer.h
r9823 r9846 26 26 SoundBufferResourcePointer(const std::string& loadString, const Resources::KeepLevel& keepLevel, const SoundBufferData::Pointer& data); 27 27 inline const SoundBufferData::Pointer& ptr() const { return pointer; } 28 virtual bool last() const { return pointer.count() == 1; } 28 29 private: 29 30 SoundBufferData::Pointer pointer; -
branches/new_class_id/src/lib/util/loading/resource.cc
r9845 r9846 178 178 std::vector<Resources::StorePointer*>::iterator it; 179 179 for (it = this->_storedResources.begin(); it != this->_storedResources.end(); ++it) 180 if((*it)->keepLevel() < keepLevel )180 if((*it)->keepLevel() < keepLevel && (*it)->last()) 181 181 { 182 182 delete (*it); -
branches/new_class_id/src/lib/util/loading/resource.h
r9845 r9846 26 26 public: 27 27 /** @param keepLevel the level to set. */ 28 KeepLevel(unsigned int keepLevel) { _keepLevel = keepLevel; };28 inline KeepLevel(unsigned int keepLevel) { _keepLevel = keepLevel; }; 29 29 KeepLevel(const std::string& keepLevelName); 30 30 31 bool operator==(const KeepLevel& keepLevel) const { return this->_keepLevel == keepLevel._keepLevel; };32 bool operator!=(const KeepLevel& keepLevel) const { return this->_keepLevel != keepLevel._keepLevel; };33 bool operator<=(const KeepLevel& keepLevel) const { return this->_keepLevel <= keepLevel._keepLevel; };34 bool operator<(const KeepLevel& keepLevel) const { return this->_keepLevel < keepLevel._keepLevel; };31 inline bool operator==(const KeepLevel& keepLevel) const { return this->_keepLevel == keepLevel._keepLevel; }; 32 inline bool operator!=(const KeepLevel& keepLevel) const { return this->_keepLevel != keepLevel._keepLevel; }; 33 inline bool operator<=(const KeepLevel& keepLevel) const { return this->_keepLevel <= keepLevel._keepLevel; }; 34 inline bool operator<(const KeepLevel& keepLevel) const { return this->_keepLevel < keepLevel._keepLevel; }; 35 35 36 36 /** @returns the KeepLevel */ 37 unsigned int keepLevel() const { return _keepLevel; };37 inline unsigned int keepLevel() const { return _keepLevel; }; 38 38 const std::string& name() const; 39 39 private: … … 41 41 }; 42 42 43 44 43 45 //! Stores a Resource-Pointer, the LoadString and it's keepLevel. 44 46 class StorePointer 45 47 { 46 48 public: 47 StorePointer(const std::string& loadString, const Resources::KeepLevel& keeplevel);48 49 //! Virtual Destructor, that removes the Stored information-pointer. 49 50 virtual ~StorePointer() {}; … … 54 55 const Resources::KeepLevel& keepLevel() const { return _keepLevel; }; 55 56 57 virtual bool last() const = 0; 58 59 protected: 60 StorePointer(const std::string& loadString, const Resources::KeepLevel& keeplevel); 61 62 private: 63 StorePointer(const StorePointer&) : _keepLevel(0) {}; 64 56 65 private: 57 66 std::string _loadString; //!< An identifier, to match when loading a File. 58 67 Resources::KeepLevel _keepLevel; //!< The Priority of this resource. (can only be increased, so none else will delete this) 59 68 }; 69 70 71 60 72 61 73 //! A Type of Resources.
Note: See TracChangeset
for help on using the changeset viewer.