Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 22, 2006, 12:19:51 AM (18 years ago)
Author:
bensch
Message:

orxonox/new_class_id: new Resources stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/util/loading/resource.h

    r9783 r9784  
    3737    void addExtension(const std::string& extension);
    3838
     39    void addResourcePath(const std::string& path);
     40    void addResourceSubPath(const std::string& subPath);
     41
     42    /// Retrieve Functions
    3943    const ClassID& storedClassID() const { return _classID; };
    4044    int id() const { return _id; };
    4145    const std::vector<std::string>& resourcePaths() const { return _resourcePaths; };
    42 
     46    const std::vector<std::string>& resourceSubPaths() const { return _resourceSubPaths; };
     47    const std::vector<Resource*>& storedResources() const { return _storedResources; };
    4348
    4449    void setID(int id);
     
    5055    std::vector<std::string>      _resourceSubPaths;
    5156    std::vector<std::string>      _fileExtensions;
     57
     58    std::vector<Resource*>        _storedResources;
    5259  };
    5360
    54   class Pointer {};
     61  class Pointer
     62  {
     63  public:
     64    Pointer(const std::string& loadString, const Resource::KeepLevel& keeplevel);
     65    const std::string& loadString() const { return _loadString; };
     66    const Resource::KeepLevel& keepLevel() const { return _keepLevel; };
     67
     68  private:
     69    std::string              _loadString;             //!< An identifier, to match when loading a File.
     70    Resource::KeepLevel      _keepLevel;              //!< The Priority of this resource. (can only be increased, so none else will delete this)
     71  };
    5572
    5673
    5774public:
    58   Resource(const std::string& fileName);
     75  Resource();
    5976  virtual ~Resource();
    6077
    61   bool loadResource(std::string& fileName, Resource::Pointer* ptr);
    6278  virtual bool reload();
    6379  virtual bool unload();
    6480
     81protected:
     82  Resource::Pointer* acquireResource(Resource::Type& resourceType, const std::string& loadString);
     83
     84private:
     85  Resource::Pointer*       _pointer;                //!< Virtual Pointer to the ResourceData.
    6586
    6687
    67 private:
    68   std::string              _loadString;             //!< An identifier, to match when loading a File.
    69   std::string              _fileName;
    70   MultiType                _parameters[3];          //!< The Parameters given to this Resource.
    71   Resource::KeepLevel      _keepLevel;              //!< The Priority of this resource. (can only be increased, so noone else will delete this)
    72 
    73 
    74   static std::vector<Resource::Type>     _resourceTypes;
     88  static std::vector<Resource::Type*>    _resourceTypes;
    7589
    7690  //! GLOBALS
Note: See TracChangeset for help on using the changeset viewer.