Thrill
0.1
|
Select is an object-oriented wrapper for select().
It takes care of the bit-fields, etc.
Definition at line 34 of file select.hpp.
#include <select.hpp>
Public Member Functions | |
Select () | |
constructor More... | |
Select & | Clear (int fd) |
Clear a file descriptor from all sets. More... | |
Select & | ClearException (int fd) |
Clear a file descriptor from the exception set. More... | |
Select & | ClearRead (int fd) |
Clear a file descriptor from the read set. More... | |
Select & | ClearWrite (int fd) |
Clear a file descriptor from the write set. More... | |
bool | InException (int fd) const |
Check if a file descriptor is in the resulting exception set. More... | |
bool | InRead (int fd) const |
Check if a file descriptor is in the resulting read set. More... | |
bool | InWrite (int fd) const |
Check if a file descriptor is in the resulting Write set. More... | |
int | select (struct timeval *timeout=nullptr) |
Do a select(), which modifies the enclosed file descriptor objects. More... | |
int | select_timeout (double timeout) |
Do a select() with timeout (in ms) More... | |
Select & | SetException (int fd) |
Add a socket to the exception selection set. More... | |
Select & | SetRead (int fd) |
Add a socket to the read and exception selection set. More... | |
Select & | SetWrite (int fd) |
Add a socket to the write and exception selection set. More... | |
Private Attributes | |
fd_set | except_set_ |
exception bit-field More... | |
int | max_fd_ = 0 |
maximum file descriptor value in bitsets More... | |
fd_set | read_set_ |
read bit-field More... | |
fd_set | write_set_ |
write bit-field More... | |
|
inline |
constructor
Definition at line 38 of file select.hpp.
References Select::except_set_, Select::read_set_, and Select::write_set_.
|
inline |
Clear a file descriptor from all sets.
Definition at line 93 of file select.hpp.
References Select::ClearException(), Select::ClearRead(), and Select::ClearWrite().
|
inline |
Clear a file descriptor from the exception set.
Definition at line 89 of file select.hpp.
References Select::except_set_.
Referenced by SelectDispatcher::Cancel(), Select::Clear(), and SelectDispatcher::DispatchOne().
|
inline |
Clear a file descriptor from the read set.
Definition at line 81 of file select.hpp.
References Select::read_set_.
Referenced by SelectDispatcher::Cancel(), Select::Clear(), and SelectDispatcher::DispatchOne().
|
inline |
Clear a file descriptor from the write set.
Definition at line 85 of file select.hpp.
References Select::write_set_.
Referenced by SelectDispatcher::Cancel(), Select::Clear(), and SelectDispatcher::DispatchOne().
|
inline |
Check if a file descriptor is in the resulting exception set.
Definition at line 77 of file select.hpp.
References Select::except_set_.
Referenced by SelectDispatcher::DispatchOne().
|
inline |
Check if a file descriptor is in the resulting read set.
Definition at line 69 of file select.hpp.
References Select::read_set_.
Referenced by SelectDispatcher::DispatchOne().
|
inline |
Check if a file descriptor is in the resulting Write set.
Definition at line 73 of file select.hpp.
References Select::write_set_.
Referenced by SelectDispatcher::DispatchOne().
|
inline |
Do a select(), which modifies the enclosed file descriptor objects.
Definition at line 97 of file select.hpp.
References Select::except_set_, Select::max_fd_, Select::read_set_, and Select::write_set_.
Referenced by Select::select_timeout().
|
inline |
Do a select() with timeout (in ms)
Definition at line 103 of file select.hpp.
References Select::select().
Referenced by SelectDispatcher::DispatchOne().
|
inline |
Add a socket to the exception selection set.
Definition at line 61 of file select.hpp.
References Select::except_set_, max(), and Select::max_fd_.
Referenced by SelectDispatcher::AddRead(), SelectDispatcher::AddWrite(), and SelectDispatcher::SetExcept().
|
inline |
Add a socket to the read and exception selection set.
Definition at line 45 of file select.hpp.
References max(), Select::max_fd_, and Select::read_set_.
Referenced by SelectDispatcher::AddRead().
|
inline |
Add a socket to the write and exception selection set.
Definition at line 53 of file select.hpp.
References max(), Select::max_fd_, and Select::write_set_.
Referenced by SelectDispatcher::AddWrite().
|
private |
exception bit-field
Definition at line 123 of file select.hpp.
Referenced by Select::ClearException(), Select::InException(), Select::Select(), Select::select(), and Select::SetException().
|
private |
maximum file descriptor value in bitsets
Definition at line 126 of file select.hpp.
Referenced by Select::select(), Select::SetException(), Select::SetRead(), and Select::SetWrite().
|
private |
read bit-field
Definition at line 117 of file select.hpp.
Referenced by Select::ClearRead(), Select::InRead(), Select::Select(), Select::select(), and Select::SetRead().
|
private |
write bit-field
Definition at line 120 of file select.hpp.
Referenced by Select::ClearWrite(), Select::InWrite(), Select::Select(), Select::select(), and Select::SetWrite().