Changeset 6431
- Timestamp:
- Dec 29, 2009, 7:16:36 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gamestate/src/libraries/util/Singleton.h
r6417 r6431 51 51 static T& getInstance() 52 52 { 53 assert(T::singletonPtr_s != 0);53 assert(T::singletonPtr_s != NULL); 54 54 return *T::singletonPtr_s; 55 } 56 57 //! Tells whether the singleton has been created 58 static bool exists() 59 { 60 return (T::singletonPtr_s != NULL); 55 61 } 56 62 … … 68 74 Singleton() 69 75 { 70 assert(T::singletonPtr_s == 0);76 assert(T::singletonPtr_s == NULL); 71 77 T::singletonPtr_s = static_cast<T*>(this); 72 78 } … … 75 81 ~Singleton() 76 82 { 77 assert(T::singletonPtr_s != 0);78 T::singletonPtr_s = 0;83 assert(T::singletonPtr_s != NULL); 84 T::singletonPtr_s = NULL; 79 85 } 80 86
Note: See TracChangeset
for help on using the changeset viewer.