Raven Core
3.0.0
P2P Digital Currency
src
qt
callback.h
Go to the documentation of this file.
1
#ifndef RAVEN_QT_CALLBACK_H
2
#define RAVEN_QT_CALLBACK_H
3
4
#include <QObject>
5
6
class
Callback
:
public
QObject
7
{
8
Q_OBJECT
9
public
Q_SLOTS:
10
virtual
void
call
() = 0;
11
};
12
13
template
<
typename
F>
14
class
FunctionCallback
:
public
Callback
15
{
16
F
f
;
17
18
public
:
19
explicit
FunctionCallback
(F f_) : f(
std
::move(f_)) {}
20
~FunctionCallback
()
override
{}
21
void
call
()
override
{ f(
this
); }
22
};
23
24
template
<
typename
F>
25
FunctionCallback<F>
*
makeCallback
(F f)
26
{
27
return
new
FunctionCallback<F>
(std::move(f));
28
}
29
30
#endif // RAVEN_QT_CALLBACK_H
std
Callback
Definition:
callback.h:6
FunctionCallback::f
F f
Definition:
callback.h:16
FunctionCallback::call
void call() override
Definition:
callback.h:21
Callback::call
virtual void call()=0
FunctionCallback::FunctionCallback
FunctionCallback(F f_)
Definition:
callback.h:19
makeCallback
FunctionCallback< F > * makeCallback(F f)
Definition:
callback.h:25
FunctionCallback::~FunctionCallback
~FunctionCallback() override
Definition:
callback.h:20
FunctionCallback
Definition:
callback.h:14
Generated on Mon Jul 29 2019 02:32:19 for Raven Core by
1.8.13