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 | /** |
---|
30 | @file NotificationListener.h |
---|
31 | @brief Definition of the NotificationListener class. |
---|
32 | @ingroup Notifications |
---|
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 | |
---|
44 | #include "util/StringUtils.h" |
---|
45 | |
---|
46 | #include "core/OrxonoxClass.h" |
---|
47 | |
---|
48 | namespace orxonox |
---|
49 | { |
---|
50 | class Notification; |
---|
51 | |
---|
52 | /** |
---|
53 | @brief |
---|
54 | NotificationListener interface. |
---|
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". |
---|
58 | @author |
---|
59 | Fabian 'x3n' Landau |
---|
60 | */ |
---|
61 | //TODO: Needed? Remove or move some NotificationQueue things over here. |
---|
62 | class _OrxonoxExport NotificationListener : virtual public OrxonoxClass |
---|
63 | { |
---|
64 | public: |
---|
65 | NotificationListener(); |
---|
66 | virtual ~NotificationListener() {} |
---|
67 | |
---|
68 | /** |
---|
69 | @brief Get the senders that are targets of this NotificationListener. |
---|
70 | @return Returns the set of senders that are targets of this NotificationListener. |
---|
71 | */ |
---|
72 | virtual const std::set<std::string> & getTargetsSet(void) = 0; |
---|
73 | |
---|
74 | /** |
---|
75 | @brief Updates the whole NotificationListener. |
---|
76 | 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. |
---|
77 | */ |
---|
78 | virtual void update(void) = 0; |
---|
79 | /** |
---|
80 | @brief Updates the NotificationListener, when a new Notification has come in at the specified time. |
---|
81 | @param notification A pointer to the @ref orxonox::Notification "Notification". |
---|
82 | @param time The time the @ref orxonox::Notification "Notification" has come in. |
---|
83 | */ |
---|
84 | virtual void update(Notification* notification, const std::time_t & time) = 0; |
---|
85 | }; |
---|
86 | } |
---|
87 | |
---|
88 | #endif /* _NotificationListener_H__ */ |
---|