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... > >::WithDefaultValue Struct Reference

Implementation of one value provider class which holds value inside (in value field) and operator() returns its held value. More...

`#include <plask/provider/providerfor.hpp>`

Inheritance diagram for plask::ProviderImpl< PropertyT, MULTI_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithDefaultValue:
[legend]
Collaboration diagram for plask::ProviderImpl< PropertyT, MULTI_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithDefaultValue:
[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
| WithDefaultValue (const std::initializer_list< ProvidedType > &values, const ProvidedType &defval=ProvidedType())
| Construct values.
template<typename Iterator >
| WithDefaultValue (const Iterator &begin, const Iterator &end, const ProvidedType &defval=ProvidedType())
| Construct values from iterator.
| WithDefaultValue (const ProvidedType &defval=ProvidedType())
| Construct default value.
ProvidedType & | operator[] (size_t n)
| Access value.
void | resize (size_t n)
| Change number of values.
size_t | size () const override
| Get number of values.
ProvidedType | operator() (EnumType num, _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
ProvidedType | default_value
| Default value.
std::vector< ProvidedType > | values
| Provided values.

## Detailed Description

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

Implementation of one value provider class which holds value inside (in value field) and operator() returns its held value.

It always has a value.

It ignores extra parameters.

Definition at line 798 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... > >::WithDefaultValue::ProvidedType

Type of provided value.

Definition at line 801 of file providerfor.hpp.

## Constructor & Destructor Documentation

## ◆ WithDefaultValue() [1/3]

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

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

Construct values.

Definition at line 810 of file providerfor.hpp.

## ◆ WithDefaultValue() [2/3]

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

plask::ProviderImpl< PropertyT, MULTI_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithDefaultValue::WithDefaultValue | ( | const Iterator & | begin,
|  | const Iterator & | end,
|  | const ProvidedType & | defval = `ProvidedType()`
| ) |  |
| inline explicit

Construct values from iterator.

Definition at line 814 of file providerfor.hpp.

## ◆ WithDefaultValue() [3/3]

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

plask::ProviderImpl< PropertyT, MULTI_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithDefaultValue::WithDefaultValue | ( | const ProvidedType & | defval = `ProvidedType()` | ) |
| inline

Construct default value.

Definition at line 817 of file providerfor.hpp.

## Member Function Documentation

## ◆ operator()()

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

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

Get provided value.

Returns
  provided value

Definition at line 857 of file providerfor.hpp.

## ◆ operator[]()

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

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

Access value.

Parameters

  n | value index

Returns
  reference to the value

Definition at line 824 of file providerfor.hpp.

## ◆ resize()

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

void plask::ProviderImpl< PropertyT, MULTI_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithDefaultValue::resize | ( | size_t | n | ) |
| inline

Change number of values.

Parameters

  n | number of values

Definition at line 837 of file providerfor.hpp.

## ◆ size()

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

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

Get number of values.

Returns
  number of values

Definition at line 849 of file providerfor.hpp.

## Member Data Documentation

## ◆ default_value

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

ProvidedType plask::ProviderImpl< PropertyT, MULTI_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >::WithDefaultValue::default_value

Default value.

Definition at line 804 of file providerfor.hpp.

## ◆ values

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

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

Provided values.

Definition at line 807 of file providerfor.hpp.

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

- plask/provider/providerfor.hpp