Async 1.8.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
165
170 int fd(void) const { return m_fd; }
171
176 FdWatchType type(void) const { return m_type; }
177
183 void setEnabled(bool enabled);
184
189 bool isEnabled(void) const { return m_enabled; }
190
202
207 sigc::signal<void, FdWatch*> activity;
208
209
210 protected:
211
212 private:
213 int m_fd;
214 FdWatchType m_type;
215 bool m_enabled;
216
217}; /* class FdWatch */
218
219
220} /* namespace */
221
222#endif /* ASYNC_FD_WATCH_INCLUDED */
223
224
225
226/*
227 * This file has not been truncated
228 */
229
A class for watching file descriptors.
sigc::signal< void, FdWatch * > activity
Signal to indicate that the descriptor is active.
FdWatchType type(void) const
Return the type of this watch.
~FdWatch(void)
Destructor.
FdWatch(void)
Default constructor.
int fd(void) const
Return the file descriptor being watched.
void setEnabled(bool enabled)
Enable or disable the watch.
FdWatchType
The type of the file descriptor watch.
@ FD_WATCH_RD
File descriptor watch for incoming data.
@ FD_WATCH_WR
File descriptor watch for outgoing data.
bool isEnabled(void) const
Check if the watch is enabled or not.
FdWatch(int fd, FdWatchType type)
Constructor.
FdWatch & operator=(FdWatch &&other)
Assignment move operator.
void setFd(int fd, FdWatchType type)
Set the file descriptor to watch.
Namespace for the asynchronous programming classes.