Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4937 in orxonox.OLD for orxonox/trunk/src


Ignore:
Timestamp:
Jul 22, 2005, 7:37:05 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: FastFactory: some more movement to the BaseClass. Now it is almost where i want it
doxygen tags will follow at 2 o'Clock in the morning …

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

Legend:

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

    r4936 r4937  
    3636  this->storedClassID = classID;
    3737  this->next = NULL;
     38
     39  this->deadList = NULL;
     40  this->unusedContainers = NULL;
    3841
    3942  this->storedDeadObjects = 0;
     
    139142
    140143
     144void FastFactory::prepare(unsigned int count)
     145{
     146/*  if (this->storedDeadObjects + this->storedLivingObjects >= count)
     147  {
     148  PRINTF(3)("not creating new Objects for class %s, because the requested count already exists\n", this->getClassName());
     149}*/
     150  for (int i = this->storedDeadObjects; i < count; i++)
     151  {
     152    this->fabricate();
     153  }
     154}
     155
     156
    141157BaseObject* FastFactory::resurect(ClassID classID)
    142158{
  • orxonox/trunk/src/util/object_manager.h

    r4936 r4937  
    5757
    5858    virtual void fabricate() = NULL;
     59    void prepare(unsigned int count);
    5960    // retrival functions for fast Ineraction
    6061    //FastFactory* getFastFactory(ClassID classID);
     
    103104    static tFastFactory<T>* getFastFactory(ClassID classID, const char* fastFactoryName = NULL);
    104105
    105     void prepare(unsigned int count);
    106 
    107106    T* resurect();
    108107  private:
     
    123122  : FastFactory(classID, fastFactoryName)
    124123{
    125   PRINTF(5)("Class: %s loadable as a FastFactory\n", this->getName());
    126 
    127   this->deadList = NULL;
    128   this->unusedContainers = NULL;
    129124}
    130125
     
    152147
    153148  this->deadList = tmpFirstDead;
    154 }
    155 
    156 template<class T>
    157     void tFastFactory<T>::prepare(unsigned int count)
    158 {
    159 /*  if (this->storedDeadObjects + this->storedLivingObjects >= count)
    160   {
    161     PRINTF(3)("not creating new Objects for class %s, because the requested count already exists\n", this->getClassName());
    162   }*/
    163   for (int i = this->storedDeadObjects; i < count; i++)
    164   {
    165     this->fabricate();
    166   }
    167149}
    168150
Note: See TracChangeset for help on using the changeset viewer.