Changeset 684 for code/branches/FICN/src/orxonox/core
- Timestamp:
- Dec 26, 2007, 2:19:53 PM (17 years ago)
- Location:
- code/branches/FICN/src/orxonox/core
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/orxonox/core/CMakeLists.txt
r560 r684 12 12 ArgReader.cc 13 13 DebugLevel.cc 14 OutputHandler.cc 14 15 ) 15 16 16 17 IF(WIN32) 17 ADD_LIBRARY(core ${CORE_SRC_FILES})18 ADD_LIBRARY(core SHARED ${CORE_SRC_FILES}) 18 19 ELSE(WIN32) 19 20 ADD_LIBRARY(core SHARED ${CORE_SRC_FILES}) -
code/branches/FICN/src/orxonox/core/CorePrereqs.h
r682 r684 61 61 class SignalHandler; 62 62 63 namespace orxonox { 63 namespace orxonox 64 { 64 65 class ArgReader; 65 66 class BaseFactory; … … 86 87 class ObjectListElement; 87 88 class OrxonoxClass; 89 class OutputHandler; 88 90 template <class T> 89 91 class SubclassIdentifier; -
code/branches/FICN/src/orxonox/core/Debug.h
r682 r684 37 37 38 38 #include <stdio.h> 39 #include <iostream>39 #include "OutputHandler.h" 40 40 41 41 #include "CorePrereqs.h" … … 68 68 69 69 #define PRINT_EXEC printf 70 #define COUT_EXEC std::cout 70 //#define COUT_EXEC std::cout 71 #define COUT_EXEC orxonox::OutputHandler::getOutStream() 71 72 72 73 #ifndef PRINTF -
code/branches/FICN/src/orxonox/core/DebugLevel.cc
r682 r684 26 26 */ 27 27 28 /*! 29 @file DebugLevel.cc 30 @brief Implementation of the DebugLevel class. 31 */ 32 28 33 #include "CoreIncludes.h" 29 34 #include "Debug.h" … … 32 37 namespace orxonox 33 38 { 34 DebugLevel* DebugLevel::pointer_s = 0; 35 bool DebugLevel::bCreatingDebugLevelObject_s = false; 39 DebugLevel* DebugLevel::pointer_s = 0; // Set the static member variable pointer_s to zero 40 bool DebugLevel::bCreatingDebugLevelObject_s = false; // Set the static member variable bCreatingDebugLevelObject_s to false 36 41 42 /** 43 @brief Constructor: Registers the object and sets the debug level. 44 */ 37 45 DebugLevel::DebugLevel() 38 46 { … … 41 49 } 42 50 51 /** 52 @returns a pointer to the only existing instance of this class. 53 */ 43 54 int DebugLevel::getSoftDebugLevel() 44 55 { 45 56 if (!pointer_s && !bCreatingDebugLevelObject_s) 46 57 { 58 // We need the bCreatingDebugLevelObject_s variable to avoid an infinite recursion: 59 // Creating the object produces debug output and debug output needs the object. 47 60 bCreatingDebugLevelObject_s = true; 48 61 pointer_s = new DebugLevel; 49 62 bCreatingDebugLevelObject_s = false; 50 63 } 51 52 if (bCreatingDebugLevelObject_s) 64 else if (bCreatingDebugLevelObject_s) 53 65 return 4; 54 66 … … 57 69 } 58 70 71 /** 72 @returns the soft debug level, stored in the only existing instance of the DebugLevel class, configured in the config-file. 73 */ 59 74 int getSoftDebugLevel() 60 75 { -
code/branches/FICN/src/orxonox/core/DebugLevel.h
r682 r684 26 26 */ 27 27 28 /*! 29 @file DebugLevel.h 30 @brief Definition of the DebugLevel class. 31 32 The DebugLevel class is a singleton, only used to configure the amount of debug 33 output (see Debug.h) into the console and the log-file (see OutputHandler.h). 34 */ 35 28 36 #ifndef _DebugLevel_H__ 29 37 #define _DebugLevel_H__ … … 35 43 namespace orxonox 36 44 { 45 //! The DebugLevel class is a singleton, only used to configure the amount of debug output. 37 46 class _CoreExport DebugLevel : public OrxonoxClass 38 47 { 39 48 public: 40 DebugLevel();41 49 static int getSoftDebugLevel(); 42 50 43 51 private: 44 int softDebugLevel_s; 45 static DebugLevel* pointer_s; 46 static bool bCreatingDebugLevelObject_s; 52 DebugLevel(); // don't create 53 DebugLevel(const DebugLevel& dl) {} // don't copy 54 ~DebugLevel() {} // don't delete 55 56 int softDebugLevel_s; //!< The output level 57 static DebugLevel* pointer_s; //!< A pointer to the only existing instance of this class 58 static bool bCreatingDebugLevelObject_s; //!< True if the only instance is being created (this is needed to avoid recurstion - creating the object produces debug output, debug output needs the object) 47 59 }; 48 60 } -
code/branches/FICN/src/orxonox/core/Error.h
r682 r684 20 20 * 21 21 * Author: 22 * Fabian 'x3n' Landau22 * Nicolas Perrenoud 23 23 * Co-authors: 24 24 * ... -
code/branches/FICN/src/orxonox/core/SignalHandler.h
r682 r684 86 86 }; 87 87 88 #else /* if defined__WIN32__ */88 #else /* #ifndef __WIN32__ */ 89 89 90 90 class _CoreExport SignalHandler … … 99 99 static SignalHandler * singletonRef; 100 100 }; 101 #endif 101 #endif /* #ifndef __WIN32__ */ 102 102 103 103 #endif /* _SignalHandler_H__ */
Note: See TracChangeset
for help on using the changeset viewer.