home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 7
/
FreshFishVol7.bin
/
bbs
/
gnu
/
aplusplus-1.01-src.lha
/
GNU
/
src
/
amiga
/
APlusPlus-1.01
/
TESTPRGS
/
exec
/
SigResp_test.cxx
< prev
next >
Wrap
C/C++ Source or Header
|
1994-04-23
|
1KB
|
61 lines
/******************************************************************************
*
* $Source: apphome:APlusPlus/RCS/TESTPRGS/exec/SigResp_test.cxx,v $
*
* Demo for the A++ Library
* Copyright (C) 1994 by Armin Vogt, EMail: armin@uni-paderborn.de
*
* $Revision: 1.3 $
* $Date: 1994/04/23 21:26:58 $
* $Author: Armin_Vogt $
*
******************************************************************************/
extern "C" {
#include <dos/dos.h>
}
#include <iostream.h>
#include <APlusPlus/exec/SignalResponder.h>
volatile static char rcs_id[] = "$Id: SigResp_test.cxx,v 1.3 1994/04/23 21:26:58 Armin_Vogt Exp Armin_Vogt $";
class MySRSP: public SignalResponder
{
private:
BOOL running;
public:
MySRSP() : SignalResponder(SIGBREAKB_CTRL_C,0)
{ running = TRUE; }
~MySRSP() {}
// overload the virtual 'signal received' action callback method.
void actionCallback()
{
cout << "**Break\n";
running = FALSE;
}
BOOL hasNotOccured() { return running==TRUE; }
};
int main(int argc,char *argv[])
{
MySRSP ctrlCBreak;
cout << "SignalResponder - Test: please press CTRL-c to end this programm.\n";
cout << "waiting..\n";
while ( ctrlCBreak.hasNotOccured() )
{
SignalResponder::WaitSignal();
}
cout << "Thank You. Goodbye.\n";
return 0;
}