Changeset 6121 in orxonox.OLD for branches/objectmanager/src/util/object_manager.cc
- Timestamp:
- Dec 15, 2005, 1:34:32 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/objectmanager/src/util/object_manager.cc
r6120 r6121 22 22 23 23 #include "shell_command.h" 24 25 #include <assert.h> 26 24 27 using namespace std; 25 28 SHELL_COMMAND(debug, ObjectManager, debug) … … 37 40 } 38 41 39 /**40 * the singleton reference to this class41 */42 ObjectManager* ObjectManager::singletonRef = NULL;43 42 44 43 /** … … 50 49 { 51 50 this->flush(); 52 ObjectManager::singletonRef = NULL;53 51 } 54 52 … … 78 76 void ObjectManager::toList (WorldEntity* entity, OM_LIST omList) 79 77 { 78 assert (omList != OM_SIZE); 79 80 80 if (likely(entity->getOMListNumber() != OM_INIT)) 81 81 this->objectLists[entity->getOMListNumber()].erase(entity->getEntityIterator()); … … 127 127 * @brief print out nice debug information about Elements in the list OM_LIST 128 128 * @param omList the List to debug. 129 */ 130 void ObjectManager::debug(OM_LIST omList) const 129 * @param level: level 0: only show list info; level 1: also show entities and their names. 130 */ 131 void ObjectManager::debug(OM_LIST omList, unsigned int level) const 131 132 { 132 133 if (omList != OM_INIT || omList == OM_SIZE) 133 134 { 134 135 PRINT(0)(" +ObjectManager-LIST: '%s'-size='%d'-----\n", ObjectManager::OMListToString((OM_LIST) omList), this->objectLists[omList].size()); 135 std::list<WorldEntity*>::const_iterator entity; 136 for (entity = this->objectLists[omList].begin(); entity != this->objectLists[omList].end(); entity++) 136 if (level > 1) 137 137 { 138 PRINT(0)(" | %s::%s\n",(*entity)->getClassName(), (*entity)->getName()); 138 std::list<WorldEntity*>::const_iterator entity; 139 for (entity = this->objectLists[omList].begin(); entity != this->objectLists[omList].end(); entity++) 140 { 141 PRINT(0)(" | %s::%s\n",(*entity)->getClassName(), (*entity)->getName()); 142 } 139 143 } 140 144 } … … 147 151 * @brief prints out very nice debug information 148 152 * @param listName the Name of the list to get Debug information from 149 */ 150 void ObjectManager::debug(const char* listName) 151 { 153 * @param level: level 0: only show list info; level 1: also show entities and their names. 154 */ 155 void ObjectManager::debug(const char* listName, unsigned int level) 156 { 157 PRINT(0)("=================================\n"); 152 158 PRINT(0)("=ObjectManager-DEBUG=============\n"); 159 PRINT(0)("=================================\n"); 153 160 if (listName == NULL || listName[0] == '\0') 154 161 for (unsigned int i = 0; i < OM_SIZE; ++i) 155 debug((OM_LIST) i );162 debug((OM_LIST) i, level); 156 163 else 157 164 debug(ObjectManager::StringToOMList(listName)); … … 198 205 "null", 199 206 "dead", 207 "dead-tick" 200 208 "environ-notick", 201 209 "environ",
Note: See TracChangeset
for help on using the changeset viewer.