Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 4, 2015, 9:12:21 PM (9 years ago)
Author:
landauf
Message:

merged branch core7 back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/libraries/core/object/IteratorBase.h

    r9667 r10624  
    3737
    3838#include "core/CorePrereqs.h"
     39
     40#include <boost/static_assert.hpp>
     41#include <boost/type_traits/is_base_of.hpp>
    3942
    4043#include "ObjectListBase.h"
     
    4952    class IteratorBase : public ObjectListElementRemovalListener
    5053    {
     54        BOOST_STATIC_ASSERT((boost::is_base_of<Listable, T>::value));
     55
     56        protected:
     57            /**
     58                @brief Constructor: Sets the element, whereon the iterator points, to the given element.
     59                This constructor is protected and only for internal usage (don't mess with the BaseElements directly).
     60            */
     61            inline IteratorBase(ObjectListBaseElement* element = NULL)
     62            {
     63                this->element_ = element;
     64                this->registerIterator();
     65            }
     66
     67
    5168        public:
    5269            /**
    53                 @brief Constructor: Sets the element, whereon the iterator points, to zero.
    54             */
    55             inline IteratorBase(ObjectListBaseElement* element)
    56             {
     70                @brief Constructor: Sets the element, whereon the iterator points, to the given element.
     71            */
     72            inline IteratorBase(ObjectListElement<T>* element)
     73            {
     74                this->element_ = element;
     75                this->registerIterator();
     76            }
     77
     78            /**
     79                @brief Constructor: Sets the element, whereon the iterator points, to the given element of another type.
     80                The element's type O must be a derivative of the Iterator's type T.
     81            */
     82            template <class O>
     83            inline IteratorBase(ObjectListElement<O>* element)
     84            {
     85                (void)static_cast<T*>((O*)NULL); // Check type: The element's type O must be a derivative of the Iterator's type T.
    5786                this->element_ = element;
    5887                this->registerIterator();
Note: See TracChangeset for help on using the changeset viewer.