Changeset 9724 in orxonox.OLD for branches/new_class_id/src/lib/lang/object_list.h
- Timestamp:
- Sep 8, 2006, 12:20:55 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/lang/object_list.h
r9718 r9724 28 28 static ObjectList<ClassName> _objectList 29 29 30 /** 31 * @brief Use this macro to easily define a Class to store its own ObjectListDefinition 32 * @param ClassName: the Name of the Class. 33 * @param ID: optional set a Fixed ID. 34 */ 30 35 #define ObjectListDefinitionID(ClassName, ID) \ 31 36 ObjectList<ClassName> ClassName::_objectList(#ClassName, ID) 32 37 33 38 /** 39 * @brief Use this macro to easily define a Class to store its own ObjectListDefinition 40 * @param ClassName: the Name of the Class. 41 */ 34 42 #define ObjectListDefinition(ClassName) \ 35 43 ObjectListDefinitionID(ClassName, -1) … … 43 51 { 44 52 public: 45 //! A fast iterator Base-Class, for iterator-casting and storing.46 /**47 * @note This Iterator is explicitely used only for storage purposes in the BaseObject48 */49 class IteratorBase { };50 51 53 /** @brief A Typedefinition for the Base-List that can be retrieved with getBaseObjectList(base_list*) */ 52 54 typedef std::list<BaseObject*> base_list; 53 55 /** @brief An iterator for the base_list */ 54 56 typedef base_list::iterator base_iterator; 57 //! A fast iterator Base-Class, for iterator-casting and storing. 58 /** @note This Iterator is explicitely used only for storage purposes in the BaseObject */ 59 class IteratorBase { }; 55 60 56 61 public: 57 62 /** @returns The Identity of the Class stored within. */ 58 inline const ClassID& identity() const { return _identity; }63 inline const ClassID& identity() const { return _identity; } 59 64 /** @returns the ID of the Identity of the ObjectList */ 60 65 inline int id() const { return _id; }; … … 67 72 /** @param name The name to compare @returns true on match, false otherwise */ 68 73 inline bool operator==(const std::string& name) const { return _name == name; }; 69 /** @param id The id to check @returns true on match, false otherwise*/74 /** @param id The id to acquire @param name the Name to acquire @brief stores a Name and an ID in a pointer. */ 70 75 inline void acquireID(const int*& id, const std::string*& name) const { id = &_id; name = &_name; }; 71 76 /** @brief fills a list of Objects into a BaseObject*-List. @param list the list to fill */ … … 104 109 105 110 private: 106 ObjectListBase(const ObjectListBase&); 111 /** @brief hidden copy constructor. */ 112 ObjectListBase(const ObjectListBase&) {}; 107 113 108 114 static bool classIDExists(int id); … … 153 159 * and not loaded before the ObjectList. 154 160 * 155 * @exampleIterating: Iteration is made easy, and fast as follows:161 * example: Iterating: Iteration is made easy, and fast as follows: 156 162 * for (ObjectList<PlayerStats>::const_iterator it = PlayerStats::objectList().begin(); 157 163 * it != PlayerStats::objectList().end(); … … 161 167 * } 162 168 * 163 * @exampleFind an Object:169 * example: Find an Object: 164 170 * Playable* playable = Playable::objectList("orxonox-super-rocket-fighter"); // searches an Object By its name. 165 171 * … … 192 198 virtual BaseObject* getBaseObject(const std::string& name) const; 193 199 T* getObject(const std::string& name) const; 200 /** @returns A constant list of Objects of this Class. */ 194 201 inline const list& objects() const { return _objects; }; 195 202 bool exists(const T* const object) const; … … 314 321 /** 315 322 * @brief registers an Object to the ObjectList. 316 * @param T object the Object to register.323 * @param object The Object to register. 317 324 * @returns a pointer to the iterator inside of the list. 318 325 */
Note: See TracChangeset
for help on using the changeset viewer.