Pigweed
C/C++ API Reference
|
Public Types | |
using | ResultVariant = typename internal::SelectVariantType< std::make_index_sequence< sizeof...(Pendables)>, Pendables... >::type |
Public Member Functions | |
Selector (Pendables &&... pendables) | |
Creates a SingleSelector from a series of pendable values. | |
Poll< ResultVariant > | Pend (Context &cx) |
A pendable value which returns the result of the first of several pendable values to complete.
Each call to Selector::Pend
polls its pendables until one returns Ready
. If a Ready
pendable is found, its value is returned as a SelectResult
indicating the index of the completed pendable.
If no pendables are Ready
, Selector::Pend
returns a Pending
.
If every pendable provided to the Selector
has already completed, Pend
will return an AllPendablesCompleted
value indicating this.
Example usage:
|
inline |
Attempts to complete the stored pendables, returning the first one which is ready.