Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9801 in orxonox.OLD


Ignore:
Timestamp:
Sep 24, 2006, 12:26:38 PM (15 years ago)
Author:
bensch
Message:

added many doxy-tags

File:
1 edited

Legend:

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

    r9800 r9801  
    1616namespace Resources
    1717{
     18  //! The KeepLevel handles the unloading of Resources.
     19  /**
     20   * Allocating a Resource also appends a KeepLevel to the Resource.
     21   * When the Resource is not used anymore it is decided on the grounds of the KeepLevel,
     22   * if the Resource should be deleted. (e.g. at the end of a Level, Campaign, or something like this).
     23   */
    1824  class KeepLevel
    1925  {
    2026  public:
     27    /** @param keepLevel the level to set. */
    2128    KeepLevel(unsigned int keepLevel) { _keepLevel = keepLevel; };
    2229    KeepLevel(const std::string& keepLevelName);
    2330
     31    /** @returns the KeepLevel */
    2432    unsigned int keepLevel() const { return _keepLevel; };
    2533    const std::string& name() const;
    2634  private:
    27     unsigned int                        _keepLevel;
     35    unsigned int                _keepLevel;              //!< The KeepLevel a Resource is in.
    2836  };
    2937
     38  //! Stores a Resource-Pointer, the LoadString and it's keepLevel.
    3039  class StorePointer
    3140  {
    3241  public:
    3342    StorePointer(const std::string& loadString, const Resources::KeepLevel& keeplevel);
     43    /** @returns the LoadString this resource was loaded with */
    3444    const std::string& loadString() const { return _loadString; };
     45    /** @returns the KeepLevel of this resource */
    3546    const Resources::KeepLevel& keepLevel() const { return _keepLevel; };
    3647
     
    4051  };
    4152
     53  //! A Type of Resources.
     54  /**
     55   * The Type is used to store the Pointers to already loaded Resources,
     56   * and also to store type-specific properties.
     57   * These are the Loading Paths, the subpaths and so on.
     58   */
    4259  class Type
    4360  {
     
    4562    Type(const std::string& typeName);
    4663    ~Type();
     64    /** @returns true if the names match @param resourceName the Name to compare. @brief compare the Type with a Name */
    4765    bool operator==(const std::string& resourceName) const { return this->_typeName == resourceName; };
    4866
     
    5371
    5472    /// Retrieve Functions
     73    /** @returns the name of the stored Class this Type loads Resources for */
    5574    const std::string& storedClassName() const { return _typeName; };
     75    /** @returns the ID of the Type != ClassID */
    5676    int id() const { return _id; };
     77    /** @returns the type-specific paths this Resource searches in. */
    5778    const std::vector<Directory>& resourcePaths() const { return _resourcePaths; };
     79    /** @returns the Type specific SubPaths this Resource Searches in @see std::vector<std::string>  _resourceSubPaths */
    5880    const std::vector<Directory>& resourceSubPaths() const { return _resourceSubPaths; };
     81    /** @returns the Pointers to the Stored resources. @note do not use this, for more than some lookup */
    5982    const std::vector<Resources::StorePointer*>& storedResources() const { return _storedResources; };
    6083
     
    6588
    6689  private:
    67     int                             _id;
    68     const std::string               _typeName;
    69     std::vector<Directory>          _resourcePaths;
    70     std::vector<Directory>          _resourceSubPaths;
    71     std::vector<std::string>        _fileExtensions;
     90    int                                   _id;                //!< ID of the Type in over all of the Types.
     91    const std::string                     _typeName;          //!< Name of the Type. (Name of the Resource this loads.)
     92    std::vector<Directory>                _resourcePaths;     //!< The Paths to search for files in this type
     93    std::vector<Directory>                _resourceSubPaths;  //!< The subpaths that will be searched under all the _resourcePaths.
     94    std::vector<std::string>              _fileExtensions;    //!< File Extensions, this Resource supports.
    7295
    73     std::vector<Resources::StorePointer*> _storedResources;
     96    std::vector<Resources::StorePointer*> _storedResources;   //!< An array of all the stored Resources.
    7497  };
    7598
     
    77100  //! A NewResource is an Object, that can be loaded from Disk
    78101  /**
    79    *
     102   * The NewResource Hanldes the location and stores pointers to data that can be retrieved.
    80103   */
    81104  class NewResource : virtual public BaseObject
     
    87110    virtual ~NewResource();
    88111
     112    /** @brief reloads the underlying resource */
    89113    virtual bool reload() { return false; };
     114    /** @brief unloads the underlying Resource */
    90115    virtual bool unload() { return false; };
    91116
    92117    std::string locateFile(const std::string& fileName) const;
    93118
    94 
    95   public:
    96119  protected:
    97120    Resources::StorePointer* acquireResource(const std::string& loadString);
Note: See TracChangeset for help on using the changeset viewer.