Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/new_class_id/src/lib/util/loading/new_resource_manager.h @ 9802

Last change on this file since 9802 was 9802, checked in by bensch, 18 years ago

new_class_id: more doxy-tags, and some default values

File size: 2.6 KB
RevLine 
[4597]1/*!
[9790]2 * @file new_resource_manager.h
3 */
[3329]4
[9790]5#ifndef _NEW_RESOURCE_MANAGER_H
6#define _NEW_RESOURCE_MANAGER_H
[4534]7
[9790]8#include "resource.h"
[8330]9#include "filesys/file.h"
[9790]10#include "filesys/directory.h"
[7661]11
[9800]12namespace Resources
[4597]13{
[9800]14
15  class NewResourceManager : public BaseObject
16  {
17    ObjectListDeclaration(NewResourceManager);
18  public:
19    /** @returns a Pointer to the only object of this Class */
20    inline static NewResourceManager* getInstance() { if (!_singletonRef) _singletonRef = new NewResourceManager();  return _singletonRef; };
[9802]21    /** @brief deletes the Instance if it exists. */
22    inline static void deleteInstance() { if (_singletonRef) delete _singletonRef; };
[1853]23
[9791]24
[9800]25    void setMainGlobalPath(const Directory& directory);
26    void addGlobalPath(const Directory& directory);
[9791]27
[9800]28    bool addResourcePath(const std::string& resourceName, const std::string& pathName);
29    bool addResourceSubPath(const std::string& resourceName, const std::string& pathName);
30    void registerType(Resources::Type* type);
31    void unregisterType(Resources::Type* type);
[9791]32
[9800]33    unsigned int addKeepLevelName(const std::string& keepLevelName);
34    unsigned int getKeepLevelID(const std::string& keepLevelName) const;
35    const std::string& getKeepLevelName(unsigned int keepLevelID) const;
[9791]36
[9802]37    /** @returns the Types of Resources */
38    const std::vector<Resources::Type*> resourceTypes() const { return _resourceTypes; };
39    /** @returns the main global search Path */
[9800]40    const Directory& mainGlobalPath() const { return _mainGlobalPath; };
41    /** @returns all global paths without mainGlobalPath */
42    const std::vector<Directory>& globalPaths() const { return _globalPaths; };
[9791]43
44
[9800]45    bool checkFileInMainPath(const File& fileInside);
[6640]46
[9800]47    bool unloadAllByKeepLevel(const Resources::KeepLevel& keepLevel);
[6640]48
[9800]49    void debug() const;
[3245]50
[9800]51    // utility functions for handling files in and around the data-directory
52    static std::string getFullName(const std::string& fileName);
53    static bool isInDataDir(const std::string& fileName);
54  private:
55    NewResourceManager();
56    virtual ~NewResourceManager();
[3245]57
[9800]58  private:
59    static NewResourceManager*         _singletonRef;       //!< singleton Reference
[3672]60
[9802]61    Directory                          _mainGlobalPath;     //!< The main include directory (default at "./")
62    std::vector<Directory>             _globalPaths;        //!< Additional Global include directories.
[9791]63
[9802]64    std::vector<Resources::Type*>      _resourceTypes;      //!< A Vector of all the stored ResourceTypes @see Resources::Type
65    std::vector<std::string>           _keepLevelNames;     //!< Names of KeepLevels @see Resources::KeepLevel
[9800]66  };
[1853]67
[9800]68}
69
[3655]70#endif /* _RESOURCE_MANAGER_H */
Note: See TracBrowser for help on using the repository browser.