Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 17, 2016, 10:29:21 PM (9 years ago)
Author:
landauf
Message:

merged branch cpp11_v3 back to trunk

Location:
code/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/libraries/core/singleton/Scope.h

    r10514 r11071  
    7272        protected:
    7373            ScopeListener() : bActivated_(false) { }
    74             virtual ~ScopeListener() { }
     74            virtual ~ScopeListener() = default;
    7575
    7676            //! Gets called if the scope is activated
  • code/trunk/src/libraries/core/singleton/ScopeManager.cc

    r10542 r11071  
    3838namespace orxonox
    3939{
    40     ScopeManager* ScopeManager::singletonPtr_s = 0;
     40    ScopeManager* ScopeManager::singletonPtr_s = nullptr;
    4141
    4242    void ScopeManager::addScope(ScopeID::Value scope)
     
    7373    void ScopeManager::activateListenersForScope(ScopeID::Value scope)
    7474    {
    75         for (std::set<ScopeListener*>::iterator it = this->listeners_[scope].begin(); it != this->listeners_[scope].end(); ++it)
    76             this->activateListener(*it);
     75        for (ScopeListener* listener : this->listeners_[scope])
     76            this->activateListener(listener);
    7777    }
    7878
    7979    void ScopeManager::deactivateListenersForScope(ScopeID::Value scope)
    8080    {
    81         for (std::set<ScopeListener*>::iterator it = this->listeners_[scope].begin(); it != this->listeners_[scope].end(); ++it)
    82             this->deactivateListener(*it);
     81        for (ScopeListener* listener : this->listeners_[scope])
     82            this->deactivateListener(listener);
    8383    }
    8484
  • code/trunk/src/libraries/core/singleton/ScopeManager.h

    r11012 r11071  
    8383
    8484            std::set<ScopeID::Value> activeScopes_;
    85             std::map<ScopeID::Value, std::set<ScopeListener*> > listeners_; //!< Stores all listeners for a scope
     85            std::map<ScopeID::Value, std::set<ScopeListener*>> listeners_; //!< Stores all listeners for a scope
    8686
    8787            static ScopeManager* singletonPtr_s;
  • code/trunk/src/libraries/core/singleton/ScopedSingletonIncludes.h

    r11052 r11071  
    7171*/
    7272#define ManageScopedSingleton(className, scope, allowedToFail) \
    73     className* className::singletonPtr_s = NULL; \
     73    className* className::singletonPtr_s = nullptr; \
    7474    static ScopedSingletonWrapper& className##ScopedSingletonWrapper \
    7575        = (new orxonox::SI_SSW(new ClassScopedSingletonWrapper<className, allowedToFail>(#className), scope))->getWrapper()
     
    8787            ~StaticallyInitializedScopedSingletonWrapper() { delete wrapper_; }
    8888
    89             virtual void load();
    90             virtual void unload();
     89            virtual void load() override;
     90            virtual void unload() override;
    9191
    9292            inline ScopedSingletonWrapper& getWrapper()
  • code/trunk/src/libraries/core/singleton/ScopedSingletonWrapper.h

    r10528 r11071  
    6464                : className_(className)
    6565            { }
    66             virtual ~ScopedSingletonWrapper() { }
     66            virtual ~ScopedSingletonWrapper() = default;
    6767
    6868        protected:
     
    9191        ClassScopedSingletonWrapper(const std::string& className)
    9292            : ScopedSingletonWrapper(className)
    93             , singletonPtr_(NULL)
     93            , singletonPtr_(nullptr)
    9494        {
    9595        }
     
    102102
    103103        //! Called if the Scope of the Singleton gets active (creates the instance)
    104         void activated()
     104        virtual void activated() override
    105105        {
    106             assert(singletonPtr_ == NULL);
     106            assert(singletonPtr_ == nullptr);
    107107            singletonPtr_ = new T();
    108108        }
    109109
    110110        //! Called if the Scope of this Singleton gets deactivated (destroys the instance)
    111         void deactivated()
     111        virtual void deactivated() override
    112112        {
    113             assert(singletonPtr_ != NULL);
     113            assert(singletonPtr_ != nullptr);
    114114            this->destroy(singletonPtr_);
    115             singletonPtr_ = NULL;
     115            singletonPtr_ = nullptr;
    116116        }
    117117
     
    146146        ClassScopedSingletonWrapper(const std::string& className)
    147147            : ScopedSingletonWrapper(className)
    148             , singletonPtr_(NULL)
     148            , singletonPtr_(nullptr)
    149149        {
    150150        }
     
    157157
    158158        //! Called if the Scope of the Singleton gets active (creates the instance)
    159         void activated()
     159        virtual void activated() override
    160160        {
    161             assert(singletonPtr_ == NULL);
     161            assert(singletonPtr_ == nullptr);
    162162            try
    163163                { singletonPtr_ = new T(); }
     
    169169
    170170        //! Called if the Scope of this Singleton gets deactivated (destroys the instance)
    171         void deactivated()
     171        virtual void deactivated() override
    172172        {
    173             if (singletonPtr_ != NULL)
     173            if (singletonPtr_ != nullptr)
    174174            {
    175175                this->destroy(singletonPtr_);
    176                 singletonPtr_ = NULL;
     176                singletonPtr_ = nullptr;
    177177            }
    178178        }
Note: See TracChangeset for help on using the changeset viewer.