| 1 | /* | 
|---|
| 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 |  | 
|---|
| 11 | ### File Specific: | 
|---|
| 12 | main-programmer: Patrick Boenzli | 
|---|
| 13 | */ | 
|---|
| 14 |  | 
|---|
| 15 | #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_OBJECT_MANAGER | 
|---|
| 16 |  | 
|---|
| 17 | #include "object_manager.h" | 
|---|
| 18 | #include "garbage_collector.h" | 
|---|
| 19 | #include "list.h" | 
|---|
| 20 |  | 
|---|
| 21 | #include "debug.h" | 
|---|
| 22 |  | 
|---|
| 23 | using namespace std; | 
|---|
| 24 |  | 
|---|
| 25 | /** | 
|---|
| 26 | *  standard constructor | 
|---|
| 27 | */ | 
|---|
| 28 | ObjectManager::ObjectManager () | 
|---|
| 29 | { | 
|---|
| 30 | this->setClassID(CL_OBJECT_MANAGER, "ObjectManager"); | 
|---|
| 31 | this->setName("ObjectManager"); | 
|---|
| 32 |  | 
|---|
| 33 | } | 
|---|
| 34 |  | 
|---|
| 35 |  | 
|---|
| 36 | /** | 
|---|
| 37 | *  the singleton reference to this class | 
|---|
| 38 | */ | 
|---|
| 39 | ObjectManager* ObjectManager::singletonRef = NULL; | 
|---|
| 40 |  | 
|---|
| 41 | /** | 
|---|
| 42 | *  standard deconstructor | 
|---|
| 43 | */ | 
|---|
| 44 | ObjectManager::~ObjectManager () | 
|---|
| 45 | { | 
|---|
| 46 | ObjectManager::singletonRef = NULL; | 
|---|
| 47 | } | 
|---|
| 48 |  | 
|---|
| 49 | /** | 
|---|
| 50 | *  outputs some simple debug information about the ObjectManage | 
|---|
| 51 | */ | 
|---|
| 52 | void ObjectManager::debug() const | 
|---|
| 53 | { | 
|---|
| 54 | PRINT(0)("\n==========================| ObjectManager::debug() |===\n"); | 
|---|
| 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 | { | 
|---|
| 59 | if( this->managedObjectList[i] != NULL) | 
|---|
| 60 | PRINT(0)("=   o Class Nr. %i has cached %i object(s)\n", i, this->managedObjectList[i]->getSize()); | 
|---|
| 61 | else | 
|---|
| 62 | PRINT(0)("=   o Class Nr. %i has cached 0 object(s)\n", i); | 
|---|
| 63 | }*/ | 
|---|
| 64 | PRINT(0)("=======================================================\n"); | 
|---|
| 65 | } | 
|---|
| 66 |  | 
|---|
| 67 |  | 
|---|