Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

callback.h
Go to the documentation of this file.
1 #ifndef BITCOIN_QT_CALLBACK_H
2 #define BITCOIN_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>
26 {
27  return new FunctionCallback<F>(std::move(f));
28 }
29 
30 #endif // BITCOIN_QT_CALLBACK_H
Definition: box.hpp:161
void call() override
Definition: callback.h:21
virtual void call()=0
FunctionCallback(F f_)
Definition: callback.h:19
FunctionCallback< F > * makeCallback(F f)
Definition: callback.h:25
~FunctionCallback() override
Definition: callback.h:20
Released under the MIT license