Changeset 9765 in orxonox.OLD for branches/new_class_id/src/lib/util/loading/load_param_class_description.cc
- Timestamp:
- Sep 19, 2006, 5:49:58 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/util/loading/load_param_class_description.cc
r9764 r9765 14 14 */ 15 15 16 #include "load_param_ description.h"16 #include "load_param_class_description.h" 17 17 18 18 #include "multi_type.h" … … 125 125 * A list, that holds all the classes that are loadable (classes not objects!!) 126 126 */ 127 std::list<Load ClassDescription*>* LoadClassDescription::classList = NULL;127 std::list<LoadParamClassDescription*>* LoadParamClassDescription::classList = NULL; 128 128 129 129 /** 130 130 * if the description of Parameters should be executed 131 131 */ 132 bool Load ClassDescription::parametersDescription = false;132 bool LoadParamClassDescription::parametersDescription = false; 133 133 134 134 /** 135 135 * @param className the name of the class to be loadable 136 136 */ 137 Load ClassDescription::LoadClassDescription(const std::string& className)137 LoadParamClassDescription::LoadParamClassDescription(const std::string& className) 138 138 { 139 139 this->className = className; 140 140 141 if (Load ClassDescription::classList == NULL)142 Load ClassDescription::classList = new std::list<LoadClassDescription*>;143 144 Load ClassDescription::classList->push_back(this);141 if (LoadParamClassDescription::classList == NULL) 142 LoadParamClassDescription::classList = new std::list<LoadParamClassDescription*>; 143 144 LoadParamClassDescription::classList->push_back(this); 145 145 } 146 146 … … 148 148 * deletes a classDescription (deletes all the parameterDescriptions as well 149 149 */ 150 Load ClassDescription::~LoadClassDescription()150 LoadParamClassDescription::~LoadParamClassDescription() 151 151 { 152 152 std::list<LoadParamDescription*>::iterator it = this->paramList.begin(); … … 158 158 } 159 159 160 void Load ClassDescription::deleteAllDescriptions()161 { 162 if (Load ClassDescription::classList != NULL)163 { 164 while (!Load ClassDescription::classList->empty())165 { 166 delete Load ClassDescription::classList->front();167 Load ClassDescription::classList->pop_front();168 } 169 delete Load ClassDescription::classList;170 } 171 Load ClassDescription::classList = NULL;160 void LoadParamClassDescription::deleteAllDescriptions() 161 { 162 if (LoadParamClassDescription::classList != NULL) 163 { 164 while (!LoadParamClassDescription::classList->empty()) 165 { 166 delete LoadParamClassDescription::classList->front(); 167 LoadParamClassDescription::classList->pop_front(); 168 } 169 delete LoadParamClassDescription::classList; 170 } 171 LoadParamClassDescription::classList = NULL; 172 172 } 173 173 … … 180 180 Otherwise it returns a new classDescription 181 181 */ 182 Load ClassDescription* LoadClassDescription::addClass(const std::string& className)183 { 184 if (Load ClassDescription::classList != NULL)185 { 186 std::list<Load ClassDescription*>::iterator it = LoadClassDescription::classList->begin();187 while (it != Load ClassDescription::classList->end())182 LoadParamClassDescription* LoadParamClassDescription::addClass(const std::string& className) 183 { 184 if (LoadParamClassDescription::classList != NULL) 185 { 186 std::list<LoadParamClassDescription*>::iterator it = LoadParamClassDescription::classList->begin(); 187 while (it != LoadParamClassDescription::classList->end()) 188 188 { 189 189 if ((*it)->className == className) … … 194 194 } 195 195 } 196 return new Load ClassDescription(className);196 return new LoadParamClassDescription(className); 197 197 } 198 198 … … 201 201 * @param paramName the name of the parameter to add. 202 202 */ 203 LoadParamDescription* Load ClassDescription::addParam(const std::string& paramName)203 LoadParamDescription* LoadParamClassDescription::addParam(const std::string& paramName) 204 204 { 205 205 std::list<LoadParamDescription*>::iterator it = this->paramList.begin(); … … 224 224 * @todo implement it 225 225 */ 226 void Load ClassDescription::printAll(const std::string& fileName)226 void LoadParamClassDescription::printAll(const std::string& fileName) 227 227 { 228 228 PRINT(3)("===============================================================\n"); 229 229 PRINT(3)(" Listing all the Loadable Options (loaded since Game started).\n\n"); 230 if (Load ClassDescription::classList != NULL)231 { 232 std::list<Load ClassDescription*>::iterator classDesc = LoadClassDescription::classList->begin();233 while (classDesc != Load ClassDescription::classList->end())230 if (LoadParamClassDescription::classList != NULL) 231 { 232 std::list<LoadParamClassDescription*>::iterator classDesc = LoadParamClassDescription::classList->begin(); 233 while (classDesc != LoadParamClassDescription::classList->end()) 234 234 { 235 235 PRINT(3)("<%s>\n", (*classDesc)->className.c_str()); … … 255 255 * !! The strings MUST NOT be deleted !! 256 256 */ 257 std::list<std::string> Load ClassDescription::searchClassWithShort(const std::string& classNameBegin)257 std::list<std::string> LoadParamClassDescription::searchClassWithShort(const std::string& classNameBegin) 258 258 { 259 259 /// FIXME … … 262 262 std::list<const std::string&> retVal; 263 263 264 tIterator<Load ClassDescription>* iterator = LoadClassDescription::classList->getIterator();265 Load ClassDescription* enumClassDesc = iterator->firstElement();264 tIterator<LoadParamClassDescription>* iterator = LoadParamClassDescription::classList->getIterator(); 265 LoadParamClassDescription* enumClassDesc = iterator->firstElement(); 266 266 while (enumClassDesc) 267 267 {
Note: See TracChangeset
for help on using the changeset viewer.