00001 00035 #ifndef ASYNC_FD_WATCH_INCLUDED 00036 #define ASYNC_FD_WATCH_INCLUDED 00037 00038 00039 /**************************************************************************** 00040 * 00041 * System Includes 00042 * 00043 ****************************************************************************/ 00044 00045 #include <sigc++/sigc++.h> 00046 00047 00048 /**************************************************************************** 00049 * 00050 * Project Includes 00051 * 00052 ****************************************************************************/ 00053 00054 00055 00056 /**************************************************************************** 00057 * 00058 * Local Includes 00059 * 00060 ****************************************************************************/ 00061 00062 00063 00064 /**************************************************************************** 00065 * 00066 * Forward declarations 00067 * 00068 ****************************************************************************/ 00069 00070 00071 00072 /**************************************************************************** 00073 * 00074 * Namespace 00075 * 00076 ****************************************************************************/ 00077 00078 namespace Async 00079 { 00080 00081 /**************************************************************************** 00082 * 00083 * Defines & typedefs 00084 * 00085 ****************************************************************************/ 00086 00087 00088 00089 /**************************************************************************** 00090 * 00091 * Exported Global Variables 00092 * 00093 ****************************************************************************/ 00094 00095 00096 00097 /**************************************************************************** 00098 * 00099 * Class definitions 00100 * 00101 ****************************************************************************/ 00102 00119 class FdWatch : public SigC::Object 00120 { 00121 public: 00125 typedef enum 00126 { 00127 FD_WATCH_RD, 00128 FD_WATCH_WR 00129 } FdWatchType; 00130 00140 FdWatch(int fd, FdWatchType type); 00141 00145 ~FdWatch(void); 00146 00151 int fd(void) const { return m_fd; } 00152 00157 FdWatchType type(void) const { return m_type; } 00158 00164 void setEnabled(bool enabled); 00165 00170 bool isEnabled(void) const { return m_enabled; } 00171 00176 SigC::Signal1<void, FdWatch*> activity; 00177 00178 00179 protected: 00180 00181 private: 00182 int m_fd; 00183 FdWatchType m_type; 00184 bool m_enabled; 00185 00186 }; /* class FdWatch */ 00187 00188 00189 } /* namespace */ 00190 00191 #endif /* ASYNC_FD_WATCH_INCLUDED */ 00192 00193 00194 00195 /* 00196 * This file has not been truncated 00197 */ 00198