Support Class Library
A set of tools providing classes and utility
|
A class representing a stream iterator's payload. More...
#include "payload.h"
Public Types | |
using | value_type = T |
The type of value stored. More... | |
using | alternative = scl::utils::Optional< value_type > |
The type that is available to the user. More... | |
using | producer = std::function< alternative(void)> |
The type of function that produces the alternative. More... | |
Public Member Functions | |
StreamIteratorPayload (producer prod) | |
Construct a payload with its producer function. More... | |
const alternative & | value () const |
Retrieve the underlying sum type. More... | |
bool | isInvalid () const |
Determine whether or not the underlying sum type store an invalid tag. More... | |
bool | isValid () const |
Determine whether or not the underlying sum type stores a value. More... | |
Static Public Member Functions | |
static constexpr StreamIteratorPayload | withValue (const T &value) |
Create a payload with a value set. More... | |
static constexpr StreamIteratorPayload | withoutValue () |
Create a payload with an invalid tag set. More... | |
Protected Member Functions | |
void | ensureGenerated () const |
Ensure that the payload has been generated before use. More... | |
Protected Attributes | |
producer | gen |
The producer function that gives an optional result. More... | |
alternative | alt |
The optional result (as a cache) More... | |
bool | generated = false |
Computation cache flag. More... | |
A class representing a stream iterator's payload.
T | being the type of the value transported by the payload |
using scl::stream::details::StreamIteratorPayload< T >::alternative = scl::utils::Optional<value_type> |
using scl::stream::details::StreamIteratorPayload< T >::producer = std::function<alternative(void)> |
using scl::stream::details::StreamIteratorPayload< T >::value_type = T |
|
inlineexplicit |
|
inlineprotected |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
mutableprotected |
|
protected |
|
mutableprotected |