Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7240 in orxonox.OLD for branches/resources/src/lib/util


Ignore:
Timestamp:
Mar 22, 2006, 12:52:16 PM (19 years ago)
Author:
bensch
Message:

resources: lib

Location:
branches/resources/src/lib/util/loading
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/resources/src/lib/util/loading/resource.cc

    r7238 r7240  
    22   orxonox - the future of 3D-vertical-scrollers
    33
    4    Copyright (C) 2004 orx
     4   Copyright (C) 2006 orx
    55
    66   This program is free software; you can redistribute it and/or modify
     
    2121namespace Loading
    2222{
     23  /**
     24   * @brief Initializes a shared Resource
     25   */
    2326  Resource::SharedResource::SharedResource()
    2427  {
     
    3033
    3134  /**
    32    * standard constructor
     35   * @brief standard constructor
    3336  */
    3437  Resource::Resource (const std::string& fileName, ResourcePriority prio)
     
    4043
    4144  /**
    42    * standard deconstructor
     45   * @brief standard deconstructor
    4346   */
    44   //   Resource::~Resource ()
    45   //   {
    46   //   }
     47  Resource::~Resource ()
     48  {}
    4749
    4850
     
    5052                      const MultiType& param0, const MultiType& param1, const MultiType& param2)
    5153  {}
     54
     55
    5256  bool Resource::cache(std::string& fileName, ResourcePriority prio,
    5357                       const MultiType& param0, const MultiType& param1,  const MultiType& param2)
     
    5559
    5660
    57   // reloads the resource.
    58 //  bool Resource::reload()
    59 //  {}
    60   // unloads the sharedResource (from this Resource)
     61  /**
     62   * @brief reloads the resource.
     63   */
     64  bool Resource::reload()
     65  {}
     66
    6167  bool Resource::unload()
    6268  {}
     
    7177  {}
    7278
    73 //   const SharedResource* findResource(std::string& fileName,
    74 //                                      const MultiType& param0, const MultiType& param1, const MultiType& param2)
    75 //   {
    76 //   }
     79
     80  bool Resource::reloadResourcesByType(ClassID ResourceType)
     81  {}
     82
     83  bool Resource::reloadAllResources()
     84  {}
     85
     86  bool Resource::unloadResourcesByType(ResourcePriority prio)
     87  {}
    7788
    7889
     90  bool Resource::unloadAllResources()
     91  {}
     92
     93  void Resource::debug()
     94  {}
     95
     96
     97
     98
     99  const Resource::SharedResource* Resource::findResource(std::string& fileName,
     100      const MultiType& param0, const MultiType& param1, const MultiType& param2)
     101  {}
     102
    79103}
  • branches/resources/src/lib/util/loading/resource.h

    r7237 r7240  
    5353    public:
    5454      SharedResource();
     55      bool reload();
    5556      std::string       fileName;
    5657
     
    6566  public:
    6667    Resource(const std::string& fileName = "", ResourcePriority prio = RP_LEVEL);
    67     virtual ~Resource() {};
     68    virtual ~Resource();
    6869
    6970    // looks if the resource was already loaded and (if not) loads it.
     
    7374                      const MultiType& param1 = MT_NULL,
    7475                      const MultiType& param2 = MT_NULL);
     76
    7577    virtual bool cache(std::string& fileName = "",
    7678                       ResourcePriority prio = RP_LEVEL,
     
    8183
    8284    // reloads the resource.
    83     virtual bool reload() { };
     85    virtual bool reload();
    8486    // unloads the sharedResource (from this Resource)
    8587    virtual bool unload();
    8688
    8789    // checks if a resource was already loaded.
    88     bool isLoaded(std::string& fileName,
    89                   const MultiType& param0 = MT_NULL,
    90                   const MultiType& param1 = MT_NULL,
    91                   const MultiType& param2 = MT_NULL);
     90    static bool isLoaded(std::string& fileName,
     91                         const MultiType& param0 = MT_NULL,
     92                         const MultiType& param1 = MT_NULL,
     93                         const MultiType& param2 = MT_NULL);
    9294
    9395    // raises the priority can only be raised
     
    9597
    9698    /** @returns the referenceCount of the shared resource behind this resource or 0 if no internal Resource is stored */
    97   unsigned int referenceCount() const { return (this->resource)? this->resource->referenceCount : 0; };
     99    unsigned int referenceCount() const { return (this->resource)? this->resource->referenceCount : 0; };
    98100
     101    static bool reloadResourcesByType(ClassID ResourceType);
     102    static bool reloadAllResources();
     103
     104    static bool unloadResourcesByType(ResourcePriority prio);
     105    static bool unloadAllResources();
     106
     107    static void debug();
    99108  protected:
    100109    const SharedResource* findResource(std::string& fileName,
Note: See TracChangeset for help on using the changeset viewer.