Changeset 4754 in orxonox.OLD for orxonox/trunk/src/lib
- Timestamp:
- Jul 1, 2005, 7:22:31 PM (19 years ago)
- Location:
- orxonox/trunk/src/lib/lang
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/lang/class_list.cc
r4752 r4754 108 108 109 109 /** 110 * checks if the BaseObject* object exists. 111 * @param object the Pointer to a BaseObject to check if it exists 112 * @param classID if not CL_NULL it will only search through a specific type of Objects. Otherwise it will be searched everywhere. 113 * @return true, if the Object Exists in the specified ClassID, false otherwise 114 * @todo: speed this up!! 115 */ 116 bool ClassList::exists(BaseObject* object, long classID) 117 { 118 if(unlikely(ClassList::first == NULL)) 119 return false; 120 else 121 { 122 ClassList* tmp = ClassList::first; 123 while (likely(tmp != NULL)) 124 { 125 if (tmp->classID == classID || classID == CL_NULL) 126 { 127 tIterator<BaseObject>* iterator = tmp->objectList->getIterator(); 128 BaseObject* enumBO = iterator->nextElement(); 129 while (enumBO) 130 { 131 if (enumBO == object) 132 return true; 133 enumBO = iterator->nextElement(); 134 } 135 delete iterator; 136 break; 137 } 138 tmp = tmp->next; 139 } 140 } 141 return false; 142 } 143 144 145 /** 110 146 * Print out some very nice debug information 111 147 */ -
orxonox/trunk/src/lib/lang/class_list.h
r4752 r4754 30 30 static void removeFromClassList(BaseObject* objectPointer); 31 31 32 bool exists(BaseObject* object, long classID = CL_NULL); 33 32 34 static void debug(unsigned int debugLevel = 0); 33 35
Note: See TracChangeset
for help on using the changeset viewer.