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. | |
void | ensureIndex (size_t n) const |
Throw NoValue exception if the index is wrong. | |
WithValue (const ProvidedType &value) | |
Construct value. | |
WithValue (ProvidedType &&value) | |
Construct value. | |
WithValue (const std::initializer_list< ProvidedType > &values) | |
Construct values. | |
template<typename Iterator > | |
WithValue (const Iterator &begin, const Iterator &end) | |
Construct values from iterator. | |
WithValue () | |
Create empty plask::optional value. | |
ProvidedType & | operator[] (size_t n) |
Access value value. | |
void | push_back (const ProvidedType &value) |
Add new value. | |
template<typename... Args> | |
void | emplate_back (Args &&... args) |
Add new value. | |
size_t | size () const override |
Get number of values. | |
ProvidedType | operator() (EnumType n, _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 | |
std::vector< ProvidedType > | values |
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 871 of file providerfor.hpp.
typedef ValueType plask::ProviderImpl< PropertyT, MULTI_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue::ProvidedType |
Type of provided value.
Definition at line 874 of file providerfor.hpp.
|
inlineexplicit |
Construct value.
Definition at line 891 of file providerfor.hpp.
|
inlineexplicit |
Construct value.
Definition at line 894 of file providerfor.hpp.
|
inline |
Construct values.
Definition at line 897 of file providerfor.hpp.
|
inlineexplicit |
Construct values from iterator.
Definition at line 901 of file providerfor.hpp.
|
inline |
Create empty plask::optional value.
Definition at line 904 of file providerfor.hpp.
|
inline |
|
inline |
Throw NoValue exception if the index is wrong.
n | value index |
Definition at line 886 of file providerfor.hpp.
|
inline |
Reset value to be uninitialized.
Definition at line 880 of file providerfor.hpp.
|
inlineoverride |
Get provided value.
n | value index |
NoValue | if value is empty plask::optional |
Definition at line 947 of file providerfor.hpp.
|
inline |
Access value value.
n | value index |
Definition at line 911 of file providerfor.hpp.
|
inline |
|
inlineoverride |
std::vector<ProvidedType> plask::ProviderImpl< PropertyT, MULTI_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue::values |
Provided value.
Definition at line 877 of file providerfor.hpp.