Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4979 in orxonox.OLD for orxonox/trunk/src/util


Ignore:
Timestamp:
Aug 10, 2005, 4:47:23 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: Objects now get cleanly ereased.
This is a fix in the Weapon-class, that kills the Resurected Projectiles created for information-gathering

Location:
orxonox/trunk/src/util
Files:
4 edited

Legend:

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

    r4951 r4979  
    8181}
    8282
    83 
    8483/**
    8584 * searches for a FastFactory
     
    135134  while (tmpFac != NULL)
    136135  {
     136    printf("DELETEING ALL OF %s\n",tmpFac->getName());
    137137    tmpFac->flush(hardFLUSH);
    138138    tmpFac = tmpFac->next;
     
    140140}
    141141
    142 
    143142/**
    144143 * ereases all the remaining containers, without deleting the stored Objects inside of them.
     
    152151    delMember = tmpMember;
    153152    tmpMember = tmpMember->next;
    154     if (unlikely(hardFLUSH == true))
     153    if (hardFLUSH)
     154    {
     155      PRINTF(1)("COOL\n");
    155156      delete delMember->objectPointer;
     157    }
    156158    delete delMember;
    157159  }
     
    267269      tmpFac = tmpFac->next;
    268270    }
    269 
    270   }
    271 }
     271  }
     272}
  • orxonox/trunk/src/util/fast_factory.h

    r4969 r4979  
    1515 * afterwards one can just retrieve an Object form the Class with
    1616 * this->bulletFactory->resurrect();  // this returns a BaseObject an Object of the class.
     17 *
     18 * The big difference to the FastFactory-class is, that this one is used more for the purpose
     19 * of fast game-interaction than for loading. althought one can also load FastFactorized classes
     20 * it is not the main topic.
    1721 */
    18 
    1922
    2023#ifndef _FAST_FACTORY_H
  • orxonox/trunk/src/util/garbage_collector.cc

    r4975 r4979  
    2525
    2626using namespace std;
    27 
    2827
    2928GarbageCollector* GarbageCollector::singletonRef = 0;
     
    119118void GarbageCollector::update()
    120119{
    121   if (this->time < this->delay)
    122   {
    123     return;
    124   }
    125   if (this->collectedObjects == NULL)
     120  if (this->time < this->delay || this->collectedObjects == NULL)
    126121    return;
    127122  else
     
    131126    while (tmpC != NULL)
    132127    {
    133       WorldEntity* entity = dynamic_cast<WorldEntity*>(tmpC->objectPointer);
     128      //WorldEntity* entity = dynamic_cast<WorldEntity*>(tmpC->objectPointer);
    134129      //State::getWorldEntityList()->remove(entity);
    135       entity->remove();
    136       FastFactory::kill(entity, true);
     130      //entity->remove();
     131      FastFactory::kill(tmpC->objectPointer, true);
    137132
    138133      moveC = tmpC->next;
  • orxonox/trunk/src/util/garbage_collector.h

    r4941 r4979  
    11/*!
    22 * @file garbage_collector.h
    3  * 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.
    5  *
    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.
    83 */
    94
     
    1712//! this class maintains the garbage collection.
    1813/**
    19    the class is been ticked by the world.cc and goes through the
    20    world_entity list to clean out all unused entities.
     14 * you can pass everything to this class that you want to be collected
     15 * just use GarbageCollector->collect(POINTER); to pass a collectable to the GarbageCollector
     16 * it will then be handled acording to the class
    2117*/
    2218class GarbageCollector : public BaseObject {
Note: See TracChangeset for help on using the changeset viewer.