Bitcoin Core  0.18.99
P2P Digital Currency
handler.h
Go to the documentation of this file.
1 // Copyright (c) 2018 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_INTERFACES_HANDLER_H
6 #define BITCOIN_INTERFACES_HANDLER_H
7 
8 #include <memory>
9 
10 namespace boost {
11 namespace signals2 {
12 class connection;
13 } // namespace signals2
14 } // namespace boost
15 
16 namespace interfaces {
17 
21 class Handler
22 {
23 public:
24  virtual ~Handler() {}
25 
27  virtual void disconnect() = 0;
28 };
29 
31 std::unique_ptr<Handler> MakeHandler(boost::signals2::connection connection);
32 
33 } // namespace interfaces
34 
35 #endif // BITCOIN_INTERFACES_HANDLER_H
Definition: init.h:25
std::unique_ptr< Handler > MakeHandler(boost::signals2::connection connection)
Return handler wrapping a boost signal connection.
Definition: handler.cpp:27
virtual ~Handler()
Definition: handler.h:24
Generic interface for managing an event handler or callback function registered with another interfac...
Definition: handler.h:21