Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4313 in orxonox.OLD


Ignore:
Timestamp:
May 26, 2005, 11:24:27 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: cleaning up other, worse approaches

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

Legend:

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

    r4312 r4313  
    3131  this->setClassName ("ObjectManager");
    3232 
    33   //this->managedObjectList = new BaseObject*[CL_NUMBER];
    3433  this->managedObjectList = new tList<BaseObject>*[CL_NUMBER];
    3534
     
    6160  ObjectManager::singletonRef = NULL;
    6261}
    63 
    64 
    65 /*
    66 void ObjectManager::cache(classList index, int number, Projectile* copyObject)
    67 {
    68   //this->managedObjectList[index] = new BaseObject[number];
    69   this->managedObjectList[index] = new tList<BaseObject>();
    70   for(int i = 0; i < number; ++i)
    71     {
    72       this->managedObjectList[index]->add(new Projectile(*copyObject));
    73     }
    74 }
    75 */
    7662
    7763
  • orxonox/trunk/src/util/object_manager.h

    r4312 r4313  
    88    - recycle deleted objects: specific for Projectils since there is a lot of world entity creation/deletion (and this needs a lot of time)
    99    - control the garbage collector
     10
     11    TO ADD SUPPORT FOR A CLASS do the following steps:
     12    1. include the hader file : #include "class_header.h"
     13    2. add the class to the type enum classList {};
     14    3. define a function void mCache( ClassName ) in class ObjectManager
     15
    1016*/
    1117
     
    3541
    3642
    37 template<class T> class tList;
    38 template<class T> class ManagedObject;
    39 
    40 
    41 
    42 
    43 
     43//! This defines the "template" makro function for cache(...)
    4444#define mCache( Class ) \
    4545 cache(classList index, int number, Class * copyObject)        \
     
    6161  virtual ~ObjectManager(void);
    6262 
    63 
    6463  void mCache(Projectile);
    65 
    6664  void addToDeadList(classList index, BaseObject* object);
    6765  BaseObject* getFromDeadList(classList index, int number = 1);
    68 
    69 
    7066
    7167  void debug();
     
    7369 private:
    7470  ObjectManager(void);
    75   //void cache(classList index, int number, Projectile* copyObject);
    7671
    7772  static ObjectManager* singletonRef;
    7873
    79   //BaseObject** managedObjectList;
    8074  tList<BaseObject>** managedObjectList;
    8175  GarbageCollector* garbageCollector;
Note: See TracChangeset for help on using the changeset viewer.