- Timestamp:
- Sep 10, 2010, 11:17:02 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/notifications/src/modules/notifications/NotificationQueue.h
r7398 r7399 43 43 44 44 #include "tools/interfaces/Tickable.h" 45 45 46 #include "interfaces/NotificationListener.h" 46 47 #include "NotificationManager.h" … … 76 77 virtual ~NotificationQueue(); 77 78 79 /** 80 @brief Destroys the NotificationQueue. 81 Used in lua. 82 */ 78 83 void destroy(void) { this->OrxonoxClass::destroy(); } // tolua_export 79 84 80 85 virtual void tick(float dt); //!< To update from time to time. 81 86 82 void update(void); //!< Updates the queue.83 void update(Notification* notification, const std::time_t & time); //!< Adds a Notification to the queue.87 void update(void); //!< Updates the NotificationQueue. 88 void update(Notification* notification, const std::time_t & time); //!< Updates the NotificationQueue by adding an new Notification. 84 89 85 90 // tolua_begin … … 110 115 /** 111 116 @brief Returns the current number of Notifications displayed. 112 @return Returns the size of the queue.117 @return Returns the size of the NotificationQueue. 113 118 */ 114 119 inline unsigned int getSize() const … … 116 121 117 122 /** 118 @brief Returns the targets of this queue, reps. the senders which Notifications are displayed in this queue.119 @return Retu ns a set of stringholding the different targets.123 @brief Returns the targets of this NotificationQueue, reps. the senders which Notifications are displayed in this NotificationQueue. 124 @return Returns a set of strings holding the different targets. 120 125 */ 121 126 inline const std::set<std::string, NotificationListenerStringCompare> & getTargetsSet() … … 123 128 124 129 // tolua_begin 125 boolsetTargets(const std::string & targets); //!< Set the targets of this NotificationQueue.130 void setTargets(const std::string & targets); //!< Set the targets of this NotificationQueue. 126 131 const std::string& getTargets(void) const; //!< Returns a string consisting of the concatination of the targets. 127 132 // tolua_end … … 137 142 unsigned int displayTime_; //!< The time a Notification is displayed. 138 143 139 std::set<std::string, NotificationListenerStringCompare> targets_; //!< The targets the Queue displays Notifications of.144 bool registered_; //!< Helper variable to remember whether the NotificationQueue is registered already. 140 145 141 std::multiset<NotificationContainer*, NotificationContainerCompare> ordering_; //!< The NotificationContainers ordered by the time they were registered. //TODO: Would set work as well? 146 std::set<std::string, NotificationListenerStringCompare> targets_; //!< The targets the NotificationQueue displays Notifications of. 147 148 std::multiset<NotificationContainer*, NotificationContainerCompare> ordering_; //!< The NotificationContainers ordered by the time they were registered. 142 149 std::vector<NotificationContainer*> notifications_; //!< The NotificationContainers in the order they were added to the NotificationQueue. 143 150 … … 145 152 NotificationContainer timeLimit_; //!< Helper object to check against to determine whether Notifications have expired. 146 153 147 bool registered_; //!< Helper variable to remember whether the NotificationQueue is registered already.148 149 void initialize(void); //!< Initializes the object.150 154 void create(void); //!< Creates the NotificationQueue in lua. 151 155 152 boolsetName(const std::string& name); //!< Sets the name of the NotificationQueue.156 void setName(const std::string& name); //!< Sets the name of the NotificationQueue. 153 157 154 void sizeChanged(void); //!< Adjusts the NotificationQueue, when the maximum size has changed. 158 void push(Notification* notification, const std::time_t & time); //!< Adds (pushes) a Notification to the NotificationQueue. 159 void pop(void); //!< Removes (pops) the least recently added Notification form the NotificationQueue. 160 void remove(NotificationContainer* container); //!< Removes the Notification that is stored in the input NotificationContainer. 155 161 156 void push(Notification* notification, const std::time_t & time); //!< Add a Notification to the NotificationQueue. 157 void pop(void); //!< Removes the least recently added Notification form the NotificationQueue. 158 void remove(NotificationContainer* container); //!< Removes the Notification that is stored in the input container. 159 160 void clear(void); //!< Clears the queue by removing all Notifications. 162 void clear(void); //!< Clears the NotificationQueue by removing all NotificationContainers. 161 163 162 164 }; // tolua_export
Note: See TracChangeset
for help on using the changeset viewer.