- Timestamp:
- Dec 13, 2005, 2:53:22 AM (19 years ago)
- Location:
- trunk/src/lib/lang
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/lang/base_object.cc
r5915 r6077 101 101 * @returns true if it is, false otherwise 102 102 */ 103 bool BaseObject::isA ( longclassID) const103 bool BaseObject::isA (ClassID classID) const 104 104 { 105 105 // if classID is a derivable object from a SUPERCLASS … … 132 132 bool BaseObject::isA (const char* className) const 133 133 { 134 longclassID = ClassList::StringToID(className);134 ClassID classID = ClassList::StringToID(className); 135 135 if (classID != CL_NULL) 136 136 return this->isA(classID); -
trunk/src/lib/lang/base_object.h
r5791 r6077 35 35 inline int getClassID() const { return this->classID; }; 36 36 37 bool isA ( longclassID) const;37 bool isA (ClassID classID) const; 38 38 bool isA (const char* className) const; 39 39 void whatIs() const; 40 40 41 41 bool operator==(const char* objectName); 42 /** @param classID comparer for a ClassID @returns true on match, false otherwise */ 43 bool operator==(ClassID classID) { return this->isA(classID); }; 42 44 43 45 protected: -
trunk/src/lib/lang/class_list.cc
r5885 r6077 37 37 * Creates a new ClassList 38 38 */ 39 ClassList::ClassList( const long&classID, const char* className)39 ClassList::ClassList(ClassID classID, const char* className) 40 40 { 41 41 this->className = className; … … 94 94 if (objectPointer->isA((*cl).classID)) 95 95 { 96 std::list<BaseObject*>::iterator bo; 97 for (bo = (*cl).objectList.begin(); bo != (*cl).objectList.end(); bo++) 98 { 99 if ((*bo) == objectPointer) 100 { 96 std::list<BaseObject*>::iterator bo = std::find ((*cl).objectList.begin(), (*cl).objectList.end(), objectPointer); 97 if (bo != (*cl).objectList.end()) 101 98 (*cl).objectList.erase(bo); 102 break;103 }104 }105 99 } 106 100 } … … 175 169 } 176 170 177 171 /** 172 * !!PRIVATE!! 173 * @param classID the ClassID to search for 174 * @returns the ClassList with classID as specifyer, or NULL if not 175 */ 178 176 ClassList* ClassList::getClassList(ClassID classID) 179 177 { … … 183 181 184 182 183 /** 184 * !!PRIVATE!! 185 * @param className the ClassName to search for 186 * @returns the ClassList with className as specifyer, or NULL if not 187 */ 185 188 ClassList* ClassList::getClassList(const char* className) 186 189 { … … 288 291 * @return the ClassID. CL_NULL, if the class was not found. 289 292 */ 290 longClassList::StringToID(const char* className)293 ClassID ClassList::StringToID(const char* className) 291 294 { 292 295 ClassList* cl = ClassList::getClassList(className); … … 314 317 * @param classID the class that should be displayed (if CL_NULL (default) all classes will be displayed) 315 318 */ 316 void ClassList::debug(unsigned int debugLevel, longclassID)319 void ClassList::debug(unsigned int debugLevel, ClassID classID) 317 320 { 318 321 if (debugLevel > 3) -
trunk/src/lib/lang/class_list.h
r6070 r6077 33 33 34 34 public: 35 ClassList( const long&classID, const char* className);35 ClassList(ClassID classID, const char* className); 36 36 virtual ~ClassList(); 37 37 … … 51 51 52 52 static const char* IDToString(ClassID classID = CL_NULL); 53 static longStringToID(const char* className);54 static void debug(unsigned int debugLevel = 0, longclassID = CL_NULL);53 static ClassID StringToID(const char* className); 54 static void debug(unsigned int debugLevel = 0, ClassID classID = CL_NULL); 55 55 static void debugS(const char* className = NULL, unsigned int debugLevel = 0); 56 56 … … 65 65 private: 66 66 67 long classID; //!< ClassID stored in this ClassList \see ClassID67 ClassID classID; //!< ClassID stored in this ClassList 68 68 const char* className; //!< Name of the Class Stored here 69 69
Note: See TracChangeset
for help on using the changeset viewer.