Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 7, 2015, 5:24:58 PM (9 years ago)
Author:
landauf
Message:

using std::shared_ptr instead of boost::shared_ptr (same for weak_ptr)

Location:
code/branches/cpp11_v2/src/orxonox/sound
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/orxonox/sound/AmbientSound.cc

    r10765 r10771  
    9292        {
    9393            const std::string& path = "ambient/" + mood + '/' + this->ambientSource_;
    94             shared_ptr<ResourceInfo> fileInfo = Resource::getInfo(path);
     94            std::shared_ptr<ResourceInfo> fileInfo = Resource::getInfo(path);
    9595            if (fileInfo != nullptr)
    9696            {
  • code/branches/cpp11_v2/src/orxonox/sound/BaseSound.h

    r9667 r10771  
    3333
    3434#include <string>
    35 #include <boost/shared_ptr.hpp>
     35#include <memory>
    3636#include <OgreDataStream.h>
    3737#include "core/object/Listable.h"
     
    107107        ALuint          audioSource_;
    108108        bool            bPooling_;
    109         shared_ptr<SoundBuffer> soundBuffer_;
     109        std::shared_ptr<SoundBuffer> soundBuffer_;
    110110        std::string     source_;
    111111        float           volume_;
  • code/branches/cpp11_v2/src/orxonox/sound/SoundBuffer.cc

    r10769 r10771  
    3939namespace orxonox
    4040{
    41     SoundBuffer::SoundBuffer(const std::string& filename, std::list<shared_ptr<SoundBuffer>>::iterator poolIterator)
     41    SoundBuffer::SoundBuffer(const std::string& filename, std::list<std::shared_ptr<SoundBuffer>>::iterator poolIterator)
    4242        : filename_(filename)
    4343        , audioBuffer_(AL_NONE)
     
    4848
    4949        // Get resource info
    50         shared_ptr<ResourceInfo> fileInfo = Resource::getInfo(filename);
     50        std::shared_ptr<ResourceInfo> fileInfo = Resource::getInfo(filename);
    5151        if (fileInfo == nullptr)
    5252        {
     
    8383    }
    8484
    85     void SoundBuffer::loadStandard(const shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream)
     85    void SoundBuffer::loadStandard(const std::shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream)
    8686    {
    8787        // Read everything into a temporary buffer
     
    127127    }
    128128
    129     void SoundBuffer::loadOgg(const shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream)
     129    void SoundBuffer::loadOgg(const std::shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream)
    130130    {
    131131        char inbuffer[256*1024];
  • code/branches/cpp11_v2/src/orxonox/sound/SoundBuffer.h

    r10769 r10771  
    3333
    3434#include <list>
    35 #include <boost/shared_ptr.hpp>
     35#include <memory>
    3636#include "core/Resource.h"
    3737
     
    4545    {
    4646        friend class SoundManager;
    47 #if !defined(_MSC_VER) || _MSC_VER >= 1500
    48         // Make sure nobody deletes an instance (using strong pointers)
    49         template <class T>
    50         friend void boost::checked_delete(T*);
    51 #endif
    5247
    5348    public:
    54 #if defined(_MSC_VER) && _MSC_VER < 1500
    5549        ~SoundBuffer();
    56 #endif
    5750        inline ALuint getBuffer()
    5851            { return this->audioBuffer_; }
     
    6457
    6558    private:
    66         SoundBuffer(const std::string& filename, std::list<shared_ptr<SoundBuffer>>::iterator poolIterator);
    67 #if !defined(_MSC_VER) || _MSC_VER >= 1500
    68         ~SoundBuffer();
    69 #endif
    70         void loadStandard(const shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream);
    71         void loadOgg(const shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream);
     59        SoundBuffer(const std::string& filename, std::list<std::shared_ptr<SoundBuffer>>::iterator poolIterator);
     60        void loadStandard(const std::shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream);
     61        void loadOgg(const std::shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream);
    7262
    7363        std::string filename_;
    7464        ALuint audioBuffer_;
    75         std::list<shared_ptr<SoundBuffer>>::iterator poolIterator_;
     65        std::list<std::shared_ptr<SoundBuffer>>::iterator poolIterator_;
    7666    };
    7767}
  • code/branches/cpp11_v2/src/orxonox/sound/SoundManager.cc

    r10769 r10771  
    505505    }
    506506
    507     shared_ptr<SoundBuffer> SoundManager::getSoundBuffer(const std::string& filename)
    508     {
    509         shared_ptr<SoundBuffer> buffer;
     507    std::shared_ptr<SoundBuffer> SoundManager::getSoundBuffer(const std::string& filename)
     508    {
     509        std::shared_ptr<SoundBuffer> buffer;
    510510        // Check active or pooled buffers
    511511        SoundBufferMap::const_iterator it = this->soundBuffers_.find(filename);
     
    538538    }
    539539
    540     void SoundManager::releaseSoundBuffer(const shared_ptr<SoundBuffer>& buffer, bool bPoolBuffer)
     540    void SoundManager::releaseSoundBuffer(const std::shared_ptr<SoundBuffer>& buffer, bool bPoolBuffer)
    541541    {
    542542        // Check if others are still using the buffer
     
    551551                while (this->effectsPoolSize_ + it->second->getSize() > this->maxEffectsPoolSize_s && !this->effectsPool_.empty())
    552552                {
    553                     shared_ptr<SoundBuffer> bufferDel = this->effectsPool_.back();
     553                    std::shared_ptr<SoundBuffer> bufferDel = this->effectsPool_.back();
    554554                    this->effectsPoolSize_ -= bufferDel->getSize();
    555555                    bufferDel->poolIterator_ = this->effectsPool_.end();
  • code/branches/cpp11_v2/src/orxonox/sound/SoundManager.h

    r10769 r10771  
    3636#include <map>
    3737#include <string>
    38 #include <boost/shared_ptr.hpp>
     38#include <memory>
    3939
    4040#include "util/Singleton.h"
     
    9696        // tolua_end
    9797
    98         shared_ptr<SoundBuffer> getSoundBuffer(const std::string& filename);
    99         void releaseSoundBuffer(const shared_ptr<SoundBuffer>& buffer, bool bPoolBuffer);
     98        std::shared_ptr<SoundBuffer> getSoundBuffer(const std::string& filename);
     99        void releaseSoundBuffer(const std::shared_ptr<SoundBuffer>& buffer, bool bPoolBuffer);
    100100
    101101        ALuint getSoundSource(BaseSound* object);
     
    139139        static const unsigned int maxEffectsPoolSize_s = 40 * 1024 * 1024;
    140140        unsigned int effectsPoolSize_;
    141         typedef std::list<shared_ptr<SoundBuffer>> EffectsPoolList;
     141        typedef std::list<std::shared_ptr<SoundBuffer>> EffectsPoolList;
    142142        EffectsPoolList effectsPool_;
    143         typedef std::map<std::string, shared_ptr<SoundBuffer>> SoundBufferMap;
     143        typedef std::map<std::string, std::shared_ptr<SoundBuffer>> SoundBufferMap;
    144144        SoundBufferMap soundBuffers_;
    145145
Note: See TracChangeset for help on using the changeset viewer.