- Timestamp:
- Jul 29, 2009, 10:27:10 PM (15 years ago)
- Location:
- code/branches/resource/src/orxonox/overlays/notifications
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/resource/src/orxonox/overlays/notifications/NotificationManager.cc
r3196 r3366 46 46 const std::string NotificationManager::NONE = "none"; 47 47 48 NotificationManager* NotificationManager::singleton Ref_s = NULL;48 NotificationManager* NotificationManager::singletonPtr_s = NULL; 49 49 50 50 /** … … 55 55 { 56 56 RegisterRootObject(NotificationManager); 57 58 assert(singletonRef_s == 0);59 singletonRef_s = this;60 57 61 58 this->highestIndex_ = 0; … … 70 67 } 71 68 72 /**73 @brief74 Returns the current (and single) instance of the NotificationManager. Creates one, if there isn't one to begin with.75 @return76 Returns a reference to the single instance of the NotificationManager.77 */78 /*static*/ NotificationManager & NotificationManager::getInstance()79 {80 assert(singletonRef_s);81 return *singletonRef_s;82 }83 84 69 /** 85 70 @brief -
code/branches/resource/src/orxonox/overlays/notifications/NotificationManager.h
r3196 r3366 40 40 #include <map> 41 41 #include <string> 42 43 #include "util/Singleton.h" 42 44 #include "core/OrxonoxClass.h" 43 45 … … 52 54 Damian 'Mozork' Frick 53 55 */ 54 class _OrxonoxExport NotificationManager : public OrxonoxClass56 class _OrxonoxExport NotificationManager : public Singleton<NotificationManager>, public OrxonoxClass 55 57 { 58 friend class Singleton<NotificationManager>; 56 59 public: 57 60 NotificationManager(); … … 60 63 static const std::string ALL; 61 64 static const std::string NONE; 62 63 static NotificationManager & getInstance(); //! Returns a reference to the single instance of the NotificationManager.64 65 65 66 bool registerNotification(Notification* notification); //!< Registers a Notification within the NotificationManager. … … 88 89 89 90 private: 90 static NotificationManager* singleton Ref_s;91 static NotificationManager* singletonPtr_s; 91 92 92 93 int highestIndex_; //!< This variable holds the highest index (resp. key) in notificationLists_s, to secure that no key appears twice.
Note: See TracChangeset
for help on using the changeset viewer.