[5635] | 1 | /* |
---|
| 2 | * ORXONOX - the hottest 3D action shooter ever to exist |
---|
| 3 | * > www.orxonox.net < |
---|
| 4 | * |
---|
| 5 | * |
---|
| 6 | * License notice: |
---|
| 7 | * |
---|
| 8 | * This program is free software; you can redistribute it and/or |
---|
| 9 | * modify it under the terms of the GNU General Public License |
---|
| 10 | * as published by the Free Software Foundation; either version 2 |
---|
| 11 | * of the License, or (at your option) any later version. |
---|
| 12 | * |
---|
| 13 | * This program is distributed in the hope that it will be useful, |
---|
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 16 | * GNU General Public License for more details. |
---|
| 17 | * |
---|
| 18 | * You should have received a copy of the GNU General Public License |
---|
| 19 | * along with this program; if not, write to the Free Software |
---|
| 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
| 21 | * |
---|
| 22 | * Author: |
---|
| 23 | * Fabian 'x3n' Landau |
---|
| 24 | * Co-authors: |
---|
| 25 | * ... |
---|
| 26 | * |
---|
| 27 | */ |
---|
| 28 | |
---|
| 29 | /** |
---|
[7484] | 30 | @file NotificationListener.h |
---|
[5635] | 31 | @brief Definition of the NotificationListener class. |
---|
[7484] | 32 | @ingroup Notifications |
---|
[5635] | 33 | */ |
---|
| 34 | |
---|
| 35 | #ifndef _NotificationListener_H__ |
---|
| 36 | #define _NotificationListener_H__ |
---|
| 37 | |
---|
| 38 | #include "OrxonoxPrereqs.h" |
---|
| 39 | |
---|
| 40 | #include <ctime> |
---|
| 41 | #include <set> |
---|
| 42 | #include <string> |
---|
| 43 | |
---|
[7413] | 44 | #include "util/StringUtils.h" |
---|
| 45 | |
---|
[5635] | 46 | #include "core/OrxonoxClass.h" |
---|
| 47 | |
---|
| 48 | namespace orxonox |
---|
| 49 | { |
---|
[5929] | 50 | class Notification; |
---|
| 51 | |
---|
[7163] | 52 | /** |
---|
| 53 | @brief |
---|
| 54 | NotificationListener interface. |
---|
[7484] | 55 | |
---|
| 56 | The NotificationListener interface presents a means to being informed when @ref orxonox::Notification "Notifications" in the target set of this NotificationListener change. (e.g. @ref orxonox::Notification "Notifications" were added or removed) |
---|
| 57 | When inheriting from a NotificationListener it is important to register (in the constructor) and unregister (in the destructor) it to and from the @ref orxonox::NotificationManager "NotificationManager". |
---|
[7552] | 58 | |
---|
[7163] | 59 | @author |
---|
| 60 | Fabian 'x3n' Landau |
---|
[7552] | 61 | |
---|
| 62 | @ingroup Notifications |
---|
[7163] | 63 | */ |
---|
[5635] | 64 | class _OrxonoxExport NotificationListener : virtual public OrxonoxClass |
---|
| 65 | { |
---|
| 66 | public: |
---|
| 67 | NotificationListener(); |
---|
| 68 | virtual ~NotificationListener() {} |
---|
| 69 | |
---|
[7484] | 70 | /** |
---|
| 71 | @brief Get the senders that are targets of this NotificationListener. |
---|
| 72 | @return Returns the set of senders that are targets of this NotificationListener. |
---|
| 73 | */ |
---|
| 74 | virtual const std::set<std::string> & getTargetsSet(void) = 0; |
---|
| 75 | |
---|
| 76 | /** |
---|
| 77 | @brief Updates the whole NotificationListener. |
---|
| 78 | This is called by the @ref orxonox::NotificationManager "NotificationManager" when the @ref orxonox::Notification "Notifications" have changed so much, that the NotificationListener may have to re-initialize his operations. |
---|
| 79 | */ |
---|
[5635] | 80 | virtual void update(void) = 0; |
---|
[7484] | 81 | /** |
---|
| 82 | @brief Updates the NotificationListener, when a new Notification has come in at the specified time. |
---|
| 83 | @param notification A pointer to the @ref orxonox::Notification "Notification". |
---|
| 84 | @param time The time the @ref orxonox::Notification "Notification" has come in. |
---|
| 85 | */ |
---|
[5635] | 86 | virtual void update(Notification* notification, const std::time_t & time) = 0; |
---|
| 87 | }; |
---|
| 88 | } |
---|
| 89 | |
---|
| 90 | #endif /* _NotificationListener_H__ */ |
---|