Changeset 13672 for trunk/FACT++/src


Ignore:
Timestamp:
05/12/12 12:42:28 (13 years ago)
Author:
tbretz
Message:
Redirect the exit handler; removed obsolete fLabel; added new class for a unattended dimctrl server RemoteStream
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/RemoteControl.h

    r13286 r13672  
    5656#include "ReadlineColor.h"
    5757#include "tools.h"
     58#include "MainImp.h"
    5859
    5960template <class T>
     
    6364    MessageImp *fImp;
    6465
    65     int32_t fLabel;
     66    void SetSection(int s) { fImp->Write(Time(), "", s); }
    6667
    6768    int Write(const Time &time, const std::string &txt, int qos=kMessage)
     
    6970        return fImp ? fImp->Write(time, txt, qos) : MessageImp::Write(time, txt, qos);
    7071    }
     72
     73    void exitHandler(int code) { if (dynamic_cast<MainImp*>(fImp)) dynamic_cast<MainImp*>(fImp)->Stop(code); else exit(code); }
    7174
    7275    static void append(std::string &str)
     
    127130    // Redirect asynchronous output to the output window
    128131    RemoteControl(const char *name) : T(name),
    129         RemoteControlImp(T::GetStreamOut(), T::GetStreamIn()), fImp(0), fLabel(-1)
     132        RemoteControlImp(T::GetStreamOut(), T::GetStreamIn()), fImp(0)
    130133    {
    131134    }
     
    261264
    262265// **************************************************************************
     266/** @class RemoteStream
     267
     268 */
     269// **************************************************************************
     270#include "Console.h"
     271
     272class RemoteStream : public RemoteControl<ConsoleStream>
     273{
     274public:
     275    RemoteStream(const char *name, bool null = false)
     276        : RemoteControl<ConsoleStream>(name) { SetNullOutput(null); }
     277};
     278
     279// **************************************************************************
    263280/** @class RemoteConsole
    264281
     
    271288 */
    272289// **************************************************************************
    273 #include "Console.h"
    274290
    275291class RemoteConsole : public RemoteControl<Console>
Note: See TracChangeset for help on using the changeset viewer.