Changeset 9846 in orxonox.OLD for branches/new_class_id/src/lib/util
- Timestamp:
- Sep 27, 2006, 11:23:43 PM (18 years ago)
- Location:
- branches/new_class_id/src/lib/util/loading
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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.