Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1586


Ignore:
Timestamp:
Jun 10, 2008, 3:35:50 PM (16 years ago)
Author:
landauf
Message:

moved Debug.h, OutputHandler and OutputBuffer to util, to make COUT(x) available everywhere

Location:
code/branches/core3/src
Files:
50 edited
5 moved

Legend:

Unmodified
Added
Removed
  • code/branches/core3/src/asylum/audio/_AudioObject.cc

    r1505 r1586  
    3030#include <string>
    3131
    32 #include "core/Debug.h"
     32#include "util/Debug.h"
    3333#include "AudioObject.h"
    3434
  • code/branches/core3/src/asylum/loader/LevelLoader.cc

    r1505 r1586  
    3131#include <OgreOverlayManager.h>
    3232
     33#include "core/BaseObject.h"
    3334#include "core/Error.h"
    34 #include "core/Debug.h"
    3535#include "core/CoreIncludes.h"
    3636
    3737#include "audio/AudioManager.h"
    38 #include "core/BaseObject.h"
    3938#include "orxonox/Orxonox.h"
    4039
  • code/branches/core3/src/asylum/orxonox/SpaceshipSteering.cc

    r1505 r1586  
    3131#include <OgreSceneNode.h>
    3232
    33 #include "core/Debug.h"
     33#include "util/Debug.h"
    3434#include "util/Math.h"
    3535#include "SpaceshipSteering.h"
  • code/branches/core3/src/asylum/util/String2Number.h

    r1505 r1586  
    3636#include <iostream>
    3737
    38 #include "core/Debug.h"
     38#include "util/Debug.h"
    3939
    4040/**
  • code/branches/core3/src/audio/AudioManager.cc

    r1505 r1586  
    3535#include "AudioStream.h"
    3636#include "core/Error.h"
    37 #include "core/Debug.h"
     37#include "util/Debug.h"
    3838
    3939namespace audio
  • code/branches/core3/src/audio/AudioStream.cc

    r1505 r1586  
    2828#include "AudioStream.h"
    2929
    30 #include "core/Debug.h"
     30#include "util/Debug.h"
    3131#include "core/Error.h"
    3232
  • code/branches/core3/src/core/CMakeLists.txt

    r1574 r1586  
    77  ObjectListBase.cc
    88  OrxonoxClass.cc
    9   OutputBuffer.cc
    10   OutputHandler.cc
    119  Script.cc
    1210  SignalHandler.cc
  • code/branches/core3/src/core/ClassFactory.h

    r1583 r1586  
    4343#include "Factory.h"
    4444#include "Identifier.h"
    45 #include "Debug.h"
     45#include "util/Debug.h"
    4646
    4747namespace orxonox
  • code/branches/core3/src/core/CommandEvaluation.cc

    r1563 r1586  
    3030#include "ConsoleCommand.h"
    3131#include "Identifier.h"
    32 #include "Debug.h"
     32#include "util/Debug.h"
    3333#include "util/String.h"
    3434
  • code/branches/core3/src/core/CommandExecutor.cc

    r1505 r1586  
    3131#include "util/String.h"
    3232#include "util/Convert.h"
     33#include "util/Debug.h"
    3334#include "Identifier.h"
    3435#include "Language.h"
    35 #include "Debug.h"
    3636#include "TclBind.h"
    3737
  • code/branches/core3/src/core/ConsoleCommandCompilation.cc

    r1505 r1586  
    2929#include "ConsoleCommandCompilation.h"
    3030#include "ConsoleCommand.h"
    31 #include "Debug.h"
     31#include "util/Debug.h"
    3232#include "util/ExprParser.h"
    3333
  • code/branches/core3/src/core/Core.cc

    r1535 r1586  
    107107            this->softDebugLevel_ = this->softDebugLevelShell_;
    108108
     109        OutputHandler::setSoftDebugLevel(OutputHandler::LD_All,     this->softDebugLevel_);
     110        OutputHandler::setSoftDebugLevel(OutputHandler::LD_Console, this->softDebugLevelConsole_);
     111        OutputHandler::setSoftDebugLevel(OutputHandler::LD_Logfile, this->softDebugLevelLogfile_);
     112        OutputHandler::setSoftDebugLevel(OutputHandler::LD_Shell,   this->softDebugLevelShell_);
    109113
    110114        std::string temp = this->language_;
     
    158162            else if (device == OutputHandler::LD_Shell)
    159163                Core::getInstance().softDebugLevelShell_ = level;
     164
     165            OutputHandler::setSoftDebugLevel(device, level);
    160166        }
    161167     }
     
    199205    }
    200206}
    201 
    202 /**
    203     @brief Returns the soft debug level, stored in the only existing instance of the DebugLevel class, configured in the config-file.
    204     @return The soft debug level
    205 */
    206 int getSoftDebugLevel()
    207 {
    208     return orxonox::Core::getSoftDebugLevel();
    209 }
  • code/branches/core3/src/core/Core.h

    r1535 r1586  
    4141
    4242#include "OrxonoxClass.h"
    43 #include "OutputHandler.h"
     43#include "util/OutputHandler.h"
    4444
    4545namespace orxonox
  • code/branches/core3/src/core/CoreIncludes.h

    r1583 r1586  
    4646#include "Factory.h"
    4747#include "ClassFactory.h"
    48 #include "Debug.h"
     48#include "util/Debug.h"
    4949
    5050
  • code/branches/core3/src/core/CorePrereqs.h

    r1574 r1586  
    139139  class ObjectListBaseElement;
    140140  class OrxonoxClass;
    141   class OutputBuffer;
    142   class OutputBufferListener;
    143   class OutputHandler;
    144141  class Shell;
    145142  class ShellListener;
  • code/branches/core3/src/core/Error.cc

    r1505 r1586  
    3333
    3434#include "Error.h"
    35 #include "Debug.h"
     35#include "util/Debug.h"
    3636
    3737namespace orxonox
  • code/branches/core3/src/core/Executor.h

    r1505 r1586  
    3737#include "util/Math.h"
    3838#include "Functor.h"
    39 #include "Debug.h"
     39#include "util/Debug.h"
    4040
    4141
  • code/branches/core3/src/core/Factory.cc

    r1505 r1586  
    3434#include "Factory.h"
    3535#include "Identifier.h"
    36 #include "Debug.h"
    3736#include "BaseObject.h"
     37#include "util/Debug.h"
    3838
    3939namespace orxonox
  • code/branches/core3/src/core/Functor.h

    r1505 r1586  
    3434
    3535#include "util/MultiTypeMath.h"
    36 #include "Debug.h"
     36#include "util/Debug.h"
    3737
    3838#define MAX_FUNCTOR_ARGUMENTS 5
  • code/branches/core3/src/core/Identifier.h

    r1583 r1586  
    6060#include <utility>
    6161
    62 #include "Debug.h"
    6362#include "Iterator.h"
     63#include "util/Debug.h"
    6464#include "util/String.h"
    6565
  • code/branches/core3/src/core/Language.cc

    r1535 r1586  
    3737
    3838#include "Core.h"
    39 
    40 #include "Debug.h"
     39#include "util/Debug.h"
    4140
    4241namespace orxonox
  • code/branches/core3/src/core/Loader.cc

    r1574 r1586  
    3333#include "Iterator.h"
    3434#include "ObjectList.h"
    35 #include "Debug.h"
    3635#include "CoreIncludes.h"
    3736#include "Script.h"
    3837#include "Namespace.h"
     38#include "util/Debug.h"
    3939
    4040#include "tinyxml/ticpp.h"
  • code/branches/core3/src/core/MetaObjectList.cc

    r1574 r1586  
    3333
    3434#include "MetaObjectList.h"
    35 #include "Debug.h"
     35#include "util/Debug.h"
    3636
    3737namespace orxonox
  • code/branches/core3/src/core/NamespaceNode.cc

    r1505 r1586  
    2828
    2929#include "NamespaceNode.h"
    30 #include "Debug.h"
     30#include "util/Debug.h"
    3131
    3232namespace orxonox
  • code/branches/core3/src/core/Shell.cc

    r1540 r1586  
    3434#include "ConsoleCommand.h"
    3535#include "input/InputInterfaces.h"
     36#include "util/OutputHandler.h"
    3637
    3738#define SHELL_UPDATE_LISTENERS(function) \
     
    4344    SetConsoleCommand(Shell, clearShell, true);
    4445    SetConsoleCommand(Shell, history, true);
     46
     47    SetConsoleCommandShortcutGeneric(log,     createConsoleCommand(createFunctor(&OutputHandler::log),     "log"    ));
     48    SetConsoleCommandShortcutGeneric(error,   createConsoleCommand(createFunctor(&OutputHandler::error),   "error"  ));
     49    SetConsoleCommandShortcutGeneric(warning, createConsoleCommand(createFunctor(&OutputHandler::warning), "warning"));
     50    SetConsoleCommandShortcutGeneric(info,    createConsoleCommand(createFunctor(&OutputHandler::info),    "info"   ));
     51    SetConsoleCommandShortcutGeneric(debug,   createConsoleCommand(createFunctor(&OutputHandler::debug),   "debug"  ));
    4552
    4653    Shell::Shell()
  • code/branches/core3/src/core/Shell.h

    r1535 r1586  
    3737#include "OrxonoxClass.h"
    3838#include "input/InputBuffer.h"
    39 #include "OutputBuffer.h"
     39#include "util/OutputBuffer.h"
    4040
    4141namespace orxonox
  • code/branches/core3/src/core/SignalHandler.cc

    r1505 r1586  
    3636#include <assert.h>
    3737#include <iostream>
    38 
    39 #include "Debug.h"
    4038
    4139SignalHandler * SignalHandler::singletonRef = NULL;
  • code/branches/core3/src/core/TclBind.cc

    r1505 r1586  
    3232#include "ConsoleCommand.h"
    3333#include "CommandExecutor.h"
    34 #include "Debug.h"
    3534#include "TclThreadManager.h"
    3635#include "TclBind.h"
     36#include "util/Debug.h"
    3737#include "util/String.h"
    3838
  • code/branches/core3/src/core/TclThreadManager.cc

    r1583 r1586  
    3838#include "ConsoleCommand.h"
    3939#include "CommandExecutor.h"
    40 #include "Debug.h"
    4140#include "TclBind.h"
    4241#include "TclThreadManager.h"
     42#include "util/Debug.h"
    4343#include "util/Convert.h"
    4444
  • code/branches/core3/src/core/XMLPort.h

    r1505 r1586  
    3232#include "CorePrereqs.h"
    3333
     34#include "util/Debug.h"
    3435#include "util/XMLIncludes.h"
    3536#include "util/MultiTypeMath.h"
    3637#include "tinyxml/ticpp.h"
    3738#include "Executor.h"
    38 #include "Debug.h"
    3939#include "CoreIncludes.h"
    4040#include "BaseObject.h"
  • code/branches/core3/src/core/input/Button.cc

    r1535 r1586  
    3636#include "util/SubString.h"
    3737#include "util/String.h"
    38 #include "core/Debug.h"
     38#include "util/Debug.h"
    3939#include "core/ConsoleCommand.h"
    4040#include "core/CommandEvaluation.h"
  • code/branches/core3/src/core/input/InputManager.cc

    r1555 r1586  
    3939#include "core/CoreIncludes.h"
    4040#include "core/ConfigValueIncludes.h"
    41 #include "core/Debug.h"
    4241#include "core/CommandExecutor.h"
    4342#include "core/ConsoleCommand.h"
    4443#include "core/Shell.h"               // hack!
     44#include "util/Debug.h"
    4545
    4646#include "InputBuffer.h"
  • code/branches/core3/src/core/input/KeyBinder.cc

    r1567 r1586  
    3636#include <string>
    3737#include "util/Convert.h"
    38 #include "core/Debug.h"
     38#include "util/Debug.h"
    3939#include "core/ConfigValueIncludes.h"
    4040#include "core/CoreIncludes.h"
  • code/branches/core3/src/core/input/KeyDetector.cc

    r1535 r1586  
    3333
    3434#include "KeyDetector.h"
    35 #include "core/Debug.h"
     35#include "util/Debug.h"
    3636#include "core/CoreIncludes.h"
    3737#include "core/CommandExecutor.h"
  • code/branches/core3/src/network/ClientConnection.cc

    r1534 r1586  
    4545
    4646#include "util/Sleep.h"
    47 #include "core/Debug.h"
     47#include "util/Debug.h"
    4848
    4949namespace network
     
    9191    return getPacket(address);
    9292  }*/
    93  
     93
    9494  ENetEvent *ClientConnection::getEvent(){
    9595    if(!buffer.isEmpty())
  • code/branches/core3/src/network/PacketDecoder.cc

    r1534 r1586  
    4040#include <iostream>
    4141
    42 #include "core/Debug.h"
     42#include "util/Debug.h"
    4343
    4444namespace network
  • code/branches/core3/src/orxonox/GraphicsEngine.cc

    r1564 r1586  
    4747#include "core/CoreIncludes.h"
    4848#include "core/ConfigValueIncludes.h"
    49 #include "core/Debug.h"
    5049#include "core/CommandExecutor.h"
    5150#include "core/ConsoleCommand.h"
    5251#include "core/input/InputManager.h"
     52#include "util/Debug.h"
    5353
    5454#include "console/InGameConsole.h"
  • code/branches/core3/src/orxonox/Orxonox.cc

    r1574 r1586  
    5555#include "core/ConfigFileManager.h"
    5656#include "core/ConsoleCommand.h"
    57 #include "core/Debug.h"
    5857#include "core/Loader.h"
    5958#include "core/input/InputManager.h"
    6059#include "core/TclBind.h"
    6160#include "core/Core.h"
     61#include "util/Debug.h"
    6262
    6363// audio
  • code/branches/core3/src/orxonox/OrxonoxStableHeaders.h

    r1543 r1586  
    9292
    9393#include "util/Convert.h"
     94#include "util/Debug.h"
    9495#include "util/Math.h"
    9596#include "util/Multitype.h"
    9697#include "util/MultiTypeMath.h"
     98#include "util/OutputBuffer.h"
     99#include "util/OutputHandler.h"
    97100#include "util/Sleep.h"
    98101#include "util/String.h"
     
    104107#include "core/CoreIncludes.h"
    105108#include "core/ConfigValueIncludes.h"
    106 #include "core/Debug.h"
    107 #include "core/OutputBuffer.h"
    108 #include "core/OutputHandler.h"
    109109#include "core/Executor.h"
    110110#include "core/XMLPort.h"
  • code/branches/core3/src/orxonox/console/InGameConsole.cc

    r1571 r1586  
    3838#include <OgreStringConverter.h>
    3939
    40 #include "core/Debug.h"
    4140#include "core/CoreIncludes.h"
    4241#include "core/ConfigValueIncludes.h"
    4342#include "core/ConsoleCommand.h"
    4443#include "core/input/InputManager.h"
     44#include "util/Debug.h"
    4545#include "util/Math.h"
    4646#include "GraphicsEngine.h"
     
    457457            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.40, 0.20, 0.40, 1.00));
    458458            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(0.80, 0.60, 0.80, 1.00));
     459        }
     460        else if (colourcode == 6)
     461        {
     462            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.30, 0.20, 0.30, 1.00));
     463            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(0.50, 0.40, 0.50, 1.00));
    459464        }
    460465        else
  • code/branches/core3/src/orxonox/hud/HUD.cc

    r1568 r1586  
    3737#include <OgreStringConverter.h>
    3838
    39 #include "core/Debug.h"
     39#include "util/Debug.h"
    4040#include "core/ConsoleCommand.h"
    4141#include "objects/SpaceShip.h"
  • code/branches/core3/src/orxonox/hud/Navigation.cc

    r1568 r1586  
    4141#include "RadarOverlayElement.h"
    4242#include "HUD.h"
    43 #include "core/Debug.h"
     43#include "util/Debug.h"
    4444#include "util/Math.h"
    4545
  • code/branches/core3/src/orxonox/objects/Ambient.cc

    r1505 r1586  
    3939#include "util/Convert.h"
    4040#include "util/Math.h"
    41 #include "core/Debug.h"
     41#include "util/Debug.h"
    4242#include "core/CoreIncludes.h"
    43 #include "GraphicsEngine.h"
    4443#include "core/XMLPort.h"
    4544#include "core/ConsoleCommand.h"
     45#include "GraphicsEngine.h"
    4646
    4747namespace orxonox
     
    6868      return Synchronisable::create();
    6969    }
    70    
     70
    7171    void Ambient::registerAllVariables(){
    7272      registerVar(&ambientLight_, sizeof(ColourValue), network::DATA);
    73      
     73
    7474    }
    75    
     75
    7676    void Ambient::loadParams(TiXmlElement* xmlElem)
    7777    {
     
    9494   {
    9595        GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(colour);
    96       ambientLight_=colour;     
     96      ambientLight_=colour;
    9797   }
    9898
  • code/branches/core3/src/orxonox/objects/Camera.cc

    r1505 r1586  
    4242#include "util/Convert.h"
    4343#include "util/Math.h"
    44 #include "core/Debug.h"
     44#include "util/Debug.h"
    4545#include "core/CoreIncludes.h"
    4646#include "GraphicsEngine.h"
  • code/branches/core3/src/orxonox/objects/Skybox.cc

    r1558 r1586  
    3737#include "GraphicsEngine.h"
    3838#include "core/CoreIncludes.h"
    39 #include "core/Debug.h"
    4039#include "core/XMLPort.h"
     40#include "util/Debug.h"
    4141
    4242namespace orxonox
  • code/branches/core3/src/orxonox/objects/SpaceShip.cc

    r1574 r1586  
    3838#include "util/Convert.h"
    3939#include "util/Math.h"
     40#include "util/Debug.h"
    4041#include "core/CoreIncludes.h"
    4142#include "core/ConfigValueIncludes.h"
    42 #include "core/Debug.h"
    43 #include "GraphicsEngine.h"
    4443#include "core/input/InputManager.h"
     44#include "core/XMLPort.h"
     45#include "core/ConsoleCommand.h"
    4546#include "tools/ParticleInterface.h"
     47#include "network/Client.h"
     48#include "hud/HUD.h"
    4649#include "RotatingProjectile.h"
    4750#include "ParticleProjectile.h"
    48 #include "core/XMLPort.h"
    49 #include "core/ConsoleCommand.h"
    50 #include "network/Client.h"
    51 #include "hud/HUD.h"
     51#include "GraphicsEngine.h"
    5252
    5353namespace orxonox
  • code/branches/core3/src/util/CMakeLists.txt

    r1505 r1586  
    77  MultiTypeString.cc
    88  MultiTypeMath.cc
     9  OutputBuffer.cc
     10  OutputHandler.cc
    911  String.cc
    1012  SubString.cc
  • code/branches/core3/src/util/Convert.h

    r1505 r1586  
    4141
    4242#include "Math.h"
     43#include "Debug.h"
    4344#include "SubString.h"
    4445#include "MultiTypeMath.h"
     
    7475    enum { specialized = false };
    7576    static bool convert(ToType* output, const FromType& input)
    76     { return false; }
     77    {
     78        COUT(2) << "Warning: Couldn't convert a value." << std::endl;
     79        return false;
     80    }
    7781};
    7882
     
    139143    static bool convert(ToType* output, const FromType& input)
    140144    {
     145        COUT(2) << "Warning: Couldn't convert a value." << std::endl;
    141146        return false;
    142147    }
  • code/branches/core3/src/util/Debug.h

    r1585 r1586  
    3737#define _Debug_H__
    3838
    39 #include "CorePrereqs.h"
     39#include "UtilPrereqs.h"
    4040
    4141#include <stdio.h>
     
    4343#include "OutputHandler.h"
    4444
    45 extern "C" _CoreExport int getSoftDebugLevel();
     45
     46/**
     47    @brief Returns the soft debug level, stored in the only existing instance of the OutputHandler class, configured in the config-file.
     48    @return The soft debug level
     49*/
     50static inline int getSoftDebugLevel()
     51{
     52    return orxonox::OutputHandler::getSoftDebugLevel();
     53}
     54
    4655
    4756// DEFINE ERROR MODES
  • code/branches/core3/src/util/OutputBuffer.h

    r1574 r1586  
    3434#include <iostream>
    3535
    36 #include "CorePrereqs.h"
     36#include "UtilPrereqs.h"
    3737
    3838namespace orxonox
    3939{
    40     class _CoreExport OutputBufferListener
     40    class _UtilExport OutputBufferListener
    4141    {
    4242        friend class OutputBuffer;
     
    4949    };
    5050
    51     class _CoreExport OutputBuffer
     51    class _UtilExport OutputBuffer
    5252    {
    5353        public:
     
    5959            {
    6060                this->stream_ << object;
     61                this->callListeners();
     62                return *this;
     63            }
     64
     65            template <const OutputBuffer&>
     66            inline OutputBuffer& operator<<(const OutputBuffer& object)
     67            {
     68                this->stream_ << object.stream_;
    6169                this->callListeners();
    6270                return *this;
     
    97105            void unregisterListener(OutputBufferListener* listener);
    98106
     107            inline std::stringstream& getStream()
     108                { return this->stream_; }
     109
    99110        private:
    100111            void callListeners();
  • code/branches/core3/src/util/OutputHandler.cc

    r1574 r1586  
    3333
    3434#include "OutputHandler.h"
    35 #include "Core.h"
    36 #include "ConsoleCommand.h"
    37 #include "Shell.h"
    3835
    3936namespace orxonox
    4037{
    41     SetConsoleCommandShortcutGeneric(log,     createConsoleCommand(createFunctor(&OutputHandler::log),     "log"    ));
    42     SetConsoleCommandShortcutGeneric(error,   createConsoleCommand(createFunctor(&OutputHandler::error),   "error"  ));
    43     SetConsoleCommandShortcutGeneric(warning, createConsoleCommand(createFunctor(&OutputHandler::warning), "warning"));
    44     SetConsoleCommandShortcutGeneric(info,    createConsoleCommand(createFunctor(&OutputHandler::info),    "info"   ));
    45     SetConsoleCommandShortcutGeneric(debug,   createConsoleCommand(createFunctor(&OutputHandler::debug),   "debug"  ));
    46 
    4738    /**
    4839        @brief Constructor: Opens the logfile and writes the first line.
     
    5142    OutputHandler::OutputHandler(const std::string& logfilename)
    5243    {
     44        this->outputBuffer_ = &this->fallbackBuffer_;
     45        this->softDebugLevel_[0] = this->softDebugLevel_[1] = this->softDebugLevel_[2] = this->softDebugLevel_[3] = 2;
    5346        this->logfilename_ = logfilename;
    5447        this->logfile_.open(this->logfilename_.c_str(), std::fstream::out);
     
    7770
    7871    /**
     72        @brief Sets the soft debug level for a given output device.
     73        @param device The output device
     74        @param level The debug level
     75    */
     76    void OutputHandler::setSoftDebugLevel(OutputHandler::OutputDevice device, int level)
     77    {
     78        OutputHandler::getOutStream().softDebugLevel_[(unsigned int)device] = level;
     79    }
     80
     81    /**
    7982        @brief Returns the soft debug level for a given output device.
    8083        @param device The output device
     
    8386    int OutputHandler::getSoftDebugLevel(OutputHandler::OutputDevice device)
    8487    {
    85         return Core::getSoftDebugLevel(device);
     88        return OutputHandler::getOutStream().softDebugLevel_[(unsigned int)device];
    8689    }
    8790
    8891    /**
    89         @brief Returns the Shell's OutputBuffer. This is mere placed here to avoid
    90                recompiling the entire project when Shell.h changes.
    91         @return The OutputBuffer of the Shell
     92        @brief Sets the OutputBuffer, representing the third output stream.
     93        @param buffer The OutputBuffer
    9294    */
    93     OutputBuffer& OutputHandler::getShellOutputBuffer()
     95    void OutputHandler::setOutputBuffer(OutputBuffer& buffer)
    9496    {
    95         return Shell::getInstance().getOutputBuffer();
     97        buffer.getStream() >> this->outputBuffer_->getStream().rdbuf();
     98        this->outputBuffer_ = &buffer;
    9699    }
    97100
     
    113116
    114117        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= this->outputLevel_)
    115             Shell::getInstance().getOutputBuffer() << sb;
     118            (*this->outputBuffer_) << sb;
    116119
    117120        return *this;
     
    135138
    136139        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= this->outputLevel_)
    137             Shell::getInstance().getOutputBuffer() << manipulator;
     140            (*this->outputBuffer_) << manipulator;
    138141
    139142        return *this;
     
    157160
    158161        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= this->outputLevel_)
    159             Shell::getInstance().getOutputBuffer() << manipulator;
     162            (*this->outputBuffer_) << manipulator;
    160163
    161164        return *this;
     
    179182
    180183        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= this->outputLevel_)
    181             Shell::getInstance().getOutputBuffer() << manipulator;
     184            (*this->outputBuffer_) << manipulator;
    182185
    183186        return *this;
  • code/branches/core3/src/util/OutputHandler.h

    r1574 r1586  
    3838#define _OutputHandler_H__
    3939
    40 #include "CorePrereqs.h"
     40#include "UtilPrereqs.h"
    4141
    4242#include <iostream>
     
    4949{
    5050    //! The OutputHandler acts like std::cout, but redirects output to the console AND the logfile.
    51     class _CoreExport OutputHandler
     51    class _UtilExport OutputHandler
    5252    {
    5353        public:
    5454            enum OutputDevice
    5555            {
    56                 LD_All,
    57                 LD_Console,
    58                 LD_Logfile,
    59                 LD_Shell
     56                LD_All = 0,
     57                LD_Console = 1,
     58                LD_Logfile = 2,
     59                LD_Shell = 3
    6060            };
    6161
     
    8686                { return this->logfile_; }
    8787
     88            /** @brief Returns a pointer to the OutputBuffer. @return The OutputBuffer */
     89            inline OutputBuffer* getOutputBuffer()
     90                { return this->outputBuffer_; }
     91
    8892            /** @brief Sets the level of the incoming output. @param level The level of the incoming output @return The OutputHandler itself */
    8993            inline OutputHandler& setOutputLevel(int level)
     
    9498                { return this->outputLevel_; }
    9599
    96             static int getSoftDebugLevel(OutputHandler::OutputDevice device);
    97 
    98             OutputBuffer& getShellOutputBuffer();
     100            static void setSoftDebugLevel(OutputHandler::OutputDevice device, int level);
     101            static int getSoftDebugLevel(OutputHandler::OutputDevice device = OutputHandler::LD_All);
     102
     103            void setOutputBuffer(OutputBuffer& buffer);
    99104
    100105            template <class T>
     
    136141            OutputHandler(const OutputHandler& oh);  // don't copy
    137142            virtual ~OutputHandler();
    138             std::ofstream logfile_;     //!< The logfile where the output is logged
    139             std::string logfilename_;   //!< The name of the logfile
    140             int outputLevel_;           //!< The level of the incoming output
     143
     144            std::ofstream logfile_;              //!< The logfile where the output is logged
     145            std::string logfilename_;            //!< The name of the logfile
     146            OutputBuffer fallbackBuffer_;        //!< The OutputBuffer that gets used if there is no other OutputBuffer
     147            OutputBuffer* outputBuffer_;         //!< The OutputBuffer to put output in (usually used by the Shell)
     148            int outputLevel_;                    //!< The level of the incoming output
     149            int softDebugLevel_[4];              //!< The soft debug level for each OutputDevice - the configurable maximal output level
    141150    };
    142151
     
    159168
    160169        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= this->outputLevel_)
    161             OutputHandler::getOutStream().getShellOutputBuffer() << output;
     170            (*this->outputBuffer_) << output;
    162171
    163172        return *this;
     
    183192
    184193        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= out.getOutputLevel())
    185             OutputHandler::getOutStream().getShellOutputBuffer() << output;
     194            (*out.getOutputBuffer()) << output;
    186195
    187196        return out;
    188197    }
    189 
    190198}
    191199
  • code/branches/core3/src/util/String.h

    r1505 r1586  
    129129            std::string input = "3.14";
    130130            float f;
    131             bool success = string2Number(&f, input);
     131            bool success = FromString(&f, input);
    132132        */
    133133        template <typename T>
     
    151151            std::string input = "3.14";
    152152            float f;
    153             bool success = string2Number(&f, input, 0.000000);
     153            bool success = FromString(&f, input, 0.000000);
    154154        */
    155155        template <typename T>
  • code/branches/core3/src/util/UtilPrereqs.h

    r1505 r1586  
    6565class MultiTypeString;
    6666class MultiTypeMath;
    67 template <class T>
    68 class String2Number;
     67class OutputHandler;
    6968class SubString;
    7069
     70namespace orxonox
     71{
     72    class OutputBuffer;
     73    class OutputBufferListener;
     74}
     75
    7176#endif /* _UtilPrereqs_H__ */
Note: See TracChangeset for help on using the changeset viewer.