Index: /code/branches/questsystem5/src/orxonox/overlays/notifications/NotificationManager.cc
===================================================================
--- /code/branches/questsystem5/src/orxonox/overlays/notifications/NotificationManager.cc	(revision 2857)
+++ /code/branches/questsystem5/src/orxonox/overlays/notifications/NotificationManager.cc	(revision 2858)
@@ -174,4 +174,6 @@
     @param queue
         The NotificationQueue the Notifications are fetched for.
+    @param map
+        A multimap, in which the notifications are stored.
     @param timeFrameStart
         The start time of the timeframe.
@@ -179,14 +181,15 @@
         The end time of the timeframe.
     @return
-        Returns a time-ordered list of Notifications.
-    @todo
-        Make sure the map is deleted.
-    */
-    std::multimap<std::time_t,Notification*>* NotificationManager::getNotifications(NotificationQueue* queue, const std::time_t & timeFrameStart, const std::time_t & timeFrameEnd)
-    {
-        std::multimap<std::time_t,Notification*>* notifications = this->notificationLists_[this->queueList_[queue]];
-        
-        if(notifications == NULL)
-            return NULL;
+        Returns true if successful.
+    */
+    bool NotificationManager::getNotifications(NotificationQueue* queue, std::multimap<std::time_t,Notification*>* map, const std::time_t & timeFrameStart, const std::time_t & timeFrameEnd)
+    {
+        if(queue == NULL || map == NULL)
+            return false;
+
+        std::multimap<std::time_t,Notification*>* notifications = this->notificationLists_[this->queueList_[queue]]; //!< The Notifications for the input NotificationQueue.
+        
+        if(notifications == NULL) //!< Returns NULL, if there are no Notifications.
+            return true;
     
         std::multimap<std::time_t,Notification*>::iterator it, itLowest, itHighest;
@@ -194,18 +197,10 @@
         itHighest = notifications->upper_bound(timeFrameStart);
         
-        std::multimap<std::time_t,Notification*>* map = new std::multimap<std::time_t,Notification*>();
-        
-        for(it = itLowest; it != itHighest; it++)
-        {
-            map->insert(std::pair<std::time_t,Notification*>(it->first,it->second));
-        }
-        
-        if(map->size() == 0)
-        {
-            delete map;
-            return NULL;
-        }
-        
-        return map;
+        for(it = itLowest; it != itHighest; it++) //!< Iterate through the Notifications from the start of the time Frame to the end of it.
+        {
+            map->insert(std::pair<std::time_t,Notification*>(it->first,it->second)); //!< Add the found Notifications to the map.
+        }
+        
+        return true;
     }
 
Index: /code/branches/questsystem5/src/orxonox/overlays/notifications/NotificationManager.h
===================================================================
--- /code/branches/questsystem5/src/orxonox/overlays/notifications/NotificationManager.h	(revision 2857)
+++ /code/branches/questsystem5/src/orxonox/overlays/notifications/NotificationManager.h	(revision 2858)
@@ -66,26 +66,27 @@
             static NotificationManager & getInstance(); //! Returns a reference to the single instance of the NotificationManager.
 
-            //TDO: Visibility?
             bool registerNotification(Notification* notification); //!< Registers a Notification within the NotificationManager.
             bool registerQueue(NotificationQueue* queue); //!< Registers a NotificationQueue within the NotificationManager.
             
-            std::multimap<std::time_t,Notification*>* getNotifications(NotificationQueue* queue, const std::time_t & timeFrameStart, const std::time_t & timeFrameEnd); //!< Returns the Notifications for a specific NotificationQueue in a specified timeframe.
+            bool getNotifications(NotificationQueue* queue, std::multimap<std::time_t,Notification*>* map, const std::time_t & timeFrameStart, const std::time_t & timeFrameEnd); //!< Returns the Notifications for a specific NotificationQueue in a specified timeframe.
             
             /**
             @brief Fetches the Notifications for a specific NotificationQueue starting at a specified time.
             @param queue The NotificationQueue the Notifications are fetched for.
+            @param map A multimap, in which the notifications are stored.
             @param timeFrameStart The start time the Notifications are fetched from.
-            @return Returns a time-ordered list of Notifications.
+            @return Returns true if successful.
             */
-            std::multimap<std::time_t,Notification*>* getNotifications(NotificationQueue* queue, const std::time_t & timeFrameStart)
-                { return this->getNotifications(queue, timeFrameStart, std::time(0)); }
+            bool getNotifications(NotificationQueue* queue, std::multimap<std::time_t,Notification*>* map, const std::time_t & timeFrameStart)
+                { return this->getNotifications(queue, map, timeFrameStart, std::time(0)); }
             /**
             @brief Fetches the Notifications for a specific NotificationQueue starting at a specified timespan before now.
             @param queue The NotificationQueue the Notifications are fetched for.
+            @param map A multimap, in which the notifications are stored.
             @param timeDelay The timespan.
-            @return Returns a time-ordered list of Notifications.
+            @return Returns true if successful.
             */
-            std::multimap<std::time_t,Notification*>* getNotifications(NotificationQueue* queue, int timeDelay)
-                { return this->getNotifications(queue, std::time(0)-timeDelay, std::time(0)); }
+            bool getNotifications(NotificationQueue* queue, std::multimap<std::time_t,Notification*>* map, int timeDelay)
+                { return this->getNotifications(queue, map, std::time(0)-timeDelay, std::time(0)); }
      
         private:
Index: /code/branches/questsystem5/src/orxonox/overlays/notifications/NotificationOverlay.cc
===================================================================
--- /code/branches/questsystem5/src/orxonox/overlays/notifications/NotificationOverlay.cc	(revision 2857)
+++ /code/branches/questsystem5/src/orxonox/overlays/notifications/NotificationOverlay.cc	(revision 2858)
@@ -27,4 +27,9 @@
  */
 
+/**
+    @file NotificationOverlay.cc
+    @brief Implementation of the NotificationOverlay class.
+*/
+
 #include "OrxonoxStableHeaders.h"
 #include "NotificationOverlay.h"
@@ -43,4 +48,8 @@
 {
 
+    /**
+    @brief
+        Constructor. Intializes the class.
+    */
     NotificationOverlay::NotificationOverlay(BaseObject* creator) : OverlayText(creator)
     {
@@ -48,9 +57,19 @@
     }
 
+    /**
+    @brief
+        Constructor. Initilaizes the class creates a graphical representation of the input Notification for the input Queue.
+    @param queue
+        A pointer to the queue the NotificatonOverlay belongs to.
+    @param notification
+        A pointer to the Notification represented by this overlay.
+    @throws Argument
+        Throws an Argument-Exception if either no Notification or no NotificationQueue were input.
+    */
     NotificationOverlay::NotificationOverlay(NotificationQueue* queue, Notification* notification) : OverlayText(this)
     {
         this->initialize();
         
-        if(notification == NULL || queue == NULL)
+        if(notification == NULL || queue == NULL) //!> If either notification or queue are not given an Exception is thrown.
         {
             ThrowException(Argument, "There were NULL-Pointer arguments in NotificationOverlay creation.");
@@ -63,4 +82,8 @@
     }
     
+    /**
+    @brief
+        Initializes and Registers the object.
+    */
     void NotificationOverlay::initialize(void)
     {
@@ -70,4 +93,8 @@
     }
     
+    /**
+    @brief
+        Set some Overlay-specific values.
+    */
     void NotificationOverlay::defineOverlay(void)
     {
@@ -78,10 +105,24 @@
     }
 
+    /**
+    @brief
+        Destructor.
+    */
     NotificationOverlay::~NotificationOverlay()
     {
     }
 
+    /**
+    @brief
+        Processes the input notification, resp. sees to it. that the NotificationOverlay displays the Notification message.
+    @param notification
+        A pointer to the notification that should be processed.
+    @return
+        Returns true if successful.
+    */
     bool NotificationOverlay::processNotification(Notification* notification)
     {
+        if(notification == NULL)
+            return false;
         this->setCaption(clipMessage(notification->getMessage()));
         this->notification_ = notification;
@@ -89,7 +130,11 @@
     }
 
+    /**
+    @brief
+        Clips the input message so that it meets the requirements for the maximal length of Notifications given by the NotificationQueue.
+    */
     const std::string NotificationOverlay::clipMessage(const std::string & message)
     {
-        if(message.length() <= (unsigned int)this->queue_->getNotificationLength())
+        if(message.length() <= (unsigned int)this->queue_->getNotificationLength()) //!< If the message is not too long.
             return message;
         return message.substr(0, this->queue_->getNotificationLength());
Index: /code/branches/questsystem5/src/orxonox/overlays/notifications/NotificationOverlay.h
===================================================================
--- /code/branches/questsystem5/src/orxonox/overlays/notifications/NotificationOverlay.h	(revision 2857)
+++ /code/branches/questsystem5/src/orxonox/overlays/notifications/NotificationOverlay.h	(revision 2858)
@@ -27,4 +27,10 @@
  */
 
+/**
+    @file NotificationOverlay.h
+    @brief Definition of the NotificationOverlay class.
+*/
+
+
 #ifndef _NotificationOverlay_H__
 #define _NotificationOverlay_H__
@@ -44,5 +50,5 @@
     /**
     @brief
-        
+        The NotificationOverlay is used to display single Notifications, then bundled in a NotificationQUeue.
     @author
         Damian 'Mozork' Frick
@@ -56,18 +62,22 @@
             virtual ~NotificationOverlay();
             
-            bool processNotification(Notification* notification);
+            bool processNotification(Notification* notification); //!< Processes the input Notification.
 
-            void setFontSize(float size)
+            /**
+            @brief Sets the font size of this overlay's text.
+            @param size The font size.
+            */
+            inline void setFontSize(float size)
                 { this->setTextSize(size); }
         
         protected:
-            const std::string clipMessage(const std::string & message);
+            const std::string clipMessage(const std::string & message); //!< Clips the input message if too long.
 
         private:
-            NotificationQueue* queue_;
-            Notification* notification_;
+            NotificationQueue* queue_; //!< The NotificationQeue this overlay belongs to.
+            Notification* notification_; //!< The Notification this overlay displays.
 
-            void initialize(void);
-            void defineOverlay(void);
+            void initialize(void); //!< Initializes the object.
+            void defineOverlay(void); //!< Sets some overlay-specific values.
 
     };
Index: /code/branches/questsystem5/src/orxonox/overlays/notifications/NotificationQueue.cc
===================================================================
--- /code/branches/questsystem5/src/orxonox/overlays/notifications/NotificationQueue.cc	(revision 2857)
+++ /code/branches/questsystem5/src/orxonox/overlays/notifications/NotificationQueue.cc	(revision 2858)
@@ -27,4 +27,9 @@
  */
 
+/**
+    @file NotificationQueue.cc
+    @brief Implementation of the NotificationQueue class.
+*/
+
 #include "OrxonoxStableHeaders.h"
 #include "NotificationQueue.h"
@@ -33,4 +38,6 @@
 #include <OgreTextAreaOverlayElement.h>
 #include <list>
+#include <iostream>
+#include <sstream>
 
 #include "core/CoreIncludes.h"
@@ -155,13 +162,20 @@
         this->clear();
     
-        std::multimap<std::time_t,Notification*>* notifications = NotificationManager::getInstance().getNotifications(this, this->displayTime_);
-        
-        if(notifications == NULL)
+        std::multimap<std::time_t,Notification*>* notifications = new std::multimap<std::time_t,Notification*>;
+        if(!NotificationManager::getInstance().getNotifications(this, notifications, this->displayTime_)) //!< Get the Notifications sent in the interval form now to minus the display time.
+        {
+            COUT(1) << "NotificationQueue update failed due to undetermined cause." << std::endl;
             return;
-        
-        for(std::multimap<std::time_t,Notification*>::iterator it = notifications->begin(); it != notifications->end(); it++)
+        }
+        
+        if(notifications->empty())
+            return;
+        
+        for(std::multimap<std::time_t,Notification*>::iterator it = notifications->begin(); it != notifications->end(); it++) //!> Add all Notifications.
         {
             this->addNotification(it->second, it->first);
         }
+        
+        delete notifications;
         
         COUT(3) << "NotificationQueue updated." << std::endl;
@@ -343,4 +357,10 @@
     }
 
+    /**
+    @brief
+        Scrolls the NotificationQueue, meaning all NotificationOverlays are moved the input vector.
+    @param pos
+        The vector the NotificationQueue is scrolled.
+    */
     void NotificationQueue::scroll(const Vector2 pos)
     {
@@ -351,5 +371,9 @@
     }
 
-    void NotificationQueue::positionChanged()
+    /**
+    @brief
+        Aligns all the Notifications to the position of the NotificationQueue.
+    */
+    void NotificationQueue::positionChanged(void)
     {
         int counter = 0;
@@ -379,7 +403,7 @@
         std::string timeString = std::ctime(&time);
         timeString.erase(timeString.length()-1);
-        char buffer[64]; //TDO: Very un-nice.
-        std::sprintf(buffer,"%x",(unsigned long)notification); //TDO: Use other conversion to avoid 64bit problems.
-        std::string addressString = buffer;
+        std::ostringstream stream;
+        stream << (unsigned long)notification;
+        std::string addressString = stream.str() ;
         container->name = "NotificationOverlay(" + timeString + ")&" + addressString;
         
Index: /code/branches/questsystem5/src/orxonox/overlays/notifications/NotificationQueue.h
===================================================================
--- /code/branches/questsystem5/src/orxonox/overlays/notifications/NotificationQueue.h	(revision 2857)
+++ /code/branches/questsystem5/src/orxonox/overlays/notifications/NotificationQueue.h	(revision 2858)
@@ -71,4 +71,17 @@
     @brief
         Displays Notifications from specific senders.
+        Beware! The NotificationQueue is an OverlayGruop and thus cannot be be a sub-element of an OverlayGroup (at least no for now.)
+
+        Creating a NotificationQueue through XML goes as follows:
+        <NotificationQueue
+            name = "SuperQueue" //Name of your OverlayQueue.
+            maxSize = "5" //The maximum size of Notifications displayed.
+            notificationLength = "64" //The maximum number of characters of a Notification, that are displayed. (Default is 5)
+            displayTime = "30" //The time a Notification is displayed in seconds. (Default is 30)
+            targets = "target1, target2" //The senders this NotificationQueue displays Notifications from. (all, if all Notifications should be displayed.)
+            font = "VeraMono" //The font (Default is VeraMono)
+            fontSize = '0.4' //The font size. (Default is 0.025)
+            position = "0.0, .0.0" //The position of the NotificationQueue. (Default is 0.0,0.0)
+        />
     @author
         Damian 'Mozork' Frick
@@ -140,8 +153,12 @@
             bool getTargets(std::string* string) const; //!< Returns a string consisting of the concatination of the targets.
             
-            inline void setPosition(Vector2 pos)
+            /**
+            @brief Sets the position of the NotificationQueue.
+            @param pos The position.
+            */
+            inline void setPosition(Vector2 pos) 
                 { this->position_ = pos; this->positionChanged(); }
 
-            void scroll(const Vector2 pos);
+            void scroll(const Vector2 pos); //!< Scrolls the NotificationQueue, meaning all NotificationOverlays are moved the input vector.
             
         private:
@@ -183,5 +200,5 @@
             bool setFont(const std::string & font); //!< Set the font.
 
-            void positionChanged();
+            void positionChanged(void); //!< Aligns all the Notifications to the position of the NotificationQueue.
             
             void addNotification(Notification* notification, const std::time_t & time); //!< Add a notification to the queue.
