Changeset 6657 for code/branches/gamestate/src/libraries/util
- Timestamp:
- Mar 30, 2010, 12:13:33 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gamestate/src/libraries/util/Singleton.h
r6431 r6657 49 49 public: 50 50 //! Returns a reference to the singleton instance 51 static T& getInstance()51 FORCEINLINE static T& getInstance() 52 52 { 53 53 assert(T::singletonPtr_s != NULL); … … 56 56 57 57 //! Tells whether the singleton has been created 58 static bool exists()58 FORCEINLINE static bool exists() 59 59 { 60 60 return (T::singletonPtr_s != NULL); … … 62 62 63 63 //! Update method called by ClassSingletonManager (if used) 64 void preUpdateSingleton(const Clock& time) { static_cast<T*>(T::singletonPtr_s)->preUpdate(time); }64 FORCEINLINE void preUpdateSingleton(const Clock& time) { static_cast<T*>(T::singletonPtr_s)->preUpdate(time); } 65 65 //! Empty update method for the static polymorphism 66 void preUpdate(const Clock& time) { }66 FORCEINLINE void preUpdate(const Clock& time) { } 67 67 //! Update method called by ClassSingletonManager (if used) 68 void postUpdateSingleton(const Clock& time) { static_cast<T*>(T::singletonPtr_s)->postUpdate(time); }68 FORCEINLINE void postUpdateSingleton(const Clock& time) { static_cast<T*>(T::singletonPtr_s)->postUpdate(time); } 69 69 //! Empty update method for the static polymorphism 70 void postUpdate(const Clock& time) { }70 FORCEINLINE void postUpdate(const Clock& time) { } 71 71 72 72 protected:
Note: See TracChangeset
for help on using the changeset viewer.