Handler structure that ExecutorBase knows about each entry to the select call.
More...
#include <Selectable.hxx>
|
| enum | SelectType { READ = 1
, WRITE = 2
, EXCEPT = 3
} |
| | Which operation this file should be selected upon. More...
|
| |
| enum | Limits { MAX_FD = (1 << 14) - 1
, MAX_PRIO = (1 << 16) - 1
} |
| | Helper declarations for the certain fields' maximums. More...
|
| |
|
| unsigned | selectType_: 2 |
| | What to watch the file for. See SelectType.
|
| |
| unsigned | fd_: 14 |
| | File descriptor to watch.
|
| |
| unsigned | priority_: 16 |
| | When the select condition is met, the Executable will be scheduled at this priority.
|
| |
| Executable * | wakeup_ |
| | This executable will be scheduled on the executor when the select condition is met.
|
| |
Handler structure that ExecutorBase knows about each entry to the select call.
See ExecutorBase::select().
Definition at line 40 of file Selectable.hxx.
◆ Limits
Helper declarations for the certain fields' maximums.
| Enumerator |
|---|
| MAX_FD | Largest FD we accept (otherwise crash with error).
|
| MAX_PRIO | Largest priority we accept (otherwise we clip).
|
Definition at line 53 of file Selectable.hxx.
◆ SelectType
Which operation this file should be selected upon.
(i.e. which fd_set the given fd is coming in).
Definition at line 45 of file Selectable.hxx.
◆ Selectable()
Constructor.
- Parameters
-
| parent | is the executable that will be woken up when this selectable is triggered. |
Definition at line 63 of file Selectable.hxx.
◆ fd()
◆ is_empty()
| bool Selectable::is_empty |
( |
| ) |
|
|
inline |
- Returns
- true if this selectable was never used before.
Definition at line 82 of file Selectable.hxx.
◆ parent()
◆ priority()
| unsigned Selectable::priority |
( |
| ) |
|
|
inline |
- Returns
- priority upon which the executable should be enqueued upon trigger.
Definition at line 88 of file Selectable.hxx.
◆ reset()
| void Selectable::reset |
( |
SelectType |
type, |
|
|
int |
fd, |
|
|
unsigned |
priority |
|
) |
| |
|
inline |
Re-initialize a Selectable preparing to add it to select().
- Parameters
-
| type | whether we waiting for READ, WRITE or EXCEPT. |
| fd | file descriptor to wait for. |
| priority | what priority should the callback be executed at once the file triggers. |
Definition at line 73 of file Selectable.hxx.
◆ set_wakeup()
Can be used to override the executable to wake up.
Make sure to set it back afterwards.
- Parameters
-
| e | is the new executable to trigger. |
Definition at line 113 of file Selectable.hxx.
◆ type()
- Returns
- what we should select this upon, READ, WRITE or EXCEPT.
Definition at line 94 of file Selectable.hxx.
◆ ExecutorBase
◆ fd_
◆ priority_
| unsigned Selectable::priority_ |
|
private |
◆ selectType_
| unsigned Selectable::selectType_ |
|
private |
◆ wakeup_
This executable will be scheduled on the executor when the select condition is met.
Definition at line 130 of file Selectable.hxx.
The documentation for this class was generated from the following file: