PLaSK library

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
plask::Provider Struct Reference

Base class for all Providers. More...

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

Inheritance diagram for plask::Provider:
[legend]
Collaboration diagram for plask::Provider:
[legend]

## Public Member Functions
virtual const char * | name () const
Provider & | operator= (const Provider &)=delete
| Provider (const Provider &)=delete
| Provider ()=default
virtual | ~Provider ()
| Call onDisconnect for all listeners in listeners set.
void | fireChanged ()
| Call onChange for all listeners.

## Public Attributes
boost::signals2::signal< void(Provider &, bool)> | changed
| Signal called when providers value has been changed or provider is being deleted.

## Static Public Attributes
static constexpr const char * | NAME = "undefined"

## Detailed Description

Base class for all Providers.

It implements listener (observer) pattern (can be observed by Receiver).

Subclasses should only implement operator()(...) which returns provided value, or throw NoValue exception. Receiver (for given provider type) can be easy implemented by inherit Receiver class template.

See also
  Providers and receivers

Definition at line 190 of file provider.hpp.

## Constructor & Destructor Documentation

## ◆ Provider() [1/2]

plask::Provider::Provider | ( | const Provider & |  | ) |
| delete

## ◆ Provider() [2/2]

plask::Provider::Provider | ( |  | ) |
| default

## ◆ ~Provider()

virtual plask::Provider::~Provider | ( |  | ) |
| inline virtual

Call onDisconnect for all listeners in listeners set.

Definition at line 206 of file provider.hpp.

## Member Function Documentation

## ◆ fireChanged()

void plask::Provider::fireChanged | ( |  | ) |
| inline

Call onChange for all listeners.

Should be called after change of value represented by this provider.

Definition at line 214 of file provider.hpp.

## ◆ name()

virtual const char * plask::Provider::name | ( |  | ) | const
| inline virtual

Reimplemented in plask::SingleValueProvider< ValueT, ArgsT >, plask::SingleValueProvider< PropertyAt< PropertyT, SpaceT >::ValueType, _ExtraParams... >, plask::MultiValueProvider< ValueT, EnumT, ArgsT >, plask::MultiValueProvider< PropertyAt< PropertyT, SpaceT >::ValueType, PropertyT::EnumType, _ExtraParams... >, plask::FieldProvider< ValueT, SpaceT, ExtraArgs >, plask::FieldProvider< PropertyAt< PropertyT, SpaceT >::ValueType, SpaceT, _ExtraParams... >, plask::MultiFieldProvider< ValueT, SpaceT, EnumT, ExtraArgs >, plask::MultiFieldProvider< PropertyAt< PropertyT, SpaceT >::ValueType, SpaceT, PropertyT::EnumType, _ExtraParams... >, plask::ProviderImpl< PropertyT, SINGLE_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >, plask::ProviderImpl< PropertyT, MULTI_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >, plask::ProviderImpl< PropertyT, FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >, and plask::ProviderImpl< PropertyT, MULTI_FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >.

Definition at line 193 of file provider.hpp.

## ◆ operator=()

Provider & plask::Provider::operator= | ( | const Provider & |  | ) |
| delete

## Member Data Documentation

## ◆ changed

boost::signals2::signal<void(Provider&, bool)> plask::Provider::changed

Signal called when providers value has been changed or provider is being deleted.

Only in second case second parameter is `true`.

Definition at line 203 of file provider.hpp.

## ◆ NAME

constexpr const char* plask::Provider::NAME = "undefined"
| static constexpr

Definition at line 192 of file provider.hpp.

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

- plask/provider/provider.hpp