diff options
author | Russell Yanofsky <russ@yanofsky.org> | 2017-04-17 13:55:43 -0400 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2018-04-04 16:52:37 -0400 |
commit | 71e0d90876efd11e2a4aeb8f3f806c5a1fd54b42 (patch) | |
tree | aef29169f36cb553e07ab75f27dbe87100ef0748 /src/interface/handler.cpp | |
parent | ea73b84d2ddde22487dee0f71d7a619051e067f2 (diff) |
Remove direct bitcoin calls from qt/bitcoin.cpp
Diffstat (limited to 'src/interface/handler.cpp')
-rw-r--r-- | src/interface/handler.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/interface/handler.cpp b/src/interface/handler.cpp new file mode 100644 index 0000000000..4b27f374f4 --- /dev/null +++ b/src/interface/handler.cpp @@ -0,0 +1,33 @@ +// Copyright (c) 2018 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include <interface/handler.h> + +#include <util.h> + +#include <boost/signals2/connection.hpp> +#include <memory> +#include <utility> + +namespace interface { +namespace { + +class HandlerImpl : public Handler +{ +public: + HandlerImpl(boost::signals2::connection connection) : m_connection(std::move(connection)) {} + + void disconnect() override { m_connection.disconnect(); } + + boost::signals2::scoped_connection m_connection; +}; + +} // namespace + +std::unique_ptr<Handler> MakeHandler(boost::signals2::connection connection) +{ + return MakeUnique<HandlerImpl>(std::move(connection)); +} + +} // namespace interface |