Fabcoin Core  0.16.2
P2P Digital Currency
callback.h
Go to the documentation of this file.
1 #ifndef FABCOIN_QT_CALLBACK_H
2 #define FABCOIN_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  FunctionCallback(F f_) : f(std::move(f_)) {}
20  ~FunctionCallback() override {}
21  void call() override { f(this); }
22 };
23 
24 template <typename F>
26 {
27  return new FunctionCallback<F>(std::move(f));
28 }
29 
30 #endif // FABCOIN_QT_CALLBACK_H
std::hash for asio::adress
Definition: Common.h:323
#define F(x, y, z)
Definition: Hash.cpp:79
void call() override
Definition: callback.h:21
virtual void call()=0
#define f(x)
Definition: gost.cpp:57
FunctionCallback(F f_)
Definition: callback.h:19
FunctionCallback< F > * makeCallback(F f)
Definition: callback.h:25
~FunctionCallback() override
Definition: callback.h:20