Changeset 9675 in orxonox.OLD for trunk/src/lib/lang/new_object_list.h
- Timestamp:
- Aug 21, 2006, 10:57:35 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/lang/new_object_list.h
r9674 r9675 9 9 10 10 #include "type_info.h" 11 #include < set>11 #include <map> 12 12 #include <list> 13 #include <vector>14 13 #include <string> 15 14 … … 33 32 34 33 public: 35 in t id() const { return _id; };36 const std::string& name() const { return _name; };34 inline int id() const { return _id; }; 35 inline const std::string& name() const { return _name; }; 37 36 bool operator==(int id) const { return _id == id; }; 38 37 bool operator==(const std::string& name) const { return _name == name; }; … … 40 39 41 40 /// Comparing operators. 42 bool compareName(const NewObjectListBase& more) const { return this->_name < more.name(); }; 43 bool compareID(const NewObjectListBase& more) const { return this->_id < more.id(); }; 41 // struct CompareID { 42 // bool operator()(const NewObjectListBase* less, const NewObjectListBase* more) { return less->id() < more->id(); }; 43 // }; 44 // struct CompareName{ 45 // bool operator()(const NewObjectListBase* less, const NewObjectListBase* more) { return less->name() < more->name(); }; 46 // }; 44 47 45 48 virtual void debug() const = 0; … … 63 66 64 67 protected: 65 typedef std:: set<NewObjectListBase*> cSet; //!< The Generic Set.66 typedef std:: vector<NewObjectListBase*> cVector; //!< The68 typedef std::map<int, NewObjectListBase*> classIDMap; //!< The Generic Map. 69 typedef std::map<std::string, NewObjectListBase*> classNameMap;//!< The Generic Map. 67 70 68 71 int _id; //!< The ID of the class. 69 72 std::string _name; //!< The Name of the Class. 70 73 71 cVector _typeOfList; //!< A List of all classes this class is derived of, and the class itself, ordered by age of addition.72 cSet _typeOfSet; //!< A Set of all classes this is derived from and the class itself (for isA).73 74 private: 74 75 75 76 static int _idCounter; //!< A counter, that gives all classes a Unique ClassID. Access to this Variable is to be Thread-Safe. 76 static cSet* _classes; //!< A Set of all the classes in existance. 77 static classIDMap* _classesByID; //!< A Map of all the classes in existance. 78 static classNameMap* _classesByName; //!< A Map of all the classes in existance. 77 79 static std::list<std::string> _classNames; //!< A list of all the registered ClassNames. 78 80 };
Note: See TracChangeset
for help on using the changeset viewer.