Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9846 in orxonox.OLD for branches/new_class_id/src/lib/util


Ignore:
Timestamp:
Sep 27, 2006, 11:23:43 PM (18 years ago)
Author:
bensch
Message:

new KeepLevel definitions

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  
    178178    std::vector<Resources::StorePointer*>::iterator it;
    179179    for (it = this->_storedResources.begin(); it != this->_storedResources.end(); ++it)
    180       if((*it)->keepLevel() < keepLevel)
     180      if((*it)->keepLevel() < keepLevel && (*it)->last())
    181181    {
    182182      delete (*it);
  • branches/new_class_id/src/lib/util/loading/resource.h

    r9845 r9846  
    2626  public:
    2727    /** @param keepLevel the level to set. */
    28     KeepLevel(unsigned int keepLevel) { _keepLevel = keepLevel; };
     28    inline KeepLevel(unsigned int keepLevel) { _keepLevel = keepLevel; };
    2929    KeepLevel(const std::string& keepLevelName);
    3030
    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; };
    3535
    3636    /** @returns the KeepLevel */
    37     unsigned int keepLevel() const { return _keepLevel; };
     37    inline unsigned int keepLevel() const { return _keepLevel; };
    3838    const std::string& name() const;
    3939  private:
     
    4141  };
    4242
     43
     44
    4345  //! Stores a Resource-Pointer, the LoadString and it's keepLevel.
    4446  class StorePointer
    4547  {
    4648  public:
    47     StorePointer(const std::string& loadString, const Resources::KeepLevel& keeplevel);
    4849    //! Virtual Destructor, that removes the Stored information-pointer.
    4950    virtual ~StorePointer() {};
     
    5455    const Resources::KeepLevel& keepLevel() const { return _keepLevel; };
    5556
     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
    5665  private:
    5766    std::string                 _loadString;             //!< An identifier, to match when loading a File.
    5867    Resources::KeepLevel        _keepLevel;              //!< The Priority of this resource. (can only be increased, so none else will delete this)
    5968  };
     69
     70
     71
    6072
    6173  //! A Type of Resources.
Note: See TracChangeset for help on using the changeset viewer.