AsyncQtApplication.h

Go to the documentation of this file.
00001 
00035 #ifndef ASYNC_QT_APPLICATION_INCLUDED
00036 #define ASYNC_QT_APPLICATION_INCLUDED
00037 
00038 
00039 /****************************************************************************
00040  *
00041  * System Includes
00042  *
00043  ****************************************************************************/
00044 
00045 #include <qapplication.h>
00046 #undef emit
00047 
00048 #include <utility>
00049 #include <map>
00050 #include <set>
00051 
00052 
00053 /****************************************************************************
00054  *
00055  * Project Includes
00056  *
00057  ****************************************************************************/
00058 
00059 #include <AsyncApplication.h>
00060 
00061 
00062 /****************************************************************************
00063  *
00064  * Local Includes
00065  *
00066  ****************************************************************************/
00067 
00068 
00069 
00070 /****************************************************************************
00071  *
00072  * Forward declarations
00073  *
00074  ****************************************************************************/
00075 
00076 class QSocketNotifier;
00077 class AsyncQtTimer;
00078 
00079 
00080 /****************************************************************************
00081  *
00082  * Namespace
00083  *
00084  ****************************************************************************/
00085 
00086 namespace Async
00087 {
00088 
00089 /****************************************************************************
00090  *
00091  * Defines & typedefs
00092  *
00093  ****************************************************************************/
00094 
00095 /*
00096  *----------------------------------------------------------------------------
00097  * Macro:   
00098  * Purpose: 
00099  * Input:   
00100  * Output:  
00101  * Author:  
00102  * Created: 
00103  * Remarks: 
00104  * Bugs:    
00105  *----------------------------------------------------------------------------
00106  */
00107 
00108 
00109 /*
00110  *----------------------------------------------------------------------------
00111  * Type:    
00112  * Purpose: 
00113  * Members: 
00114  * Input:   
00115  * Output:  
00116  * Author:  
00117  * Created: 
00118  * Remarks: 
00119  *----------------------------------------------------------------------------
00120  */
00121 
00122 
00123 /****************************************************************************
00124  *
00125  * Exported Global Variables
00126  *
00127  ****************************************************************************/
00128 
00129 
00130 
00131 /****************************************************************************
00132  *
00133  * Class definitions
00134  *
00135  ****************************************************************************/
00136 
00152 class QtApplication : public QApplication, public Application
00153 {
00154   Q_OBJECT
00155     
00156   public:
00165     QtApplication(int argc, char **argv);
00166 
00170     virtual ~QtApplication(void);
00171     
00179     void exec(void);
00180     
00186     void quit(void);
00187     
00188   protected:
00189     
00190   private:
00191     typedef std::pair<Async::FdWatch*, QSocketNotifier*>  FdWatchMapItem;
00192     typedef std::map<int, FdWatchMapItem>                 FdWatchMap;
00193     typedef std::map<Timer *, AsyncQtTimer *>             TimerMap;
00194     
00195     FdWatchMap  rd_watch_map;
00196     FdWatchMap  wr_watch_map;
00197     TimerMap    timer_map;
00198     
00199     void addFdWatch(FdWatch *fd_watch);
00200     void delFdWatch(FdWatch *fd_watch);
00201     void addTimer(Timer *timer);
00202     void delTimer(Timer *timer);
00203     DnsLookupWorker *newDnsLookupWorker(const std::string& label);
00204     
00205   private slots:
00206     void rdFdActivity(int socket);
00207     void wrFdActivity(int socket);
00208     
00209 };  /* class QtApplication */
00210 
00211 
00212 } /* namespace */
00213 
00214 #endif /* ASYNC_QT_APPLICATION_INCLUDED */
00215 
00216 
00217 
00218 /*
00219  * This file has not been truncated
00220  */
00221 
Generated by  doxygen 1.6.2-20100208