Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9846 in orxonox.OLD for branches


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
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/graphics/importer/md2/resource_md2.h

    r9824 r9846  
    2525    MD2ResourcePointer(const std::string& loadString, const Resources::KeepLevel& keepLevel, const MD2Data::Pointer& data);
    2626    inline const MD2Data::Pointer& ptr() const { return pointer; }
    27 private:
     27    virtual bool last() const { return pointer.count() == 1; }
     28  private:
    2829    MD2Data::Pointer pointer;
    2930  };
  • branches/new_class_id/src/lib/graphics/importer/resource_obj.h

    r9831 r9846  
    2323    OBJResourcePointer(const std::string& loadString, const Resources::KeepLevel& keepLevel, const StaticModelData::Pointer& data);
    2424    inline const StaticModelData::Pointer& ptr() const { return pointer; }
     25    virtual bool last() const { return pointer.count() == 1; }
    2526private:
    2627    StaticModelData::Pointer pointer;
  • branches/new_class_id/src/lib/graphics/importer/resource_texture.h

    r9823 r9846  
    2424    TextureResourcePointer(const std::string& loadString, const Resources::KeepLevel& keepLevel, const TextureData::Pointer& data);
    2525    inline const TextureData::Pointer& ptr() const { return pointer; }
    26 private:
     26    virtual bool last() const { return pointer.count() == 1; }
     27  private:
    2728    TextureData::Pointer pointer;
    2829  };
  • branches/new_class_id/src/lib/graphics/resource_shader.h

    r9823 r9846  
    2424    ShaderResourcePointer(const std::string& loadString, const Resources::KeepLevel& keepLevel, const ShaderData::Pointer& data);
    2525    inline const ShaderData::Pointer& ptr() const { return pointer; }
     26    virtual bool last() const { return pointer.count() == 1; }
    2627  private:
    2728    ShaderData::Pointer pointer;
  • branches/new_class_id/src/lib/graphics/text_engine/resource_font.h

    r9839 r9846  
    2424    FontResourcePointer(const std::string& loadString, const Resources::KeepLevel& keepLevel, const FontData::Pointer& data);
    2525    inline const FontData::Pointer& ptr() const { return pointer; }
    26 private:
     26    virtual bool last() const { return pointer.count() == 1; }
     27  private:
    2728    FontData::Pointer pointer;
    2829  };
  • branches/new_class_id/src/lib/sound/resource_sound_buffer.h

    r9823 r9846  
    2626      SoundBufferResourcePointer(const std::string& loadString, const Resources::KeepLevel& keepLevel, const SoundBufferData::Pointer& data);
    2727      inline const SoundBufferData::Pointer& ptr() const { return pointer; }
     28      virtual bool last() const { return pointer.count() == 1; }
    2829    private:
    2930      SoundBufferData::Pointer pointer;
  • 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.