Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 10, 2008, 12:27:30 AM (16 years ago)
Author:
landauf
Message:

std::set instead of std::list for Identifier-lists (parents, children, …) for faster accessing by key ( std::set::find(xyz) )

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core2/src/orxonox/core/OrxonoxClass.h

    r871 r876  
    3737#define _OrxonoxClass_H__
    3838
    39 #include <list>
     39#include <set>
    4040#include <string>
    4141
     
    6767
    6868            /** @brief Returns the list of all parents of the object. @return The list */
    69             inline std::list<const Identifier*>* getParents() const { return this->parents_; }
     69            inline std::set<const Identifier*>* getParents() const { return this->parents_; }
    7070
    7171            /** @brief Creates the parents-list. */
    72             inline void createParents() { this->parents_ = new std::list<const Identifier*>(); }
     72            inline void createParents() { this->parents_ = new std::set<const Identifier*>(); }
    7373
    7474            /** @brief Returns the MetaObjectList of the object, containing a link to all ObjectLists and ObjectListElements the object is registered in. @return The list */
     
    157157        private:
    158158            Identifier* identifier_;                    //!< The Identifier of the object
    159             std::list<const Identifier*>* parents_;     //!< List of all parents of the object
     159            std::set<const Identifier*>* parents_;     //!< List of all parents of the object
    160160            MetaObjectList metaList_;                   //!< MetaObjectList, containing all ObjectLists and ObjectListElements the object is registered in
    161161    };
Note: See TracChangeset for help on using the changeset viewer.