Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 29, 2015, 5:35:59 PM (9 years ago)
Author:
landauf
Message:

renamed SmartPtr to StrongPtr (now we have weak and strong pointers)

Location:
code/branches/core7/src/orxonox/overlays
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core7/src/orxonox/overlays/OverlayGroup.cc

    r10347 r10555  
    6161    OverlayGroup::~OverlayGroup()
    6262    {
    63         for (std::set< SmartPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
     63        for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
    6464            (*it)->destroy();
    6565        this->hudElements_.clear();
     
    8585    void OverlayGroup::setScale(const Vector2& scale)
    8686    {
    87         for (std::set< SmartPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
     87        for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
    8888            (*it)->scale(scale / this->scale_);
    8989        this->scale_ = scale;
     
    9393    void OverlayGroup::setScroll(const Vector2& scroll)
    9494    {
    95         for (std::set< SmartPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
     95        for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
    9696            (*it)->scroll(scroll - this->scroll_);
    9797        this->scroll_ = scroll;
     
    106106    void OverlayGroup::addElement(OrxonoxOverlay* element)
    107107    {
    108         hudElements_.insert(SmartPtr<OrxonoxOverlay>(element));
     108        hudElements_.insert(StrongPtr<OrxonoxOverlay>(element));
    109109        element->setOverlayGroup( this );
    110110        if (this->owner_)
     
    122122    bool OverlayGroup::removeElement(OrxonoxOverlay* element)
    123123    {
    124         if(this->hudElements_.erase(SmartPtr<OrxonoxOverlay>(element)) == 0)
     124        if(this->hudElements_.erase(StrongPtr<OrxonoxOverlay>(element)) == 0)
    125125            return false;
    126126        return true;
     
    132132        if (index < this->hudElements_.size())
    133133        {
    134             std::set< SmartPtr<OrxonoxOverlay> >::const_iterator it = hudElements_.begin();
     134            std::set< StrongPtr<OrxonoxOverlay> >::const_iterator it = hudElements_.begin();
    135135            for (unsigned int i = 0; i != index; ++it, ++i)
    136136                ;
     
    146146        SUPER( OverlayGroup, changedVisibility );
    147147
    148         for (std::set< SmartPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
     148        for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
    149149            (*it)->changedVisibility(); //inform all Child Overlays that our visibility has changed
    150150    }
     
    155155        SUPER( OverlayGroup, changedGametype );
    156156
    157         for (std::set< SmartPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
     157        for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
    158158            (*it)->setGametype(this->getGametype());
    159159    }
     
    163163        this->owner_ = owner;
    164164
    165         for (std::set< SmartPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
     165        for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
    166166            (*it)->setOwner(owner);
    167167    }
  • code/branches/core7/src/orxonox/overlays/OverlayGroup.h

    r9667 r10555  
    6565        static void scrollGroup(const std::string& name, const Vector2& scroll);
    6666
    67         inline const std::set< SmartPtr<OrxonoxOverlay> >& getOverlays() const
     67        inline const std::set< StrongPtr<OrxonoxOverlay> >& getOverlays() const
    6868            { return this->hudElements_; }
    6969
     
    9292
    9393    private:
    94         std::set< SmartPtr<OrxonoxOverlay> > hudElements_;    //!< Contains all the OrxonoxOverlays of the this group.
     94        std::set< StrongPtr<OrxonoxOverlay> > hudElements_;    //!< Contains all the OrxonoxOverlays of the this group.
    9595        Vector2 scale_;                            //!< Current scale (independent of the elements).
    9696        Vector2 scroll_;                           //!< Current scrolling offset.
Note: See TracChangeset for help on using the changeset viewer.