Last change
on this file since 4617 was
4519,
checked in by bensch, 19 years ago
|
orxonox/trunk: changed all getInstances into inline functions to save some (minor) time
|
File size:
1.4 KB
|
Rev | Line | |
---|
[3647] | 1 | /*! |
---|
[4485] | 2 | \file garbage_collector.h |
---|
[3647] | 3 | \brief 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. |
---|
| 8 | */ |
---|
| 9 | |
---|
| 10 | #ifndef _GARBAGE_COLLECTOR_H |
---|
| 11 | #define _GARBAGE_COLLECTOR_H |
---|
| 12 | |
---|
| 13 | #include "base_object.h" |
---|
| 14 | |
---|
| 15 | |
---|
| 16 | //! this class maintains the garbage collection. |
---|
| 17 | /** |
---|
| 18 | the class is been ticked by the world.cc and goes through the |
---|
| 19 | world_entity list to clean out all unused entities. |
---|
| 20 | */ |
---|
| 21 | class GarbageCollector : public BaseObject { |
---|
| 22 | |
---|
| 23 | public: |
---|
| 24 | virtual ~GarbageCollector(); |
---|
[4519] | 25 | /** \returns a Pointer to the only object of this Class */ |
---|
| 26 | inline static GarbageCollector* getInstance(void) { if (!singletonRef) singletonRef = new GarbageCollector(); return singletonRef; }; |
---|
[3647] | 27 | |
---|
| 28 | void setCollectionDelay(float delay); |
---|
| 29 | |
---|
| 30 | void forceCollection(); |
---|
| 31 | |
---|
| 32 | void tick(float time); |
---|
| 33 | void update(); |
---|
| 34 | |
---|
| 35 | private: |
---|
[4519] | 36 | GarbageCollector(); |
---|
| 37 | |
---|
| 38 | private: |
---|
[4485] | 39 | static GarbageCollector* singletonRef; //!< The reference to this class (singleton) |
---|
| 40 | float delay; //!< this is the delay to wait until collection |
---|
| 41 | float time; //!< the current time |
---|
[3647] | 42 | |
---|
| 43 | }; |
---|
| 44 | |
---|
| 45 | #endif /* _GARBAGE_COLLECTOR_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.