Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 10, 2016, 1:54:11 PM (8 years ago)
Author:
landauf
Message:

merged branch cpp11_v2 into cpp11_v3

Location:
code/branches/cpp11_v3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v3

  • code/branches/cpp11_v3/src/libraries/core/singleton/ScopedSingletonWrapper.h

    r10528 r11054  
    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.