Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 10, 2016, 1:54:11 PM (9 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/util/Singleton.h

    r10624 r11054  
    6666    And don't forget to initialize the static singleton pointer in the source (*.cc) %file:
    6767    @code
    68     TestSingleton* TestSingleton::singletonPtr_s = NULL;
     68    TestSingleton* TestSingleton::singletonPtr_s = nullptr;
    6969    @endcode
    7070
     
    118118        static T& getInstance()
    119119        {
    120             OrxVerify(T::singletonPtr_s != NULL, "T=" << typeid(T).name());
     120            OrxVerify(T::singletonPtr_s != nullptr, "T=" << typeid(T).name());
    121121            return *T::singletonPtr_s;
    122122        }
     
    125125        static bool exists()
    126126        {
    127             return (T::singletonPtr_s != NULL);
     127            return (T::singletonPtr_s != nullptr);
    128128        }
    129129
     
    132132        Singleton()
    133133        {
    134             OrxVerify(T::singletonPtr_s == NULL, "T=" << typeid(T).name());
     134            OrxVerify(T::singletonPtr_s == nullptr, "T=" << typeid(T).name());
    135135            T::singletonPtr_s = static_cast<T*>(this);
    136136        }
     
    139139        virtual ~Singleton()
    140140        {
    141             OrxVerify(T::singletonPtr_s != NULL, "T=" << typeid(T).name());
    142             T::singletonPtr_s = NULL;
     141            OrxVerify(T::singletonPtr_s != nullptr, "T=" << typeid(T).name());
     142            T::singletonPtr_s = nullptr;
    143143        }
    144144
    145145    private:
    146         Singleton(const Singleton& rhs); //!< Don't use (undefined)
     146        // non-copyable:
     147        Singleton(const Singleton&) = delete;
     148        Singleton& operator=(const Singleton&) = delete;
    147149    };
    148150}
Note: See TracChangeset for help on using the changeset viewer.