Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 4, 2015, 10:25:42 PM (9 years ago)
Author:
landauf
Message:

replace 'NULL' by 'nullptr'

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  
    4646        static size_t count = 0;
    4747        // 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 NULL is returned because we're in the constructor of the context itself
     48        // the second time this is called, ++count returns 2 and nullptr is returned because we're in the constructor of the context itself
    4949        // for each future call the context (now completely created) is returned
    5050        if (++count == 2)
    51             return NULL;
     51            return nullptr;
    5252        else
    5353        {
    54             static Context context(NULL);
     54            static Context context(nullptr);
    5555            return &context;
    5656        }
     
    8282    {
    8383        delete Context::rootContext_s;
    84         Context::rootContext_s = NULL;
     84        Context::rootContext_s = nullptr;
    8585    }
    8686
    8787    /*static*/ Context* Context::getRootContext()
    8888    {
    89         OrxVerify(Context::rootContext_s != NULL, "Root Context is undefined");
     89        OrxVerify(Context::rootContext_s != nullptr, "Root Context is undefined");
    9090        return Context::rootContext_s;
    9191    }
     
    105105        ObjectListBase* objectList = this->getObjectList(identifier);
    106106        delete objectList;
    107         this->objectLists_[identifier->getClassID()] = NULL;
     107        this->objectLists_[identifier->getClassID()] = nullptr;
    108108    }
    109109}
  • code/branches/cpp11_v2/src/libraries/core/object/Destroyable.cc

    r10624 r10765  
    6666    void Destroyable::destroy()
    6767    {
    68         assert(this); // Just in case someone tries to delete a NULL pointer
     68        assert(this); // Just in case someone tries to delete a nullptr
    6969        this->requestedDestruction_ = true;
    7070        if (this->referenceCount_ == 0)
  • code/branches/cpp11_v2/src/libraries/core/object/IteratorBase.h

    r10736 r10765  
    5858                @brief Constructor: Sets the element, whereon the iterator points, to the given element.
    5959            */
    60             inline IteratorBase(ObjectListElement<T>* element = NULL)
     60            inline IteratorBase(ObjectListElement<T>* element = nullptr)
    6161            {
    6262                this->element_ = element;
     
    151151            inline operator bool() const
    152152            {
    153                 return (this->element_ != NULL);
     153                return (this->element_ != nullptr);
    154154            }
    155155
     
    208208                }
    209209                else
    210                     this->list_ = NULL;
     210                    this->list_ = nullptr;
    211211            }
    212212
  • code/branches/cpp11_v2/src/libraries/core/object/StrongPtr.h

    r10745 r10765  
    248248            }
    249249
    250             /// Returns true if the wrapped pointer is NULL.
     250            /// Returns true if the wrapped pointer is nullptr.
    251251            inline bool operator!() const
    252252            {
     
    269269            }
    270270
    271             /// Resets the strong pointer (equivalent to assigning a NULL pointer).
     271            /// Resets the strong pointer (equivalent to assigning a nullptr).
    272272            inline void reset()
    273273            {
  • code/branches/cpp11_v2/src/libraries/core/object/WeakPtr.h

    r10745 r10765  
    3737
    3838    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 be
     39    nullptr. This can be used to store pointers to objects without knowing when they will be
    4040    destroyed.
    4141
     
    5050    WeakPtr<MyClass> pointer = object;                  // create a WeakPtr and assign the object
    5151
    52     if (pointer)                                        // checks if pointer is not NULL (which is true)
     52    if (pointer)                                        // checks if pointer is not nullptr (which is true)
    5353        pointer->someFunction();                        // calls MyClass::someFunction()
    5454
    5555    object->destroy();                                  // calls destroy() which deletes the object
    5656
    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)
    5858        pointer->someFunction();                        // this will not be executed
    5959    @endcode
     
    9191{
    9292    /**
    93         @brief WeakPtr wraps a pointer to an object, which becomes NULL if the object is deleted.
     93        @brief WeakPtr wraps a pointer to an object, which becomes nullptr if the object is deleted.
    9494
    9595        @see See @ref WeakPtrExample "this description" for more information and an example.
     
    183183            }
    184184
    185             /// Returns true if the wrapped pointer is NULL.
     185            /// Returns true if the wrapped pointer is nullptr.
    186186            inline bool operator!() const
    187187            {
     
    210210            }
    211211
    212             /// Resets the weak pointer (equivalent to assigning a NULL pointer).
     212            /// Resets the weak pointer (equivalent to assigning a nullptr).
    213213            inline void reset()
    214214            {
Note: See TracChangeset for help on using the changeset viewer.