Changeset 9676 in orxonox.OLD for trunk/src/lib/lang/new_object_list.h
- Timestamp:
- Aug 21, 2006, 11:09:53 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/lang/new_object_list.h
r9675 r9676 37 37 bool operator==(const std::string& name) const { return _name == name; }; 38 38 39 40 /// Comparing operators.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 // };47 48 39 virtual void debug() const = 0; 49 40 50 static unsigned int classCount() { return _idCounter; };41 static unsigned int classCount(); 51 42 static const std::string& IDToString(int classID); 52 43 static int StringToID(const std::string& className); … … 57 48 58 49 protected: 59 NewObjectListBase(const std::string& className );50 NewObjectListBase(const std::string& className, int id = -1); 60 51 virtual ~NewObjectListBase(); 61 52 … … 63 54 NewObjectListBase(const NewObjectListBase&); 64 55 56 static bool classIDExists(int id); 65 57 static bool classNameExists(const std::string& className); 66 58 … … 73 65 74 66 private: 75 76 static int _idCounter; //!< A counter, that gives all classes a Unique ClassID. Access to this Variable is to be Thread-Safe.77 67 static classIDMap* _classesByID; //!< A Map of all the classes in existance. 78 68 static classNameMap* _classesByName; //!< A Map of all the classes in existance. … … 110 100 111 101 public: 112 NewObjectList(const std::string& name );102 NewObjectList(const std::string& name, int id = -1); 113 103 ~NewObjectList(); 114 104 … … 137 127 ///////////////////////// 138 128 template <class T> 139 NewObjectList<T>::NewObjectList(const std::string& name )140 : NewObjectListBase(name )129 NewObjectList<T>::NewObjectList(const std::string& name, int id) 130 : NewObjectListBase(name, id) 141 131 {} 142 132
Note: See TracChangeset
for help on using the changeset viewer.