This class allows to perfom polls easily over a vector of descriptors.
More...
#include <poll_table.h>
|
| PollTable () |
|
void | Add (int fd, int mask) |
| Adds a new file descriptor and mask to the vector. More...
|
|
int | Poll (int timeout=-1) |
| Peforms a poll over all the descriptors using the associated masks. More...
|
|
int | GetSize () const |
| Returns the size of the internal vector. More...
|
|
void | Remove (int fd) |
| Removes an item of the internal vector giving its file descriptor. More...
|
|
void | RemoveAt (int n) |
| Remove an item of the internal vector giving its index position. More...
|
|
PollFD & | operator[] (int n) |
| Indexing operator. More...
|
|
virtual | ~PollTable () |
|
|
vector< PollFD > | fds |
| Vector with the file descriptors and masks for polling. More...
|
|
This class allows to perfom polls easily over a vector of descriptors.
It uses an internal STL vector of PollFD
objects to handle dinamically the file descriptors and masks.
- See Also
- PollFD
net::PollTable::PollTable |
( |
| ) |
|
|
inline |
virtual net::PollTable::~PollTable |
( |
| ) |
|
|
inlinevirtual |
void net::PollTable::Add |
( |
int |
fd, |
|
|
int |
mask |
|
) |
| |
|
inline |
Adds a new file descriptor and mask to the vector.
- Parameters
-
fd | File descriptor. |
mask | Polling mask. |
int net::PollTable::GetSize |
( |
| ) |
const |
|
inline |
Returns the size of the internal vector.
PollFD& net::PollTable::operator[] |
( |
int |
n | ) |
|
|
inline |
int net::PollTable::Poll |
( |
int |
timeout = -1 | ) |
|
|
inline |
Peforms a poll over all the descriptors using the associated masks.
- Parameters
-
timeout | Time out of the poll (infinite by default). |
- Returns
- The value given by the kernel function
poll
.
void net::PollTable::Remove |
( |
int |
fd | ) |
|
|
inline |
Removes an item of the internal vector giving its file descriptor.
- Parameters
-
fd | File descriptor to remove. |
void net::PollTable::RemoveAt |
( |
int |
n | ) |
|
|
inline |
Remove an item of the internal vector giving its index position.
- Parameters
-
n | Position of the item to remove. |
vector<PollFD> net::PollTable::fds |
|
private |
Vector with the file descriptors and masks for polling.
The documentation for this class was generated from the following file: