Changeset 9715 in orxonox.OLD for branches/new_class_id/src/lib/lang/new_class_id.h
- Timestamp:
- Sep 1, 2006, 8:06:39 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/lang/new_class_id.h
r9709 r9715 10 10 #include <string> 11 11 12 class NewObjectListBase;12 class ObjectListBase; 13 13 14 14 //! A class to dynamically allocate ClassID's and to support a isA operator 15 15 /** 16 * A NewClassID can only be aquired over a NewObjectList,16 * A ClassID can only be aquired over a ObjectList, 17 17 * thus enabling the developer to have permanent access to the correct ID and ClassName 18 18 * 19 * The Idea behind this concept is, that storing a NewClassID that changes its internal state20 * all NewClassID's will be updated correctly.19 * The Idea behind this concept is, that storing a ClassID that changes its internal state 20 * all ClassID's will be updated correctly. 21 21 * 22 * Since the Existance of any NewObjectList is a requirement during the working process all22 * Since the Existance of any ObjectList is a requirement during the working process all 23 23 * ID's should reference a valid ID and ClassName 24 24 */ 25 class NewClassID25 class ClassID 26 26 { 27 27 public: 28 NewClassID();29 NewClassID(const NewObjectListBase* const id);28 ClassID(); 29 ClassID(const ObjectListBase* const id); 30 30 /// the copy constructor is also defined implicitely. 31 31 … … 36 36 37 37 /** @param id the id to compare @returns true on match (match is same ID) @brief compares two id's */ 38 bool operator==(const NewClassID& id) const { return *_id == *id._id /* || _name == id._name */; };38 bool operator==(const ClassID& id) const { return *_id == *id._id /* || _name == id._name */; }; 39 39 /** @param id the id to compare @returns true on match (match is same ID) @brief compares two id's */ 40 40 bool operator==(int id) const { return *_id == id; }; … … 42 42 bool operator==(const std::string& name) const { return *_name == name; }; 43 43 /** @param id the id to compare @returns false on match (match is same ID) @brief compares two id's */ 44 bool operator!=(const NewClassID& id) const { return *_id != *id._id /* && _name != id._name*/; };44 bool operator!=(const ClassID& id) const { return *_id != *id._id /* && _name != id._name*/; }; 45 45 /** @param id the id to compare @returns false on match (match is same ID) @brief compares two id's */ 46 46 bool operator!=(int id) const { return *_id != id; }; … … 61 61 public: 62 62 /** @returns the NullClass' ID. */ 63 static const NewClassID& classID() { return NullClass::_classID; }63 static const ClassID& classID() { return NullClass::_classID; } 64 64 /** @param id the ID to acquire @param name the name to acquire @brief acquires the ID of this Class */ 65 65 static void acquireID(const int*& id, const std::string*& name) { id = &_nullID; name = &_nullName; }; … … 69 69 70 70 private: 71 static NewClassID _classID; //!< The NullClass' ID71 static ClassID _classID; //!< The NullClass' ID 72 72 static const std::string _nullName; //!< The NullClass' Name ("NullClass") 73 73 static int _nullID; //!< The NullClass' ID
Note: See TracChangeset
for help on using the changeset viewer.