PLaSK library

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

Template of class which is a 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::PolymorphicDelegateProvider< _BaseClass, _Res(_ArgTypes...)>:
[legend]
Collaboration diagram for plask::PolymorphicDelegateProvider< _BaseClass, _Res(_ArgTypes...)>:
[legend]

## Public Member Functions
| PolymorphicDelegateProvider ()=delete
template<typename Functor >
| PolymorphicDelegateProvider (Functor functor)
| Create delegate provider.
template<typename ClassType , typename MemberType >
| PolymorphicDelegateProvider (ClassType *object, MemberType member)
| Create delegate provider.
template<typename ... Args>
| PolymorphicDelegateProvider (Args &&... params)
| Initialize valueGetter using given parameters.
_Res | operator() (_ArgTypes... params) const override
| Call functor held by valueGetter.

## Public Attributes
std::function< _Res(_ArgTypes...)> | valueGetter
| Held external functor.

## Detailed Description

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

Template of class which is a 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 693 of file provider.hpp.

## Constructor & Destructor Documentation

## ◆ PolymorphicDelegateProvider() [1/4]

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

plask::PolymorphicDelegateProvider< _BaseClass, _Res(_ArgTypes...)>::PolymorphicDelegateProvider | ( |  | ) |
| delete

## ◆ PolymorphicDelegateProvider() [2/4]

template<typename _BaseClass , typename _Res , typename... _ArgTypes>
template<typename Functor >

plask::PolymorphicDelegateProvider< _BaseClass, _Res(_ArgTypes...)>::PolymorphicDelegateProvider | ( | Functor | functor | ) |
| inline

Create delegate provider.

Parameters

  functor | delegate functor

Definition at line 699 of file provider.hpp.

## ◆ PolymorphicDelegateProvider() [3/4]

template<typename _BaseClass , typename _Res , typename... _ArgTypes>
template<typename ClassType , typename MemberType >

plask::PolymorphicDelegateProvider< _BaseClass, _Res(_ArgTypes...)>::PolymorphicDelegateProvider | ( | ClassType * | object,
|  | MemberType | member
| ) |  |
| inline

Create delegate provider.

Parameters

  object | object of class with delegate method
  member | delegate member method

Definition at line 699 of file provider.hpp.

## ◆ PolymorphicDelegateProvider() [4/4]

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

plask::PolymorphicDelegateProvider< _BaseClass, _Res(_ArgTypes...)>::PolymorphicDelegateProvider | ( | Args &&... | params | ) |
| inline

Initialize valueGetter using given parameters.

Parameters

  params | parameters for valueGetter constructor

Definition at line 699 of file provider.hpp.

## Member Function Documentation

## ◆ operator()()

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

_Res plask::PolymorphicDelegateProvider< _BaseClass, _Res(_ArgTypes...)>::operator() | ( | _ArgTypes... | params | ) | const
| inline override

Call functor held by valueGetter.

Parameters

  params | parameters for functor held by valueGetter

Returns
  value returned by functor held by valueGetter

Definition at line 737 of file provider.hpp.

## Member Data Documentation

## ◆ valueGetter

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

std::function<_Res(_ArgTypes...)> plask::PolymorphicDelegateProvider< _BaseClass, _Res(_ArgTypes...)>::valueGetter

Held external functor.

Definition at line 697 of file provider.hpp.

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

- plask/provider/provider.hpp