| [4592] | 1 | /* |
|---|
| [4245] | 2 | orxonox - the future of 3D-vertical-scrollers |
|---|
| 3 | |
|---|
| 4 | Copyright (C) 2004 orx |
|---|
| 5 | |
|---|
| 6 | This program is free software; you can redistribute it and/or modify |
|---|
| 7 | it under the terms of the GNU General Public License as published by |
|---|
| 8 | the Free Software Foundation; either version 2, or (at your option) |
|---|
| 9 | any later version. |
|---|
| 10 | |
|---|
| [4940] | 11 | ### File Specific: |
|---|
| [4245] | 12 | main-programmer: Patrick Boenzli |
|---|
| 13 | */ |
|---|
| 14 | |
|---|
| 15 | #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_OBJECT_MANAGER |
|---|
| 16 | |
|---|
| 17 | #include "object_manager.h" |
|---|
| [4288] | 18 | #include "garbage_collector.h" |
|---|
| [4286] | 19 | #include "list.h" |
|---|
| [4245] | 20 | |
|---|
| [4930] | 21 | #include "debug.h" |
|---|
| [4288] | 22 | |
|---|
| [4245] | 23 | using namespace std; |
|---|
| 24 | |
|---|
| 25 | /** |
|---|
| [4836] | 26 | * standard constructor |
|---|
| [4245] | 27 | */ |
|---|
| [4592] | 28 | ObjectManager::ObjectManager () |
|---|
| [4245] | 29 | { |
|---|
| [4320] | 30 | this->setClassID(CL_OBJECT_MANAGER, "ObjectManager"); |
|---|
| [4597] | 31 | this->setName("ObjectManager"); |
|---|
| [4592] | 32 | |
|---|
| [4245] | 33 | } |
|---|
| 34 | |
|---|
| [4322] | 35 | |
|---|
| [4245] | 36 | /** |
|---|
| [4836] | 37 | * the singleton reference to this class |
|---|
| [4245] | 38 | */ |
|---|
| 39 | ObjectManager* ObjectManager::singletonRef = NULL; |
|---|
| 40 | |
|---|
| 41 | /** |
|---|
| [4836] | 42 | * standard deconstructor |
|---|
| [4245] | 43 | */ |
|---|
| [4592] | 44 | ObjectManager::~ObjectManager () |
|---|
| [4245] | 45 | { |
|---|
| 46 | ObjectManager::singletonRef = NULL; |
|---|
| [4285] | 47 | } |
|---|
| [4245] | 48 | |
|---|
| [4485] | 49 | /** |
|---|
| [4836] | 50 | * outputs some simple debug information about the ObjectManage |
|---|
| [4485] | 51 | */ |
|---|
| [4746] | 52 | void ObjectManager::debug() const |
|---|
| [4287] | 53 | { |
|---|
| 54 | PRINT(0)("\n==========================| ObjectManager::debug() |===\n"); |
|---|
| [4932] | 55 | /* PRINT(0)("= Number of registerable classes: %i\n", CL_NUMBER ); |
|---|
| 56 | PRINT(0)("= Currently cached objects: \n"); |
|---|
| 57 | for(int i = 0; i < CL_NUMBER; ++i) |
|---|
| 58 | { |
|---|
| [4318] | 59 | if( this->managedObjectList[i] != NULL) |
|---|
| [4592] | 60 | PRINT(0)("= o Class Nr. %i has cached %i object(s)\n", i, this->managedObjectList[i]->getSize()); |
|---|
| [4287] | 61 | else |
|---|
| [4592] | 62 | PRINT(0)("= o Class Nr. %i has cached 0 object(s)\n", i); |
|---|
| [4932] | 63 | }*/ |
|---|
| [4287] | 64 | PRINT(0)("=======================================================\n"); |
|---|
| 65 | } |
|---|
| [4930] | 66 | |
|---|
| [4931] | 67 | |
|---|