llmessagethrottle.h

Go to the documentation of this file.
00001 
00032 #ifndef LL_LLMESSAGETHROTTLE_H
00033 #define LL_LLMESSAGETHROTTLE_H
00034 
00035 #include <deque>
00036 
00037 #include "linden_common.h"
00038 #include "lluuid.h"
00039 
00040 typedef enum e_message_throttle_categories
00041 {
00042         MTC_VIEWER_ALERT,
00043         MTC_AGENT_ALERT,
00044         MTC_EOF
00045 } EMessageThrottleCats;
00046 
00047 class LLMessageThrottleEntry
00048 {
00049 public:
00050         LLMessageThrottleEntry(const size_t hash, const U64 entry_time)
00051                 : mHash(hash), mEntryTime(entry_time) {}
00052 
00053         size_t  getHash()       { return mHash; }
00054         U64     getEntryTime()  { return mEntryTime; }
00055 protected:
00056         size_t  mHash;
00057         U64             mEntryTime;
00058 };
00059 
00060 
00061 class LLMessageThrottle
00062 {
00063 public:
00064         LLMessageThrottle();
00065         ~LLMessageThrottle();
00066 
00067         BOOL addViewerAlert     (const LLUUID& to, const char* mesg);
00068         BOOL addAgentAlert      (const LLUUID& agent, const LLUUID& task, const char* mesg);
00069 
00070         void pruneEntries();
00071 
00072 protected:
00073         typedef std::deque<LLMessageThrottleEntry>                                                      message_list_t;
00074         typedef std::deque<LLMessageThrottleEntry>::iterator                            message_list_iterator_t;
00075         typedef std::deque<LLMessageThrottleEntry>::reverse_iterator            message_list_reverse_iterator_t;
00076         typedef std::deque<LLMessageThrottleEntry>::const_iterator                      message_list_const_iterator_t;
00077         typedef std::deque<LLMessageThrottleEntry>::const_reverse_iterator      message_list_const_reverse_iterator_t;
00078         message_list_t  mMessageList[MTC_EOF];
00079 };
00080 
00081 extern LLMessageThrottle gMessageThrottle;
00082 
00083 #endif
00084 
00085 

Generated on Thu Jul 1 06:08:53 2010 for Second Life Viewer by  doxygen 1.4.7