Changeset 9848 in orxonox.OLD for branches/new_class_id/src/lib
- Timestamp:
- Sep 27, 2006, 11:39:47 PM (18 years ago)
- Location:
- branches/new_class_id/src/lib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/shell/some_shell_commands.cc
r9836 r9848 53 53 54 54 #include "loading/resource_manager.h" 55 namespace Resources 56 {SHELL_COMMAND(debug, ResourceManager, debug);} 55 namespace Resources { 56 SHELL_COMMAND(debug, ResourceManager, debug); 57 SHELL_COMMAND(load, ResourceManager, loadFromLoadString); 58 } 57 59 58 60 #include "loading/load_param_class_description.h" -
branches/new_class_id/src/lib/util/loading/resource.h
r9847 r9848 42 42 43 43 44 44 /////////////////// 45 // STORE POINTER // 46 /////////////////// 45 47 //! Stores a Resource-Pointer, the LoadString and it's keepLevel. 46 48 class StorePointer … … 70 72 71 73 72 74 /////////////////// 75 // RESOURCE TYPE // 76 /////////////////// 73 77 //! A Type of Resources. 74 78 /** … … 122 126 }; 123 127 128 /** 129 * @brief A Type Definition Class for any Object that is resourceable. 130 * 131 * This Class's main reason of Existence is, that resources can be dynamically 132 * created over a loadString. For this the Type of Resource is required, and the Resource must 133 * itself support the 'void createFromString(const std::string&)' function. 134 */ 124 135 template<class T> class tType : public Type 125 136 { 126 137 public: 138 /** Create the ResourceType @see Type(const std::string&) */ 127 139 tType(const std::string& typeName) : Type(typeName) {}; 140 /** @param loadString the String to load a Resource with @brief tries to create a Resource of Type T with a loadString */ 128 141 virtual void createFromString(const std::string& loadString) { T::createFromString(loadString); } 129 142 }; … … 131 144 132 145 146 ///////////////////// 147 // RESOURCE ITSELF // 148 ///////////////////// 133 149 134 150 //! A Resource is an Object, that can be loaded from Disk -
branches/new_class_id/src/lib/util/loading/resource_manager.cc
r9845 r9848 144 144 } 145 145 146 void ResourceManager::loadFromLoadString(const std::string& resourceTypeName, const std::string& loadString) 147 { 148 std::vector<Resources::Type*>::const_iterator it; 149 for (it = this->_resourceTypes.begin(); it != this->_resourceTypes.end(); ++it) 150 { 151 if (*(*it) == resourceTypeName) 152 { 153 (*it)->createFromString(loadString); 154 /// TODO check if the resource was allocated!! 155 return ; 156 } 157 } 158 return ; 159 } 160 146 161 147 162 void ResourceManager::unloadAllBelowKeepLevel(const Resources::KeepLevel& keepLevel) -
branches/new_class_id/src/lib/util/loading/resource_manager.h
r9845 r9848 47 47 48 48 void unloadAllBelowKeepLevel(const Resources::KeepLevel& keepLevel); 49 void loadFromLoadString(const std::string& resourceTypeName, const std::string& loadString); 49 50 50 51 void debug() const; … … 58 59 59 60 private: 60 static ResourceManager* _singletonRef; //!< singleton Reference61 static ResourceManager* _singletonRef; //!< singleton Reference 61 62 62 63 Directory _mainGlobalPath; //!< The main include directory (default at "./")
Note: See TracChangeset
for help on using the changeset viewer.