Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 9, 2008, 4:44:36 PM (17 years ago)
Author:
landauf
Message:

merged core branch to trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/core/ObjectList.h

    r790 r871  
    2626 */
    2727
    28 /*!
     28/**
    2929    @file ObjectList.h
    3030    @brief Definition and implementation of the ObjectList class.
     
    4040#include "CorePrereqs.h"
    4141#include "Iterator.h"
     42#include "ClassManager.h"
    4243
    4344namespace orxonox
     
    8384    {
    8485        public:
    85             static ObjectList<T>* getList();
     86            ObjectList();
     87            ~ObjectList();
    8688
    8789            ObjectListElement<T>* add(T* object);
    8890//            void remove(OrxonoxClass* object, bool bIterateForwards = true);
    8991
    90             /** @returns the first element in the list */
     92            /** @brief Returns the first element in the list. @return The first element */
    9193            inline static Iterator<T> start()
    92                 { return Iterator<T>(getList()->first_); }
    93 
    94             /** @returns the first element in the list */
     94                { return Iterator<T>(ClassManager<T>::getIdentifier()->getObjects()->first_); }
     95
     96            /** @brief Returns the first element in the list. @return The first element */
    9597            inline static Iterator<T> begin()
    96                 { return Iterator<T>(getList()->first_); }
    97 
    98             /** @returns the last element in the list */
     98                { return Iterator<T>(ClassManager<T>::getIdentifier()->getObjects()->first_); }
     99
     100            /** @brief Returns the last element in the list. @return The last element */
    99101            inline static Iterator<T> end()
    100                 { return Iterator<T>(getList()->last_); }
     102                { return Iterator<T>(ClassManager<T>::getIdentifier()->getObjects()->last_); }
    101103
    102104            ObjectListElement<T>* first_;       //!< The first element in the list
    103105            ObjectListElement<T>* last_;        //!< The last element in the list
    104 
    105         private:
    106             ObjectList();
    107             ~ObjectList();
    108106    };
    109107
     
    131129            this->first_ = temp;
    132130        }
    133     }
    134 
    135     /**
    136         @returns a pointer to the only existing instance for the given class T.
    137     */
    138     template <class T>
    139     ObjectList<T>* ObjectList<T>::getList()
    140     {
    141         static ObjectList<T> theOnlyObjectListObjectForClassT = ObjectList<T>();
    142         return &theOnlyObjectListObjectForClassT;
    143131    }
    144132
Note: See TracChangeset for help on using the changeset viewer.