Changeset 9536 for code/branches/testing/src/libraries/util/output
- Timestamp:
- Mar 4, 2013, 10:47:26 PM (12 years ago)
- Location:
- code/branches/testing/src/libraries/util/output
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/testing/src/libraries/util/output/ConsoleWriter.cc
r9531 r9536 66 66 67 67 /** 68 @brief Returns the only existing instance of this class.69 */70 /*static*/ ConsoleWriter& ConsoleWriter::getInstance()71 {72 static ConsoleWriter instance;73 return instance;74 }75 76 /**77 68 @brief Inherited function from BaseWriter, writes output to the console using std::cout. 78 69 */ -
code/branches/testing/src/libraries/util/output/ConsoleWriter.h
r9535 r9536 54 54 virtual ~ConsoleWriter(); 55 55 56 static ConsoleWriter& getInstance();57 58 56 void enable(); 59 57 void disable(); -
code/branches/testing/src/libraries/util/output/LogWriter.cc
r8858 r9536 76 76 77 77 /** 78 @brief Returns the only existing instance of this class.79 */80 /*static*/ LogWriter& LogWriter::getInstance()81 {82 static LogWriter instance;83 return instance;84 }85 86 /**87 78 @brief Opens the log-file in order to write output to it. 88 79 */ … … 133 124 134 125 // request old output from MemoryWriter 135 MemoryWriter::getInstance().resendOutput(this);126 OutputManager::getInstance().getMemoryWriter().resendOutput(this); 136 127 } 137 128 -
code/branches/testing/src/libraries/util/output/LogWriter.h
r9535 r9536 61 61 virtual ~LogWriter(); 62 62 63 static LogWriter& getInstance();64 65 63 void setLogPath(const std::string& path); 66 64 -
code/branches/testing/src/libraries/util/output/MemoryWriter.cc
r8858 r9536 53 53 54 54 /** 55 @brief Returns the only existing instance of this singleton class.56 */57 /*static*/ MemoryWriter& MemoryWriter::getInstance()58 {59 static MemoryWriter instance;60 return instance;61 }62 63 /**64 55 @brief Implementation of the output() function inherited from OutputListener, stores the received output in memory. 65 56 */ -
code/branches/testing/src/libraries/util/output/MemoryWriter.h
r9535 r9536 71 71 virtual ~MemoryWriter(); 72 72 73 static MemoryWriter& getInstance();74 75 73 void resendOutput(OutputListener* listener) const; 76 74 void disable(); -
code/branches/testing/src/libraries/util/output/OutputManager.cc
r9533 r9536 88 88 static OutputManager& instance = OutputManager::getInstance(); 89 89 90 static MemoryWriter& memoryWriterInstance = MemoryWriter::getInstance(); (void)memoryWriterInstance; 91 static ConsoleWriter& consoleWriterInstance = ConsoleWriter::getInstance(); (void)consoleWriterInstance; 92 static LogWriter& logWriterInstance = LogWriter::getInstance(); (void)logWriterInstance; 93 90 static MemoryWriter& memoryWriterInstance = OutputManager::getInstance().getMemoryWriter(); (void)memoryWriterInstance; 91 static ConsoleWriter& consoleWriterInstance = OutputManager::getInstance().getConsoleWriter(); (void)consoleWriterInstance; 92 static LogWriter& logWriterInstance = OutputManager::getInstance().getLogWriter(); (void)logWriterInstance; 93 94 return instance; 95 } 96 97 /** 98 * @brief Returns the main instance of MemoryWriter which is managed by the OutputManager singleton. 99 * @note If OutputManager is ever un-singletonized, this instance must not remain static. 100 */ 101 MemoryWriter& OutputManager::getMemoryWriter() 102 { 103 static MemoryWriter instance; 104 return instance; 105 } 106 107 /** 108 * @brief Returns the main instance of ConsoleWriter which is managed by the OutputManager singleton. 109 * @note If OutputManager is ever un-singletonized, this instance must not remain static. 110 */ 111 ConsoleWriter& OutputManager::getConsoleWriter() 112 { 113 static ConsoleWriter instance; 114 return instance; 115 } 116 117 /** 118 * @brief Returns the main instance of LogWriter which is managed by the OutputManager singleton. 119 * @note If OutputManager is ever un-singletonized, this instance must not remain static. 120 */ 121 LogWriter& OutputManager::getLogWriter() 122 { 123 static LogWriter instance; 94 124 return instance; 95 125 } -
code/branches/testing/src/libraries/util/output/OutputManager.h
r9535 r9536 72 72 static OutputManager& getInstanceAndCreateListeners(); 73 73 74 MemoryWriter& getMemoryWriter(); 75 ConsoleWriter& getConsoleWriter(); 76 LogWriter& getLogWriter(); 77 74 78 void pushMessage(OutputLevel level, const OutputContextContainer& context, const std::string& message); 75 79
Note: See TracChangeset
for help on using the changeset viewer.