Pigweed
C/C++ API Reference
|
Public Types | |
using | OutputType = T |
Public Member Functions | |
Poll ()=delete | |
Basic constructors. | |
constexpr | Poll (const Poll &)=default |
constexpr Poll & | operator= (const Poll &)=default |
constexpr | Poll (Poll &&)=default |
constexpr Poll & | operator= (Poll &&)=default |
template<typename U , internal_poll::EnableIfImplicitlyConvertible< T, const U & > = 0> | |
constexpr | Poll (const Poll< U > &other) |
template<typename U , internal_poll::EnableIfExplicitlyConvertible< T, const U & > = 0> | |
constexpr | Poll (const Poll< U > &other) |
template<typename U , internal_poll::EnableIfImplicitlyConvertible< T, U && > = 0> | |
constexpr | Poll (Poll< U > &&other) |
template<typename U , internal_poll::EnableIfExplicitlyConvertible< T, U && > = 0> | |
constexpr | Poll (Poll< U > &&other) |
template<typename U = T, internal_poll::EnableIfImplicitlyInitializable< T, U > = 0> | |
constexpr | Poll (U &&u) |
template<typename U = T, internal_poll::EnableIfExplicitlyInitializable< T, U > = 0> | |
constexpr | Poll (U &&u) |
template<typename... Args> | |
constexpr | Poll (std::in_place_t, Args &&... args) |
constexpr | Poll (T &&value) |
constexpr Poll & | operator= (T &&value) |
constexpr | Poll (PendingType) noexcept |
constexpr Poll & | operator= (PendingType) noexcept |
constexpr bool | IsReady () const noexcept |
Returns whether or not this value is Ready . | |
constexpr bool | IsPending () const noexcept |
Returns whether or not this value is Pending . | |
constexpr Poll | Readiness () const noexcept |
constexpr T & | value () &noexcept |
constexpr const T & | value () const &noexcept |
constexpr T && | value () &&noexcept |
constexpr const T && | value () const &&noexcept |
constexpr const T * | operator-> () const noexcept |
constexpr T * | operator-> () noexcept |
constexpr const T & | operator* () const &noexcept |
constexpr T & | operator* () &noexcept |
constexpr const T && | operator* () const &&noexcept |
constexpr T && | operator* () &&noexcept |
constexpr void | IgnorePoll () const |
A value that may or may not be ready yet.
Poll<T>
most commonly appears as the return type of an function that checks the current status of an asynchronous operation. If the operation has completed, it returns with Ready(value)
. Otherwise, it returns Pending
to indicate that the operations has not yet completed, and the caller should try again in the future.
Poll<T>
itself is "plain old data" and does not change on its own. To check the current status of an operation, the caller must invoke the Poll<T>
returning function again and examine the newly returned Poll<T>
.
|
inlineconstexpr |
|
inlineconstexpr |
Ignores the Poll
value.
This method does nothing except prevent no_discard
or unused variable warnings from firing.
|
inlineconstexprnoexcept |
Returns the inner value.
This must only be called if IsReady()
returned true
.
|
inlineconstexprnoexcept |
Accesses the inner value.
This must only be called if IsReady()
returned true
.
|
inlineconstexprnoexcept |
Returns a Poll<>
without the inner value whose readiness matches that of this
.
|
inlineconstexprnoexcept |
Returns the inner value.
This must only be called if IsReady()
returned true
.