[Orxonox-commit 4904] r9573 - code/branches/core6/src/libraries/core/object

landauf at orxonox.net landauf at orxonox.net
Sun Mar 24 22:43:27 CET 2013


Author: landauf
Date: 2013-03-24 22:43:27 +0100 (Sun, 24 Mar 2013)
New Revision: 9573

Modified:
   code/branches/core6/src/libraries/core/object/Iterator.h
   code/branches/core6/src/libraries/core/object/ObjectListBase.cc
   code/branches/core6/src/libraries/core/object/ObjectListBase.h
   code/branches/core6/src/libraries/core/object/ObjectListIterator.h
Log:
using Listable instead of OrxonoxClass as base class in object lists

Modified: code/branches/core6/src/libraries/core/object/Iterator.h
===================================================================
--- code/branches/core6/src/libraries/core/object/Iterator.h	2013-03-24 21:30:39 UTC (rev 9572)
+++ code/branches/core6/src/libraries/core/object/Iterator.h	2013-03-24 21:43:27 UTC (rev 9573)
@@ -68,7 +68,7 @@
 
         @see See @ref IteratorExample "Iterator.h" for more information an example.
     */
-    template <class T = OrxonoxClass>
+    template <class T>
     class Iterator
     {
         public:
@@ -294,7 +294,7 @@
                 @brief Increments the Iterator if it points at the given object.
                 @param object The object to compare with
             */
-            inline void incrementIfEqual(OrxonoxClass* object)
+            inline void incrementIfEqual(Listable* object)
             {
                 if (this->element_ && this->element_->objectBase_ == object)
                     this->operator++();
@@ -304,8 +304,6 @@
             ObjectListBaseElement* element_;       //!< The element the Iterator points at
             ObjectListBase* list_;                 //!< The list wherein the element is
     };
-
-    typedef Iterator<OrxonoxClass> BaseIterator;
 }
 
 #endif /* _Iterator_H__ */

Modified: code/branches/core6/src/libraries/core/object/ObjectListBase.cc
===================================================================
--- code/branches/core6/src/libraries/core/object/ObjectListBase.cc	2013-03-24 21:30:39 UTC (rev 9572)
+++ code/branches/core6/src/libraries/core/object/ObjectListBase.cc	2013-03-24 21:43:27 UTC (rev 9573)
@@ -67,12 +67,12 @@
         @brief Increases all Iterators that currently point on the given element (because it gets removed).
         @param object The object that gets removed
     */
-    void ObjectListBase::notifyIterators(OrxonoxClass* object) const
+    void ObjectListBase::notifyIterators(Listable* object) const
     {
         for (std::vector<void*>::const_iterator it = this->iterators_.begin(); it != this->iterators_.end(); ++it)
-            ((Iterator<OrxonoxClass>*)(*it))->incrementIfEqual(object);
+            ((Iterator<Listable>*)(*it))->incrementIfEqual(object);
         for (std::vector<void*>::const_iterator it = this->objectListIterators_.begin(); it != this->objectListIterators_.end(); ++it)
-            ((ObjectListIterator<OrxonoxClass>*)(*it))->incrementIfEqual(object);
+            ((ObjectListIterator<Listable>*)(*it))->incrementIfEqual(object);
     }
 
     /**

Modified: code/branches/core6/src/libraries/core/object/ObjectListBase.h
===================================================================
--- code/branches/core6/src/libraries/core/object/ObjectListBase.h	2013-03-24 21:30:39 UTC (rev 9572)
+++ code/branches/core6/src/libraries/core/object/ObjectListBase.h	2013-03-24 21:43:27 UTC (rev 9573)
@@ -55,11 +55,11 @@
                 @brief Constructor: Creates the list-element with an object.
                 @param objectBase The object to store
             */
-            ObjectListBaseElement(OrxonoxClass* objectBase) : next_(0), prev_(0), objectBase_(objectBase) {}
+            ObjectListBaseElement(Listable* objectBase) : next_(0), prev_(0), objectBase_(objectBase) {}
 
             ObjectListBaseElement* next_;       //!< The next element in the list
             ObjectListBaseElement* prev_;       //!< The previous element in the list
-            OrxonoxClass* objectBase_;
+            Listable* objectBase_;
     };
 
 
@@ -71,7 +71,7 @@
     class ObjectListElement : public ObjectListBaseElement
     {
         public:
-            ObjectListElement(T* object) : ObjectListBaseElement(static_cast<OrxonoxClass*>(object)), object_(object) {}
+            ObjectListElement(T* object) : ObjectListBaseElement(static_cast<Listable*>(object)), object_(object) {}
             T* object_;              //!< The object
     };
 
@@ -141,7 +141,7 @@
                     }
                 }
             }
-            void notifyIterators(OrxonoxClass* object) const;
+            void notifyIterators(Listable* object) const;
 
             inline Identifier* getIdentifier() const { return this->identifier_; }
 

Modified: code/branches/core6/src/libraries/core/object/ObjectListIterator.h
===================================================================
--- code/branches/core6/src/libraries/core/object/ObjectListIterator.h	2013-03-24 21:30:39 UTC (rev 9572)
+++ code/branches/core6/src/libraries/core/object/ObjectListIterator.h	2013-03-24 21:43:27 UTC (rev 9573)
@@ -222,7 +222,7 @@
                 @brief Increments the ObjectListIterator if it points at the given object.
                 @param object The object to compare with
             */
-            inline void incrementIfEqual(OrxonoxClass* object)
+            inline void incrementIfEqual(Listable* object)
             {
                 if (this->element_ && this->element_->objectBase_ == object)
                     this->operator++();




More information about the Orxonox-commit mailing list