Changeset 2785 for code/branches/questsystem5/src/orxonox/overlays/notifications/NotificationManager.h
- Timestamp:
- Mar 15, 2009, 11:41:25 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem5/src/orxonox/overlays/notifications/NotificationManager.h
r2779 r2785 50 50 /** 51 51 @brief 52 The NotificationManager functions as a gateway between Notifications and NotificationQueues.52 The Singleton NotificationManager functions as a gateway between Notifications and NotificationQueues. 53 53 It receives, organizes Notifications and the redistributes them to the specific NotificationQueues. 54 54 @author … … 57 57 class _OrxonoxExport NotificationManager : public BaseObject 58 58 { 59 protected: 60 NotificationManager(); 61 59 62 public: 60 NotificationManager(BaseObject* creator);61 63 virtual ~NotificationManager(); 62 64 … … 64 66 static const std::string NONE; 65 67 68 static NotificationManager & getInstance(); //! Returns a reference to the single instance of the NotificationManager. 69 66 70 //TDO: Visibility? 67 staticbool registerNotification(Notification* notification); //!< Registers a Notification within the NotificationManager.68 staticbool registerQueue(NotificationQueue* queue); //!< Registers a NotificationQueue within the NotificationManager.71 bool registerNotification(Notification* notification); //!< Registers a Notification within the NotificationManager. 72 bool registerQueue(NotificationQueue* queue); //!< Registers a NotificationQueue within the NotificationManager. 69 73 70 st atic std::multimap<std::time_t,Notification*>* getNotifications(NotificationQueue* queue, const std::time_t & timeFrameStart, const std::time_t & timeFrameEnd); //!< Returns the Notifications for a specific NotificationQueue in a specified timeframe.74 std::multimap<std::time_t,Notification*>* getNotifications(NotificationQueue* queue, const std::time_t & timeFrameStart, const std::time_t & timeFrameEnd); //!< Returns the Notifications for a specific NotificationQueue in a specified timeframe. 71 75 72 76 /** … … 76 80 @return Returns a time-ordered list of Notifications. 77 81 */ 78 st atic std::multimap<std::time_t,Notification*>* getNotifications(NotificationQueue* queue, const std::time_t & timeFrameStart)79 { return NotificationManager::getNotifications(queue, timeFrameStart, std::time(0)); }82 std::multimap<std::time_t,Notification*>* getNotifications(NotificationQueue* queue, const std::time_t & timeFrameStart) 83 { return this->getNotifications(queue, timeFrameStart, std::time(0)); } 80 84 /** 81 85 @brief Fetches the Notifications for a specific NotificationQueue starting at a specified timespan before now. … … 84 88 @return Returns a time-ordered list of Notifications. 85 89 */ 86 st atic std::multimap<std::time_t,Notification*>* getNotifications(NotificationQueue* queue, int timeDelay)87 { return NotificationManager::getNotifications(queue, std::time(0)-timeDelay, std::time(0)); }90 std::multimap<std::time_t,Notification*>* getNotifications(NotificationQueue* queue, int timeDelay) 91 { return this->getNotifications(queue, std::time(0)-timeDelay, std::time(0)); } 88 92 89 private: 90 static int highestIndex_s; //!< This variable holds the highest index (resp. key) in notificationLists_s, to secure that no key appears twice. 93 private: 94 static NotificationManager* singletonRef_s; 95 96 int highestIndex_; //!< This variable holds the highest index (resp. key) in notificationLists_s, to secure that no key appears twice. 91 97 92 st atic std::multimap<std::time_t,Notification*> allNotificationsList_s; //!< Container where all notifications are stored (together with their respecive timestamps).93 st atic std::map<NotificationQueue*,int> queueList_s; //!< Container where all NotificationQueues are stored with a number as identifier.94 st atic std::map<int,std::multimap<std::time_t,Notification*>*> notificationLists_s; //!< Container where all Notifications, for each identifier (associated with a NotificationQueue), are stored.98 std::multimap<std::time_t,Notification*> allNotificationsList_; //!< Container where all notifications are stored (together with their respecive timestamps). 99 std::map<NotificationQueue*,int> queueList_; //!< Container where all NotificationQueues are stored with a number as identifier. 100 std::map<int,std::multimap<std::time_t,Notification*>*> notificationLists_; //!< Container where all Notifications, for each identifier (associated with a NotificationQueue), are stored. 95 101 96 102
Note: See TracChangeset
for help on using the changeset viewer.