PLaSK library
|
Implementation of one value provider class which holds value inside (in value field) and operator() return its held value. More...
#include <plask/provider/providerfor.hpp>
Public Types | |
typedef ValueType | ProvidedType |
Type of provided value. | |
Public Types inherited from plask::ProviderFor< PropertyT, SpaceT > | |
typedef PropertyT | PropertyTag |
typedef SpaceT | SpaceType |
Public Member Functions | |
void | invalidate () |
Reset value to be uninitialized. | |
bool | hasValue () const |
Check if this has value / is initialized. | |
void | ensureHasValue () const |
Throw NoValue exception if value is not initialized. | |
WithValue (const ProvidedType &value) | |
Construct value. | |
WithValue (ProvidedType &&value) | |
Construct value. | |
WithValue () | |
Create empty plask::optional value. | |
WithValue & | operator= (const ValueType &v) |
Set new value. | |
ProvidedType | operator() (_ExtraParams...) const override |
Get provided value. | |
Public Member Functions inherited from plask::ProviderFor< PropertyT, SpaceT > | |
ProviderFor (Args &&... params) | |
Delegate all constructors to parent class. | |
Public Attributes | |
plask::optional< ProvidedType > | value |
Provided value. | |
Implementation of one value provider class which holds value inside (in value field) and operator() return its held value.
Its value is optional and can throw exception if value was not assigned before requesting it.
It ignores extra parameters.
Definition at line 704 of file providerfor.hpp.
typedef ValueType plask::ProviderImpl< PropertyT, SINGLE_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue::ProvidedType |
Type of provided value.
Definition at line 707 of file providerfor.hpp.
|
inline |
Construct value.
Definition at line 727 of file providerfor.hpp.
|
inline |
Construct value.
Definition at line 730 of file providerfor.hpp.
|
inline |
Create empty plask::optional value.
Definition at line 733 of file providerfor.hpp.
|
inline |
Throw NoValue exception if value is not initialized.
Definition at line 722 of file providerfor.hpp.
|
inline |
Check if this has value / is initialized.
true
only if this is initialized (has value) Definition at line 719 of file providerfor.hpp.
|
inline |
Reset value to be uninitialized.
Definition at line 713 of file providerfor.hpp.
|
inlineoverride |
Get provided value.
NoValue | if value is empty plask::optional |
Definition at line 750 of file providerfor.hpp.
|
inline |
plask::optional<ProvidedType> plask::ProviderImpl< PropertyT, SINGLE_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue::value |
Provided value.
Definition at line 710 of file providerfor.hpp.