Changeset 5850 for code/branches/core5/src/libraries/util/ScopedSingleton.h
- Timestamp:
- Oct 1, 2009, 11:44:53 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core5/src/libraries/util/ScopedSingleton.h
r5802 r5850 37 37 namespace orxonox 38 38 { 39 class Clock; 39 40 /** 40 41 @brief … … 59 60 assert(Scope<scope>::isActive()); 60 61 61 if (!T::singletonPtr_s && Scope<scope>::isActive())62 if (!T::singletonPtr_s) 62 63 T::singletonPtr_s = new T(); 63 64 64 65 return *T::singletonPtr_s; 65 66 } 67 68 //! Update method for singletons like the ingame console 69 virtual void updated(const Clock& time) { static_cast<T*>(this)->update(time); } 70 //! Empty update method for the static polymorphism 71 void update(const Clock& time) { } 66 72 67 73 protected: … … 85 91 { 86 92 // The ScopedSingleton shouldn't be active bevor the scope is activated -> always assertion failed 87 assert( T::singletonPtr_s == 0 &&false);93 assert(false); 88 94 } 89 95
Note: See TracChangeset
for help on using the changeset viewer.