Ignore:
Timestamp:
06/17/11 09:56:41 (13 years ago)
Author:
tbretz
Message:
Added ConsoleStream class
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/Console.cc

    r10922 r11053  
    180180    fLogO.Display(true);
    181181}
     182
     183// **************************************************************************
     184/** @class ConsoleStream
     185
     186@brief This is an extension to the Readline class provding a colored output
     187
     188This in an extension to the Readline class. It's purpose is just to have a
     189colored output stream available. It's main idea is that it is used in
     190environments without user interaction as a replacement the Console class.
     191This is interesting to be able to do everything identical as if Console
     192would be used, but Run() does not prompt but just wait until Stop()
     193was called. The advantage is that some functions of Readline can be used
     194like Execute and the history (just for Execute() commands of course)
     195
     196 */
     197// **************************************************************************
     198
     199
     200// --------------------------------------------------------------------------
     201//
     202//! Instantiate a console stream. It will create a single WindowLog object
     203//! which is returned as input and output stream.
     204//!
     205//! @param name
     206//!     The name of the program passed to the Readline constructor
     207//!
     208ConsoleStream::ConsoleStream(const char *name) : Readline(name)
     209{
     210    ReadlineColor::PrintBootMsg(fLogO, GetName());
     211}
     212
     213// --------------------------------------------------------------------------
     214//
     215//! Just usleep until Stop() was called.
     216//
     217void ConsoleStream::Run(const char *)
     218{
     219    while (!IsStopped())
     220        usleep(10000);
     221}
Note: See TracChangeset for help on using the changeset viewer.