Changeset 10765 for code/branches/cpp11_v2/src/libraries/core/object
- Timestamp:
- Nov 4, 2015, 10:25:42 PM (9 years ago)
- Location:
- code/branches/cpp11_v2/src/libraries/core/object
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/libraries/core/object/Context.cc
r10624 r10765 46 46 static size_t count = 0; 47 47 // the first time this is called, ++count returns 1 and the context is created 48 // the second time this is called, ++count returns 2 and NULLis returned because we're in the constructor of the context itself48 // the second time this is called, ++count returns 2 and nullptr is returned because we're in the constructor of the context itself 49 49 // for each future call the context (now completely created) is returned 50 50 if (++count == 2) 51 return NULL;51 return nullptr; 52 52 else 53 53 { 54 static Context context( NULL);54 static Context context(nullptr); 55 55 return &context; 56 56 } … … 82 82 { 83 83 delete Context::rootContext_s; 84 Context::rootContext_s = NULL;84 Context::rootContext_s = nullptr; 85 85 } 86 86 87 87 /*static*/ Context* Context::getRootContext() 88 88 { 89 OrxVerify(Context::rootContext_s != NULL, "Root Context is undefined");89 OrxVerify(Context::rootContext_s != nullptr, "Root Context is undefined"); 90 90 return Context::rootContext_s; 91 91 } … … 105 105 ObjectListBase* objectList = this->getObjectList(identifier); 106 106 delete objectList; 107 this->objectLists_[identifier->getClassID()] = NULL;107 this->objectLists_[identifier->getClassID()] = nullptr; 108 108 } 109 109 } -
code/branches/cpp11_v2/src/libraries/core/object/Destroyable.cc
r10624 r10765 66 66 void Destroyable::destroy() 67 67 { 68 assert(this); // Just in case someone tries to delete a NULL pointer68 assert(this); // Just in case someone tries to delete a nullptr 69 69 this->requestedDestruction_ = true; 70 70 if (this->referenceCount_ == 0) -
code/branches/cpp11_v2/src/libraries/core/object/IteratorBase.h
r10736 r10765 58 58 @brief Constructor: Sets the element, whereon the iterator points, to the given element. 59 59 */ 60 inline IteratorBase(ObjectListElement<T>* element = NULL)60 inline IteratorBase(ObjectListElement<T>* element = nullptr) 61 61 { 62 62 this->element_ = element; … … 151 151 inline operator bool() const 152 152 { 153 return (this->element_ != NULL);153 return (this->element_ != nullptr); 154 154 } 155 155 … … 208 208 } 209 209 else 210 this->list_ = NULL;210 this->list_ = nullptr; 211 211 } 212 212 -
code/branches/cpp11_v2/src/libraries/core/object/StrongPtr.h
r10745 r10765 248 248 } 249 249 250 /// Returns true if the wrapped pointer is NULL.250 /// Returns true if the wrapped pointer is nullptr. 251 251 inline bool operator!() const 252 252 { … … 269 269 } 270 270 271 /// Resets the strong pointer (equivalent to assigning a NULL pointer).271 /// Resets the strong pointer (equivalent to assigning a nullptr). 272 272 inline void reset() 273 273 { -
code/branches/cpp11_v2/src/libraries/core/object/WeakPtr.h
r10745 r10765 37 37 38 38 A WeakPtr wraps a pointer to an object. If the object gets deleted, the WeakPtr becomes 39 NULL. This can be used to store pointers to objects without knowing when they will be39 nullptr. This can be used to store pointers to objects without knowing when they will be 40 40 destroyed. 41 41 … … 50 50 WeakPtr<MyClass> pointer = object; // create a WeakPtr and assign the object 51 51 52 if (pointer) // checks if pointer is not NULL(which is true)52 if (pointer) // checks if pointer is not nullptr (which is true) 53 53 pointer->someFunction(); // calls MyClass::someFunction() 54 54 55 55 object->destroy(); // calls destroy() which deletes the object 56 56 57 if (pointer) // checks if pointer is not NULL(which is now false)57 if (pointer) // checks if pointer is not nullptr (which is now false) 58 58 pointer->someFunction(); // this will not be executed 59 59 @endcode … … 91 91 { 92 92 /** 93 @brief WeakPtr wraps a pointer to an object, which becomes NULLif the object is deleted.93 @brief WeakPtr wraps a pointer to an object, which becomes nullptr if the object is deleted. 94 94 95 95 @see See @ref WeakPtrExample "this description" for more information and an example. … … 183 183 } 184 184 185 /// Returns true if the wrapped pointer is NULL.185 /// Returns true if the wrapped pointer is nullptr. 186 186 inline bool operator!() const 187 187 { … … 210 210 } 211 211 212 /// Resets the weak pointer (equivalent to assigning a NULL pointer).212 /// Resets the weak pointer (equivalent to assigning a nullptr). 213 213 inline void reset() 214 214 {
Note: See TracChangeset
for help on using the changeset viewer.