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
Files:
12 edited

Legend:

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

    r10415 r10555  
    6262        RegisterObject(Scene);
    6363
    64         this->setScene(SmartPtr<Scene>(this, false), OBJECTID_UNKNOWN);
     64        this->setScene(StrongPtr<Scene>(this, false), OBJECTID_UNKNOWN);
    6565        this->bShadows_ = true;
    6666        this->bDebugDrawPhysics_ = false;
     
    366366    {
    367367        // get the WorldEntity pointers
    368         SmartPtr<WorldEntity> object0 = static_cast<WorldEntity*>(colObj0->getUserPointer());
    369         SmartPtr<WorldEntity> object1 = static_cast<WorldEntity*>(colObj1->getUserPointer());
     368        StrongPtr<WorldEntity> object0 = static_cast<WorldEntity*>(colObj0->getUserPointer());
     369        StrongPtr<WorldEntity> object1 = static_cast<WorldEntity*>(colObj1->getUserPointer());
    370370
    371371        // get the CollisionShape pointers
  • code/branches/core7/src/orxonox/gametypes/Gametype.cc

    r10554 r10555  
    6161        RegisterObject(Gametype);
    6262
    63         this->setGametype(SmartPtr<Gametype>(this, false));
     63        this->setGametype(StrongPtr<Gametype>(this, false));
    6464
    6565        this->gtinfo_ = new GametypeInfo(context);
  • code/branches/core7/src/orxonox/interfaces/RadarViewable.h

    r9939 r10555  
    3737#include "util/Math.h"
    3838#include "core/class/OrxonoxInterface.h"
    39 #include "core/object/SmartPtr.h"
     39#include "core/object/StrongPtr.h"
    4040
    4141namespace orxonox
     
    163163        //Radar
    164164        const WorldEntity* wePtr_;
    165         SmartPtr<Radar> radar_;
     165        StrongPtr<Radar> radar_;
    166166        float radarObjectCamouflage_;
    167167        Shape radarObjectShape_;
  • 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.
  • code/branches/core7/src/orxonox/sound/AmbientSound.cc

    r10380 r10555  
    5151        if (GameMode::playsSound())
    5252        {
    53             // Smoothly fade out by keeping a SmartPtr
     53            // Smoothly fade out by keeping a StrongPtr
    5454            SoundManager::getInstance().unregisterAmbientSound(this);
    5555        }
  • code/branches/core7/src/orxonox/sound/SoundBuffer.h

    r6764 r10555  
    4646        friend class SoundManager;
    4747#if !defined(_MSC_VER) || _MSC_VER >= 1500
    48         // Make sure nobody deletes an instance (using smart pointers)
     48        // Make sure nobody deletes an instance (using strong pointers)
    4949        template <class T>
    5050        friend void boost::checked_delete(T*);
  • code/branches/core7/src/orxonox/sound/SoundManager.cc

    r10464 r10555  
    165165    SoundManager::~SoundManager()
    166166    {
    167         // Erase fade lists because of the smart pointers
     167        // Erase fade lists because of the strong pointers
    168168        this->bDestructorCalled_ = true;
    169169        this->fadeInList_.clear();
     
    419419    }
    420420
    421     void SoundManager::fadeIn(const SmartPtr<AmbientSound>& sound)
     421    void SoundManager::fadeIn(const StrongPtr<AmbientSound>& sound)
    422422    {
    423423        // If we're already fading out --> remove that
    424         for (std::list<SmartPtr<AmbientSound> >::iterator it = this->fadeOutList_.begin(); it != this->fadeOutList_.end(); it++)
     424        for (std::list<StrongPtr<AmbientSound> >::iterator it = this->fadeOutList_.begin(); it != this->fadeOutList_.end(); it++)
    425425        {
    426426            if (*it == sound)
     
    435435    }
    436436
    437     void SoundManager::fadeOut(const SmartPtr<AmbientSound>& sound)
     437    void SoundManager::fadeOut(const StrongPtr<AmbientSound>& sound)
    438438    {
    439439        // If we're already fading in --> remove that
    440         for (std::list<SmartPtr<AmbientSound> >::iterator it = this->fadeInList_.begin(); it != this->fadeInList_.end(); it++)
     440        for (std::list<StrongPtr<AmbientSound> >::iterator it = this->fadeInList_.begin(); it != this->fadeInList_.end(); it++)
    441441        {
    442442            if (*it == sound)
     
    461461
    462462        // FADE IN
    463         for (std::list<SmartPtr<AmbientSound> >::iterator it= this->fadeInList_.begin(); it != this->fadeInList_.end(); )
     463        for (std::list<StrongPtr<AmbientSound> >::iterator it= this->fadeInList_.begin(); it != this->fadeInList_.end(); )
    464464        {
    465465            if ((*it)->getVolume() + this->crossFadeStep_*dt > 1.0f)
     
    476476
    477477        // FADE OUT
    478         for (std::list<SmartPtr<AmbientSound> >::iterator it = this->fadeOutList_.begin(); it != this->fadeOutList_.end(); )
     478        for (std::list<StrongPtr<AmbientSound> >::iterator it = this->fadeOutList_.begin(); it != this->fadeOutList_.end(); )
    479479        {
    480480            if ((*it)->getVolume() - this->crossFadeStep_*dt < 0.0f)
  • code/branches/core7/src/orxonox/sound/SoundManager.h

    r10413 r10555  
    4040#include "util/Singleton.h"
    4141#include "core/config/Configurable.h"
    42 #include "core/object/SmartPtr.h"
     42#include "core/object/StrongPtr.h"
    4343#include "core/UpdateListener.h"
    4444
     
    106106    private:
    107107        void processCrossFading(float dt);
    108         void fadeIn(const SmartPtr<AmbientSound>& sound);
    109         void fadeOut(const SmartPtr<AmbientSound>& sound);
     108        void fadeIn(const StrongPtr<AmbientSound>& sound);
     109        void fadeOut(const StrongPtr<AmbientSound>& sound);
    110110
    111111        void checkFadeStepValidity();
     
    129129        //! Absolute change per second (0.1 means 10% of the nominal volume) for cross fading
    130130        float                              crossFadeStep_;
    131         std::list<SmartPtr<AmbientSound> > fadeInList_;
    132         std::list<SmartPtr<AmbientSound> > fadeOutList_;
     131        std::list<StrongPtr<AmbientSound> > fadeInList_;
     132        std::list<StrongPtr<AmbientSound> > fadeOutList_;
    133133
    134134        // Volume related
  • code/branches/core7/src/orxonox/worldentities/ControllableEntity.cc

    r10478 r10555  
    108108                this->camera_->destroy();
    109109
    110             for (std::list<SmartPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
     110            for (std::list<StrongPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
    111111                (*it)->destroy();
    112112
     
    165165    {
    166166        unsigned int i = 0;
    167         for (std::list<SmartPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
     167        for (std::list<StrongPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
    168168        {
    169169            if (i == index)
     
    180180
    181181        unsigned int counter = 0;
    182         for (std::list<SmartPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
     182        for (std::list<StrongPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
    183183        {
    184184            if ((*it) == this->currentCameraPosition_)
     
    219219            else if (this->cameraPositions_.size() > 0)
    220220            {
    221                 for (std::list<SmartPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
     221                for (std::list<StrongPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
    222222                {
    223223                    if ((*it) == this->camera_->getParent())
     
    477477        if (parent)
    478478        {
    479             for (std::list<SmartPtr<CameraPosition> >::iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
     479            for (std::list<StrongPtr<CameraPosition> >::iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
    480480                if ((*it)->getIsAbsolute())
    481481                    parent->attach((*it));
  • code/branches/core7/src/orxonox/worldentities/ControllableEntity.h

    r9667 r10555  
    114114            void addCameraPosition(CameraPosition* position);
    115115            CameraPosition* getCameraPosition(unsigned int index) const;
    116             inline const std::list<SmartPtr<CameraPosition> >& getCameraPositions() const
     116            inline const std::list<StrongPtr<CameraPosition> >& getCameraPositions() const
    117117                { return this->cameraPositions_; }
    118118            unsigned int getCurrentCameraIndex() const;
     
    235235            bool bMouseLook_;
    236236            float mouseLookSpeed_;
    237             std::list<SmartPtr<CameraPosition> > cameraPositions_;
     237            std::list<StrongPtr<CameraPosition> > cameraPositions_;
    238238            CameraPosition* currentCameraPosition_;
    239239            std::string cameraPositionTemplate_;
  • code/branches/core7/src/orxonox/worldentities/WorldEntity.cc

    r10362 r10555  
    130130                WorldEntity* entity = *it;
    131131
    132                 // do this for all children, because even if getDeleteWithParent() returns true a child might still stay active due to smart pointers pointing to it
     132                // do this for all children, because even if getDeleteWithParent() returns true a child might still stay active due to strong pointers pointing to it
    133133                entity->setPosition(entity->getWorldPosition());
    134134                this->detach(entity); // detach also erases the element from the children set
Note: See TracChangeset for help on using the changeset viewer.