Changeset 373 for cpp/frams


Ignore:
Timestamp:
04/23/15 03:16:55 (9 years ago)
Author:
Maciej Komosinski
Message:

Less cryptic variable names

Location:
cpp/frams/mhandlers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/mhandlers/mhandlers.cpp

    r372 r373  
    3131int MessageHandlerManager::add(MessageHandlerBase *h)
    3232{
    33         h->mgr = this;
     33        h->manager = this;
    3434        handlers += h;
    3535        return handlers.size() - 1;
     
    3939{
    4040        MessageHandlerBase *h = handlers(i);
    41         h->mgr = 0;
     41        h->manager = NULL;
    4242        handlers.remove(i);
    4343}
     
    6161{
    6262        if (!isEnabled()) return;
    63         int level = mgr->find(this);
    64         if (level >= 0) mgr->send(level - 1, o, m, bl, w);
     63        int level = manager->find(this);
     64        if (level >= 0) manager->send(level - 1, o, m, bl, w);
    6565}
    6666
     
    110110        if (w >= HMLV_ERROR) errcount++;
    111111
    112         if (w >= storlevel)
     112        if (w >= minleveltostore)
    113113        {
    114                 storcount++;
     114                storedcount++;
    115115                if (options & (StoreFirstMessage | StoreAllMessages))
    116116                {
  • cpp/frams/mhandlers/mhandlers.h

    r372 r373  
    3939        friend class MessageHandlerManager;
    4040protected:
    41         MessageHandlerManager* mgr;
     41        MessageHandlerManager* manager;
    4242        int options;
    4343
     
    5252        void send(const char *o, const char *m, const char *bl, int w);
    5353
    54         bool isEnabled() { return mgr ? 1 : 0; }
     54        bool isEnabled() { return manager ? true : false; }
    5555        void enable();
    5656        void disable();
     
    5959        void resume();
    6060
    61         MessageHandlerBase(int opts = 0) :mgr(0), options(opts)
     61        MessageHandlerBase(int opts = 0) :manager(NULL), options(opts)
    6262        {
    6363                if (options&Enable) enable();
     
    7676{
    7777protected:
    78         int maxlevel, errcount, warncount, storlevel, storcount, infocount;
     78        int maxlevel, minleveltostore, errcount, warncount, storedcount, infocount;
    7979        SString msgs;
    8080
    8181public:
    8282
    83         void reset() { maxlevel = HMLV_INFO - 1; errcount = warncount = storcount = infocount = 0; msgs = 0; }
     83        void reset() { maxlevel = HMLV_INFO - 1; errcount = warncount = storedcount = infocount = 0; msgs = 0; }
    8484
    8585        enum Options2
     
    9191        int getWarningCount()     { return warncount; }
    9292        int getInfoCount()        { return infocount; }
    93         int getStoredCount()      { return storcount; }
     93        int getStoredCount()      { return storedcount; }
    9494        int getErrorLevel()       { return maxlevel; }
    9595        const SString& getMessages() { return msgs; }
    9696
    97         MessageHandlerToMemory(int opts = 0, int minimal_level_to_store = HMLV_ERROR) :MessageHandlerBase(opts), storlevel(minimal_level_to_store)
     97        MessageHandlerToMemory(int opts = 0, int minimal_level_to_store = HMLV_ERROR) :MessageHandlerBase(opts), minleveltostore(minimal_level_to_store)
    9898        {
    9999                reset();
     
    105105class RedirectingMessageHandler : public MessageHandlerBase
    106106{
    107         MessageHandlerManager *other_mgr;
     107        MessageHandlerManager *other_manager;
    108108public:
    109         RedirectingMessageHandler(MessageHandlerManager *om,int opts=0)
    110                 :MessageHandlerBase(opts), other_mgr(om) {}
     109        RedirectingMessageHandler(MessageHandlerManager *other_mgr,int opts=0)
     110                :MessageHandlerBase(opts), other_manager(other_mgr) {}
    111111
    112112        void handle(const char *o, const char *m, const char *bl, int w)
    113113        {
    114                 other_mgr->send(o, m, bl, w);
     114                other_manager->send(o, m, bl, w);
    115115        }
    116116};
Note: See TracChangeset for help on using the changeset viewer.