PLaSK library

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
plask::ProviderImpl< PropertyT, MULTI_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue Struct Reference

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>`

Inheritance diagram for plask::ProviderImpl< PropertyT, MULTI_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue:
[legend]
Collaboration diagram for plask::ProviderImpl< PropertyT, MULTI_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue:
[legend]

## 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.

## Detailed Description

template<typename PropertyT, typename SpaceT, typename... _ExtraParams>
struct plask::ProviderImpl< PropertyT, MULTI_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue

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.

## Member Typedef Documentation

## ◆ ProvidedType

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>

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.

## Constructor & Destructor Documentation

## ◆ WithValue() [1/5]

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>

plask::ProviderImpl< PropertyT, MULTI_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue::WithValue | ( | const ProvidedType & | value | ) |
| inline explicit

Construct value.

Definition at line 891 of file providerfor.hpp.

## ◆ WithValue() [2/5]

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>

plask::ProviderImpl< PropertyT, MULTI_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue::WithValue | ( | ProvidedType && | value | ) |
| inline explicit

Construct value.

Definition at line 894 of file providerfor.hpp.

## ◆ WithValue() [3/5]

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>

plask::ProviderImpl< PropertyT, MULTI_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue::WithValue | ( | const std::initializer_list< ProvidedType > & | values | ) |
| inline

Construct values.

Definition at line 897 of file providerfor.hpp.

## ◆ WithValue() [4/5]

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>
template<typename Iterator >

plask::ProviderImpl< PropertyT, MULTI_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue::WithValue | ( | const Iterator & | begin,
|  | const Iterator & | end
| ) |  |
| inline explicit

Construct values from iterator.

Definition at line 901 of file providerfor.hpp.

## ◆ WithValue() [5/5]

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>

plask::ProviderImpl< PropertyT, MULTI_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue::WithValue | ( |  | ) |
| inline

Create empty plask::optional value.

Definition at line 904 of file providerfor.hpp.

## Member Function Documentation

## ◆ emplate_back()

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>
template<typename... Args>

void plask::ProviderImpl< PropertyT, MULTI_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue::emplate_back | ( | Args &&... | args | ) |
| inline

Add new value.

Parameters

  val | new value

Definition at line 929 of file providerfor.hpp.

## ◆ ensureIndex()

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>

void plask::ProviderImpl< PropertyT, MULTI_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue::ensureIndex | ( | size_t | n | ) | const
| inline

Throw NoValue exception if the index is wrong.

Parameters

  n | value index

Definition at line 886 of file providerfor.hpp.

## ◆ invalidate()

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>

void plask::ProviderImpl< PropertyT, MULTI_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue::invalidate | ( |  | ) |
| inline

Reset value to be uninitialized.

Definition at line 880 of file providerfor.hpp.

## ◆ operator()()

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>

ProvidedType plask::ProviderImpl< PropertyT, MULTI_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue::operator() | ( | EnumType | n,
|  | _ExtraParams... |
| ) |  | const
| inline override

Get provided value.

Returns
  provided value

Parameters

  n | value index

Exceptions

  NoValue | if value is empty plask::optional

Definition at line 947 of file providerfor.hpp.

## ◆ operator[]()

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>

ProvidedType & plask::ProviderImpl< PropertyT, MULTI_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue::operator[] | ( | size_t | n | ) |
| inline

Access value value.

Parameters

  n | value index

Returns
  reference to the value

Definition at line 911 of file providerfor.hpp.

## ◆ push_back()

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>

void plask::ProviderImpl< PropertyT, MULTI_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue::push_back | ( | const ProvidedType & | value | ) |
| inline

Add new value.

Parameters

  val | new value

Definition at line 920 of file providerfor.hpp.

## ◆ size()

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>

size_t plask::ProviderImpl< PropertyT, MULTI_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue::size | ( |  | ) | const
| inline override

Get number of values.

Returns
  number of values

Definition at line 937 of file providerfor.hpp.

## Member Data Documentation

## ◆ values

template<typename PropertyT , typename SpaceT , typename... _ExtraParams>

std::vector<ProvidedType> plask::ProviderImpl< PropertyT, MULTI_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithValue::values

Provided value.

Definition at line 877 of file providerfor.hpp.

The documentation for this struct was generated from the following file:

- plask/provider/providerfor.hpp