Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4938 in orxonox.OLD for orxonox/trunk/src/util/object_manager.cc


Ignore:
Timestamp:
Jul 22, 2005, 11:57:38 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: doxygen tags.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/util/object_manager.cc

    r4937 r4938  
    2323using namespace std;
    2424
    25 
    26 
    27 
    28 /**
    29  *  constructor, sets everything to zero and define factoryName
     25/**
     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
    3030 */
    3131FastFactory::FastFactory (ClassID classID, const char* fastFactoryName)
     
    5050/**
    5151 *  destructor
    52  *  clear the Q
     52 * deletes all the Instances of the FastFactory.
    5353 */
    5454FastFactory::~FastFactory ()
     
    6161}
    6262
     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 */
    6369void FastFactory::registerFastFactory(FastFactory* fastFactory)
    6470{
     
    101107
    102108/**
    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 !!
    104111 */
    105112void FastFactory::flushAll(bool hardFLUSH)
     
    116123/**
    117124 * 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 !!
    118126 */
    119127void FastFactory::flush(bool hardFLUSH)
     
    140148}
    141149
    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 */
    144154void FastFactory::prepare(unsigned int count)
    145155{
     
    154164}
    155165
    156 
    157 BaseObject* FastFactory::resurect(ClassID classID)
     166/**
     167 * gives back live to one Object.
     168 * @return the Object to resurrect.
     169 */
     170BaseObject* FastFactory::resurrect()
    158171{
    159172  PRINTF(4)("Resurecting Object of type %s\n", this->getName());
     
    163176        "Fabricating a new %s", this->getName(), this->getName());
    164177    this->fabricate();
    165     return this->resurect(classID);
     178    return this->resurrect();
    166179  }
    167180  else
     
    177190}
    178191
    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 */
     197BaseObject* 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 */
     214void FastFactory::kill(BaseObject* object)
    182215{
    183216  FastObjectMember* tmpC;
     
    194227  tmpC->next = this->deadList;
    195228  tmpC->objectPointer = object;
    196 }
    197 
    198 
    199 
     229  this->deadList = tmpC;
     230}
     231
     232
     233void FastFactory::kill(BaseObject* object, ClassID classID)
     234{
     235
     236
     237}
    200238
    201239
Note: See TracChangeset for help on using the changeset viewer.