Changeset 4938 in orxonox.OLD for orxonox/trunk/src/util/object_manager.cc
- Timestamp:
- Jul 22, 2005, 11:57:38 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/util/object_manager.cc
r4937 r4938 23 23 using namespace std; 24 24 25 26 27 28 /** 29 * constructor, sets everything to zero and define factoryName25 /** 26 * Initializes a FastFactory 27 * @param classID the ClassID this Class belongs to (the top-most) 28 * @param fastFactoryName the Name of the ObjectClass-handled here 29 * @return a new FastFactory 30 30 */ 31 31 FastFactory::FastFactory (ClassID classID, const char* fastFactoryName) … … 50 50 /** 51 51 * destructor 52 * clear the Q52 * deletes all the Instances of the FastFactory. 53 53 */ 54 54 FastFactory::~FastFactory () … … 61 61 } 62 62 63 /** 64 * registers a Factory to the List of known factories. 65 * @param fastFactory The factory to add 66 * 67 * needed, to step through all the FastFactories. 68 */ 63 69 void FastFactory::registerFastFactory(FastFactory* fastFactory) 64 70 { … … 101 107 102 108 /** 103 * 109 * Removes all the stored Containers, and sets the Lists back to emptienes. 110 * @param hardFLUSH if true the containing Objects will also be deleted !! THIS IS DANGEROUS !! 104 111 */ 105 112 void FastFactory::flushAll(bool hardFLUSH) … … 116 123 /** 117 124 * ereases all the remaining containers, without deleting the stored Objects inside of them. 125 * @param hardFLUSH if the the containing Objects will also be deleted !! THIS IS DANGEROUS !! 118 126 */ 119 127 void FastFactory::flush(bool hardFLUSH) … … 140 148 } 141 149 142 143 150 /** 151 * generates count new Object of the Corresponding class. (precaching) 152 * @param count How many instances of the class should be generated. 153 */ 144 154 void FastFactory::prepare(unsigned int count) 145 155 { … … 154 164 } 155 165 156 157 BaseObject* FastFactory::resurect(ClassID classID) 166 /** 167 * gives back live to one Object. 168 * @return the Object to resurrect. 169 */ 170 BaseObject* FastFactory::resurrect() 158 171 { 159 172 PRINTF(4)("Resurecting Object of type %s\n", this->getName()); … … 163 176 "Fabricating a new %s", this->getName(), this->getName()); 164 177 this->fabricate(); 165 return this->resur ect(classID);178 return this->resurrect(); 166 179 } 167 180 else … … 177 190 } 178 191 179 180 181 void FastFactory::kill(ClassID classID, BaseObject* object) 192 /** 193 * gives back live to one Object. 194 * @param classID the class From which to resurrect an Object. 195 * @return the Object to resurrect, NULL if classID is not found. 196 */ 197 BaseObject* FastFactory::resurrect(ClassID classID) 198 { 199 FastFactory* tmpFac = FastFactory::getFirst(); 200 201 while (tmpFac != NULL) 202 { 203 if (classID == tmpFac->storedClassID) 204 return tmpFac->resurrect(); 205 tmpFac = tmpFac->next; 206 } 207 return NULL; 208 } 209 210 /** 211 * kills Object object, meaning, that it will be stored in the deadList of the FastFactory, and waiting for resurrection 212 * @param object the Object to kill. 213 */ 214 void FastFactory::kill(BaseObject* object) 182 215 { 183 216 FastObjectMember* tmpC; … … 194 227 tmpC->next = this->deadList; 195 228 tmpC->objectPointer = object; 196 } 197 198 199 229 this->deadList = tmpC; 230 } 231 232 233 void FastFactory::kill(BaseObject* object, ClassID classID) 234 { 235 236 237 } 200 238 201 239
Note: See TracChangeset
for help on using the changeset viewer.