LCOV - code coverage report
Current view: top level - src/interfaces - handler.h (source / functions) Hit Total Coverage
Test: coverage.lcov Lines: 1 1 100.0 %
Date: 2022-04-21 14:51:19 Functions: 1 1 100.0 %
Legend: Modified by patch:
Lines: hit not hit | Branches: + taken - not taken # not executed

Not modified by patch:
Lines: hit not hit | Branches: + taken - not taken # not executed
Branches: 0 0 -

           Branch data     Line data    Source code
#       1                 :            : // Copyright (c) 2018-2020 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 <functional>
#       9                 :            : #include <memory>
#      10                 :            : 
#      11                 :            : namespace boost {
#      12                 :            : namespace signals2 {
#      13                 :            : class connection;
#      14                 :            : } // namespace signals2
#      15                 :            : } // namespace boost
#      16                 :            : 
#      17                 :            : namespace interfaces {
#      18                 :            : 
#      19                 :            : //! Generic interface for managing an event handler or callback function
#      20                 :            : //! registered with another interface. Has a single disconnect method to cancel
#      21                 :            : //! the registration and prevent any future notifications.
#      22                 :            : class Handler
#      23                 :            : {
#      24                 :            : public:
#      25                 :      52773 :     virtual ~Handler() {}
#      26                 :            : 
#      27                 :            :     //! Disconnect the handler.
#      28                 :            :     virtual void disconnect() = 0;
#      29                 :            : };
#      30                 :            : 
#      31                 :            : //! Return handler wrapping a boost signal connection.
#      32                 :            : std::unique_ptr<Handler> MakeHandler(boost::signals2::connection connection);
#      33                 :            : 
#      34                 :            : //! Return handler wrapping a cleanup function.
#      35                 :            : std::unique_ptr<Handler> MakeHandler(std::function<void()> cleanup);
#      36                 :            : 
#      37                 :            : } // namespace interfaces
#      38                 :            : 
#      39                 :            : #endif // BITCOIN_INTERFACES_HANDLER_H

Generated by: LCOV version 0-eol-96201-ge66f56f4af6a