Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 22, 2015, 5:30:57 PM (9 years ago)
Author:
landauf
Message:

replace all remaining usages of SharedPtr with std::shared_ptr

Location:
code/branches/cpp11_v2
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/libraries/core/input/KeyBinderManager.cc

    r10768 r10829  
    205205    void KeyBinderManager::registerKeybindCallback(LuaFunctor* function)
    206206    {
    207         this->callbackFunction_ = function;
     207        this->callbackFunction_.reset(function);
    208208    }
    209209}
  • code/branches/cpp11_v2/src/libraries/core/input/KeyBinderManager.h

    r10825 r10829  
    3434#include <map>
    3535#include <string>
     36#include <memory>
    3637
    3738#include "util/Singleton.h"
    38 #include "util/SharedPtr.h"
    3939#include "core/config/Configurable.h"
    4040
     
    108108
    109109        // KeyBinder management
    110         KeyBinder* currentBinder_;                   //! Currently selected KeyBinder (never nullptr!)
    111         std::map<std::string, KeyBinder*> binders_;  //! All loaded KeyBinders
    112         bool bDefaultFileLoaded_;                    //! Tells whether the default one is loaded
    113         std::string defaultFilename_;                //! Name of the file with the default key bindings
     110        KeyBinder* currentBinder_;                      //! Currently selected KeyBinder (never nullptr!)
     111        std::map<std::string, KeyBinder*> binders_;     //! All loaded KeyBinders
     112        bool bDefaultFileLoaded_;                       //! Tells whether the default one is loaded
     113        std::string defaultFilename_;                   //! Name of the file with the default key bindings
    114114
    115115        // keybind command related
    116         SharedPtr<LuaFunctor> callbackFunction_;     //! Function to be called when key was pressed after "keybind" command
    117         bool bBinding_;                              //! Tells whether a key binding process is active
    118         bool bTemporary_;                            //! Stores tkeybind/keybind value
    119         std::string command_;                        //! Stores the command received by (t)keybind
     116        std::shared_ptr<LuaFunctor> callbackFunction_;  //! Function to be called when key was pressed after "keybind" command
     117        bool bBinding_;                                 //! Tells whether a key binding process is active
     118        bool bTemporary_;                               //! Stores tkeybind/keybind value
     119        std::string command_;                           //! Stores the command received by (t)keybind
    120120
    121121        static KeyBinderManager* singletonPtr_s;
  • code/branches/cpp11_v2/src/libraries/util/output/OutputManager.cc

    r10821 r10829  
    4141#include "util/Output.h"
    4242#include "util/StringUtils.h"
    43 #include "util/SharedPtr.h"
    4443
    4544namespace orxonox
     
    8180    }
    8281
    83     /*static*/ SharedPtr<OutputManager>& OutputManager::Testing::getInstancePointer()
    84     {
    85         static SharedPtr<OutputManager> instance(new OutputManager());
     82    /*static*/ std::shared_ptr<OutputManager>& OutputManager::Testing::getInstancePointer()
     83    {
     84        static std::shared_ptr<OutputManager> instance(new OutputManager());
    8685        return instance;
    8786    }
  • code/branches/cpp11_v2/src/libraries/util/output/OutputManager.h

    r10817 r10829  
    4141#include <vector>
    4242#include <map>
     43#include <memory>
    4344
    4445#include "OutputDefinitions.h"
     
    137138            struct _UtilExport Testing
    138139            {
    139                 static SharedPtr<OutputManager>& getInstancePointer();
     140                static std::shared_ptr<OutputManager>& getInstancePointer();
    140141            };
    141142    };
  • code/branches/cpp11_v2/test/util/output/ConsoleWriterTest.cc

    r10765 r10829  
    33#include "util/output/ConsoleWriter.h"
    44#include "util/output/OutputManager.h"
    5 #include "util/SharedPtr.h"
    65
    76namespace orxonox
     
    1615                {
    1716                    // reset output manager
    18                     OutputManager::Testing::getInstancePointer() = new OutputManager();
     17                    OutputManager::Testing::getInstancePointer().reset(new OutputManager());
    1918                }
    2019
  • code/branches/cpp11_v2/test/util/output/LogWriterTest.cc

    r10624 r10829  
    44#include "util/Convert.h"
    55#include "util/output/OutputManager.h"
    6 #include "util/SharedPtr.h"
    76
    87namespace orxonox
     
    2423                {
    2524                    // reset output manager
    26                     OutputManager::Testing::getInstancePointer() = new OutputManager();
     25                    OutputManager::Testing::getInstancePointer().reset(new OutputManager());
    2726                }
    2827
  • code/branches/cpp11_v2/test/util/output/MemoryWriterTest.cc

    r10624 r10829  
    44#include "util/output/MemoryWriter.h"
    55#include "util/output/OutputManager.h"
    6 #include "util/SharedPtr.h"
    76
    87namespace orxonox
     
    2322                {
    2423                    // reset output manager
    25                     OutputManager::Testing::getInstancePointer() = new OutputManager();
     24                    OutputManager::Testing::getInstancePointer().reset(new OutputManager());
    2625                }
    2726
  • code/branches/cpp11_v2/test/util/output/OutputListenerTest.cc

    r9545 r10829  
    33#include "util/output/OutputListener.h"
    44#include "util/output/OutputManager.h"
    5 #include "util/SharedPtr.h"
    65
    76namespace orxonox
     
    342341            {
    343342                this->manager_ = new MockOutputManager();
    344                 OutputManager::Testing::getInstancePointer() = this->manager_;
     343                OutputManager::Testing::getInstancePointer().reset(this->manager_);
    345344            }
    346345
    347346            virtual void TearDown()
    348347            {
    349                 OutputManager::Testing::getInstancePointer() = new OutputManager();
     348                OutputManager::Testing::getInstancePointer().reset(new OutputManager());
    350349            }
    351350
  • code/branches/cpp11_v2/test/util/output/OutputStreamTest.cc

    r9547 r10829  
    88#include "util/output/OutputManager.h"
    99#include "util/output/MemoryWriter.h"
    10 #include "util/SharedPtr.h"
    1110
    1211namespace orxonox
     
    8887            {
    8988                this->manager_ = new MockOutputManager();
    90                 OutputManager::Testing::getInstancePointer() = this->manager_;
     89                OutputManager::Testing::getInstancePointer().reset(this->manager_);
    9190            }
    9291
    9392            virtual void TearDown()
    9493            {
    95                 OutputManager::Testing::getInstancePointer() = new OutputManager();
     94                OutputManager::Testing::getInstancePointer().reset(new OutputManager());
    9695            }
    9796
Note: See TracChangeset for help on using the changeset viewer.