Changeset 5996
- Timestamp:
- Oct 28, 2009, 10:47:25 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/console/src/libraries/util/OutputHandler.h
r5994 r5996 217 217 }; 218 218 219 /** 220 @brief 221 Interface for listening to output. 222 @remarks 223 Remember to register the listener (not done automatically!) 224 */ 225 class OutputListener 226 { 227 friend class OutputHandler; 228 229 public: 230 OutputListener(const std::string& name) 231 : outputStream_(NULL) 232 , name_(name) 233 {} 234 virtual ~OutputListener() {} 235 236 //! Gets called whenever output is put into the stream 237 virtual void outputChanged() {} 238 //! Returns the name of this output listener 239 const std::string& getOutputListenerName() const { return this->name_; } 240 241 protected: 242 std::ostream* outputStream_; //!< Pointer to the associated output stream, can be NULL 243 244 private: 245 const std::string name_; //!< Name of the listener, constant and unique! 246 int softDebugLevel_; //!< Current soft debug level that defines what kind of output is written to the stream 247 }; 248 219 249 template<class T> 220 250 inline OutputHandler& OutputHandler::output(const T& output) … … 233 263 return *this; 234 264 } 235 236 /**237 @brief238 Interface for listening to output.239 @remarks240 Remember to register the listener (not done automatically!)241 */242 class OutputListener243 {244 friend class OutputHandler;245 246 public:247 OutputListener(const std::string& name)248 : outputStream_(NULL)249 , name_(name)250 {}251 virtual ~OutputListener() {}252 253 //! Gets called whenever output is put into the stream254 virtual void outputChanged() {}255 //! Returns the name of this output listener256 const std::string& getOutputListenerName() const { return this->name_; }257 258 protected:259 std::ostream* outputStream_; //!< Pointer to the associated output stream, can be NULL260 261 private:262 const std::string name_; //!< Name of the listener, constant and unique!263 int softDebugLevel_; //!< Current soft debug level that defines what kind of output is written to the stream264 };265 265 } 266 266
Note: See TracChangeset
for help on using the changeset viewer.