[Orxonox-commit 3769] r8449 - code/branches/tutoriallevel2/src/modules/notifications

dafrick at orxonox.net dafrick at orxonox.net
Wed May 11 22:55:30 CEST 2011


Author: dafrick
Date: 2011-05-11 22:55:30 +0200 (Wed, 11 May 2011)
New Revision: 8449

Removed:
   code/branches/tutoriallevel2/src/modules/notifications/Notification.cc
   code/branches/tutoriallevel2/src/modules/notifications/Notification.h
Modified:
   code/branches/tutoriallevel2/src/modules/notifications/CMakeLists.txt
   code/branches/tutoriallevel2/src/modules/notifications/NotificationManager.cc
   code/branches/tutoriallevel2/src/modules/notifications/NotificationManager.h
   code/branches/tutoriallevel2/src/modules/notifications/NotificationQueue.cc
   code/branches/tutoriallevel2/src/modules/notifications/NotificationQueueCEGUI.cc
Log:
Moving the Notification class int NotificationManager, since it is only a container now.


Modified: code/branches/tutoriallevel2/src/modules/notifications/CMakeLists.txt
===================================================================
--- code/branches/tutoriallevel2/src/modules/notifications/CMakeLists.txt	2011-05-11 20:45:56 UTC (rev 8448)
+++ code/branches/tutoriallevel2/src/modules/notifications/CMakeLists.txt	2011-05-11 20:55:30 UTC (rev 8449)
@@ -1,5 +1,4 @@
 SET_SOURCE_FILES(NOTIFICATIONS_SRC_FILES
-  Notification.cc
   NotificationDispatcher.cc
   NotificationManager.cc
   NotificationQueue.cc

Deleted: code/branches/tutoriallevel2/src/modules/notifications/Notification.cc
===================================================================
--- code/branches/tutoriallevel2/src/modules/notifications/Notification.cc	2011-05-11 20:45:56 UTC (rev 8448)
+++ code/branches/tutoriallevel2/src/modules/notifications/Notification.cc	2011-05-11 20:55:30 UTC (rev 8449)
@@ -1,80 +0,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See thes
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Damian 'Mozork' Frick
- *   Co-authors:
- *      ...
- *
- */
-
-/**
-    @file Notification.cc
-    @brief Implementation of the Notification class.
-*/
-
-#include "Notification.h"
-
-#include "core/CoreIncludes.h"
-#include "interfaces/NotificationListener.h"
-
-namespace orxonox
-{
-
-    /**
-    @brief
-        Constructor. Creates a Notification with the input message and sender.
-    @param message
-        The message of the Notification.
-    @param sender
-        The sender of the Notification.
-    @param type
-        The type of the Notification.
-    */
-    Notification::Notification(const std::string& message, const std::string& sender, notificationMessageType::Value type)
-    {
-        RegisterRootObject(Notification);
-        this->initialize();
-        this->message_ = message;
-        this->sender_ = sender;
-        this->type_ = type;
-    }
-
-    /**
-    @brief
-        Destructor.
-    */
-    Notification::~Notification()
-    {
-
-    }
-
-    /**
-    @brief
-        Registers the object and sets some default values.
-    */
-    void Notification::initialize(void)
-    {
-        this->message_.clear();
-        this->sender_ = NotificationListener::NONE;
-    }
-
-}

Deleted: code/branches/tutoriallevel2/src/modules/notifications/Notification.h
===================================================================
--- code/branches/tutoriallevel2/src/modules/notifications/Notification.h	2011-05-11 20:45:56 UTC (rev 8448)
+++ code/branches/tutoriallevel2/src/modules/notifications/Notification.h	2011-05-11 20:55:30 UTC (rev 8449)
@@ -1,96 +0,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Damian 'Mozork' Frick
- *   Co-authors:
- *      ...
- *
- */
-
-/**
-    @file Notification.h
-    @brief Definition of the Notification class.
-    @ingroup Notifications
-*/
-
-#ifndef _Notification_H__
-#define _Notification_H__
-
-#include "notifications/NotificationsPrereqs.h"
-
-#include <string>
-#include "core/OrxonoxClass.h"
-#include "interfaces/NotificationListener.h"
-
-namespace orxonox
-{
-
-    /**
-    @brief
-        A Notification represents a short message used to inform the player about something that just happened. With the @ref orxonox::NotificationManager "NotificationManager" a Notification can be sent from any part of orxonox and is then displayed by the proper @ref orxonox::NotificationQueue "NotificationQueue(s)" (depending on which senders the specific @ref orxonox::NotificationQueue "NotificationQueues" accepts).
-
-        A Notification is just a data structure that is used internally by the Notifications module.
-
-    @author
-        Damian 'Mozork' Frick
-
-    @ingroup Notifications
-    */
-    class _NotificationsExport Notification : public OrxonoxClass
-    {
-        public:
-            Notification(const std::string& message, const std::string& sender, notificationMessageType::Value type);
-            virtual ~Notification();
-
-            /**
-            @brief Get the message of the Notification.
-            @return Returns the message of the Notification.
-            */
-            inline const std::string & getMessage(void) const
-                { return this->message_; }
-
-            /**
-            @brief Get the sender of the Notification.
-            @return Returns the sender of the Notification.
-            */
-            inline const std::string & getSender(void) const
-                { return this->sender_; }
-
-            /**
-            @brief Get the type of the Notification.
-            @return Returns an enum with the type of the Notification.
-            */
-            inline notificationMessageType::Value getType(void) const
-                { return this->type_; }
-
-        private:
-            std::string message_; //!< The Notification message.
-            std::string sender_; //!< The sender of the notification.
-            notificationMessageType::Value type_; //!< The type of the notification.
-
-            void initialize(void); //!< Registers the object and sets some default values.
-
-    };
-
-}
-
-#endif /* _Notification_H__ */

Modified: code/branches/tutoriallevel2/src/modules/notifications/NotificationManager.cc
===================================================================
--- code/branches/tutoriallevel2/src/modules/notifications/NotificationManager.cc	2011-05-11 20:45:56 UTC (rev 8448)
+++ code/branches/tutoriallevel2/src/modules/notifications/NotificationManager.cc	2011-05-11 20:55:30 UTC (rev 8449)
@@ -40,7 +40,6 @@
 
 #include "interfaces/NotificationListener.h"
 
-#include "Notification.h"
 #include "NotificationQueue.h"
 #include "NotificationQueueCEGUI.h"
 
@@ -423,4 +422,43 @@
         infoQueue->setDisplaySize(Vector2(0.6, 0.0));
     }
 
+    // Notification class
+
+    /**
+    @brief
+        Constructor. Creates a Notification with the input message and sender.
+    @param message
+        The message of the Notification.
+    @param sender
+        The sender of the Notification.
+    @param type
+
+    */
+    Notification::Notification(const std::string& message, const std::string& sender, notificationMessageType::Value type)
+    {
+        this->initialize();
+        this->message_ = message;
+        this->sender_ = sender;
+        this->type_ = type;
+    }
+
+    /**
+    @brief
+        Destructor.
+    */
+    Notification::~Notification()
+    {
+
+    }
+
+    /**
+    @brief
+        Registers the object and sets some default values.
+    */
+    void Notification::initialize(void)
+    {
+        this->message_.clear();
+        this->sender_ = NotificationListener::NONE;
+    }
+
 }

Modified: code/branches/tutoriallevel2/src/modules/notifications/NotificationManager.h
===================================================================
--- code/branches/tutoriallevel2/src/modules/notifications/NotificationManager.h	2011-05-11 20:45:56 UTC (rev 8448)
+++ code/branches/tutoriallevel2/src/modules/notifications/NotificationManager.h	2011-05-11 20:55:30 UTC (rev 8449)
@@ -41,6 +41,7 @@
 #include <map>
 #include <string>
 
+#include "core/OrxonoxClass.h"
 #include "util/Singleton.h"
 #include "interfaces/NotificationListener.h"
 
@@ -49,6 +50,59 @@
 
     /**
     @brief
+        A Notification represents a short message used to inform the player about something that just happened. With the @ref orxonox::NotificationManager "NotificationManager" a Notification can be sent from any part of orxonox and is then displayed by the proper @ref orxonox::NotificationQueue "NotificationQueue(s)" (depending on which senders the specific @ref orxonox::NotificationQueue "NotificationQueues" accepts).
+
+        A Notification is just a data structure that is used internally by the Notifications module.
+
+    @author
+        Damian 'Mozork' Frick
+
+    @ingroup Notifications
+    */
+    class _NotificationsExport Notification
+    {
+        public:
+            Notification(const std::string& message, const std::string& sender, notificationMessageType::Value type);
+            virtual ~Notification();
+
+            /**
+            @brief Destroys the Notification.
+            */
+            void destroy(void)
+                { delete this; }
+
+            /**
+            @brief Get the message of the Notification.
+            @return Returns the message of the Notification.
+            */
+            inline const std::string & getMessage(void) const
+                { return this->message_; }
+
+            /**
+            @brief Get the sender of the Notification.
+            @return Returns the sender of the Notification.
+            */
+            inline const std::string & getSender(void) const
+                { return this->sender_; }
+
+            /**
+            @brief Get the type of the Notification.
+            @return Returns an enum with the type of the Notification.
+            */
+            inline notificationMessageType::Value getType(void) const
+                { return this->type_; }
+
+        private:
+            std::string message_; //!< The Notification message.
+            std::string sender_; //!< The sender of the notification.
+            notificationMessageType::Value type_; //!< The type of the notification.
+
+            void initialize(void); //!< Registers the object and sets some default values.
+
+    };
+
+    /**
+    @brief
         The Singleton NotificationManager is a NotificationListener and functions as a gateway between @ref orxonox::Notification "Notifications" and @ref orxonox::NotificationQueue "NotificationQueues".
         It receives, organizes @ref orxonox::Notification "Notifications" and the redistributes them to the specific @ref orxonox::NotificationQueue "NotificationQueues".
         It also works as a liaison between the @ref orxonox::NotificationQueue "NotificationQueues" and the GUI that displays notification, called NotificationLayer.

Modified: code/branches/tutoriallevel2/src/modules/notifications/NotificationQueue.cc
===================================================================
--- code/branches/tutoriallevel2/src/modules/notifications/NotificationQueue.cc	2011-05-11 20:45:56 UTC (rev 8448)
+++ code/branches/tutoriallevel2/src/modules/notifications/NotificationQueue.cc	2011-05-11 20:55:30 UTC (rev 8449)
@@ -39,8 +39,6 @@
 #include "core/CoreIncludes.h"
 #include "util/SubString.h"
 
-#include "Notification.h"
-
 namespace orxonox
 {
 

Modified: code/branches/tutoriallevel2/src/modules/notifications/NotificationQueueCEGUI.cc
===================================================================
--- code/branches/tutoriallevel2/src/modules/notifications/NotificationQueueCEGUI.cc	2011-05-11 20:45:56 UTC (rev 8448)
+++ code/branches/tutoriallevel2/src/modules/notifications/NotificationQueueCEGUI.cc	2011-05-11 20:55:30 UTC (rev 8449)
@@ -41,8 +41,6 @@
 #include "core/LuaState.h"
 #include "util/Convert.h"
 
-#include "Notification.h"
-
 #include "ToluaBindNotifications.h"
 
 namespace orxonox




More information about the Orxonox-commit mailing list