Changeset 9701 in orxonox.OLD for branches/new_class_id/src/lib/lang/new_class_id.h
- Timestamp:
- Aug 25, 2006, 11:20:21 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/lang/new_class_id.h
r9698 r9701 10 10 #include <string> 11 11 12 class NewObjectListBase; 13 12 14 //! A class to dynamically allocate ClassID's and support a isA operator 13 15 class NewClassID … … 15 17 public: 16 18 NewClassID(); 17 NewClassID( int id, const std::string& name) : _id(id), _name(name) { };19 NewClassID(const NewObjectListBase* id); 18 20 // the copy constructor is also defined. 19 const int& id() const { return _id; };20 const std::string& name() const { return _name; };21 const int& id() const { return *_id; }; 22 const std::string& name() const { return *_name; }; 21 23 22 bool operator==( NewClassID id) const { return _id == id._id || _name == id._name; };23 bool operator==(int id) const { return _id == id; };24 bool operator==(const std::string& name) const { return _name == name; };25 bool operator!=( NewClassID id) const { return _id != id._id && _name != id._name;};26 bool operator!=(int id) const { return _id != id; };27 bool operator!=(const std::string& name) const { return _name != name; };24 bool operator==(const NewClassID& id) const { return *_id == *id._id /* || _name == id._name */; }; 25 bool operator==(int id) const { return *_id == id; }; 26 bool operator==(const std::string& name) const { return *_name == name; }; 27 bool operator!=(const NewClassID& id) const { return *_id != *id._id /* && _name != id._name*/; }; 28 bool operator!=(int id) const { return *_id != id; }; 29 bool operator!=(const std::string& name) const { return *_name != name; }; 28 30 29 31 private: 30 int_id;31 std::string_name;32 const int* _id; 33 const std::string* _name; 32 34 }; 33 35
Note: See TracChangeset
for help on using the changeset viewer.