Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4939 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Jul 23, 2005, 12:15:03 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: now the garbage collector should be ready to store the Objects

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

Legend:

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

    r4938 r4939  
    211211 * kills Object object, meaning, that it will be stored in the deadList of the FastFactory, and waiting for resurrection
    212212 * @param object the Object to kill.
     213 *
     214 * synony that would be really grate would be abolish, but this is more like exterminate than pause-mode.
    213215 */
    214216void FastFactory::kill(BaseObject* object)
     
    231233
    232234
    233 void FastFactory::kill(BaseObject* object, ClassID classID)
    234 {
    235 
    236 
     235void FastFactory::kill(BaseObject* object, bool searchForFastFactory)
     236{
     237  if (likely(searchForFastFactory == true))
     238  {
     239    FastFactory* tmpFac = FastFactory::first;
     240    while (tmpFac != NULL)
     241    {
     242      if (object->isA(tmpFac->storedClassID))
     243      {
     244        tmpFac->kill(object);
     245        return;
     246      }
     247      tmpFac = tmpFac->next;
     248    }
     249
     250  }
    237251}
    238252
  • orxonox/trunk/src/util/object_manager.h

    r4938 r4939  
    6060    static BaseObject* resurrect(ClassID classID);
    6161    void kill(BaseObject* object);
    62     static void kill(BaseObject* object, ClassID classID);
     62    static void kill(BaseObject* object, bool searchForFastFactory);
    6363
    6464    void prepare(unsigned int count);
     
    8080    FastFactory* getNext() const { return this->next; };
    8181
    82 //    virtual BaseObject* fabricate(ClassID classID) = NULL;
     82    /** generates a new Object of the Class T */
    8383    virtual void fabricate() = NULL;
    8484    static FastFactory* searchFastFactory(ClassID classID, const char* fastFactoryName = NULL);
     
    119119 * @param fastFactoryName the name of the FastFactory
    120120 * @param fastFactory the ID of the class
     121 * @todo (can this be written in another form??)
    121122 */
    122123template<class T>
     
    126127}
    127128
     129/**
     130 * creates (if not existent) a Factory of Class T, and assigns some values to it
     131 * @param classID the ClassID to assign to this class
     132 * @param fastFactoryName the name to assign
     133 * @returns The FastFactory if existent a new Factory if not.
     134 */
    128135template<class T>
    129136    tFastFactory<T>* tFastFactory<T>::getFastFactory(ClassID classID, const char* fastFactoryName)
     
    140147
    141148
     149/**
     150 * fabricates an Object of Class T, that corresponds to classID.
     151 */
    142152template<class T>
    143153    void tFastFactory<T>::fabricate()
Note: See TracChangeset for help on using the changeset viewer.