Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/orxonox/interfaces/NotificationListener.h @ 7552

Last change on this file since 7552 was 7552, checked in by dafrick, 14 years ago

Resolving some TODOs and doing some additional cleanup. Almost done now…

  • Property svn:eol-style set to native
File size: 3.2 KB
Line 
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
48namespace 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
59    @author
60        Fabian 'x3n' Landau
61
62    @ingroup Notifications
63    */
64    class _OrxonoxExport NotificationListener : virtual public OrxonoxClass
65    {
66        public:
67            NotificationListener();
68            virtual ~NotificationListener() {}
69
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            */
80            virtual void update(void) = 0;
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            */
86            virtual void update(Notification* notification, const std::time_t & time) = 0;
87    };
88}
89
90#endif /* _NotificationListener_H__ */
Note: See TracBrowser for help on using the repository browser.