Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 20, 2011, 3:58:29 AM (13 years ago)
Author:
rgrieder
Message:

Separate method in OutputHandler for updating the global debug level and using std::vector instead of std::list for the listeners.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/unity_build/src/libraries/util/OutputHandler.h

    r8515 r8516  
    3939#include "UtilPrereqs.h"
    4040
    41 #include <list>
    4241#include <ostream>
    4342#include <string>
     
    221220            OutputHandler(const OutputHandler& rhs);      //!< Copy-constructor: Unused and undefined
    222221
    223             std::list<OutputListener*> listeners_;        //!< Array with all registered output listeners
    224             int                        outputLevel_;      //!< The level of the incoming output
    225             LogFileWriter*             logFile_;          //!< Listener that writes to the log file
    226             ConsoleWriter*             consoleWriter_;    //!< Listener for std::cout (just program beginning)
    227             MemoryLogWriter*           memoryBuffer_;     //!< Writes to memory as a buffer (can/must be stopped at some time)
    228             static int                 softDebugLevel_s;  //!< Maximum of all soft debug levels. @note This is only static for faster access
     222            /// Evaluates the maximum global log level
     223            void updateGlobalDebugLevel();
     224
     225            std::vector<OutputListener*> listeners_;        //!< Array with all registered output listeners
     226            int                          outputLevel_;      //!< The level of the incoming output
     227            LogFileWriter*               logFile_;          //!< Writes output to the log file
     228            ConsoleWriter*               consoleWriter_;    //!< Writes to std::cout (can be disabled)
     229            MemoryLogWriter*             memoryBuffer_;     //!< Writes to memory as a buffer (can/must be stopped at some time)
     230            static int                   softDebugLevel_s;  //!< Maximum of all soft debug levels. @note This is only static for faster access
    229231    };
    230232
     
    271273    inline OutputHandler& OutputHandler::output(const T& output)
    272274    {
    273         for (std::list<OutputListener*>::const_iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)
     275        for (std::vector<OutputListener*>::const_iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)
    274276        {
    275277            if (this->outputLevel_ <= (*it)->softDebugLevel_ && (*it)->outputStream_ != NULL)
Note: See TracChangeset for help on using the changeset viewer.