home *** CD-ROM | disk | FTP | other *** search
- /******************************************************************************
- *
- * $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;
- }
-