31#if !defined(ARDUINO) || defined(ESP8266) || defined(ESP32)
41 template<
typename R,
typename... P>
42 R IRAM_ATTR vPtrToFunPtrExec(
void* fn, P... args)
44 using target_type = R(P...);
55#if !defined(ARDUINO) || defined(ESP8266) || defined(ESP32)
56 template<
typename A,
typename R,
typename... P>
81 functional.~FunctionType();
107 if (
FUNC == del.kind)
111 else if (
FPA == del.kind)
125 DelegatePImpl::fnA = fnA;
126 new (&this->obj) A(
obj);
132 DelegatePImpl::fnA = fnA;
139 DelegatePImpl::fn = fn;
150 if (
this == &del)
return *
this;
155 functional.~FunctionType();
173 functional = del.functional;
189 if (
this == &del)
return *
this;
190 if (
kind != del.kind)
194 functional.~FunctionType();
200 if (
FUNC == del.kind)
204 else if (
FPA == del.kind)
210 if (
FUNC == del.kind)
214 else if (
FPA == del.kind)
230 functional.~FunctionType();
245 functional.~FunctionType();
256 operator bool()
const
268 return functional ? true :
false;
283 return vPtrToFunPtrExec<R, P...>;
291 return [](
void* self, P... args) -> R
302 return reinterpret_cast<void*
>(fn);
354 template<
typename A,
typename R,
typename... P>
355 class DelegatePImpl {
406 DelegatePImpl::fnA = fnA;
413 DelegatePImpl::fnA = fnA;
420 DelegatePImpl::fn = fn;
431 if (
this == &del)
return *
this;
432 if (
kind != del.kind)
454 if (
this == &del)
return *
this;
455 if (
kind != del.kind)
497 operator bool()
const
520 return vPtrToFunPtrExec<R, P...>;
532 return reinterpret_cast<void*
>(fn);
562#if !defined(ARDUINO) || defined(ESP8266) || defined(ESP32)
563 template<
typename R,
typename... P>
587 functional.~FunctionType();
593 if (
FUNC == del.kind)
606 if (
FUNC == del.kind)
619 DelegatePImpl::fn =
fn;
630 if (
this == &del)
return *
this;
633 functional.~FunctionType();
640 if (
FUNC == del.kind)
642 functional = del.functional;
653 if (
this == &del)
return *
this;
656 functional.~FunctionType();
663 if (
FUNC == del.kind)
678 functional.~FunctionType();
681 DelegatePImpl::fn =
fn;
689 functional.~FunctionType();
696 operator bool()
const
704 return functional ? true :
false;
712 return vPtrToFunPtrExec<R, P...>;
716 return [](
void* self, P... args) -> R
727 return reinterpret_cast<void*
>(
fn);
767 template<
typename R,
typename... P>
768 class DelegatePImpl<void, R, P...> {
797 DelegatePImpl::fn =
fn;
807 if (
this == &del)
return *
this;
814 if (
this == &del)
return *
this;
821 DelegatePImpl::fn =
fn;
831 operator bool()
const
838 return vPtrToFunPtrExec<R, P...>;
843 return reinterpret_cast<void*
>(
fn);
856#if !defined(ARDUINO) || defined(ESP8266) || defined(ESP32)
857 template<
typename A,
typename R>
882 functional.~FunctionType();
908 if (
FUNC == del.kind)
912 else if (
FPA == del.kind)
926 DelegateImpl::fnA = fnA;
927 new (&this->obj) A(
obj);
933 DelegateImpl::fnA = fnA;
940 DelegateImpl::fn = fn;
951 if (
this == &del)
return *
this;
956 functional.~FunctionType();
974 functional = del.functional;
990 if (
this == &del)
return *
this;
991 if (
kind != del.kind)
995 functional.~FunctionType();
1001 if (
FUNC == del.kind)
1005 else if (
FPA == del.kind)
1011 if (
FUNC == del.kind)
1015 else if (
FPA == del.kind)
1031 functional.~FunctionType();
1046 functional.~FunctionType();
1057 operator bool()
const
1069 return functional ? true :
false;
1083 return reinterpret_cast<FunVPPtr>(fn);
1091 return [](
void* self) -> R
1118 return [
this]() {
return fnA(
obj); };
1138 return functional();
1154 template<
typename A,
typename R>
1155 class DelegateImpl {
1178 if (
FPA == del.kind)
1192 if (
FPA == del.kind)
1206 DelegateImpl::fnA = fnA;
1213 DelegateImpl::fnA = fnA;
1220 DelegateImpl::fn = fn;
1231 if (
this == &del)
return *
this;
1232 if (
kind != del.kind)
1240 if (
FPA == del.kind)
1254 if (
this == &del)
return *
this;
1255 if (
kind != del.kind)
1263 if (
FPA == del.kind)
1297 operator bool()
const
1319 return reinterpret_cast<FunVPPtr>(fn);
1361#if !defined(ARDUINO) || defined(ESP8266) || defined(ESP32)
1362 template<
typename R>
1386 functional.~FunctionType();
1392 if (
FUNC == del.kind)
1405 if (
FUNC == del.kind)
1418 DelegateImpl::fn =
fn;
1429 if (
this == &del)
return *
this;
1432 functional.~FunctionType();
1439 if (
FUNC == del.kind)
1441 functional = del.functional;
1452 if (
this == &del)
return *
this;
1455 functional.~FunctionType();
1462 if (
FUNC == del.kind)
1477 functional.~FunctionType();
1480 DelegateImpl::fn =
fn;
1488 functional.~FunctionType();
1495 operator bool()
const
1503 return functional ? true :
false;
1515 return [](
void* self) -> R
1554 return functional();
1566 template<
typename R>
1567 class DelegateImpl<void, R> {
1596 DelegateImpl::fn =
fn;
1606 if (
this == &del)
return *
this;
1613 if (
this == &del)
return *
this;
1620 DelegateImpl::fn =
fn;
1630 operator bool()
const
1655 template<
typename A = void,
typename R = void,
typename... P>
1664#if !defined(ARDUINO) || defined(ESP8266) || defined(ESP32)
1673#if !defined(ARDUINO) || defined(ESP8266) || defined(ESP32)
1716 template<
typename A,
typename R,
typename... P>
1725#if !defined(ARDUINO) || defined(ESP8266) || defined(ESP32)
1743#if !defined(ARDUINO) || defined(ESP8266) || defined(ESP32)
1795 template<
typename R,
typename... P>
1802#if !defined(ARDUINO) || defined(ESP8266) || defined(ESP32)
1812#if !defined(ARDUINO) || defined(ESP8266) || defined(ESP32)
1851 template<
typename A,
typename R>
1860#if !defined(ARDUINO) || defined(ESP8266) || defined(ESP32)
1869#if !defined(ARDUINO) || defined(ESP8266) || defined(ESP32)
1912 template<
typename A,
typename R>
1921#if !defined(ARDUINO) || defined(ESP8266) || defined(ESP32)
1939#if !defined(ARDUINO) || defined(ESP8266) || defined(ESP32)
1991 template<
typename R>
1998#if !defined(ARDUINO) || defined(ESP8266) || defined(ESP32)
2008#if !defined(ARDUINO) || defined(ESP8266) || defined(ESP32)
2049template<
typename A = void,
typename R = void,
typename... P>
class Delegate;
Delegate(const Delegate &del)
Definition Delegate.h:2057
Delegate & operator=(typename delegate::detail::Delegate< A, R, P... >::FunPtr fn)
Definition Delegate.h:2081
Delegate & operator=(const Delegate &del)
Definition Delegate.h:2071
Delegate &IRAM_ATTR operator=(std::nullptr_t)
Definition Delegate.h:2086
Delegate(F functional)
Definition Delegate.h:2069
Delegate(typename delegate::detail::Delegate< A, R, P... >::FunAPtr fnA, const A &obj)
Definition Delegate.h:2063
Delegate(Delegate &&del)
Definition Delegate.h:2060
Delegate(typename delegate::detail::Delegate< A, R, P... >::FunAPtr fnA, A &&obj)
Definition Delegate.h:2065
Delegate(typename delegate::detail::Delegate< A, R, P... >::FunPtr fn)
Definition Delegate.h:2067
Delegate(std::nullptr_t)
Definition Delegate.h:2055
Delegate & operator=(Delegate &&del)
Definition Delegate.h:2076
Delegate()
Definition Delegate.h:2053
Delegate(Delegate &&del)
Definition Delegate.h:2102
Delegate(const Delegate &del)
Definition Delegate.h:2099
Delegate(typename delegate::detail::Delegate< void, R, P... >::FunPtr fn)
Definition Delegate.h:2105
Delegate & operator=(typename delegate::detail::Delegate< void, R, P... >::FunPtr fn)
Definition Delegate.h:2119
Delegate(F functional)
Definition Delegate.h:2107
Delegate & operator=(Delegate &&del)
Definition Delegate.h:2114
Delegate()
Definition Delegate.h:2095
Delegate(std::nullptr_t)
Definition Delegate.h:2097
Delegate & operator=(const Delegate &del)
Definition Delegate.h:2109
Delegate &IRAM_ATTR operator=(std::nullptr_t)
Definition Delegate.h:2124
Definition Delegate.h:2049
Delegate(const Delegate &del)
Definition Delegate.h:1877
target_type * FunPtr
Definition Delegate.h:1857
Delegate(FunAPtr fnA, A &&obj)
Definition Delegate.h:1885
R() target_type
Definition Delegate.h:1855
Delegate(Delegate &&del)
Definition Delegate.h:1880
Delegate & operator=(const Delegate &del)
Definition Delegate.h:1891
R(*)(void *) FunVPPtr
Definition Delegate.h:1859
Delegate & operator=(Delegate &&del)
Definition Delegate.h:1896
Delegate(std::nullptr_t)
Definition Delegate.h:1875
Delegate(FunPtr fn)
Definition Delegate.h:1887
Delegate(FunAPtr fnA, const A &obj)
Definition Delegate.h:1883
Delegate()
Definition Delegate.h:1873
Delegate(F functional)
Definition Delegate.h:1889
R(*)(A) FunAPtr
Definition Delegate.h:1858
std::function< target_type > FunctionType
Definition Delegate.h:1861
Delegate & operator=(FunPtr fn)
Definition Delegate.h:1901
Delegate &IRAM_ATTR operator=(std::nullptr_t)
Definition Delegate.h:1906
void * arg() const
Definition Delegate.h:1746
R(P...) target_type
Definition Delegate.h:1720
Delegate()
Definition Delegate.h:1758
R(*)(A *, P...) FunAPtr
Definition Delegate.h:1723
Delegate(const Delegate &del)
Definition Delegate.h:1762
Delegate & operator=(FunPtr fn)
Definition Delegate.h:1784
Delegate(std::nullptr_t)
Definition Delegate.h:1760
Delegate & operator=(const Delegate &del)
Definition Delegate.h:1774
Delegate &IRAM_ATTR operator=(std::nullptr_t)
Definition Delegate.h:1789
std::function< target_type > FunctionType
Definition Delegate.h:1726
Delegate(FunPtr fn)
Definition Delegate.h:1770
Delegate(F functional)
Definition Delegate.h:1772
R(*)(void *, P...) FunVPPtr
Definition Delegate.h:1724
Delegate(FunAPtr fnA, A *obj)
Definition Delegate.h:1768
Delegate & operator=(Delegate &&del)
Definition Delegate.h:1779
target_type * FunPtr
Definition Delegate.h:1722
Delegate(Delegate &&del)
Definition Delegate.h:1765
R() target_type
Definition Delegate.h:1916
Delegate(FunPtr fn)
Definition Delegate.h:1966
Delegate()
Definition Delegate.h:1954
R(*)(void *) FunVPPtr
Definition Delegate.h:1920
void * arg() const
Definition Delegate.h:1942
target_type * FunPtr
Definition Delegate.h:1918
std::function< target_type > FunctionType
Definition Delegate.h:1922
Delegate & operator=(const Delegate &del)
Definition Delegate.h:1970
Delegate(FunAPtr fnA, A *obj)
Definition Delegate.h:1964
R(*)(A *) FunAPtr
Definition Delegate.h:1919
Delegate &IRAM_ATTR operator=(std::nullptr_t)
Definition Delegate.h:1985
Delegate(const Delegate &del)
Definition Delegate.h:1958
Delegate & operator=(FunPtr fn)
Definition Delegate.h:1980
Delegate(Delegate &&del)
Definition Delegate.h:1961
Delegate(F functional)
Definition Delegate.h:1968
Delegate & operator=(Delegate &&del)
Definition Delegate.h:1975
Delegate(std::nullptr_t)
Definition Delegate.h:1956
Delegate & operator=(FunPtr fn)
Definition Delegate.h:1840
Delegate & operator=(const Delegate &del)
Definition Delegate.h:1830
Delegate(Delegate &&del)
Definition Delegate.h:1823
Delegate(std::nullptr_t)
Definition Delegate.h:1818
Delegate(const Delegate &del)
Definition Delegate.h:1820
Delegate(F functional)
Definition Delegate.h:1828
R(P...) target_type
Definition Delegate.h:1799
Delegate()
Definition Delegate.h:1816
Delegate(FunPtr fn)
Definition Delegate.h:1826
Delegate & operator=(Delegate &&del)
Definition Delegate.h:1835
std::function< target_type > FunctionType
Definition Delegate.h:1803
R(*)(void *, P...) FunVPPtr
Definition Delegate.h:1805
target_type * FunPtr
Definition Delegate.h:1801
Delegate &IRAM_ATTR operator=(std::nullptr_t)
Definition Delegate.h:1845
Delegate(std::nullptr_t)
Definition Delegate.h:2014
Delegate(Delegate &&del)
Definition Delegate.h:2019
R() target_type
Definition Delegate.h:1995
target_type * FunPtr
Definition Delegate.h:1997
Delegate()
Definition Delegate.h:2012
Delegate(FunPtr fn)
Definition Delegate.h:2022
Delegate &IRAM_ATTR operator=(std::nullptr_t)
Definition Delegate.h:2041
Delegate(F functional)
Definition Delegate.h:2024
Delegate & operator=(const Delegate &del)
Definition Delegate.h:2026
R(*)(void *) FunVPPtr
Definition Delegate.h:2001
Delegate & operator=(Delegate &&del)
Definition Delegate.h:2031
Delegate & operator=(FunPtr fn)
Definition Delegate.h:2036
Delegate(const Delegate &del)
Definition Delegate.h:2016
std::function< target_type > FunctionType
Definition Delegate.h:1999
Definition Delegate.h:1657
std::function< target_type > FunctionType
Definition Delegate.h:1665
Delegate & operator=(Delegate &&del)
Definition Delegate.h:1700
Delegate(FunAPtr fnA, const A &obj)
Definition Delegate.h:1687
Delegate(std::nullptr_t)
Definition Delegate.h:1679
R(P...) target_type
Definition Delegate.h:1659
R(*)(void *, P...) FunVPPtr
Definition Delegate.h:1663
Delegate(F functional)
Definition Delegate.h:1693
Delegate & operator=(FunPtr fn)
Definition Delegate.h:1705
Delegate(Delegate &&del)
Definition Delegate.h:1684
R(*)(A, P...) FunAPtr
Definition Delegate.h:1662
Delegate(FunAPtr fnA, A &&obj)
Definition Delegate.h:1689
Delegate &IRAM_ATTR operator=(std::nullptr_t)
Definition Delegate.h:1710
Delegate & operator=(const Delegate &del)
Definition Delegate.h:1695
Delegate(FunPtr fn)
Definition Delegate.h:1691
Delegate(const Delegate &del)
Definition Delegate.h:1681
Delegate()
Definition Delegate.h:1677
target_type * FunPtr
Definition Delegate.h:1661
DelegateImpl(FunPtr fn)
Definition Delegate.h:1415
DelegateImpl(std::nullptr_t)
Definition Delegate.h:1377
void * arg() const
Definition Delegate.h:1522
R(*)(void *) FunVPPtr
Definition Delegate.h:1369
R IRAM_ATTR operator()() const
Definition Delegate.h:1546
DelegateImpl(F fn)
Definition Delegate.h:1599
R() target_type
Definition Delegate.h:1365
DelegateImpl &IRAM_ATTR operator=(std::nullptr_t)
Definition Delegate.h:1484
DelegateImpl & operator=(DelegateImpl &&del)
Definition Delegate.h:1450
@ FUNC
Definition Delegate.h:1563
@ FP
Definition Delegate.h:1563
DelegateImpl()
Definition Delegate.h:1371
enum delegate::detail::DelegateImpl< void, R >::@114344005227220021355033017110347071325077114273 kind
DelegateImpl & operator=(FunPtr fn)
Definition Delegate.h:1473
DelegateImpl(F functional)
Definition Delegate.h:1421
DelegateImpl & operator=(const DelegateImpl &del)
Definition Delegate.h:1427
DelegateImpl(const DelegateImpl &del)
Definition Delegate.h:1389
std::function< target_type > FunctionType
Definition Delegate.h:1368
~DelegateImpl()
Definition Delegate.h:1383
DelegateImpl(DelegateImpl &&del)
Definition Delegate.h:1402
target_type * FunPtr
Definition Delegate.h:1367
FunPtr fn
Definition Delegate.h:1651
Definition Delegate.h:858
DelegateImpl(FunAPtr fnA, const A &obj)
Definition Delegate.h:923
std::function< target_type > FunctionType
Definition Delegate.h:864
DelegateImpl & operator=(const DelegateImpl &del)
Definition Delegate.h:949
@ FP
Definition Delegate.h:1151
@ FPA
Definition Delegate.h:1151
@ FUNC
Definition Delegate.h:1151
R() target_type
Definition Delegate.h:860
DelegateImpl(const DelegateImpl &del)
Definition Delegate.h:887
enum delegate::detail::DelegateImpl::@276166300377071027042035035353331176204001142173 kind
DelegateImpl & operator=(DelegateImpl &&del)
Definition Delegate.h:988
R IRAM_ATTR operator()() const
Definition Delegate.h:1126
~DelegateImpl()
Definition Delegate.h:879
void * arg() const
Definition Delegate.h:1098
static R IRAM_ATTR vPtrToFunAPtrExec(void *self)
Definition Delegate.h:1073
DelegateImpl &IRAM_ATTR operator=(std::nullptr_t)
Definition Delegate.h:1042
DelegateImpl(F functional)
Definition Delegate.h:943
DelegateImpl & operator=(FunPtr fn)
Definition Delegate.h:1027
DelegateImpl(FunAPtr fnA, A &&obj)
Definition Delegate.h:930
target_type * FunPtr
Definition Delegate.h:862
R(*)(void *) FunVPPtr
Definition Delegate.h:865
R(*)(A) FunAPtr
Definition Delegate.h:863
DelegateImpl()
Definition Delegate.h:867
DelegateImpl(F fn)
Definition Delegate.h:1223
DelegateImpl(std::nullptr_t)
Definition Delegate.h:873
DelegateImpl(FunPtr fn)
Definition Delegate.h:937
DelegateImpl(DelegateImpl &&del)
Definition Delegate.h:905
A obj
Definition Delegate.h:1356
void * arg() const
Definition Delegate.h:723
DelegatePImpl(DelegatePImpl &&del)
Definition Delegate.h:603
R IRAM_ATTR operator()(P... args) const
Definition Delegate.h:747
enum delegate::detail::DelegatePImpl< void, R, P... >::@006171226213135320310136052116166122321273173352 kind
~DelegatePImpl()
Definition Delegate.h:584
DelegatePImpl & operator=(DelegatePImpl &&del)
Definition Delegate.h:651
DelegatePImpl(const DelegatePImpl &del)
Definition Delegate.h:590
DelegatePImpl & operator=(const DelegatePImpl &del)
Definition Delegate.h:628
DelegatePImpl(FunPtr fn)
Definition Delegate.h:616
target_type * FunPtr
Definition Delegate.h:568
DelegatePImpl()
Definition Delegate.h:572
R(P...) target_type
Definition Delegate.h:566
DelegatePImpl(F functional)
Definition Delegate.h:622
DelegatePImpl(F fn)
Definition Delegate.h:800
FunPtr fn
Definition Delegate.h:852
DelegatePImpl(std::nullptr_t)
Definition Delegate.h:578
DelegatePImpl &IRAM_ATTR operator=(std::nullptr_t)
Definition Delegate.h:685
std::function< target_type > FunctionType
Definition Delegate.h:569
R(*)(void *, P...) FunVPPtr
Definition Delegate.h:570
DelegatePImpl & operator=(FunPtr fn)
Definition Delegate.h:674
@ FP
Definition Delegate.h:764
@ FUNC
Definition Delegate.h:764
DelegatePImpl()
Definition Delegate.h:66
DelegatePImpl(std::nullptr_t)
Definition Delegate.h:72
DelegatePImpl &IRAM_ATTR operator=(std::nullptr_t)
Definition Delegate.h:241
DelegatePImpl(const DelegatePImpl &del)
Definition Delegate.h:86
~DelegatePImpl()
Definition Delegate.h:78
DelegatePImpl & operator=(DelegatePImpl &&del)
Definition Delegate.h:187
static R IRAM_ATTR vPtrToFunAPtrExec(void *self, P... args)
Definition Delegate.h:272
DelegatePImpl(FunAPtr fnA, A &&obj)
Definition Delegate.h:129
@ FPA
Definition Delegate.h:351
@ FP
Definition Delegate.h:351
A obj
Definition Delegate.h:557
target_type * FunPtr
Definition Delegate.h:61
DelegatePImpl(DelegatePImpl &&del)
Definition Delegate.h:104
void * arg() const
Definition Delegate.h:298
enum delegate::detail::DelegatePImpl::@325353310314210164331113235057320064231226252317 kind
DelegatePImpl(F functional)
Definition Delegate.h:142
R IRAM_ATTR operator()(P... args) const
Definition Delegate.h:326
DelegatePImpl & operator=(FunPtr fn)
Definition Delegate.h:226
DelegatePImpl(FunAPtr fnA, const A &obj)
Definition Delegate.h:122
R(*)(A, P...) FunAPtr
Definition Delegate.h:62
DelegatePImpl(FunPtr fn)
Definition Delegate.h:136
DelegatePImpl & operator=(const DelegatePImpl &del)
Definition Delegate.h:148
R(*)(void *, P...) FunVPPtr
Definition Delegate.h:63
@ FUNC
Definition Delegate.h:351
R(P...) target_type
Definition Delegate.h:59
std::function< target_type > FunctionType
Definition Delegate.h:64
T && move(T &t) noexcept
Definition ghostl.h:50
decltype(nullptr) nullptr_t
Definition ghostl.h:80
T && forward(typename identity< T >::type &t) noexcept
Definition ghostl.h:88
T * function
Definition ghostl.h:79