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

capisuite.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 CAPISUITE_H 00018 #define CAPISUITE_H 00019 00020 #include <Python.h> 00021 #include <map> 00022 #include <queue> 00023 #include <fstream> 00024 #include "../backend/applicationinterface.h" 00025 #include "applicationexception.h" 00026 #include "capisuitemodule.h" 00027 class Capi; 00028 class IdleScript; 00029 class PycStringIO_CAPI; 00030 00046 class CapiSuite: public ApplicationInterface 00047 { 00048 public: 00060 CapiSuite(int argc, char** argv); 00061 00066 ~CapiSuite(); 00067 00070 virtual void callWaiting (Connection *conn); 00071 00079 void mainLoop(); 00080 00083 void finish(); 00084 00093 void parseConfigFile(ifstream &configfile); 00094 00101 void readConfiguration(); 00102 00105 void readCommandline(int argc, char**argv); 00106 00109 void help(); 00110 00115 void reload(); 00116 00124 void logMessage(string message, int level); 00125 00132 void errorMessage(string message); 00133 00134 private: 00139 string prefix(); 00140 00146 void checkOption(string key, string value); 00147 00148 queue <Connection*> waiting; 00149 IdleScript *idle; 00150 00151 PyThreadState *py_state; 00152 PycStringIO_CAPI* save_cStringIO; 00153 Capi* capi; 00154 ostream *debug, 00155 *error; 00156 00157 unsigned short debug_level; 00158 00159 bool finish_flag; 00160 00161 bool daemonmode; 00162 00163 map<string,string> config; 00164 string custom_configfile; 00165 00166 }; 00167 00168 #endif 00169 00170 /* History 00171 00172 $Log: capisuite.h,v $ 00173 Revision 1.3 2003/02/25 13:23:19 gernot 00174 - comment fix 00175 - remove old, unused attribute 00176 00177 Revision 1.2 2003/02/21 23:21:44 gernot 00178 - follow some a little bit stricter rules of gcc-2.95.3 00179 00180 Revision 1.1.1.1 2003/02/19 08:19:53 gernot 00181 initial checkin of 0.4 00182 00183 Revision 1.8 2003/01/31 11:25:53 ghillie 00184 - moved capisuiteInstance from header to cpp (mustn't be defined in 00185 each file including capisuite.h, use extern there instead!) 00186 00187 Revision 1.7 2003/01/19 12:06:25 ghillie 00188 - new methods logMessage() and errorMessage() 00189 00190 Revision 1.6 2003/01/18 12:51:48 ghillie 00191 - added save_cStringIO attribute for Python cStringIO C API 00192 00193 Revision 1.5 2003/01/13 21:24:47 ghillie 00194 - added new method checkOption 00195 00196 Revision 1.4 2003/01/07 14:52:36 ghillie 00197 - added support for custom config files 00198 - added support for parsing commandline options 00199 00200 Revision 1.3 2003/01/06 21:00:48 ghillie 00201 - added SIGHUP support (new method reload) 00202 00203 Revision 1.2 2003/01/06 16:20:51 ghillie 00204 - updated comment 00205 00206 Revision 1.1 2003/01/05 12:28:09 ghillie 00207 - renamed FlowControl to CapiSuite 00208 - the code from main() was moved to this class 00209 00210 Revision 1.13 2003/01/04 15:58:38 ghillie 00211 - log improvements: log_level, timestamp 00212 - added finish() method 00213 - added static FlowControl pointer 00214 00215 Revision 1.12 2002/12/11 13:02:56 ghillie 00216 - executeIdleScript() removed, its function is now done by IdleScript 00217 object (changes in constructor and mainLoop()) 00218 - removed getCapi() 00219 - minor docu bugs fixed 00220 00221 Revision 1.11 2002/12/09 15:29:13 ghillie 00222 - debug stream given in constructor 00223 - doc update for callWaiting() and mainLoop() 00224 - obsolete debug() method removed 00225 00226 Revision 1.10 2002/12/06 12:54:30 ghillie 00227 -removed callCompleted() 00228 00229 Revision 1.9 2002/12/05 14:54:15 ghillie 00230 - constructor gets Capi* now 00231 - new method getCapi() 00232 - python idle script gets called with pointer to FlowControl now 00233 00234 Revision 1.8 2002/12/02 12:30:30 ghillie 00235 - constructor now takes 3 additional arguments for the scripts to use 00236 - added support for an idle script which is started in regular intervals 00237 00238 Revision 1.7 2002/11/29 10:20:44 ghillie 00239 - updated docs, use doxygen format now 00240 00241 Revision 1.6 2002/11/27 15:58:13 ghillie 00242 updated comments for doxygen 00243 00244 Revision 1.5 2002/11/19 15:57:18 ghillie 00245 - Added missing throw() declarations 00246 - phew. Added error handling. All exceptions are caught now. 00247 00248 Revision 1.4 2002/11/18 14:21:07 ghillie 00249 - moved global severity_t to ApplicationError::severity_t 00250 - added throw() declarations to header files 00251 00252 Revision 1.3 2002/11/13 08:34:54 ghillie 00253 moved history to the bottom 00254 00255 Revision 1.2 2002/10/27 12:47:20 ghillie 00256 - added multithread support for python 00257 - changed callcontrol reference to stay in the python namespace 00258 - changed ApplicationError to support differen severity 00259 00260 Revision 1.1 2002/10/25 13:29:38 ghillie 00261 grouped files into subdirectories 00262 00263 Revision 1.6 2002/10/24 09:55:52 ghillie 00264 many fixes. Works for one call now 00265 00266 Revision 1.5 2002/10/23 15:40:15 ghillie 00267 added python integration... 00268 00269 Revision 1.4 2002/10/09 14:36:22 gernot 00270 added CallModule base class for all call handling modules 00271 00272 Revision 1.3 2002/10/04 15:48:03 gernot 00273 structure changes completed & compiles now! 00274 00275 Revision 1.2 2002/10/04 13:27:15 gernot 00276 some restructuring to get it to a working state ;-) 00277 00278 does not do anything useful yet nor does it even compile... 00279 00280 Revision 1.1 2002/10/02 14:10:07 gernot 00281 first version 00282 00283 */

Generated on Sun Nov 28 14:37:44 2004 for CapiSuite by doxygen 1.3.8