Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 27, 2005, 7:14:55 PM (19 years ago)
Author:
bensch
Message:

orxonox/branches/physics: merged the trunk back to the physics-branche
merged with command:
svn merge -r 4301:HEAD trunk/ branches/physics/
little conflict in particle-system resolved easily

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/physics/src/util/object_manager.h

    r4301 r4332  
    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 {}; in class_list.h
     14    3. define a function void mCache( ClassName ) in class ObjectManager
     15
    1016*/
    1117
     
    1521
    1622#include "base_object.h"
    17 
    18 #define OM_
     23#include "projectile.h"
     24#include "list.h"
    1925
    2026#include "class_list.h"
    21 
     27 
    2228
    2329class WorldEntity;
     
    2531
    2632
    27 template<class T> class tList;
    28 template<class T> class ManagedObject;
     33//! This defines the "template" makro function for cache(...)
     34#define mCache( Class ) \
     35 cache(classList index, int number, Class * copyObject)        \
     36{                                                              \
     37  this->managedObjectList[index] = new tList<BaseObject>(); \
     38  for(int i = 0; i < number; ++i)\
     39    {\
     40      this->managedObjectList[index]->add(new Class (*copyObject));\
     41    }\
     42}
     43
     44
    2945
    3046//! the object manager itself
     
    3551  virtual ~ObjectManager(void);
    3652 
    37   void cache(classList index, int number, const BaseObject &copyObject);
    38   void addToDeadList(classList index, BaseObject* object);
    39   BaseObject* getFromDeadList(classList index, int number = 1);
     53  void mCache(Projectile);
     54  void addToDeadList(int index, BaseObject* object);
     55  BaseObject* getFromDeadList(int index, int number = 1);
    4056
    4157  void debug();
     
    4359 private:
    4460  ObjectManager(void);
     61
    4562  static ObjectManager* singletonRef;
    4663
    47   //BaseObject** managedObjectList;
    4864  tList<BaseObject>** managedObjectList;
    4965  GarbageCollector* garbageCollector;
Note: See TracChangeset for help on using the changeset viewer.