Changeset 9726 in orxonox.OLD for branches/new_class_id/src/lib/lang/object_list.h
- Timestamp:
- Sep 9, 2006, 7:42:16 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/lang/object_list.h
r9724 r9726 9 9 10 10 #include "class_id.h" 11 #include <cassert>12 11 #include <map> 13 12 #include <list> 14 13 #include <string> 14 15 #include <cassert> 15 16 #include <iostream> 16 17 … … 101 102 static int StringToID(const std::string& className); 102 103 103 //! Only use t to unsubscribe a BaseObject.104 //! Only used to unsubscribe a BaseObject. (just try to make a valid iterator, stupid :)) 104 105 virtual void unregisterObject(IteratorBase* _iterators) = 0; 105 106 … … 117 118 118 119 protected: 119 typedef std::map<int, ObjectListBase*> classIDMap; //!< The Generic Map.120 typedef std::map<std::string, ObjectListBase*> classNameMap; //!< The Generic Map.120 typedef std::map<int, ObjectListBase*> IDMap; //!< The Generic Map. 121 typedef std::map<std::string, ObjectListBase*> NameMap; //!< The Generic Map. 121 122 122 123 private: … … 126 127 127 128 private: 128 static classIDMap*_classesByID; //!< A Map of all the classes in existance.129 static classNameMap*_classesByName; //!< A Map of all the classes in existance.129 static IDMap* _classesByID; //!< A Map of all the classes in existance. 130 static NameMap* _classesByName; //!< A Map of all the classes in existance. 130 131 static std::list<std::string> _classNames; //!< A list of all the registered ClassNames. 131 132 }; … … 135 136 //// TEMPLATISATION ///// 136 137 ///////////////////////// 137 //! Defines a Object sList handler for objects of type T.138 //! Defines a ObjectList handler for objects of type T. 138 139 /** 139 140 * The ObjectList is a generic way to store every object created from a Class 'T' 140 * in toa List. The list can be retrieved, and used constantly over iterators,141 * in a List. The list can be retrieved, and used constantly over iterators, 141 142 * as with normal std::list. 142 143 * 143 144 * Furthermore the linkage over the single Lists is given over the Superclass ObjectListBase. 144 145 * 145 * 146 * 146 * The approach of ObjectList is an intrusive one, meaning, that each Class that wants to 147 * support it must implement a Declaration and a Definition for the ObjectList, as mentioned 148 * in the next statement: 147 149 * 148 150 * To define a Class with a ObjectList, you have to: … … 152 154 * 153 155 * @note The Class must define the compare with const std::string& operator for this to work. 156 * The operator==(const std::string& name) should compare the object's name with name. 154 157 * 155 158 *
Note: See TracChangeset
for help on using the changeset viewer.