LCOV - code coverage report
Current view: top level - src/interfaces - handler.h Coverage Total Hit
Test: total_coverage.info Lines: 100.0 % 2 2
Test Date: 2026-04-27 06:58:15 Functions: - 0 0
Branches: 50.0 % 4 2

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

Generated by: LCOV version 2.0-1