Changeset 3655 in orxonox.OLD for orxonox/trunk/src/lib/util/resource_manager.h
- Timestamp:
- Mar 26, 2005, 3:28:39 PM (19 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/util/resource_manager.h
r3645 r3655 1 1 /*! 2 \file proto_class.h 3 \brief Definition of the proto class template, used quickly start work 4 \todo Example: this shows how to use simply add a Marker that here has to be done something. 2 \file resource_manager.h 3 \brief The Resource Manager checks if a file/resource is loaded. 5 4 6 The Protoclass exists, to help you quikly getting the run for how to develop in orxonox. 7 It is an example for the CODING-CONVENTION, and a starting-point for every class. 5 If a file/resource was already loaded the resourceManager will 6 return a void pointer to the desired resource. 7 Otherwise it will instruct the coresponding resource-loader to load, 8 and receive a pointer to it. 8 9 */ 9 10 10 #ifndef _ PROTO_CLASS_H11 #define _ PROTO_CLASS_H11 #ifndef _RESOURCE_MANAGER_H 12 #define _RESOURCE_MANAGER_H 12 13 13 #include "what realy has to be included"14 14 #include "base_object.h" 15 15 16 16 // FORWARD DEFINITION \\ 17 class someClassWeNeed;18 17 19 18 20 /*class Test;*/ /* forward definition of class Test (without including it here!)*/ 19 enum ResourceType {OBJ, WAV, MP3, OGG, IMAGE}; 21 20 22 //! A default class that aids you to start creating a new class21 //! The ResourceManager is a class, that decides if a file/resource should be loaded 23 22 /** 24 here can be some longer description of this class 23 If a file/resource was already loaded the resourceManager will 24 return a void pointer to the desired resource. 25 Otherwise it will instruct the corresponding resource-loader to load, 26 and receive the pointer to it. 27 28 It does it by looking, if a desired file has already been loaded. 25 29 */ 26 class ProtoClass : public BaseObject { 30 class ResourceManager : public BaseObject 31 { 32 public: 33 static ResourceManager* getInstance(); 34 virtual ~ResourceManager(); 27 35 28 public: 29 ProtoClass(); 30 virtual ~ProtoClass(); 31 32 bool doNonSense (int nothing); 36 bool setDataDir(char* dataDir); 37 static void* load(const char* fileName); 38 static void* load(const char* fileName, ResourceType type); 33 39 34 40 private: 35 int nonSense; //!< doxygen tag here like this for all the variables - delete this variable if you use this 41 ResourceManager(); 42 static ResourceManager* singletonRef; 36 43 44 45 struct file; 46 struct folder 47 { 48 char* name; 49 folder** subfolders; //!< 50 file** files; //!< Files in the directory 51 }; 52 struct file 53 { 54 char* name; //!< exact Name of a file 55 void* pointer; 56 }; 57 58 char* dataDir; //!< The main data directory 59 60 static bool isDir(const char* directory); 61 static bool isFile(const char* directory); 37 62 }; 38 63 39 #endif /* _ PROTO_CLASS_H */64 #endif /* _RESOURCE_MANAGER_H */
Note: See TracChangeset
for help on using the changeset viewer.