Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7195 in orxonox.OLD for trunk/src/lib/util/loading/resource.h


Ignore:
Timestamp:
Mar 7, 2006, 11:12:31 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: performance issues

File:
1 edited

Legend:

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

    r7193 r7195  
    11/*!
    22 * @file resource.h
    3  * @brief Definition of ...
     3 * @brief Definition of a Resource.
    44*/
    55
     
    99#include "base_object.h"
    1010#include "multi_type.h"
    11 
     11#include <string>
    1212
    1313// FORWARD DECLARATION
     
    1515
    1616
    17 //! A class for ...
     17//! An enumerator for different (UN)LOAD-types.
     18/**
     19 * RP_NO:        will be unloaded on request
     20 * RP_LEVEL:     will be unloaded at the end of a Level
     21 * RP_CAMPAIGN:  will be unloaded at the end of a Campaign
     22 * RP_GAME:      will be unloaded at the end of the whole Game (when closing orxonox)
     23 */
     24typedef enum ResourcePriority
     25{
     26  RP_NO        =   0,
     27  RP_LEVEL     =   1,
     28  RP_CAMPAIGN  =   2,
     29  RP_GAME      =   3
     30};
     31
     32
     33
     34//! A Resource is an Object, that can be loaded from Disk
     35/**
     36 *
     37 */
    1838class Resource : virtual public BaseObject {
    1939
    2040 public:
    21   Resource();
     41   Resource(const std::string& fileName);
    2242  virtual ~Resource();
    2343
    24   virtual bool load(const char* fileName, const MultiType& param1, const MultiType& param2);
     44  virtual bool load(std::string& fileName, const MultiType& param1, const MultiType& param2);
    2545  virtual bool reload();
    2646  virtual bool unload();
    2747
    2848 private:
     49   std::string       fileName;
    2950
     51   unsigned int      referenceCount;    //!< How many times this Resource has been loaded.
     52/// TODO REMOVE THIS:   ResourceType      type;              //!< ResourceType of this Resource.
     53   ResourcePriority  prio;              //!< The Priority of this resource. (can only be increased, so noone else will delete this)
     54
     55   MultiType         param[3];          //!< The Parameters given to this Resource.
    3056};
    3157
Note: See TracChangeset for help on using the changeset viewer.