Changeset 14083 for trunk


Ignore:
Timestamp:
06/05/12 17:23:36 (12 years ago)
Author:
tbretz
Message:
Moved switching off and on of the logging before and after a sleep to Lock() and Unlock() respectively.
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

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

    r14071 r14083  
    8282}
    8383
     84void Console::Lock()
     85{
     86    // FIXME: Check missing
     87    fLogO.Display(true);
     88    fLogO.SetBacklog(false);
     89    fLogO.SetNullOutput(false);
     90}
     91
     92void Console::Unlock()
     93{
     94    // FIXME: Check missing
     95    fLogO.SetNullOutput(true);
     96    fLogO.SetBacklog(true);
     97}
     98
    8499// --------------------------------------------------------------------------
    85100//
     
    96111    if (str.substr(0, 3)==".w ")
    97112    {
    98         fLogO.Display(true);
    99         fLogO.SetBacklog(false);
    100         fLogO.SetNullOutput(false);
     113        Lock();
    101114        usleep(stoul(str.substr(3))*1000);
    102         fLogO.SetNullOutput(true);
    103         fLogO.SetBacklog(true);
     115        Unlock();
    104116        return true;
    105117    }
     
    205217// **************************************************************************
    206218
     219ConsoleStream::~ConsoleStream()
     220{
     221    fLogO.Display();
     222}
    207223
    208224// --------------------------------------------------------------------------
  • trunk/FACT++/src/Console.h

    r13771 r14083  
    1414public:
    1515    ConsoleStream(const char *name);
     16    ~ConsoleStream();
    1617
    1718    void SetNullOutput(bool null) { fLogO.SetNullOutput(null); }
     
    2425    const WindowLog &GetStreamIn()  const { return fLogO; }
    2526
     27    void Lock() { }
    2628    void Run(const char * = 0);
     29    void Unlock() { }
    2730};
    2831
     
    5962    bool PrintKeyBindings();
    6063
     64    void Lock();
    6165    bool Process(const std::string &str);
     66    void Unlock();
    6267
    6368    std::string GetLinePrompt() const;
Note: See TracChangeset for help on using the changeset viewer.