Async 1.5.0
AsyncFdWatch.h
Go to the documentation of this file.
1
35#ifndef ASYNC_FD_WATCH_INCLUDED
36#define ASYNC_FD_WATCH_INCLUDED
37
38
39/****************************************************************************
40 *
41 * System Includes
42 *
43 ****************************************************************************/
44
45#include <sigc++/sigc++.h>
46
47
48/****************************************************************************
49 *
50 * Project Includes
51 *
52 ****************************************************************************/
53
54
55
56/****************************************************************************
57 *
58 * Local Includes
59 *
60 ****************************************************************************/
61
62
63
64/****************************************************************************
65 *
66 * Forward declarations
67 *
68 ****************************************************************************/
69
70
71
72/****************************************************************************
73 *
74 * Namespace
75 *
76 ****************************************************************************/
77
78namespace Async
79{
80
81/****************************************************************************
82 *
83 * Defines & typedefs
84 *
85 ****************************************************************************/
86
87
88
89/****************************************************************************
90 *
91 * Exported Global Variables
92 *
93 ****************************************************************************/
94
95
96
97/****************************************************************************
98 *
99 * Class definitions
100 *
101 ****************************************************************************/
102
119class FdWatch : public sigc::trackable
120{
121 public:
125 typedef enum
126 {
130
137 FdWatch(void);
138
149
153 ~FdWatch(void);
154
159 int fd(void) const { return m_fd; }
160
165 FdWatchType type(void) const { return m_type; }
166
172 void setEnabled(bool enabled);
173
178 bool isEnabled(void) const { return m_enabled; }
179
190
195 sigc::signal<void, FdWatch*> activity;
196
197
198 protected:
199
200 private:
201 int m_fd;
202 FdWatchType m_type;
203 bool m_enabled;
204
205}; /* class FdWatch */
206
207
208} /* namespace */
209
210#endif /* ASYNC_FD_WATCH_INCLUDED */
211
212
213
214/*
215 * This file has not been truncated
216 */
217
A class for watching file descriptors.
Definition: AsyncFdWatch.h:120
sigc::signal< void, FdWatch * > activity
Signal to indicate that the descriptor is active.
Definition: AsyncFdWatch.h:195
FdWatchType type(void) const
Return the type of this watch.
Definition: AsyncFdWatch.h:165
~FdWatch(void)
Destructor.
FdWatch(void)
Default constructor.
int fd(void) const
Return the file descriptor being watched.
Definition: AsyncFdWatch.h:159
void setEnabled(bool enabled)
Enable or disable the watch.
FdWatchType
The type of the file descriptor watch.
Definition: AsyncFdWatch.h:126
@ FD_WATCH_RD
File descriptor watch for incoming data.
Definition: AsyncFdWatch.h:127
@ FD_WATCH_WR
File descriptor watch for outgoing data.
Definition: AsyncFdWatch.h:128
bool isEnabled(void) const
Check if the watch is enabled or not.
Definition: AsyncFdWatch.h:178
FdWatch(int fd, FdWatchType type)
Constructor.
void setFd(int fd, FdWatchType type)
Set the file descriptor to watch.
Namespace for the asynchronous programming classes.