PLaSK library

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
plask::DelegateProvider< _Res(_ArgTypes...)> Struct Template Reference

Template of class which is good base class for providers which delegate calls of operator() to external functor (function or method). More...

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

Inheritance diagram for plask::DelegateProvider< _Res(_ArgTypes...)>:
[legend]
Collaboration diagram for plask::DelegateProvider< _Res(_ArgTypes...)>:
[legend]

## Public Member Functions
template<typename ... Args>
| DelegateProvider (Args &&... params)
| Initialize valueGetter using given params.
virtual _Res | operator() (_ArgTypes &&... params) const
| Call functor held by valueGetter.
Public Member Functions inherited from plask::Provider
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
std::function< _Res(_ArgTypes...)> | valueGetter
| Held external functor.
Public Attributes inherited from plask::Provider
boost::signals2::signal< void(Provider &, bool)> | changed
| Signal called when providers value has been changed or provider is being deleted.

## Additional Inherited Members
Static Public Attributes inherited from plask::Provider
static constexpr const char * | NAME = "undefined"

## Detailed Description

template<typename _Res, typename... _ArgTypes>
struct plask::DelegateProvider< _Res(_ArgTypes...)>

Template of class which is good base class for providers which delegate calls of operator() to external functor (function or method).

Template Parameters

  _Res(_ArgTypes...) | functor signature (result and arguments types)

Definition at line 661 of file provider.hpp.

## Constructor & Destructor Documentation

## ◆ DelegateProvider()

template<typename _Res , typename... _ArgTypes>
template<typename ... Args>

plask::DelegateProvider< _Res(_ArgTypes...)>::DelegateProvider | ( | Args &&... | params | ) |
| inline

Initialize valueGetter using given params.

Parameters

  params | parameters for valueGetter constructor

Definition at line 664 of file provider.hpp.

## Member Function Documentation

## ◆ operator()()

template<typename _Res , typename... _ArgTypes>

virtual _Res plask::DelegateProvider< _Res(_ArgTypes...)>::operator() | ( | _ArgTypes &&... | params | ) | const
| inline virtual

Call functor held by valueGetter.

Parameters

  params | parameters for functor held by valueGetter

Returns
  value returned by functor held by valueGetter

Definition at line 680 of file provider.hpp.

## Member Data Documentation

## ◆ valueGetter

template<typename _Res , typename... _ArgTypes>

std::function<_Res(_ArgTypes...)> plask::DelegateProvider< _Res(_ArgTypes...)>::valueGetter

Held external functor.

Definition at line 664 of file provider.hpp.

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

- plask/provider/provider.hpp