Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 9, 2010, 10:59:01 PM (14 years ago)
Author:
dafrick
Message:

Finished EditMode, needs some polish (no not the language…) though.
Took better advantage of lua tables in NotificationLayer.lua
Fixed a lot of bugs, it really is a miracle that the Notifications worked as well as they did.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/notifications/src/modules/notifications/NotificationManager.h

    r7354 r7395  
    2828
    2929/**
    30     @file
     30    @file NotificationManager.h
    3131    @brief Definition of the NotificationManager class.
    3232*/
     
    4040#include <map>
    4141#include <string>
    42 #include <vector>
    4342
    4443#include "util/Singleton.h"
     
    5554        Damian 'Mozork' Frick
    5655    */
    57     class _NotificationsExport NotificationManager  // tolua_export
     56    class _NotificationsExport NotificationManager // tolua_export
    5857        : public Singleton<NotificationManager>, public OrxonoxClass
    5958    { // tolua_export
     
    7574            void unregisterListener(NotificationListener* listener); //!< Unregisters a NotificationListener withing the NotificationManager.
    7675
    77             bool getNotifications(NotificationListener* listener, std::multimap<std::time_t,Notification*>* map, const std::time_t & timeFrameStart, const std::time_t & timeFrameEnd); //!< Returns the Notifications for a specific NotificationListener in a specified timeframe.
     76            bool getNotifications(NotificationListener* listener, std::multimap<std::time_t, Notification*>* map, const std::time_t & timeFrameStart, const std::time_t & timeFrameEnd); //!< Returns the Notifications for a specific NotificationListener in a specified timeframe.
    7877
    7978            /**
     
    8483            @return Returns true if successful.
    8584            */
    86             bool getNotifications(NotificationListener* listener, std::multimap<std::time_t,Notification*>* map, int timeDelay)
     85            bool getNotifications(NotificationListener* listener, std::multimap<std::time_t, Notification*>* map, int timeDelay)
    8786                { return this->getNotifications(listener, map, std::time(0)-timeDelay, std::time(0)); }
    8887
    8988            void enterEditMode(void);
    9089
    91             void createQueue(const std::string& name, const std::string& targets, unsigned int size, unsigned int displayTime); // tolua_export
     90            // tolua_begin
     91            void loadQueues(void);
     92           
     93            void createQueue(const std::string& name);
     94            orxonox::NotificationQueue* getQueue(const std::string & name);
     95            // tolua_end
     96
     97            bool registerQueue(NotificationQueue* queue);
     98            void unregisterQueue(NotificationQueue* queue);
    9299
    93100        private:
    94101            static NotificationManager* singletonPtr_s;
    95102
    96             std::vector<NotificationQueue*> queues_; //!< The list of NotificationQueues created by the NotificationManager.
     103            std::map<const std::string, NotificationQueue*> queues_; //!< The list of NotificationQueues created by the NotificationManager.
    97104
    98105            int highestIndex_; //!< This variable holds the highest index (resp. key) in notificationLists_s, to secure that no key appears twice.
    99106
    100             std::multimap<std::time_t,Notification*> allNotificationsList_; //!< Container where all notifications are stored.
    101             std::map<NotificationListener*,int> listenerList_; //!< Container where all NotificationListeners are stored with a number as identifier.
    102             std::map<int,std::multimap<std::time_t,Notification*>*> notificationLists_; //!< Container where all Notifications, for each identifier (associated with a NotificationListener), are stored.
     107            std::multimap<std::time_t, Notification*> allNotificationsList_; //!< Container where all notifications are stored.
     108            std::map<NotificationListener*, int> listenerList_; //!< Container where all NotificationListeners are stored with a number as identifier.
     109            std::map<int,std::multimap<std::time_t, Notification*>*> notificationLists_; //!< Container where all Notifications, for each identifier (associated with a NotificationListener), are stored.
    103110            std::map<Notification*, unsigned int> listenerCounter_; //!< A container to store the number of NotificationListeners a Notification is registered with.
    104111
Note: See TracChangeset for help on using the changeset viewer.