Changeset 1586 for code/branches/core3
- Timestamp:
- Jun 10, 2008, 3:35:50 PM (17 years ago)
- Location:
- code/branches/core3/src
- Files:
-
- 50 edited
- 5 moved
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core3/src/asylum/audio/_AudioObject.cc
r1505 r1586 30 30 #include <string> 31 31 32 #include " core/Debug.h"32 #include "util/Debug.h" 33 33 #include "AudioObject.h" 34 34 -
code/branches/core3/src/asylum/loader/LevelLoader.cc
r1505 r1586 31 31 #include <OgreOverlayManager.h> 32 32 33 #include "core/BaseObject.h" 33 34 #include "core/Error.h" 34 #include "core/Debug.h"35 35 #include "core/CoreIncludes.h" 36 36 37 37 #include "audio/AudioManager.h" 38 #include "core/BaseObject.h"39 38 #include "orxonox/Orxonox.h" 40 39 -
code/branches/core3/src/asylum/orxonox/SpaceshipSteering.cc
r1505 r1586 31 31 #include <OgreSceneNode.h> 32 32 33 #include " core/Debug.h"33 #include "util/Debug.h" 34 34 #include "util/Math.h" 35 35 #include "SpaceshipSteering.h" -
code/branches/core3/src/asylum/util/String2Number.h
r1505 r1586 36 36 #include <iostream> 37 37 38 #include " core/Debug.h"38 #include "util/Debug.h" 39 39 40 40 /** -
code/branches/core3/src/audio/AudioManager.cc
r1505 r1586 35 35 #include "AudioStream.h" 36 36 #include "core/Error.h" 37 #include " core/Debug.h"37 #include "util/Debug.h" 38 38 39 39 namespace audio -
code/branches/core3/src/audio/AudioStream.cc
r1505 r1586 28 28 #include "AudioStream.h" 29 29 30 #include " core/Debug.h"30 #include "util/Debug.h" 31 31 #include "core/Error.h" 32 32 -
code/branches/core3/src/core/CMakeLists.txt
r1574 r1586 7 7 ObjectListBase.cc 8 8 OrxonoxClass.cc 9 OutputBuffer.cc10 OutputHandler.cc11 9 Script.cc 12 10 SignalHandler.cc -
code/branches/core3/src/core/ClassFactory.h
r1583 r1586 43 43 #include "Factory.h" 44 44 #include "Identifier.h" 45 #include " Debug.h"45 #include "util/Debug.h" 46 46 47 47 namespace orxonox -
code/branches/core3/src/core/CommandEvaluation.cc
r1563 r1586 30 30 #include "ConsoleCommand.h" 31 31 #include "Identifier.h" 32 #include " Debug.h"32 #include "util/Debug.h" 33 33 #include "util/String.h" 34 34 -
code/branches/core3/src/core/CommandExecutor.cc
r1505 r1586 31 31 #include "util/String.h" 32 32 #include "util/Convert.h" 33 #include "util/Debug.h" 33 34 #include "Identifier.h" 34 35 #include "Language.h" 35 #include "Debug.h"36 36 #include "TclBind.h" 37 37 -
code/branches/core3/src/core/ConsoleCommandCompilation.cc
r1505 r1586 29 29 #include "ConsoleCommandCompilation.h" 30 30 #include "ConsoleCommand.h" 31 #include " Debug.h"31 #include "util/Debug.h" 32 32 #include "util/ExprParser.h" 33 33 -
code/branches/core3/src/core/Core.cc
r1535 r1586 107 107 this->softDebugLevel_ = this->softDebugLevelShell_; 108 108 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_); 109 113 110 114 std::string temp = this->language_; … … 158 162 else if (device == OutputHandler::LD_Shell) 159 163 Core::getInstance().softDebugLevelShell_ = level; 164 165 OutputHandler::setSoftDebugLevel(device, level); 160 166 } 161 167 } … … 199 205 } 200 206 } 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 level205 */206 int getSoftDebugLevel()207 {208 return orxonox::Core::getSoftDebugLevel();209 } -
code/branches/core3/src/core/Core.h
r1535 r1586 41 41 42 42 #include "OrxonoxClass.h" 43 #include " OutputHandler.h"43 #include "util/OutputHandler.h" 44 44 45 45 namespace orxonox -
code/branches/core3/src/core/CoreIncludes.h
r1583 r1586 46 46 #include "Factory.h" 47 47 #include "ClassFactory.h" 48 #include " Debug.h"48 #include "util/Debug.h" 49 49 50 50 -
code/branches/core3/src/core/CorePrereqs.h
r1574 r1586 139 139 class ObjectListBaseElement; 140 140 class OrxonoxClass; 141 class OutputBuffer;142 class OutputBufferListener;143 class OutputHandler;144 141 class Shell; 145 142 class ShellListener; -
code/branches/core3/src/core/Error.cc
r1505 r1586 33 33 34 34 #include "Error.h" 35 #include " Debug.h"35 #include "util/Debug.h" 36 36 37 37 namespace orxonox -
code/branches/core3/src/core/Executor.h
r1505 r1586 37 37 #include "util/Math.h" 38 38 #include "Functor.h" 39 #include " Debug.h"39 #include "util/Debug.h" 40 40 41 41 -
code/branches/core3/src/core/Factory.cc
r1505 r1586 34 34 #include "Factory.h" 35 35 #include "Identifier.h" 36 #include "Debug.h"37 36 #include "BaseObject.h" 37 #include "util/Debug.h" 38 38 39 39 namespace orxonox -
code/branches/core3/src/core/Functor.h
r1505 r1586 34 34 35 35 #include "util/MultiTypeMath.h" 36 #include " Debug.h"36 #include "util/Debug.h" 37 37 38 38 #define MAX_FUNCTOR_ARGUMENTS 5 -
code/branches/core3/src/core/Identifier.h
r1583 r1586 60 60 #include <utility> 61 61 62 #include "Debug.h"63 62 #include "Iterator.h" 63 #include "util/Debug.h" 64 64 #include "util/String.h" 65 65 -
code/branches/core3/src/core/Language.cc
r1535 r1586 37 37 38 38 #include "Core.h" 39 40 #include "Debug.h" 39 #include "util/Debug.h" 41 40 42 41 namespace orxonox -
code/branches/core3/src/core/Loader.cc
r1574 r1586 33 33 #include "Iterator.h" 34 34 #include "ObjectList.h" 35 #include "Debug.h"36 35 #include "CoreIncludes.h" 37 36 #include "Script.h" 38 37 #include "Namespace.h" 38 #include "util/Debug.h" 39 39 40 40 #include "tinyxml/ticpp.h" -
code/branches/core3/src/core/MetaObjectList.cc
r1574 r1586 33 33 34 34 #include "MetaObjectList.h" 35 #include " Debug.h"35 #include "util/Debug.h" 36 36 37 37 namespace orxonox -
code/branches/core3/src/core/NamespaceNode.cc
r1505 r1586 28 28 29 29 #include "NamespaceNode.h" 30 #include " Debug.h"30 #include "util/Debug.h" 31 31 32 32 namespace orxonox -
code/branches/core3/src/core/Shell.cc
r1540 r1586 34 34 #include "ConsoleCommand.h" 35 35 #include "input/InputInterfaces.h" 36 #include "util/OutputHandler.h" 36 37 37 38 #define SHELL_UPDATE_LISTENERS(function) \ … … 43 44 SetConsoleCommand(Shell, clearShell, true); 44 45 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" )); 45 52 46 53 Shell::Shell() -
code/branches/core3/src/core/Shell.h
r1535 r1586 37 37 #include "OrxonoxClass.h" 38 38 #include "input/InputBuffer.h" 39 #include " OutputBuffer.h"39 #include "util/OutputBuffer.h" 40 40 41 41 namespace orxonox -
code/branches/core3/src/core/SignalHandler.cc
r1505 r1586 36 36 #include <assert.h> 37 37 #include <iostream> 38 39 #include "Debug.h"40 38 41 39 SignalHandler * SignalHandler::singletonRef = NULL; -
code/branches/core3/src/core/TclBind.cc
r1505 r1586 32 32 #include "ConsoleCommand.h" 33 33 #include "CommandExecutor.h" 34 #include "Debug.h"35 34 #include "TclThreadManager.h" 36 35 #include "TclBind.h" 36 #include "util/Debug.h" 37 37 #include "util/String.h" 38 38 -
code/branches/core3/src/core/TclThreadManager.cc
r1583 r1586 38 38 #include "ConsoleCommand.h" 39 39 #include "CommandExecutor.h" 40 #include "Debug.h"41 40 #include "TclBind.h" 42 41 #include "TclThreadManager.h" 42 #include "util/Debug.h" 43 43 #include "util/Convert.h" 44 44 -
code/branches/core3/src/core/XMLPort.h
r1505 r1586 32 32 #include "CorePrereqs.h" 33 33 34 #include "util/Debug.h" 34 35 #include "util/XMLIncludes.h" 35 36 #include "util/MultiTypeMath.h" 36 37 #include "tinyxml/ticpp.h" 37 38 #include "Executor.h" 38 #include "Debug.h"39 39 #include "CoreIncludes.h" 40 40 #include "BaseObject.h" -
code/branches/core3/src/core/input/Button.cc
r1535 r1586 36 36 #include "util/SubString.h" 37 37 #include "util/String.h" 38 #include " core/Debug.h"38 #include "util/Debug.h" 39 39 #include "core/ConsoleCommand.h" 40 40 #include "core/CommandEvaluation.h" -
code/branches/core3/src/core/input/InputManager.cc
r1555 r1586 39 39 #include "core/CoreIncludes.h" 40 40 #include "core/ConfigValueIncludes.h" 41 #include "core/Debug.h"42 41 #include "core/CommandExecutor.h" 43 42 #include "core/ConsoleCommand.h" 44 43 #include "core/Shell.h" // hack! 44 #include "util/Debug.h" 45 45 46 46 #include "InputBuffer.h" -
code/branches/core3/src/core/input/KeyBinder.cc
r1567 r1586 36 36 #include <string> 37 37 #include "util/Convert.h" 38 #include " core/Debug.h"38 #include "util/Debug.h" 39 39 #include "core/ConfigValueIncludes.h" 40 40 #include "core/CoreIncludes.h" -
code/branches/core3/src/core/input/KeyDetector.cc
r1535 r1586 33 33 34 34 #include "KeyDetector.h" 35 #include " core/Debug.h"35 #include "util/Debug.h" 36 36 #include "core/CoreIncludes.h" 37 37 #include "core/CommandExecutor.h" -
code/branches/core3/src/network/ClientConnection.cc
r1534 r1586 45 45 46 46 #include "util/Sleep.h" 47 #include " core/Debug.h"47 #include "util/Debug.h" 48 48 49 49 namespace network … … 91 91 return getPacket(address); 92 92 }*/ 93 93 94 94 ENetEvent *ClientConnection::getEvent(){ 95 95 if(!buffer.isEmpty()) -
code/branches/core3/src/network/PacketDecoder.cc
r1534 r1586 40 40 #include <iostream> 41 41 42 #include " core/Debug.h"42 #include "util/Debug.h" 43 43 44 44 namespace network -
code/branches/core3/src/orxonox/GraphicsEngine.cc
r1564 r1586 47 47 #include "core/CoreIncludes.h" 48 48 #include "core/ConfigValueIncludes.h" 49 #include "core/Debug.h"50 49 #include "core/CommandExecutor.h" 51 50 #include "core/ConsoleCommand.h" 52 51 #include "core/input/InputManager.h" 52 #include "util/Debug.h" 53 53 54 54 #include "console/InGameConsole.h" -
code/branches/core3/src/orxonox/Orxonox.cc
r1574 r1586 55 55 #include "core/ConfigFileManager.h" 56 56 #include "core/ConsoleCommand.h" 57 #include "core/Debug.h"58 57 #include "core/Loader.h" 59 58 #include "core/input/InputManager.h" 60 59 #include "core/TclBind.h" 61 60 #include "core/Core.h" 61 #include "util/Debug.h" 62 62 63 63 // audio -
code/branches/core3/src/orxonox/OrxonoxStableHeaders.h
r1543 r1586 92 92 93 93 #include "util/Convert.h" 94 #include "util/Debug.h" 94 95 #include "util/Math.h" 95 96 #include "util/Multitype.h" 96 97 #include "util/MultiTypeMath.h" 98 #include "util/OutputBuffer.h" 99 #include "util/OutputHandler.h" 97 100 #include "util/Sleep.h" 98 101 #include "util/String.h" … … 104 107 #include "core/CoreIncludes.h" 105 108 #include "core/ConfigValueIncludes.h" 106 #include "core/Debug.h"107 #include "core/OutputBuffer.h"108 #include "core/OutputHandler.h"109 109 #include "core/Executor.h" 110 110 #include "core/XMLPort.h" -
code/branches/core3/src/orxonox/console/InGameConsole.cc
r1571 r1586 38 38 #include <OgreStringConverter.h> 39 39 40 #include "core/Debug.h"41 40 #include "core/CoreIncludes.h" 42 41 #include "core/ConfigValueIncludes.h" 43 42 #include "core/ConsoleCommand.h" 44 43 #include "core/input/InputManager.h" 44 #include "util/Debug.h" 45 45 #include "util/Math.h" 46 46 #include "GraphicsEngine.h" … … 457 457 this->consoleOverlayTextAreas_[index]->setColourTop (ColourValue(0.40, 0.20, 0.40, 1.00)); 458 458 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)); 459 464 } 460 465 else -
code/branches/core3/src/orxonox/hud/HUD.cc
r1568 r1586 37 37 #include <OgreStringConverter.h> 38 38 39 #include " core/Debug.h"39 #include "util/Debug.h" 40 40 #include "core/ConsoleCommand.h" 41 41 #include "objects/SpaceShip.h" -
code/branches/core3/src/orxonox/hud/Navigation.cc
r1568 r1586 41 41 #include "RadarOverlayElement.h" 42 42 #include "HUD.h" 43 #include " core/Debug.h"43 #include "util/Debug.h" 44 44 #include "util/Math.h" 45 45 -
code/branches/core3/src/orxonox/objects/Ambient.cc
r1505 r1586 39 39 #include "util/Convert.h" 40 40 #include "util/Math.h" 41 #include " core/Debug.h"41 #include "util/Debug.h" 42 42 #include "core/CoreIncludes.h" 43 #include "GraphicsEngine.h"44 43 #include "core/XMLPort.h" 45 44 #include "core/ConsoleCommand.h" 45 #include "GraphicsEngine.h" 46 46 47 47 namespace orxonox … … 68 68 return Synchronisable::create(); 69 69 } 70 70 71 71 void Ambient::registerAllVariables(){ 72 72 registerVar(&ambientLight_, sizeof(ColourValue), network::DATA); 73 73 74 74 } 75 75 76 76 void Ambient::loadParams(TiXmlElement* xmlElem) 77 77 { … … 94 94 { 95 95 GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(colour); 96 ambientLight_=colour; 96 ambientLight_=colour; 97 97 } 98 98 -
code/branches/core3/src/orxonox/objects/Camera.cc
r1505 r1586 42 42 #include "util/Convert.h" 43 43 #include "util/Math.h" 44 #include " core/Debug.h"44 #include "util/Debug.h" 45 45 #include "core/CoreIncludes.h" 46 46 #include "GraphicsEngine.h" -
code/branches/core3/src/orxonox/objects/Skybox.cc
r1558 r1586 37 37 #include "GraphicsEngine.h" 38 38 #include "core/CoreIncludes.h" 39 #include "core/Debug.h"40 39 #include "core/XMLPort.h" 40 #include "util/Debug.h" 41 41 42 42 namespace orxonox -
code/branches/core3/src/orxonox/objects/SpaceShip.cc
r1574 r1586 38 38 #include "util/Convert.h" 39 39 #include "util/Math.h" 40 #include "util/Debug.h" 40 41 #include "core/CoreIncludes.h" 41 42 #include "core/ConfigValueIncludes.h" 42 #include "core/Debug.h"43 #include "GraphicsEngine.h"44 43 #include "core/input/InputManager.h" 44 #include "core/XMLPort.h" 45 #include "core/ConsoleCommand.h" 45 46 #include "tools/ParticleInterface.h" 47 #include "network/Client.h" 48 #include "hud/HUD.h" 46 49 #include "RotatingProjectile.h" 47 50 #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" 52 52 53 53 namespace orxonox -
code/branches/core3/src/util/CMakeLists.txt
r1505 r1586 7 7 MultiTypeString.cc 8 8 MultiTypeMath.cc 9 OutputBuffer.cc 10 OutputHandler.cc 9 11 String.cc 10 12 SubString.cc -
code/branches/core3/src/util/Convert.h
r1505 r1586 41 41 42 42 #include "Math.h" 43 #include "Debug.h" 43 44 #include "SubString.h" 44 45 #include "MultiTypeMath.h" … … 74 75 enum { specialized = false }; 75 76 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 } 77 81 }; 78 82 … … 139 143 static bool convert(ToType* output, const FromType& input) 140 144 { 145 COUT(2) << "Warning: Couldn't convert a value." << std::endl; 141 146 return false; 142 147 } -
code/branches/core3/src/util/Debug.h
r1585 r1586 37 37 #define _Debug_H__ 38 38 39 #include " CorePrereqs.h"39 #include "UtilPrereqs.h" 40 40 41 41 #include <stdio.h> … … 43 43 #include "OutputHandler.h" 44 44 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 */ 50 static inline int getSoftDebugLevel() 51 { 52 return orxonox::OutputHandler::getSoftDebugLevel(); 53 } 54 46 55 47 56 // DEFINE ERROR MODES -
code/branches/core3/src/util/OutputBuffer.h
r1574 r1586 34 34 #include <iostream> 35 35 36 #include " CorePrereqs.h"36 #include "UtilPrereqs.h" 37 37 38 38 namespace orxonox 39 39 { 40 class _ CoreExport OutputBufferListener40 class _UtilExport OutputBufferListener 41 41 { 42 42 friend class OutputBuffer; … … 49 49 }; 50 50 51 class _ CoreExport OutputBuffer51 class _UtilExport OutputBuffer 52 52 { 53 53 public: … … 59 59 { 60 60 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_; 61 69 this->callListeners(); 62 70 return *this; … … 97 105 void unregisterListener(OutputBufferListener* listener); 98 106 107 inline std::stringstream& getStream() 108 { return this->stream_; } 109 99 110 private: 100 111 void callListeners(); -
code/branches/core3/src/util/OutputHandler.cc
r1574 r1586 33 33 34 34 #include "OutputHandler.h" 35 #include "Core.h"36 #include "ConsoleCommand.h"37 #include "Shell.h"38 35 39 36 namespace orxonox 40 37 { 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 47 38 /** 48 39 @brief Constructor: Opens the logfile and writes the first line. … … 51 42 OutputHandler::OutputHandler(const std::string& logfilename) 52 43 { 44 this->outputBuffer_ = &this->fallbackBuffer_; 45 this->softDebugLevel_[0] = this->softDebugLevel_[1] = this->softDebugLevel_[2] = this->softDebugLevel_[3] = 2; 53 46 this->logfilename_ = logfilename; 54 47 this->logfile_.open(this->logfilename_.c_str(), std::fstream::out); … … 77 70 78 71 /** 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 /** 79 82 @brief Returns the soft debug level for a given output device. 80 83 @param device The output device … … 83 86 int OutputHandler::getSoftDebugLevel(OutputHandler::OutputDevice device) 84 87 { 85 return Core::getSoftDebugLevel(device);88 return OutputHandler::getOutStream().softDebugLevel_[(unsigned int)device]; 86 89 } 87 90 88 91 /** 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 92 94 */ 93 OutputBuffer& OutputHandler::getShellOutputBuffer()95 void OutputHandler::setOutputBuffer(OutputBuffer& buffer) 94 96 { 95 return Shell::getInstance().getOutputBuffer(); 97 buffer.getStream() >> this->outputBuffer_->getStream().rdbuf(); 98 this->outputBuffer_ = &buffer; 96 99 } 97 100 … … 113 116 114 117 if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= this->outputLevel_) 115 Shell::getInstance().getOutputBuffer() << sb;118 (*this->outputBuffer_) << sb; 116 119 117 120 return *this; … … 135 138 136 139 if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= this->outputLevel_) 137 Shell::getInstance().getOutputBuffer() << manipulator;140 (*this->outputBuffer_) << manipulator; 138 141 139 142 return *this; … … 157 160 158 161 if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= this->outputLevel_) 159 Shell::getInstance().getOutputBuffer() << manipulator;162 (*this->outputBuffer_) << manipulator; 160 163 161 164 return *this; … … 179 182 180 183 if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= this->outputLevel_) 181 Shell::getInstance().getOutputBuffer() << manipulator;184 (*this->outputBuffer_) << manipulator; 182 185 183 186 return *this; -
code/branches/core3/src/util/OutputHandler.h
r1574 r1586 38 38 #define _OutputHandler_H__ 39 39 40 #include " CorePrereqs.h"40 #include "UtilPrereqs.h" 41 41 42 42 #include <iostream> … … 49 49 { 50 50 //! The OutputHandler acts like std::cout, but redirects output to the console AND the logfile. 51 class _ CoreExport OutputHandler51 class _UtilExport OutputHandler 52 52 { 53 53 public: 54 54 enum OutputDevice 55 55 { 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 60 60 }; 61 61 … … 86 86 { return this->logfile_; } 87 87 88 /** @brief Returns a pointer to the OutputBuffer. @return The OutputBuffer */ 89 inline OutputBuffer* getOutputBuffer() 90 { return this->outputBuffer_; } 91 88 92 /** @brief Sets the level of the incoming output. @param level The level of the incoming output @return The OutputHandler itself */ 89 93 inline OutputHandler& setOutputLevel(int level) … … 94 98 { return this->outputLevel_; } 95 99 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); 99 104 100 105 template <class T> … … 136 141 OutputHandler(const OutputHandler& oh); // don't copy 137 142 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 141 150 }; 142 151 … … 159 168 160 169 if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= this->outputLevel_) 161 OutputHandler::getOutStream().getShellOutputBuffer() << output;170 (*this->outputBuffer_) << output; 162 171 163 172 return *this; … … 183 192 184 193 if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= out.getOutputLevel()) 185 OutputHandler::getOutStream().getShellOutputBuffer() << output;194 (*out.getOutputBuffer()) << output; 186 195 187 196 return out; 188 197 } 189 190 198 } 191 199 -
code/branches/core3/src/util/String.h
r1505 r1586 129 129 std::string input = "3.14"; 130 130 float f; 131 bool success = string2Number(&f, input);131 bool success = FromString(&f, input); 132 132 */ 133 133 template <typename T> … … 151 151 std::string input = "3.14"; 152 152 float f; 153 bool success = string2Number(&f, input, 0.000000);153 bool success = FromString(&f, input, 0.000000); 154 154 */ 155 155 template <typename T> -
code/branches/core3/src/util/UtilPrereqs.h
r1505 r1586 65 65 class MultiTypeString; 66 66 class MultiTypeMath; 67 template <class T> 68 class String2Number; 67 class OutputHandler; 69 68 class SubString; 70 69 70 namespace orxonox 71 { 72 class OutputBuffer; 73 class OutputBufferListener; 74 } 75 71 76 #endif /* _UtilPrereqs_H__ */
Note: See TracChangeset
for help on using the changeset viewer.