Main Page | Modules | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

idlescript.h

Go to the documentation of this file.
00001 
00008 /***************************************************************************
00009  *                                                                         *
00010  *   This program is free software; you can redistribute it and/or modify  *
00011  *   it under the terms of the GNU General Public License as published by  *
00012  *   the Free Software Foundation; either version 2 of the License, or     *
00013  *   (at your option) any later version.                                   *
00014  *                                                                         *
00015  ***************************************************************************/
00016 
00017 #ifndef IDLESCRIPT_H
00018 #define IDLESCRIPT_H
00019 
00020 #include <string>
00021 #include "applicationexception.h"
00022 #include "pythonscript.h"
00023 
00024 class Capi;
00025 class PycStringIO_CAPI;
00026 
00032 void* idlescript_exec_handler(void* arg);
00033 
00039 void idlescript_cleanup_handler(void* arg);
00040 
00054 class IdleScript: public PythonScript
00055 {
00056         friend void* idlescript_exec_handler(void*);
00057         friend void idlescript_cleanup_handler(void*);
00058         public:
00071                 IdleScript(ostream &debug, unsigned short debug_level, ostream &error, Capi *capi, string idlescript, int idlescript_interval, PyThreadState *py_state, PycStringIO_CAPI* cStringIO) throw (ApplicationError);
00072 
00075                 virtual ~IdleScript(); 
00076                 
00079                 void requestTerminate(void);
00080 
00083                 void activate(void);
00084 
00085         private:
00105                 virtual void run(void) throw();
00106                 
00107                 PyThreadState *py_state; 
00108                 string idlescript; 
00109                 int idlescript_interval; 
00110                 Capi *capi; 
00111                 bool active; 
00112                 
00113                 pthread_t thread_handle; 
00114 };
00115 
00116 #endif
00117 
00118 /* History
00119 
00120 $Log: idlescript.h,v $
00121 Revision 1.1.1.1  2003/02/19 08:19:53  gernot
00122 initial checkin of 0.4
00123 
00124 Revision 1.9  2003/02/10 14:17:09  ghillie
00125 merged from NATIVE_PTHREADS to HEAD
00126 
00127 Revision 1.8.2.2  2003/02/10 14:04:57  ghillie
00128 - made destructors virtual, otherwise wrong destructor is called!
00129 
00130 Revision 1.8.2.1  2003/02/09 15:03:41  ghillie
00131 - rewritten to use native pthread_* calls instead of CommonC++ Thread
00132 
00133 Revision 1.8  2003/01/18 12:53:06  ghillie
00134 - pass on reference to Python C API to PythonScript
00135 
00136 Revision 1.7  2003/01/13 21:25:13  ghillie
00137 - improved comment for finish flag
00138 
00139 Revision 1.6  2003/01/06 21:02:56  ghillie
00140 - added support for deactivating/activating script execution w/o exiting the
00141   thread (new method activate, comment changes)
00142 
00143 Revision 1.5  2003/01/06 16:22:24  ghillie
00144 - renamed terminate() to requestTerminate() to avoid name-conflict
00145 - added finish flag
00146 
00147 Revision 1.4  2003/01/04 16:00:53  ghillie
00148 - log improvements: log_level, timestamp
00149 
00150 Revision 1.3  2002/12/14 14:02:51  ghillie
00151 - added terminate() method
00152 - added error counting code to run() to deactivate after 10 errors
00153 
00154 Revision 1.2  2002/12/11 13:04:35  ghillie
00155 - minor improvements in comments, ...
00156 
00157 Revision 1.1  2002/12/10 15:54:08  ghillie
00158 - initial checkin, will take over functionality from FlowControl::executeIdleScript()
00159 
00160 */

Generated on Sun Jan 18 11:12:46 2004 for CapiSuite by doxygen 1.3.2