- Timestamp:
- Jan 10, 2016, 1:54:11 PM (8 years ago)
- Location:
- code/branches/cpp11_v3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v3
- Property svn:mergeinfo changed
-
code/branches/cpp11_v3/src/libraries/core/singleton/ScopedSingletonWrapper.h
r10528 r11054 64 64 : className_(className) 65 65 { } 66 virtual ~ScopedSingletonWrapper() { }66 virtual ~ScopedSingletonWrapper() = default; 67 67 68 68 protected: … … 91 91 ClassScopedSingletonWrapper(const std::string& className) 92 92 : ScopedSingletonWrapper(className) 93 , singletonPtr_( NULL)93 , singletonPtr_(nullptr) 94 94 { 95 95 } … … 102 102 103 103 //! Called if the Scope of the Singleton gets active (creates the instance) 104 v oid activated()104 virtual void activated() override 105 105 { 106 assert(singletonPtr_ == NULL);106 assert(singletonPtr_ == nullptr); 107 107 singletonPtr_ = new T(); 108 108 } 109 109 110 110 //! Called if the Scope of this Singleton gets deactivated (destroys the instance) 111 v oid deactivated()111 virtual void deactivated() override 112 112 { 113 assert(singletonPtr_ != NULL);113 assert(singletonPtr_ != nullptr); 114 114 this->destroy(singletonPtr_); 115 singletonPtr_ = NULL;115 singletonPtr_ = nullptr; 116 116 } 117 117 … … 146 146 ClassScopedSingletonWrapper(const std::string& className) 147 147 : ScopedSingletonWrapper(className) 148 , singletonPtr_( NULL)148 , singletonPtr_(nullptr) 149 149 { 150 150 } … … 157 157 158 158 //! Called if the Scope of the Singleton gets active (creates the instance) 159 v oid activated()159 virtual void activated() override 160 160 { 161 assert(singletonPtr_ == NULL);161 assert(singletonPtr_ == nullptr); 162 162 try 163 163 { singletonPtr_ = new T(); } … … 169 169 170 170 //! Called if the Scope of this Singleton gets deactivated (destroys the instance) 171 v oid deactivated()171 virtual void deactivated() override 172 172 { 173 if (singletonPtr_ != NULL)173 if (singletonPtr_ != nullptr) 174 174 { 175 175 this->destroy(singletonPtr_); 176 singletonPtr_ = NULL;176 singletonPtr_ = nullptr; 177 177 } 178 178 }
Note: See TracChangeset
for help on using the changeset viewer.