/tmp/bitcoin/src/util/btcsignals.h
Line | Count | Source |
1 | | // Copyright (c) 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_UTIL_BTCSIGNALS_H |
6 | | #define BITCOIN_UTIL_BTCSIGNALS_H |
7 | | |
8 | | #include <sync.h> |
9 | | |
10 | | #include <algorithm> |
11 | | #include <atomic> |
12 | | #include <functional> |
13 | | #include <memory> |
14 | | #include <optional> |
15 | | #include <type_traits> |
16 | | #include <utility> |
17 | | #include <vector> |
18 | | |
19 | | /** |
20 | | * btcsignals is a simple mechanism for signaling events to multiple subscribers. |
21 | | * It is api-compatible with a minimal subset of boost::signals2. |
22 | | * |
23 | | * Rather than using a custom slot type, and the features/complexity that they |
24 | | * imply, std::function is used to store the callbacks. There is no automatic |
25 | | * tracking of objects the callbacks refer to, so callers need to disconnect |
26 | | * callbacks before those objects are destroyed. |
27 | | * |
28 | | * Like boost::signals2, disconnecting a connection destroys its callback |
29 | | * object, or if the callback is running at the time, destroys it when the |
30 | | * call returns. Callbacks that are never disconnected are destroyed with the |
31 | | * signal. |
32 | | * |
33 | | * All usage is thread-safe except for interacting with a connection while |
34 | | * copying/moving it on another thread. |
35 | | */ |
36 | | |
37 | | namespace btcsignals { |
38 | | |
39 | | /// The default combiner, which only returns void. |
40 | | class null_value |
41 | | { |
42 | | public: |
43 | | using result_type = void; |
44 | | }; |
45 | | |
46 | | /// A combiner, which checks if at least one callback returned true. |
47 | | class any_of |
48 | | { |
49 | | public: |
50 | | // This is the only supported combiner with a non-void return type. As |
51 | | // such, its behavior is embedded into the signal functor. |
52 | | using result_type = bool; |
53 | | }; |
54 | | |
55 | | template <typename Signature, typename Combiner = null_value> |
56 | | class signal; |
57 | | |
58 | | namespace detail { |
59 | | #ifdef __cpp_lib_atomic_shared_ptr |
60 | | template <typename T> |
61 | | using atomic_shared_ptr = std::atomic<std::shared_ptr<T>>; |
62 | | #else |
63 | | //! Substitute for the C++20 std::atomic<std::shared_ptr<T>> specialization on |
64 | | //! standard libraries that do not provide it yet (feature-test macro |
65 | | //! __cpp_lib_atomic_shared_ptr), implemented with the C++11 atomic_load and |
66 | | //! atomic_store overloads for shared_ptr. Only the members used here are |
67 | | //! provided. |
68 | | template <typename T> |
69 | | class atomic_shared_ptr |
70 | | { |
71 | | std::shared_ptr<T> m_ptr; |
72 | | |
73 | | public: |
74 | | explicit atomic_shared_ptr(std::shared_ptr<T> ptr) noexcept : m_ptr{std::move(ptr)} {} |
75 | | atomic_shared_ptr(const atomic_shared_ptr&) = delete; |
76 | | atomic_shared_ptr& operator=(const atomic_shared_ptr&) = delete; |
77 | | std::shared_ptr<T> load() const noexcept { return std::atomic_load(&m_ptr); } |
78 | | void store(std::shared_ptr<T> ptr) noexcept { std::atomic_store(&m_ptr, std::move(ptr)); } |
79 | | }; |
80 | | #endif |
81 | | } // namespace detail |
82 | | |
83 | | /* |
84 | | * State object representing the liveness of a registered callback. |
85 | | * signal::connect() returns an enabled connection which can be held and |
86 | | * disabled in the future. |
87 | | */ |
88 | | class connection |
89 | | { |
90 | | template <typename Signature, typename Combiner> |
91 | | friend class signal; |
92 | | /** |
93 | | * Track liveness. Also serves as a tag for the constructor used by signal. |
94 | | */ |
95 | | class liveness |
96 | | { |
97 | | friend class connection; |
98 | | |
99 | | //! Callback object, type-erased so connection does not depend on the |
100 | | //! signal type, and set to null by disconnect(). Signal invocation |
101 | | //! holds a reference to it while calling it, so a callback |
102 | | //! disconnected during a call is destroyed when the call returns. |
103 | | detail::atomic_shared_ptr<const void> m_callback; |
104 | | |
105 | 1.44k | void disconnect() { m_callback.store(nullptr); } |
106 | | |
107 | | protected: |
108 | 24.1k | explicit liveness(std::shared_ptr<const void> callback) : m_callback{std::move(callback)} {} |
109 | | |
110 | 533k | std::shared_ptr<const void> load() const { return m_callback.load(); } |
111 | | |
112 | | public: |
113 | 263k | bool connected() const { return load() != nullptr; } |
114 | | }; |
115 | | |
116 | | /** |
117 | | * connections have shared_ptr-like copy and move semantics. |
118 | | */ |
119 | | std::shared_ptr<liveness> m_state{}; |
120 | | |
121 | | /** |
122 | | * Only a signal can create an enabled connection. |
123 | | */ |
124 | 24.1k | explicit connection(std::shared_ptr<liveness>&& state) : m_state{std::move(state)}{} |
125 | | |
126 | | public: |
127 | | /** |
128 | | * The default constructor creates a connection with no associated signal |
129 | | */ |
130 | 7 | constexpr connection() noexcept = default; |
131 | | |
132 | | /** |
133 | | * If a callback is associated with this connection, prevent it from being |
134 | | * called in the future. |
135 | | * |
136 | | * If a connection is disabled as part of a signal's callback function, it |
137 | | * will _not_ be executed in the current signal invocation. |
138 | | * |
139 | | * The callback object is destroyed here (or when the last concurrently |
140 | | * executing invocation of it completes). The empty holder entry is not |
141 | | * removed from the owning signal; it is garbage collected in |
142 | | * signal::connect(). |
143 | | */ |
144 | | void disconnect() |
145 | 1.94k | { |
146 | 1.94k | if (m_state) { |
147 | 1.44k | m_state->disconnect(); |
148 | 1.44k | } |
149 | 1.94k | } |
150 | | |
151 | | /** |
152 | | * Returns true if this connection was created by a signal and has not been |
153 | | * disabled. |
154 | | */ |
155 | | bool connected() const |
156 | 1.01k | { |
157 | 1.01k | return m_state && m_state->connected(); |
158 | 1.01k | } |
159 | | }; |
160 | | |
161 | | /* |
162 | | * RAII-style connection management |
163 | | */ |
164 | | class scoped_connection |
165 | | { |
166 | | connection m_conn; |
167 | | |
168 | | public: |
169 | 1.00k | explicit scoped_connection(connection rhs) noexcept : m_conn{std::move(rhs)} {} |
170 | | |
171 | 500 | scoped_connection(scoped_connection&&) noexcept = default; |
172 | | |
173 | | /** |
174 | | * For simplicity, disable copy construction and copy/move assignment. |
175 | | */ |
176 | | scoped_connection& operator=(scoped_connection&&) = delete; |
177 | | scoped_connection& operator=(const scoped_connection&) = delete; |
178 | | scoped_connection(const scoped_connection&) = delete; |
179 | | |
180 | | void disconnect() |
181 | 1.50k | { |
182 | 1.50k | m_conn.disconnect(); |
183 | 1.50k | } |
184 | | |
185 | | ~scoped_connection() |
186 | 1.50k | { |
187 | 1.50k | disconnect(); |
188 | 1.50k | } |
189 | | }; |
190 | | |
191 | | /* |
192 | | * Functor for calling zero or more connected callbacks |
193 | | */ |
194 | | template <typename Signature, typename Combiner> |
195 | | class signal |
196 | | { |
197 | | using function_type = std::function<Signature>; |
198 | | |
199 | | /* |
200 | | * Helper struct for maintaining a callback and its associated connection liveness |
201 | | */ |
202 | | struct connection_holder : connection::liveness { |
203 | | template <typename Callable> |
204 | | explicit connection_holder(Callable&& callback) |
205 | 24.1k | : liveness{std::make_shared<const function_type>(std::forward<Callable>(callback))} |
206 | 24.1k | { |
207 | 24.1k | } btcsignals::signal<void (int&), btcsignals::null_value>::connection_holder::connection_holder<void (&)(int&)>(void (&)(int&)) Line | Count | Source | 205 | 8 | : liveness{std::make_shared<const function_type>(std::forward<Callable>(callback))} | 206 | 8 | { | 207 | 8 | } |
btcsignals_tests.cpp:btcsignals::signal<void (), btcsignals::null_value>::connection_holder::connection_holder<btcsignals_tests::callback_destruction::test_method()::$_0>(btcsignals_tests::callback_destruction::test_method()::$_0&&) Line | Count | Source | 205 | 1 | : liveness{std::make_shared<const function_type>(std::forward<Callable>(callback))} | 206 | 1 | { | 207 | 1 | } |
btcsignals_tests.cpp:btcsignals::signal<void (), btcsignals::null_value>::connection_holder::connection_holder<btcsignals_tests::callback_destruction::test_method()::$_1>(btcsignals_tests::callback_destruction::test_method()::$_1&&) Line | Count | Source | 205 | 1 | : liveness{std::make_shared<const function_type>(std::forward<Callable>(callback))} | 206 | 1 | { | 207 | 1 | } |
btcsignals_tests.cpp:btcsignals::signal<void (), btcsignals::null_value>::connection_holder::connection_holder<btcsignals_tests::self_disconnect_destruction::test_method()::$_0>(btcsignals_tests::self_disconnect_destruction::test_method()::$_0&&) Line | Count | Source | 205 | 1 | : liveness{std::make_shared<const function_type>(std::forward<Callable>(callback))} | 206 | 1 | { | 207 | 1 | } |
btcsignals_tests.cpp:btcsignals::signal<void (), btcsignals::null_value>::connection_holder::connection_holder<btcsignals_tests::concurrent_disconnect_destruction::test_method()::$_0>(btcsignals_tests::concurrent_disconnect_destruction::test_method()::$_0&&) Line | Count | Source | 205 | 1 | : liveness{std::make_shared<const function_type>(std::forward<Callable>(callback))} | 206 | 1 | { | 207 | 1 | } |
btcsignals::signal<bool (), btcsignals::any_of>::connection_holder::connection_holder<bool (&)()>(bool (&)()) Line | Count | Source | 205 | 3 | : liveness{std::make_shared<const function_type>(std::forward<Callable>(callback))} | 206 | 3 | { | 207 | 3 | } |
btcsignals_tests.cpp:btcsignals::signal<void (), btcsignals::null_value>::connection_holder::connection_holder<btcsignals_tests::thread_safety::test_method()::$_0>(btcsignals_tests::thread_safety::test_method()::$_0&&) Line | Count | Source | 205 | 1 | : liveness{std::make_shared<const function_type>(std::forward<Callable>(callback))} | 206 | 1 | { | 207 | 1 | } |
btcsignals_tests.cpp:btcsignals::signal<void (), btcsignals::null_value>::connection_holder::connection_holder<btcsignals_tests::thread_safety::test_method()::$_2::operator()() const::'lambda'()>(btcsignals_tests::thread_safety::test_method()::$_2::operator()() const::'lambda'()&&) Line | Count | Source | 205 | 1.00k | : liveness{std::make_shared<const function_type>(std::forward<Callable>(callback))} | 206 | 1.00k | { | 207 | 1.00k | } |
btcsignals_tests.cpp:btcsignals::signal<void (), btcsignals::null_value>::connection_holder::connection_holder<btcsignals_tests::recursion_safety::test_method()::$_0>(btcsignals_tests::recursion_safety::test_method()::$_0&&) Line | Count | Source | 205 | 1 | : liveness{std::make_shared<const function_type>(std::forward<Callable>(callback))} | 206 | 1 | { | 207 | 1 | } |
btcsignals_tests.cpp:btcsignals::signal<void (), btcsignals::null_value>::connection_holder::connection_holder<btcsignals_tests::recursion_safety::test_method()::$_1>(btcsignals_tests::recursion_safety::test_method()::$_1&&) Line | Count | Source | 205 | 1 | : liveness{std::make_shared<const function_type>(std::forward<Callable>(callback))} | 206 | 1 | { | 207 | 1 | } |
btcsignals_tests.cpp:btcsignals::signal<void (), btcsignals::null_value>::connection_holder::connection_holder<btcsignals_tests::recursion_safety::test_method()::$_2>(btcsignals_tests::recursion_safety::test_method()::$_2&&) Line | Count | Source | 205 | 1 | : liveness{std::make_shared<const function_type>(std::forward<Callable>(callback))} | 206 | 1 | { | 207 | 1 | } |
btcsignals_tests.cpp:btcsignals::signal<void (), btcsignals::null_value>::connection_holder::connection_holder<btcsignals_tests::recursion_safety::test_method()::$_2::operator()() const::'lambda'()>(btcsignals_tests::recursion_safety::test_method()::$_2::operator()() const::'lambda'()&&) Line | Count | Source | 205 | 1 | : liveness{std::make_shared<const function_type>(std::forward<Callable>(callback))} | 206 | 1 | { | 207 | 1 | } |
btcsignals_tests.cpp:btcsignals::signal<void (int&), btcsignals::null_value>::connection_holder::connection_holder<btcsignals_tests::disconnect_thread_safety::test_method()::$_0>(btcsignals_tests::disconnect_thread_safety::test_method()::$_0&&) Line | Count | Source | 205 | 1 | : liveness{std::make_shared<const function_type>(std::forward<Callable>(callback))} | 206 | 1 | { | 207 | 1 | } |
rescan_tests.cpp:btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int), btcsignals::null_value>::connection_holder::connection_holder<wallet::rescan_tests::scan_for_wallet_transactions_tip_extension::test_method()::$_0>(wallet::rescan_tests::scan_for_wallet_transactions_tip_extension::test_method()::$_0&&) Line | Count | Source | 205 | 1 | : liveness{std::make_shared<const function_type>(std::forward<Callable>(callback))} | 206 | 1 | { | 207 | 1 | } |
btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&), btcsignals::null_value>::connection_holder::connection_holder<void (&)(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)>(void (&)(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)) Line | Count | Source | 205 | 2.81k | : liveness{std::make_shared<const function_type>(std::forward<Callable>(callback))} | 206 | 2.81k | { | 207 | 2.81k | } |
init.cpp:btcsignals::signal<void (SynchronizationState, CBlockIndex const&, double), btcsignals::null_value>::connection_holder::connection_holder<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_9>(AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_9&&) Line | Count | Source | 205 | 1 | : liveness{std::make_shared<const function_type>(std::forward<Callable>(callback))} | 206 | 1 | { | 207 | 1 | } |
Unexecuted instantiation: btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&), btcsignals::null_value>::connection_holder::connection_holder<std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)>&>(std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)>&) Unexecuted instantiation: btcsignals::signal<void (bilingual_str const&, unsigned int), btcsignals::null_value>::connection_holder::connection_holder<std::function<void (bilingual_str const&, unsigned int)>&>(std::function<void (bilingual_str const&, unsigned int)>&) Unexecuted instantiation: btcsignals::signal<bool (bilingual_str const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int), btcsignals::any_of>::connection_holder::connection_holder<std::function<bool (bilingual_str const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int)>&>(std::function<bool (bilingual_str const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int)>&) Unexecuted instantiation: btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, bool), btcsignals::null_value>::connection_holder::connection_holder<std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, bool)>&>(std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, bool)>&) Unexecuted instantiation: btcsignals::signal<void (), btcsignals::null_value>::connection_holder::connection_holder<std::function<void ()>&>(std::function<void ()>&) Unexecuted instantiation: btcsignals::signal<void (int), btcsignals::null_value>::connection_holder::connection_holder<std::function<void (int)>&>(std::function<void (int)>&) Unexecuted instantiation: btcsignals::signal<void (bool), btcsignals::null_value>::connection_holder::connection_holder<std::function<void (bool)>&>(std::function<void (bool)>&) Unexecuted instantiation: interfaces.cpp:btcsignals::signal<void (SynchronizationState, CBlockIndex const&, double), btcsignals::null_value>::connection_holder::connection_holder<node::(anonymous namespace)::NodeImpl::handleNotifyBlockTip(std::function<void (SynchronizationState, interfaces::BlockTip, double)>)::'lambda'(SynchronizationState, CBlockIndex const&, double)>(node::(anonymous namespace)::NodeImpl::handleNotifyBlockTip(std::function<void (SynchronizationState, interfaces::BlockTip, double)>)::'lambda'(SynchronizationState, CBlockIndex const&, double)&&) Unexecuted instantiation: interfaces.cpp:btcsignals::signal<void (SynchronizationState, long, long, bool), btcsignals::null_value>::connection_holder::connection_holder<node::(anonymous namespace)::NodeImpl::handleNotifyHeaderTip(std::function<void (SynchronizationState, interfaces::BlockTip, bool)>)::'lambda'(SynchronizationState, long, long, bool)>(node::(anonymous namespace)::NodeImpl::handleNotifyHeaderTip(std::function<void (SynchronizationState, interfaces::BlockTip, bool)>)::'lambda'(SynchronizationState, long, long, bool)&&) btcsignals::signal<void (bilingual_str const&, unsigned int), btcsignals::null_value>::connection_holder::connection_holder<void (&)(bilingual_str const&, unsigned int)>(void (&)(bilingual_str const&, unsigned int)) Line | Count | Source | 205 | 1.58k | : liveness{std::make_shared<const function_type>(std::forward<Callable>(callback))} | 206 | 1.58k | { | 207 | 1.58k | } |
btcsignals::signal<bool (bilingual_str const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int), btcsignals::any_of>::connection_holder::connection_holder<bool (&)(bilingual_str const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int)>(bool (&)(bilingual_str const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int)) Line | Count | Source | 205 | 1.58k | : liveness{std::make_shared<const function_type>(std::forward<Callable>(callback))} | 206 | 1.58k | { | 207 | 1.58k | } |
Unexecuted instantiation: btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int), btcsignals::null_value>::connection_holder::connection_holder<std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)>&>(std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)>&) Unexecuted instantiation: interfaces.cpp:btcsignals::signal<void (wallet::CWallet*), btcsignals::null_value>::connection_holder::connection_holder<wallet::(anonymous namespace)::WalletImpl::handleStatusChanged(std::function<void ()>)::'lambda'(wallet::CWallet*)>(wallet::(anonymous namespace)::WalletImpl::handleStatusChanged(std::function<void ()>)::'lambda'(wallet::CWallet*)&&) Unexecuted instantiation: interfaces.cpp:btcsignals::signal<void (std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, wallet::AddressPurpose, ChangeType), btcsignals::null_value>::connection_holder::connection_holder<wallet::(anonymous namespace)::WalletImpl::handleAddressBookChanged(std::function<void (std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, wallet::AddressPurpose, ChangeType)>)::'lambda'(std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, wallet::AddressPurpose, ChangeType)>(wallet::(anonymous namespace)::WalletImpl::handleAddressBookChanged(std::function<void (std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, wallet::AddressPurpose, ChangeType)>)::'lambda'(std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, wallet::AddressPurpose, ChangeType)&&) Unexecuted instantiation: interfaces.cpp:btcsignals::signal<void (transaction_identifier<false> const&, ChangeType), btcsignals::null_value>::connection_holder::connection_holder<wallet::(anonymous namespace)::WalletImpl::handleTransactionChanged(std::function<void (transaction_identifier<false> const&, ChangeType)>)::'lambda'(transaction_identifier<false> const&, ChangeType)>(wallet::(anonymous namespace)::WalletImpl::handleTransactionChanged(std::function<void (transaction_identifier<false> const&, ChangeType)>)::'lambda'(transaction_identifier<false> const&, ChangeType)&&) wallet.cpp:btcsignals::signal<void (), btcsignals::null_value>::connection_holder::connection_holder<wallet::CWallet::ConnectScriptPubKeyManNotifiers()::$_0>(wallet::CWallet::ConnectScriptPubKeyManNotifiers()::$_0&&) Line | Count | Source | 205 | 8.55k | : liveness{std::make_shared<const function_type>(std::forward<Callable>(callback))} | 206 | 8.55k | { | 207 | 8.55k | } |
wallet.cpp:btcsignals::signal<void (wallet::ScriptPubKeyMan const*, long), btcsignals::null_value>::connection_holder::connection_holder<wallet::CWallet::ConnectScriptPubKeyManNotifiers()::$_1>(wallet::CWallet::ConnectScriptPubKeyManNotifiers()::$_1&&) Line | Count | Source | 205 | 8.55k | : liveness{std::make_shared<const function_type>(std::forward<Callable>(callback))} | 206 | 8.55k | { | 207 | 8.55k | } |
|
208 | | |
209 | | //! Return the callback, or null if disconnected. The callback stays |
210 | | //! alive while the returned pointer is held. |
211 | | std::shared_ptr<const function_type> callback() const |
212 | 270k | { |
213 | 270k | return std::static_pointer_cast<const function_type>(load()); |
214 | 270k | } btcsignals::signal<void (int&), btcsignals::null_value>::connection_holder::callback() const Line | Count | Source | 212 | 13 | { | 213 | 13 | return std::static_pointer_cast<const function_type>(load()); | 214 | 13 | } |
btcsignals::signal<void (), btcsignals::null_value>::connection_holder::callback() const Line | Count | Source | 212 | 253k | { | 213 | 253k | return std::static_pointer_cast<const function_type>(load()); | 214 | 253k | } |
btcsignals::signal<bool (), btcsignals::any_of>::connection_holder::callback() const Line | Count | Source | 212 | 8 | { | 213 | 8 | return std::static_pointer_cast<const function_type>(load()); | 214 | 8 | } |
btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&), btcsignals::null_value>::connection_holder::callback() const Line | Count | Source | 212 | 16.8k | { | 213 | 16.8k | return std::static_pointer_cast<const function_type>(load()); | 214 | 16.8k | } |
btcsignals::signal<void (bilingual_str const&, unsigned int), btcsignals::null_value>::connection_holder::callback() const Line | Count | Source | 212 | 212 | { | 213 | 212 | return std::static_pointer_cast<const function_type>(load()); | 214 | 212 | } |
btcsignals::signal<bool (bilingual_str const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int), btcsignals::any_of>::connection_holder::callback() const Line | Count | Source | 212 | 11 | { | 213 | 11 | return std::static_pointer_cast<const function_type>(load()); | 214 | 11 | } |
Unexecuted instantiation: btcsignals::signal<void (int), btcsignals::null_value>::connection_holder::callback() const Unexecuted instantiation: btcsignals::signal<void (bool), btcsignals::null_value>::connection_holder::callback() const Unexecuted instantiation: btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, bool), btcsignals::null_value>::connection_holder::callback() const btcsignals::signal<void (SynchronizationState, CBlockIndex const&, double), btcsignals::null_value>::connection_holder::callback() const Line | Count | Source | 212 | 113 | { | 213 | 113 | return std::static_pointer_cast<const function_type>(load()); | 214 | 113 | } |
Unexecuted instantiation: btcsignals::signal<void (SynchronizationState, long, long, bool), btcsignals::null_value>::connection_holder::callback() const btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int), btcsignals::null_value>::connection_holder::callback() const Line | Count | Source | 212 | 4 | { | 213 | 4 | return std::static_pointer_cast<const function_type>(load()); | 214 | 4 | } |
btcsignals::signal<void (wallet::ScriptPubKeyMan const*, long), btcsignals::null_value>::connection_holder::callback() const Line | Count | Source | 212 | 35 | { | 213 | 35 | return std::static_pointer_cast<const function_type>(load()); | 214 | 35 | } |
Unexecuted instantiation: btcsignals::signal<void (wallet::CWallet*), btcsignals::null_value>::connection_holder::callback() const Unexecuted instantiation: btcsignals::signal<void (transaction_identifier<false> const&, ChangeType), btcsignals::null_value>::connection_holder::callback() const Unexecuted instantiation: btcsignals::signal<void (std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, wallet::AddressPurpose, ChangeType), btcsignals::null_value>::connection_holder::callback() const |
215 | | }; |
216 | | |
217 | | mutable Mutex m_mutex; |
218 | | |
219 | | std::vector<std::shared_ptr<connection_holder>> m_connections GUARDED_BY(m_mutex){}; |
220 | | |
221 | | public: |
222 | | using result_type = Combiner::result_type; |
223 | | |
224 | 24.4k | constexpr signal() noexcept = default; btcsignals::signal<void (int&), btcsignals::null_value>::signal() Line | Count | Source | 224 | 3 | constexpr signal() noexcept = default; |
btcsignals::signal<void (), btcsignals::null_value>::signal() Line | Count | Source | 224 | 11.0k | constexpr signal() noexcept = default; |
btcsignals::signal<bool (), btcsignals::any_of>::signal() Line | Count | Source | 224 | 1 | constexpr signal() noexcept = default; |
btcsignals::signal<void (wallet::ScriptPubKeyMan const*, long), btcsignals::null_value>::signal() Line | Count | Source | 224 | 8.57k | constexpr signal() noexcept = default; |
btcsignals::signal<void (std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, wallet::AddressPurpose, ChangeType), btcsignals::null_value>::signal() Line | Count | Source | 224 | 1.21k | constexpr signal() noexcept = default; |
btcsignals::signal<void (transaction_identifier<false> const&, ChangeType), btcsignals::null_value>::signal() Line | Count | Source | 224 | 1.21k | constexpr signal() noexcept = default; |
btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int), btcsignals::null_value>::signal() Line | Count | Source | 224 | 1.21k | constexpr signal() noexcept = default; |
btcsignals::signal<void (wallet::CWallet*), btcsignals::null_value>::signal() Line | Count | Source | 224 | 1.21k | constexpr signal() noexcept = default; |
|
225 | 24.4k | ~signal() = default; btcsignals::signal<void (int&), btcsignals::null_value>::~signal() Line | Count | Source | 225 | 3 | ~signal() = default; |
btcsignals::signal<void (), btcsignals::null_value>::~signal() Line | Count | Source | 225 | 11.0k | ~signal() = default; |
btcsignals::signal<bool (), btcsignals::any_of>::~signal() Line | Count | Source | 225 | 1 | ~signal() = default; |
Unexecuted instantiation: btcsignals::signal<void (SynchronizationState, long, long, bool), btcsignals::null_value>::~signal() Unexecuted instantiation: btcsignals::signal<void (SynchronizationState, CBlockIndex const&, double), btcsignals::null_value>::~signal() Unexecuted instantiation: btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, bool), btcsignals::null_value>::~signal() Unexecuted instantiation: btcsignals::signal<void (bool), btcsignals::null_value>::~signal() Unexecuted instantiation: btcsignals::signal<void (int), btcsignals::null_value>::~signal() Unexecuted instantiation: btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&), btcsignals::null_value>::~signal() Unexecuted instantiation: btcsignals::signal<bool (bilingual_str const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int), btcsignals::any_of>::~signal() Unexecuted instantiation: btcsignals::signal<void (bilingual_str const&, unsigned int), btcsignals::null_value>::~signal() btcsignals::signal<void (wallet::ScriptPubKeyMan const*, long), btcsignals::null_value>::~signal() Line | Count | Source | 225 | 8.57k | ~signal() = default; |
btcsignals::signal<void (wallet::CWallet*), btcsignals::null_value>::~signal() Line | Count | Source | 225 | 1.21k | ~signal() = default; |
btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int), btcsignals::null_value>::~signal() Line | Count | Source | 225 | 1.21k | ~signal() = default; |
btcsignals::signal<void (transaction_identifier<false> const&, ChangeType), btcsignals::null_value>::~signal() Line | Count | Source | 225 | 1.21k | ~signal() = default; |
btcsignals::signal<void (std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, wallet::AddressPurpose, ChangeType), btcsignals::null_value>::~signal() Line | Count | Source | 225 | 1.21k | ~signal() = default; |
|
226 | | |
227 | | /* |
228 | | * For simplicity, disable all moving/copying/assigning. |
229 | | */ |
230 | | signal(const signal&) = delete; |
231 | | signal(signal&&) = delete; |
232 | | signal& operator=(const signal&) = delete; |
233 | | signal& operator=(signal&&) = delete; |
234 | | |
235 | | /* |
236 | | * Execute all enabled callbacks for the signal. Rather than allowing for |
237 | | * custom combiners, the behavior of any_of is hard-coded here. |
238 | | * |
239 | | * Callbacks which return void require special handling. |
240 | | * |
241 | | * In order to avoid locking during the callbacks, the list of callbacks is |
242 | | * cached before they are called. This allows a callback to call connect(), |
243 | | * but the newly connected callback will not be run during the current |
244 | | * signal invocation. |
245 | | * |
246 | | * Note that the parameters are accepted as universal references, though |
247 | | * they are not perfectly forwarded as that could cause a use-after-move if |
248 | | * more than one callback is enabled. |
249 | | */ |
250 | | template <typename... Args> |
251 | | [[nodiscard]] result_type operator()(Args&&... args) const EXCLUSIVE_LOCKS_REQUIRED(!m_mutex) |
252 | 266k | { |
253 | 266k | std::vector<std::shared_ptr<connection_holder>> connections; |
254 | 266k | { |
255 | 266k | LOCK(m_mutex); |
256 | 266k | connections = m_connections; |
257 | 266k | } |
258 | 266k | if constexpr (std::is_void_v<result_type>) { |
259 | 266k | static_assert(std::is_same_v<result_type, typename function_type::result_type>, |
260 | 266k | "Callback result type must be equal to the combiner result type (void)."); |
261 | 270k | for (const auto& connection : connections) { |
262 | | // Holding the callback pointer keeps the callback alive until |
263 | | // the call returns, even if it is disconnected concurrently. |
264 | 270k | if (const auto callback{connection->callback()}) { |
265 | 270k | (*callback)(args...); |
266 | 270k | } |
267 | 270k | } |
268 | 266k | } else { |
269 | 17 | static_assert(std::is_same_v<Combiner, any_of>, |
270 | 17 | "only the any_of combiner is supported and hard-coded into this functor."); |
271 | 17 | static_assert(std::is_same_v<result_type, typename function_type::result_type>, |
272 | 17 | "Callback result type must be equal to the combiner result type (bool)."); |
273 | 17 | result_type ret{false}; |
274 | 19 | for (const auto& connection : connections) { |
275 | 19 | if (const auto callback{connection->callback()}) { |
276 | 15 | ret |= (*callback)(args...); |
277 | 15 | } |
278 | 19 | } |
279 | 17 | return ret; |
280 | 17 | } |
281 | 266k | } void btcsignals::signal<void (int&), btcsignals::null_value>::operator()<int&>(int&) const Line | Count | Source | 252 | 6 | { | 253 | 6 | std::vector<std::shared_ptr<connection_holder>> connections; | 254 | 6 | { | 255 | 6 | LOCK(m_mutex); | 256 | 6 | connections = m_connections; | 257 | 6 | } | 258 | 6 | if constexpr (std::is_void_v<result_type>) { | 259 | 6 | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 260 | 6 | "Callback result type must be equal to the combiner result type (void)."); | 261 | 13 | for (const auto& connection : connections) { | 262 | | // Holding the callback pointer keeps the callback alive until | 263 | | // the call returns, even if it is disconnected concurrently. | 264 | 13 | if (const auto callback{connection->callback()}) { | 265 | 6 | (*callback)(args...); | 266 | 6 | } | 267 | 13 | } | 268 | | } else { | 269 | | static_assert(std::is_same_v<Combiner, any_of>, | 270 | | "only the any_of combiner is supported and hard-coded into this functor."); | 271 | | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 272 | | "Callback result type must be equal to the combiner result type (bool)."); | 273 | | result_type ret{false}; | 274 | | for (const auto& connection : connections) { | 275 | | if (const auto callback{connection->callback()}) { | 276 | | ret |= (*callback)(args...); | 277 | | } | 278 | | } | 279 | | return ret; | 280 | | } | 281 | 6 | } |
void btcsignals::signal<void (), btcsignals::null_value>::operator()<>() const Line | Count | Source | 252 | 12.8k | { | 253 | 12.8k | std::vector<std::shared_ptr<connection_holder>> connections; | 254 | 12.8k | { | 255 | 12.8k | LOCK(m_mutex); | 256 | 12.8k | connections = m_connections; | 257 | 12.8k | } | 258 | 12.8k | if constexpr (std::is_void_v<result_type>) { | 259 | 12.8k | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 260 | 12.8k | "Callback result type must be equal to the combiner result type (void)."); | 261 | 253k | for (const auto& connection : connections) { | 262 | | // Holding the callback pointer keeps the callback alive until | 263 | | // the call returns, even if it is disconnected concurrently. | 264 | 253k | if (const auto callback{connection->callback()}) { | 265 | 253k | (*callback)(args...); | 266 | 253k | } | 267 | 253k | } | 268 | | } else { | 269 | | static_assert(std::is_same_v<Combiner, any_of>, | 270 | | "only the any_of combiner is supported and hard-coded into this functor."); | 271 | | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 272 | | "Callback result type must be equal to the combiner result type (bool)."); | 273 | | result_type ret{false}; | 274 | | for (const auto& connection : connections) { | 275 | | if (const auto callback{connection->callback()}) { | 276 | | ret |= (*callback)(args...); | 277 | | } | 278 | | } | 279 | | return ret; | 280 | | } | 281 | 12.8k | } |
bool btcsignals::signal<bool (), btcsignals::any_of>::operator()<>() const Line | Count | Source | 252 | 6 | { | 253 | 6 | std::vector<std::shared_ptr<connection_holder>> connections; | 254 | 6 | { | 255 | 6 | LOCK(m_mutex); | 256 | 6 | connections = m_connections; | 257 | 6 | } | 258 | | if constexpr (std::is_void_v<result_type>) { | 259 | | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 260 | | "Callback result type must be equal to the combiner result type (void)."); | 261 | | for (const auto& connection : connections) { | 262 | | // Holding the callback pointer keeps the callback alive until | 263 | | // the call returns, even if it is disconnected concurrently. | 264 | | if (const auto callback{connection->callback()}) { | 265 | | (*callback)(args...); | 266 | | } | 267 | | } | 268 | 6 | } else { | 269 | 6 | static_assert(std::is_same_v<Combiner, any_of>, | 270 | 6 | "only the any_of combiner is supported and hard-coded into this functor."); | 271 | 6 | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 272 | 6 | "Callback result type must be equal to the combiner result type (bool)."); | 273 | 6 | result_type ret{false}; | 274 | 8 | for (const auto& connection : connections) { | 275 | 8 | if (const auto callback{connection->callback()}) { | 276 | 4 | ret |= (*callback)(args...); | 277 | 4 | } | 278 | 8 | } | 279 | 6 | return ret; | 280 | 6 | } | 281 | 6 | } |
void btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&), btcsignals::null_value>::operator()<util::TranslatedLiteral>(util::TranslatedLiteral&&) const Line | Count | Source | 252 | 6.92k | { | 253 | 6.92k | std::vector<std::shared_ptr<connection_holder>> connections; | 254 | 6.92k | { | 255 | 6.92k | LOCK(m_mutex); | 256 | 6.92k | connections = m_connections; | 257 | 6.92k | } | 258 | 6.92k | if constexpr (std::is_void_v<result_type>) { | 259 | 6.92k | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 260 | 6.92k | "Callback result type must be equal to the combiner result type (void)."); | 261 | 13.8k | for (const auto& connection : connections) { | 262 | | // Holding the callback pointer keeps the callback alive until | 263 | | // the call returns, even if it is disconnected concurrently. | 264 | 13.8k | if (const auto callback{connection->callback()}) { | 265 | 13.8k | (*callback)(args...); | 266 | 13.8k | } | 267 | 13.8k | } | 268 | | } else { | 269 | | static_assert(std::is_same_v<Combiner, any_of>, | 270 | | "only the any_of combiner is supported and hard-coded into this functor."); | 271 | | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 272 | | "Callback result type must be equal to the combiner result type (bool)."); | 273 | | result_type ret{false}; | 274 | | for (const auto& connection : connections) { | 275 | | if (const auto callback{connection->callback()}) { | 276 | | ret |= (*callback)(args...); | 277 | | } | 278 | | } | 279 | | return ret; | 280 | | } | 281 | 6.92k | } |
void btcsignals::signal<void (bilingual_str const&, unsigned int), btcsignals::null_value>::operator()<bilingual_str, CClientUIInterface::MessageBoxFlags>(bilingual_str&&, CClientUIInterface::MessageBoxFlags&&) const Line | Count | Source | 252 | 1 | { | 253 | 1 | std::vector<std::shared_ptr<connection_holder>> connections; | 254 | 1 | { | 255 | 1 | LOCK(m_mutex); | 256 | 1 | connections = m_connections; | 257 | 1 | } | 258 | 1 | if constexpr (std::is_void_v<result_type>) { | 259 | 1 | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 260 | 1 | "Callback result type must be equal to the combiner result type (void)."); | 261 | 1 | for (const auto& connection : connections) { | 262 | | // Holding the callback pointer keeps the callback alive until | 263 | | // the call returns, even if it is disconnected concurrently. | 264 | 1 | if (const auto callback{connection->callback()}) { | 265 | 1 | (*callback)(args...); | 266 | 1 | } | 267 | 1 | } | 268 | | } else { | 269 | | static_assert(std::is_same_v<Combiner, any_of>, | 270 | | "only the any_of combiner is supported and hard-coded into this functor."); | 271 | | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 272 | | "Callback result type must be equal to the combiner result type (bool)."); | 273 | | result_type ret{false}; | 274 | | for (const auto& connection : connections) { | 275 | | if (const auto callback{connection->callback()}) { | 276 | | ret |= (*callback)(args...); | 277 | | } | 278 | | } | 279 | | return ret; | 280 | | } | 281 | 1 | } |
void btcsignals::signal<void (bilingual_str const&, unsigned int), btcsignals::null_value>::operator()<util::TranslatedLiteral, CClientUIInterface::MessageBoxFlags>(util::TranslatedLiteral&&, CClientUIInterface::MessageBoxFlags&&) const Line | Count | Source | 252 | 12 | { | 253 | 12 | std::vector<std::shared_ptr<connection_holder>> connections; | 254 | 12 | { | 255 | 12 | LOCK(m_mutex); | 256 | 12 | connections = m_connections; | 257 | 12 | } | 258 | 12 | if constexpr (std::is_void_v<result_type>) { | 259 | 12 | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 260 | 12 | "Callback result type must be equal to the combiner result type (void)."); | 261 | 12 | for (const auto& connection : connections) { | 262 | | // Holding the callback pointer keeps the callback alive until | 263 | | // the call returns, even if it is disconnected concurrently. | 264 | 12 | if (const auto callback{connection->callback()}) { | 265 | 12 | (*callback)(args...); | 266 | 12 | } | 267 | 12 | } | 268 | | } else { | 269 | | static_assert(std::is_same_v<Combiner, any_of>, | 270 | | "only the any_of combiner is supported and hard-coded into this functor."); | 271 | | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 272 | | "Callback result type must be equal to the combiner result type (bool)."); | 273 | | result_type ret{false}; | 274 | | for (const auto& connection : connections) { | 275 | | if (const auto callback{connection->callback()}) { | 276 | | ret |= (*callback)(args...); | 277 | | } | 278 | | } | 279 | | return ret; | 280 | | } | 281 | 12 | } |
bool btcsignals::signal<bool (bilingual_str const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int), btcsignals::any_of>::operator()<bilingual_str, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned int>(bilingual_str&&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&&, unsigned int&&) const Line | Count | Source | 252 | 11 | { | 253 | 11 | std::vector<std::shared_ptr<connection_holder>> connections; | 254 | 11 | { | 255 | 11 | LOCK(m_mutex); | 256 | 11 | connections = m_connections; | 257 | 11 | } | 258 | | if constexpr (std::is_void_v<result_type>) { | 259 | | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 260 | | "Callback result type must be equal to the combiner result type (void)."); | 261 | | for (const auto& connection : connections) { | 262 | | // Holding the callback pointer keeps the callback alive until | 263 | | // the call returns, even if it is disconnected concurrently. | 264 | | if (const auto callback{connection->callback()}) { | 265 | | (*callback)(args...); | 266 | | } | 267 | | } | 268 | 11 | } else { | 269 | 11 | static_assert(std::is_same_v<Combiner, any_of>, | 270 | 11 | "only the any_of combiner is supported and hard-coded into this functor."); | 271 | 11 | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 272 | 11 | "Callback result type must be equal to the combiner result type (bool)."); | 273 | 11 | result_type ret{false}; | 274 | 11 | for (const auto& connection : connections) { | 275 | 11 | if (const auto callback{connection->callback()}) { | 276 | 11 | ret |= (*callback)(args...); | 277 | 11 | } | 278 | 11 | } | 279 | 11 | return ret; | 280 | 11 | } | 281 | 11 | } |
void btcsignals::signal<void (int), btcsignals::null_value>::operator()<unsigned long&>(unsigned long&) const Line | Count | Source | 252 | 2.53k | { | 253 | 2.53k | std::vector<std::shared_ptr<connection_holder>> connections; | 254 | 2.53k | { | 255 | 2.53k | LOCK(m_mutex); | 256 | 2.53k | connections = m_connections; | 257 | 2.53k | } | 258 | 2.53k | if constexpr (std::is_void_v<result_type>) { | 259 | 2.53k | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 260 | 2.53k | "Callback result type must be equal to the combiner result type (void)."); | 261 | 2.53k | for (const auto& connection : connections) { | 262 | | // Holding the callback pointer keeps the callback alive until | 263 | | // the call returns, even if it is disconnected concurrently. | 264 | 0 | if (const auto callback{connection->callback()}) { | 265 | 0 | (*callback)(args...); | 266 | 0 | } | 267 | 0 | } | 268 | | } else { | 269 | | static_assert(std::is_same_v<Combiner, any_of>, | 270 | | "only the any_of combiner is supported and hard-coded into this functor."); | 271 | | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 272 | | "Callback result type must be equal to the combiner result type (bool)."); | 273 | | result_type ret{false}; | 274 | | for (const auto& connection : connections) { | 275 | | if (const auto callback{connection->callback()}) { | 276 | | ret |= (*callback)(args...); | 277 | | } | 278 | | } | 279 | | return ret; | 280 | | } | 281 | 2.53k | } |
void btcsignals::signal<void (bool), btcsignals::null_value>::operator()<std::atomic<bool>&>(std::atomic<bool>&) const Line | Count | Source | 252 | 11 | { | 253 | 11 | std::vector<std::shared_ptr<connection_holder>> connections; | 254 | 11 | { | 255 | 11 | LOCK(m_mutex); | 256 | 11 | connections = m_connections; | 257 | 11 | } | 258 | 11 | if constexpr (std::is_void_v<result_type>) { | 259 | 11 | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 260 | 11 | "Callback result type must be equal to the combiner result type (void)."); | 261 | 11 | for (const auto& connection : connections) { | 262 | | // Holding the callback pointer keeps the callback alive until | 263 | | // the call returns, even if it is disconnected concurrently. | 264 | 0 | if (const auto callback{connection->callback()}) { | 265 | 0 | (*callback)(args...); | 266 | 0 | } | 267 | 0 | } | 268 | | } else { | 269 | | static_assert(std::is_same_v<Combiner, any_of>, | 270 | | "only the any_of combiner is supported and hard-coded into this functor."); | 271 | | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 272 | | "Callback result type must be equal to the combiner result type (bool)."); | 273 | | result_type ret{false}; | 274 | | for (const auto& connection : connections) { | 275 | | if (const auto callback{connection->callback()}) { | 276 | | ret |= (*callback)(args...); | 277 | | } | 278 | | } | 279 | | return ret; | 280 | | } | 281 | 11 | } |
void btcsignals::signal<void (bilingual_str const&, unsigned int), btcsignals::null_value>::operator()<bilingual_str&, CClientUIInterface::MessageBoxFlags>(bilingual_str&, CClientUIInterface::MessageBoxFlags&&) const Line | Count | Source | 252 | 12 | { | 253 | 12 | std::vector<std::shared_ptr<connection_holder>> connections; | 254 | 12 | { | 255 | 12 | LOCK(m_mutex); | 256 | 12 | connections = m_connections; | 257 | 12 | } | 258 | 12 | if constexpr (std::is_void_v<result_type>) { | 259 | 12 | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 260 | 12 | "Callback result type must be equal to the combiner result type (void)."); | 261 | 12 | for (const auto& connection : connections) { | 262 | | // Holding the callback pointer keeps the callback alive until | 263 | | // the call returns, even if it is disconnected concurrently. | 264 | 12 | if (const auto callback{connection->callback()}) { | 265 | 12 | (*callback)(args...); | 266 | 12 | } | 267 | 12 | } | 268 | | } else { | 269 | | static_assert(std::is_same_v<Combiner, any_of>, | 270 | | "only the any_of combiner is supported and hard-coded into this functor."); | 271 | | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 272 | | "Callback result type must be equal to the combiner result type (bool)."); | 273 | | result_type ret{false}; | 274 | | for (const auto& connection : connections) { | 275 | | if (const auto callback{connection->callback()}) { | 276 | | ret |= (*callback)(args...); | 277 | | } | 278 | | } | 279 | | return ret; | 280 | | } | 281 | 12 | } |
void btcsignals::signal<void (bilingual_str const&, unsigned int), btcsignals::null_value>::operator()<bilingual_str const&, CClientUIInterface::MessageBoxFlags>(bilingual_str const&, CClientUIInterface::MessageBoxFlags&&) const Line | Count | Source | 252 | 187 | { | 253 | 187 | std::vector<std::shared_ptr<connection_holder>> connections; | 254 | 187 | { | 255 | 187 | LOCK(m_mutex); | 256 | 187 | connections = m_connections; | 257 | 187 | } | 258 | 187 | if constexpr (std::is_void_v<result_type>) { | 259 | 187 | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 260 | 187 | "Callback result type must be equal to the combiner result type (void)."); | 261 | 187 | for (const auto& connection : connections) { | 262 | | // Holding the callback pointer keeps the callback alive until | 263 | | // the call returns, even if it is disconnected concurrently. | 264 | 187 | if (const auto callback{connection->callback()}) { | 265 | 187 | (*callback)(args...); | 266 | 187 | } | 267 | 187 | } | 268 | | } else { | 269 | | static_assert(std::is_same_v<Combiner, any_of>, | 270 | | "only the any_of combiner is supported and hard-coded into this functor."); | 271 | | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 272 | | "Callback result type must be equal to the combiner result type (bool)."); | 273 | | result_type ret{false}; | 274 | | for (const auto& connection : connections) { | 275 | | if (const auto callback{connection->callback()}) { | 276 | | ret |= (*callback)(args...); | 277 | | } | 278 | | } | 279 | | return ret; | 280 | | } | 281 | 187 | } |
void btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&), btcsignals::null_value>::operator()<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const Line | Count | Source | 252 | 1.50k | { | 253 | 1.50k | std::vector<std::shared_ptr<connection_holder>> connections; | 254 | 1.50k | { | 255 | 1.50k | LOCK(m_mutex); | 256 | 1.50k | connections = m_connections; | 257 | 1.50k | } | 258 | 1.50k | if constexpr (std::is_void_v<result_type>) { | 259 | 1.50k | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 260 | 1.50k | "Callback result type must be equal to the combiner result type (void)."); | 261 | 3.00k | for (const auto& connection : connections) { | 262 | | // Holding the callback pointer keeps the callback alive until | 263 | | // the call returns, even if it is disconnected concurrently. | 264 | 3.00k | if (const auto callback{connection->callback()}) { | 265 | 3.00k | (*callback)(args...); | 266 | 3.00k | } | 267 | 3.00k | } | 268 | | } else { | 269 | | static_assert(std::is_same_v<Combiner, any_of>, | 270 | | "only the any_of combiner is supported and hard-coded into this functor."); | 271 | | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 272 | | "Callback result type must be equal to the combiner result type (bool)."); | 273 | | result_type ret{false}; | 274 | | for (const auto& connection : connections) { | 275 | | if (const auto callback{connection->callback()}) { | 276 | | ret |= (*callback)(args...); | 277 | | } | 278 | | } | 279 | | return ret; | 280 | | } | 281 | 1.50k | } |
void btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, bool), btcsignals::null_value>::operator()<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int&, bool&>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int&, bool&) const Line | Count | Source | 252 | 8.29k | { | 253 | 8.29k | std::vector<std::shared_ptr<connection_holder>> connections; | 254 | 8.29k | { | 255 | 8.29k | LOCK(m_mutex); | 256 | 8.29k | connections = m_connections; | 257 | 8.29k | } | 258 | 8.29k | if constexpr (std::is_void_v<result_type>) { | 259 | 8.29k | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 260 | 8.29k | "Callback result type must be equal to the combiner result type (void)."); | 261 | 8.29k | for (const auto& connection : connections) { | 262 | | // Holding the callback pointer keeps the callback alive until | 263 | | // the call returns, even if it is disconnected concurrently. | 264 | 0 | if (const auto callback{connection->callback()}) { | 265 | 0 | (*callback)(args...); | 266 | 0 | } | 267 | 0 | } | 268 | | } else { | 269 | | static_assert(std::is_same_v<Combiner, any_of>, | 270 | | "only the any_of combiner is supported and hard-coded into this functor."); | 271 | | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 272 | | "Callback result type must be equal to the combiner result type (bool)."); | 273 | | result_type ret{false}; | 274 | | for (const auto& connection : connections) { | 275 | | if (const auto callback{connection->callback()}) { | 276 | | ret |= (*callback)(args...); | 277 | | } | 278 | | } | 279 | | return ret; | 280 | | } | 281 | 8.29k | } |
void btcsignals::signal<void (SynchronizationState, CBlockIndex const&, double), btcsignals::null_value>::operator()<SynchronizationState&, CBlockIndex const&, double&>(SynchronizationState&, CBlockIndex const&, double&) const Line | Count | Source | 252 | 98.7k | { | 253 | 98.7k | std::vector<std::shared_ptr<connection_holder>> connections; | 254 | 98.7k | { | 255 | 98.7k | LOCK(m_mutex); | 256 | 98.7k | connections = m_connections; | 257 | 98.7k | } | 258 | 98.7k | if constexpr (std::is_void_v<result_type>) { | 259 | 98.7k | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 260 | 98.7k | "Callback result type must be equal to the combiner result type (void)."); | 261 | 98.7k | for (const auto& connection : connections) { | 262 | | // Holding the callback pointer keeps the callback alive until | 263 | | // the call returns, even if it is disconnected concurrently. | 264 | 113 | if (const auto callback{connection->callback()}) { | 265 | 113 | (*callback)(args...); | 266 | 113 | } | 267 | 113 | } | 268 | | } else { | 269 | | static_assert(std::is_same_v<Combiner, any_of>, | 270 | | "only the any_of combiner is supported and hard-coded into this functor."); | 271 | | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 272 | | "Callback result type must be equal to the combiner result type (bool)."); | 273 | | result_type ret{false}; | 274 | | for (const auto& connection : connections) { | 275 | | if (const auto callback{connection->callback()}) { | 276 | | ret |= (*callback)(args...); | 277 | | } | 278 | | } | 279 | | return ret; | 280 | | } | 281 | 98.7k | } |
void btcsignals::signal<void (SynchronizationState, long, long, bool), btcsignals::null_value>::operator()<SynchronizationState&, long&, long&, bool&>(SynchronizationState&, long&, long&, bool&) const Line | Count | Source | 252 | 72.4k | { | 253 | 72.4k | std::vector<std::shared_ptr<connection_holder>> connections; | 254 | 72.4k | { | 255 | 72.4k | LOCK(m_mutex); | 256 | 72.4k | connections = m_connections; | 257 | 72.4k | } | 258 | 72.4k | if constexpr (std::is_void_v<result_type>) { | 259 | 72.4k | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 260 | 72.4k | "Callback result type must be equal to the combiner result type (void)."); | 261 | 72.4k | for (const auto& connection : connections) { | 262 | | // Holding the callback pointer keeps the callback alive until | 263 | | // the call returns, even if it is disconnected concurrently. | 264 | 0 | if (const auto callback{connection->callback()}) { | 265 | 0 | (*callback)(args...); | 266 | 0 | } | 267 | 0 | } | 268 | | } else { | 269 | | static_assert(std::is_same_v<Combiner, any_of>, | 270 | | "only the any_of combiner is supported and hard-coded into this functor."); | 271 | | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 272 | | "Callback result type must be equal to the combiner result type (bool)."); | 273 | | result_type ret{false}; | 274 | | for (const auto& connection : connections) { | 275 | | if (const auto callback{connection->callback()}) { | 276 | | ret |= (*callback)(args...); | 277 | | } | 278 | | } | 279 | | return ret; | 280 | | } | 281 | 72.4k | } |
void btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int), btcsignals::null_value>::operator()<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int const&>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&&, int const&) const Line | Count | Source | 252 | 908 | { | 253 | 908 | std::vector<std::shared_ptr<connection_holder>> connections; | 254 | 908 | { | 255 | 908 | LOCK(m_mutex); | 256 | 908 | connections = m_connections; | 257 | 908 | } | 258 | 908 | if constexpr (std::is_void_v<result_type>) { | 259 | 908 | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 260 | 908 | "Callback result type must be equal to the combiner result type (void)."); | 261 | 908 | for (const auto& connection : connections) { | 262 | | // Holding the callback pointer keeps the callback alive until | 263 | | // the call returns, even if it is disconnected concurrently. | 264 | 2 | if (const auto callback{connection->callback()}) { | 265 | 2 | (*callback)(args...); | 266 | 2 | } | 267 | 2 | } | 268 | | } else { | 269 | | static_assert(std::is_same_v<Combiner, any_of>, | 270 | | "only the any_of combiner is supported and hard-coded into this functor."); | 271 | | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 272 | | "Callback result type must be equal to the combiner result type (bool)."); | 273 | | result_type ret{false}; | 274 | | for (const auto& connection : connections) { | 275 | | if (const auto callback{connection->callback()}) { | 276 | | ret |= (*callback)(args...); | 277 | | } | 278 | | } | 279 | | return ret; | 280 | | } | 281 | 908 | } |
void btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int), btcsignals::null_value>::operator()<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&&, int&&) const Line | Count | Source | 252 | 1.46k | { | 253 | 1.46k | std::vector<std::shared_ptr<connection_holder>> connections; | 254 | 1.46k | { | 255 | 1.46k | LOCK(m_mutex); | 256 | 1.46k | connections = m_connections; | 257 | 1.46k | } | 258 | 1.46k | if constexpr (std::is_void_v<result_type>) { | 259 | 1.46k | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 260 | 1.46k | "Callback result type must be equal to the combiner result type (void)."); | 261 | 1.46k | for (const auto& connection : connections) { | 262 | | // Holding the callback pointer keeps the callback alive until | 263 | | // the call returns, even if it is disconnected concurrently. | 264 | 2 | if (const auto callback{connection->callback()}) { | 265 | 2 | (*callback)(args...); | 266 | 2 | } | 267 | 2 | } | 268 | | } else { | 269 | | static_assert(std::is_same_v<Combiner, any_of>, | 270 | | "only the any_of combiner is supported and hard-coded into this functor."); | 271 | | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 272 | | "Callback result type must be equal to the combiner result type (bool)."); | 273 | | result_type ret{false}; | 274 | | for (const auto& connection : connections) { | 275 | | if (const auto callback{connection->callback()}) { | 276 | | ret |= (*callback)(args...); | 277 | | } | 278 | | } | 279 | | return ret; | 280 | | } | 281 | 1.46k | } |
void btcsignals::signal<void (wallet::ScriptPubKeyMan const*, long), btcsignals::null_value>::operator()<wallet::DescriptorScriptPubKeyMan*, unsigned long&>(wallet::DescriptorScriptPubKeyMan*&&, unsigned long&) const Line | Count | Source | 252 | 24 | { | 253 | 24 | std::vector<std::shared_ptr<connection_holder>> connections; | 254 | 24 | { | 255 | 24 | LOCK(m_mutex); | 256 | 24 | connections = m_connections; | 257 | 24 | } | 258 | 24 | if constexpr (std::is_void_v<result_type>) { | 259 | 24 | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 260 | 24 | "Callback result type must be equal to the combiner result type (void)."); | 261 | 35 | for (const auto& connection : connections) { | 262 | | // Holding the callback pointer keeps the callback alive until | 263 | | // the call returns, even if it is disconnected concurrently. | 264 | 35 | if (const auto callback{connection->callback()}) { | 265 | 35 | (*callback)(args...); | 266 | 35 | } | 267 | 35 | } | 268 | | } else { | 269 | | static_assert(std::is_same_v<Combiner, any_of>, | 270 | | "only the any_of combiner is supported and hard-coded into this functor."); | 271 | | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 272 | | "Callback result type must be equal to the combiner result type (bool)."); | 273 | | result_type ret{false}; | 274 | | for (const auto& connection : connections) { | 275 | | if (const auto callback{connection->callback()}) { | 276 | | ret |= (*callback)(args...); | 277 | | } | 278 | | } | 279 | | return ret; | 280 | | } | 281 | 24 | } |
void btcsignals::signal<void (wallet::CWallet*), btcsignals::null_value>::operator()<wallet::CWallet*>(wallet::CWallet*&&) const Line | Count | Source | 252 | 254 | { | 253 | 254 | std::vector<std::shared_ptr<connection_holder>> connections; | 254 | 254 | { | 255 | 254 | LOCK(m_mutex); | 256 | 254 | connections = m_connections; | 257 | 254 | } | 258 | 254 | if constexpr (std::is_void_v<result_type>) { | 259 | 254 | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 260 | 254 | "Callback result type must be equal to the combiner result type (void)."); | 261 | 254 | for (const auto& connection : connections) { | 262 | | // Holding the callback pointer keeps the callback alive until | 263 | | // the call returns, even if it is disconnected concurrently. | 264 | 0 | if (const auto callback{connection->callback()}) { | 265 | 0 | (*callback)(args...); | 266 | 0 | } | 267 | 0 | } | 268 | | } else { | 269 | | static_assert(std::is_same_v<Combiner, any_of>, | 270 | | "only the any_of combiner is supported and hard-coded into this functor."); | 271 | | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 272 | | "Callback result type must be equal to the combiner result type (bool)."); | 273 | | result_type ret{false}; | 274 | | for (const auto& connection : connections) { | 275 | | if (const auto callback{connection->callback()}) { | 276 | | ret |= (*callback)(args...); | 277 | | } | 278 | | } | 279 | | return ret; | 280 | | } | 281 | 254 | } |
void btcsignals::signal<void (transaction_identifier<false> const&, ChangeType), btcsignals::null_value>::operator()<transaction_identifier<false> const&, ChangeType>(transaction_identifier<false> const&, ChangeType&&) const Line | Count | Source | 252 | 4.58k | { | 253 | 4.58k | std::vector<std::shared_ptr<connection_holder>> connections; | 254 | 4.58k | { | 255 | 4.58k | LOCK(m_mutex); | 256 | 4.58k | connections = m_connections; | 257 | 4.58k | } | 258 | 4.58k | if constexpr (std::is_void_v<result_type>) { | 259 | 4.58k | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 260 | 4.58k | "Callback result type must be equal to the combiner result type (void)."); | 261 | 4.58k | for (const auto& connection : connections) { | 262 | | // Holding the callback pointer keeps the callback alive until | 263 | | // the call returns, even if it is disconnected concurrently. | 264 | 0 | if (const auto callback{connection->callback()}) { | 265 | 0 | (*callback)(args...); | 266 | 0 | } | 267 | 0 | } | 268 | | } else { | 269 | | static_assert(std::is_same_v<Combiner, any_of>, | 270 | | "only the any_of combiner is supported and hard-coded into this functor."); | 271 | | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 272 | | "Callback result type must be equal to the combiner result type (bool)."); | 273 | | result_type ret{false}; | 274 | | for (const auto& connection : connections) { | 275 | | if (const auto callback{connection->callback()}) { | 276 | | ret |= (*callback)(args...); | 277 | | } | 278 | | } | 279 | | return ret; | 280 | | } | 281 | 4.58k | } |
void btcsignals::signal<void (transaction_identifier<false> const&, ChangeType), btcsignals::null_value>::operator()<transaction_identifier<false>&, ChangeType>(transaction_identifier<false>&, ChangeType&&) const Line | Count | Source | 252 | 27.1k | { | 253 | 27.1k | std::vector<std::shared_ptr<connection_holder>> connections; | 254 | 27.1k | { | 255 | 27.1k | LOCK(m_mutex); | 256 | 27.1k | connections = m_connections; | 257 | 27.1k | } | 258 | 27.1k | if constexpr (std::is_void_v<result_type>) { | 259 | 27.1k | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 260 | 27.1k | "Callback result type must be equal to the combiner result type (void)."); | 261 | 27.1k | for (const auto& connection : connections) { | 262 | | // Holding the callback pointer keeps the callback alive until | 263 | | // the call returns, even if it is disconnected concurrently. | 264 | 0 | if (const auto callback{connection->callback()}) { | 265 | 0 | (*callback)(args...); | 266 | 0 | } | 267 | 0 | } | 268 | | } else { | 269 | | static_assert(std::is_same_v<Combiner, any_of>, | 270 | | "only the any_of combiner is supported and hard-coded into this functor."); | 271 | | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 272 | | "Callback result type must be equal to the combiner result type (bool)."); | 273 | | result_type ret{false}; | 274 | | for (const auto& connection : connections) { | 275 | | if (const auto callback{connection->callback()}) { | 276 | | ret |= (*callback)(args...); | 277 | | } | 278 | | } | 279 | | return ret; | 280 | | } | 281 | 27.1k | } |
void btcsignals::signal<void (std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, wallet::AddressPurpose, ChangeType), btcsignals::null_value>::operator()<std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool&, wallet::AddressPurpose, ChangeType>(std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool&, wallet::AddressPurpose&&, ChangeType&&) const Line | Count | Source | 252 | 28.2k | { | 253 | 28.2k | std::vector<std::shared_ptr<connection_holder>> connections; | 254 | 28.2k | { | 255 | 28.2k | LOCK(m_mutex); | 256 | 28.2k | connections = m_connections; | 257 | 28.2k | } | 258 | 28.2k | if constexpr (std::is_void_v<result_type>) { | 259 | 28.2k | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 260 | 28.2k | "Callback result type must be equal to the combiner result type (void)."); | 261 | 28.2k | for (const auto& connection : connections) { | 262 | | // Holding the callback pointer keeps the callback alive until | 263 | | // the call returns, even if it is disconnected concurrently. | 264 | 0 | if (const auto callback{connection->callback()}) { | 265 | 0 | (*callback)(args...); | 266 | 0 | } | 267 | 0 | } | 268 | | } else { | 269 | | static_assert(std::is_same_v<Combiner, any_of>, | 270 | | "only the any_of combiner is supported and hard-coded into this functor."); | 271 | | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 272 | | "Callback result type must be equal to the combiner result type (bool)."); | 273 | | result_type ret{false}; | 274 | | for (const auto& connection : connections) { | 275 | | if (const auto callback{connection->callback()}) { | 276 | | ret |= (*callback)(args...); | 277 | | } | 278 | | } | 279 | | return ret; | 280 | | } | 281 | 28.2k | } |
void btcsignals::signal<void (std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, wallet::AddressPurpose, ChangeType), btcsignals::null_value>::operator()<std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown> const&, char const (&) [1], bool, wallet::AddressPurpose, ChangeType>(std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown> const&, char const (&) [1], bool&&, wallet::AddressPurpose&&, ChangeType&&) const Line | Count | Source | 252 | 28 | { | 253 | 28 | std::vector<std::shared_ptr<connection_holder>> connections; | 254 | 28 | { | 255 | 28 | LOCK(m_mutex); | 256 | 28 | connections = m_connections; | 257 | 28 | } | 258 | 28 | if constexpr (std::is_void_v<result_type>) { | 259 | 28 | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 260 | 28 | "Callback result type must be equal to the combiner result type (void)."); | 261 | 28 | for (const auto& connection : connections) { | 262 | | // Holding the callback pointer keeps the callback alive until | 263 | | // the call returns, even if it is disconnected concurrently. | 264 | 0 | if (const auto callback{connection->callback()}) { | 265 | 0 | (*callback)(args...); | 266 | 0 | } | 267 | 0 | } | 268 | | } else { | 269 | | static_assert(std::is_same_v<Combiner, any_of>, | 270 | | "only the any_of combiner is supported and hard-coded into this functor."); | 271 | | static_assert(std::is_same_v<result_type, typename function_type::result_type>, | 272 | | "Callback result type must be equal to the combiner result type (bool)."); | 273 | | result_type ret{false}; | 274 | | for (const auto& connection : connections) { | 275 | | if (const auto callback{connection->callback()}) { | 276 | | ret |= (*callback)(args...); | 277 | | } | 278 | | } | 279 | | return ret; | 280 | | } | 281 | 28 | } |
|
282 | | |
283 | | /* |
284 | | * Connect a new callback to the signal. A forwarding callable accepts |
285 | | * anything that can be stored in a std::function. |
286 | | */ |
287 | | template <typename Callable> |
288 | | connection connect(Callable&& func) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex) |
289 | 24.1k | { |
290 | 24.1k | LOCK(m_mutex); |
291 | | |
292 | | // Garbage-collect disconnected connections to prevent unbounded growth |
293 | 260k | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); });auto btcsignals::connection btcsignals::signal<void (int&), btcsignals::null_value>::connect<void (&)(int&)>(void (&)(int&))::'lambda'(void (& const&)(int&))::operator()<std::shared_ptr<btcsignals::signal<void (int&), btcsignals::null_value>::connection_holder>>(void (& const&)(int&)) const Line | Count | Source | 293 | 8 | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); |
Unexecuted instantiation: btcsignals_tests.cpp:auto btcsignals::connection btcsignals::signal<void (), btcsignals::null_value>::connect<btcsignals_tests::callback_destruction::test_method()::$_0>(btcsignals_tests::callback_destruction::test_method()::$_0&&)::'lambda'(btcsignals_tests::callback_destruction::test_method()::$_0 const&)::operator()<std::shared_ptr<btcsignals::signal<void (), btcsignals::null_value>::connection_holder>>(btcsignals_tests::callback_destruction::test_method()::$_0 const&) const Unexecuted instantiation: btcsignals_tests.cpp:auto btcsignals::connection btcsignals::signal<void (), btcsignals::null_value>::connect<btcsignals_tests::callback_destruction::test_method()::$_1>(btcsignals_tests::callback_destruction::test_method()::$_1&&)::'lambda'(btcsignals_tests::callback_destruction::test_method()::$_1 const&)::operator()<std::shared_ptr<btcsignals::signal<void (), btcsignals::null_value>::connection_holder>>(btcsignals_tests::callback_destruction::test_method()::$_1 const&) const Unexecuted instantiation: btcsignals_tests.cpp:auto btcsignals::connection btcsignals::signal<void (), btcsignals::null_value>::connect<btcsignals_tests::self_disconnect_destruction::test_method()::$_0>(btcsignals_tests::self_disconnect_destruction::test_method()::$_0&&)::'lambda'(btcsignals_tests::self_disconnect_destruction::test_method()::$_0 const&)::operator()<std::shared_ptr<btcsignals::signal<void (), btcsignals::null_value>::connection_holder>>(btcsignals_tests::self_disconnect_destruction::test_method()::$_0 const&) const Unexecuted instantiation: btcsignals_tests.cpp:auto btcsignals::connection btcsignals::signal<void (), btcsignals::null_value>::connect<btcsignals_tests::concurrent_disconnect_destruction::test_method()::$_0>(btcsignals_tests::concurrent_disconnect_destruction::test_method()::$_0&&)::'lambda'(btcsignals_tests::concurrent_disconnect_destruction::test_method()::$_0 const&)::operator()<std::shared_ptr<btcsignals::signal<void (), btcsignals::null_value>::connection_holder>>(btcsignals_tests::concurrent_disconnect_destruction::test_method()::$_0 const&) const auto btcsignals::connection btcsignals::signal<bool (), btcsignals::any_of>::connect<bool (&)()>(bool (&)())::'lambda'(bool (& const&)())::operator()<std::shared_ptr<btcsignals::signal<bool (), btcsignals::any_of>::connection_holder>>(bool (& const&)()) const Line | Count | Source | 293 | 2 | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); |
Unexecuted instantiation: btcsignals_tests.cpp:auto btcsignals::connection btcsignals::signal<void (), btcsignals::null_value>::connect<btcsignals_tests::thread_safety::test_method()::$_0>(btcsignals_tests::thread_safety::test_method()::$_0&&)::'lambda'(btcsignals_tests::thread_safety::test_method()::$_0 const&)::operator()<std::shared_ptr<btcsignals::signal<void (), btcsignals::null_value>::connection_holder>>(btcsignals_tests::thread_safety::test_method()::$_0 const&) const btcsignals_tests.cpp:auto btcsignals::connection btcsignals::signal<void (), btcsignals::null_value>::connect<btcsignals_tests::thread_safety::test_method()::$_2::operator()() const::'lambda'()>(btcsignals_tests::thread_safety::test_method()::$_2::operator()() const::'lambda'()&&)::'lambda'(btcsignals_tests::thread_safety::test_method()::$_2::operator()() const::'lambda'() const&)::operator()<std::shared_ptr<btcsignals::signal<void (), btcsignals::null_value>::connection_holder>>(btcsignals_tests::thread_safety::test_method()::$_2::operator()() const::'lambda'() const&) const Line | Count | Source | 293 | 251k | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); |
Unexecuted instantiation: btcsignals_tests.cpp:auto btcsignals::connection btcsignals::signal<void (), btcsignals::null_value>::connect<btcsignals_tests::recursion_safety::test_method()::$_0>(btcsignals_tests::recursion_safety::test_method()::$_0&&)::'lambda'(btcsignals_tests::recursion_safety::test_method()::$_0 const&)::operator()<std::shared_ptr<btcsignals::signal<void (), btcsignals::null_value>::connection_holder>>(btcsignals_tests::recursion_safety::test_method()::$_0 const&) const btcsignals_tests.cpp:auto btcsignals::connection btcsignals::signal<void (), btcsignals::null_value>::connect<btcsignals_tests::recursion_safety::test_method()::$_1>(btcsignals_tests::recursion_safety::test_method()::$_1&&)::'lambda'(btcsignals_tests::recursion_safety::test_method()::$_1 const&)::operator()<std::shared_ptr<btcsignals::signal<void (), btcsignals::null_value>::connection_holder>>(btcsignals_tests::recursion_safety::test_method()::$_1 const&) const Line | Count | Source | 293 | 1 | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); |
btcsignals_tests.cpp:auto btcsignals::connection btcsignals::signal<void (), btcsignals::null_value>::connect<btcsignals_tests::recursion_safety::test_method()::$_2>(btcsignals_tests::recursion_safety::test_method()::$_2&&)::'lambda'(btcsignals_tests::recursion_safety::test_method()::$_2 const&)::operator()<std::shared_ptr<btcsignals::signal<void (), btcsignals::null_value>::connection_holder>>(btcsignals_tests::recursion_safety::test_method()::$_2 const&) const Line | Count | Source | 293 | 2 | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); |
btcsignals_tests.cpp:auto btcsignals::connection btcsignals::signal<void (), btcsignals::null_value>::connect<btcsignals_tests::recursion_safety::test_method()::$_2::operator()() const::'lambda'()>(btcsignals_tests::recursion_safety::test_method()::$_2::operator()() const::'lambda'()&&)::'lambda'(btcsignals_tests::recursion_safety::test_method()::$_2::operator()() const::'lambda'() const&)::operator()<std::shared_ptr<btcsignals::signal<void (), btcsignals::null_value>::connection_holder>>(btcsignals_tests::recursion_safety::test_method()::$_2::operator()() const::'lambda'() const&) const Line | Count | Source | 293 | 2 | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); |
Unexecuted instantiation: btcsignals_tests.cpp:auto btcsignals::connection btcsignals::signal<void (int&), btcsignals::null_value>::connect<btcsignals_tests::disconnect_thread_safety::test_method()::$_0>(btcsignals_tests::disconnect_thread_safety::test_method()::$_0&&)::'lambda'(btcsignals_tests::disconnect_thread_safety::test_method()::$_0 const&)::operator()<std::shared_ptr<btcsignals::signal<void (int&), btcsignals::null_value>::connection_holder>>(btcsignals_tests::disconnect_thread_safety::test_method()::$_0 const&) const Unexecuted instantiation: rescan_tests.cpp:auto btcsignals::connection btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int), btcsignals::null_value>::connect<wallet::rescan_tests::scan_for_wallet_transactions_tip_extension::test_method()::$_0>(wallet::rescan_tests::scan_for_wallet_transactions_tip_extension::test_method()::$_0&&)::'lambda'(wallet::rescan_tests::scan_for_wallet_transactions_tip_extension::test_method()::$_0 const&)::operator()<std::shared_ptr<btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int), btcsignals::null_value>::connection_holder>>(wallet::rescan_tests::scan_for_wallet_transactions_tip_extension::test_method()::$_0 const&) const auto btcsignals::connection btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&), btcsignals::null_value>::connect<void (&)(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)>(void (&)(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&))::'lambda'(void (& const&)(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&))::operator()<std::shared_ptr<btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&), btcsignals::null_value>::connection_holder>>(void (& const&)(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)) const Line | Count | Source | 293 | 1.36k | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); |
Unexecuted instantiation: init.cpp:auto btcsignals::connection btcsignals::signal<void (SynchronizationState, CBlockIndex const&, double), btcsignals::null_value>::connect<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_9>(AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_9&&)::'lambda'(AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_9 const&)::operator()<std::shared_ptr<btcsignals::signal<void (SynchronizationState, CBlockIndex const&, double), btcsignals::null_value>::connection_holder>>(AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_9 const&) const Unexecuted instantiation: auto btcsignals::connection btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&), btcsignals::null_value>::connect<std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)>&>(std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)>&)::'lambda'(std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)>& const&)::operator()<std::shared_ptr<btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&), btcsignals::null_value>::connection_holder>>(std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)>& const&) const Unexecuted instantiation: auto btcsignals::connection btcsignals::signal<void (bilingual_str const&, unsigned int), btcsignals::null_value>::connect<std::function<void (bilingual_str const&, unsigned int)>&>(std::function<void (bilingual_str const&, unsigned int)>&)::'lambda'(std::function<void (bilingual_str const&, unsigned int)>& const&)::operator()<std::shared_ptr<btcsignals::signal<void (bilingual_str const&, unsigned int), btcsignals::null_value>::connection_holder>>(std::function<void (bilingual_str const&, unsigned int)>& const&) const Unexecuted instantiation: auto btcsignals::connection btcsignals::signal<bool (bilingual_str const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int), btcsignals::any_of>::connect<std::function<bool (bilingual_str const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int)>&>(std::function<bool (bilingual_str const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int)>&)::'lambda'(std::function<bool (bilingual_str const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int)>& const&)::operator()<std::shared_ptr<btcsignals::signal<bool (bilingual_str const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int), btcsignals::any_of>::connection_holder>>(std::function<bool (bilingual_str const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int)>& const&) const Unexecuted instantiation: auto btcsignals::connection btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, bool), btcsignals::null_value>::connect<std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, bool)>&>(std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, bool)>&)::'lambda'(std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, bool)>& const&)::operator()<std::shared_ptr<btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, bool), btcsignals::null_value>::connection_holder>>(std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, bool)>& const&) const Unexecuted instantiation: auto btcsignals::connection btcsignals::signal<void (), btcsignals::null_value>::connect<std::function<void ()>&>(std::function<void ()>&)::'lambda'(std::function<void ()>& const&)::operator()<std::shared_ptr<btcsignals::signal<void (), btcsignals::null_value>::connection_holder>>(std::function<void ()>& const&) const Unexecuted instantiation: auto btcsignals::connection btcsignals::signal<void (int), btcsignals::null_value>::connect<std::function<void (int)>&>(std::function<void (int)>&)::'lambda'(std::function<void (int)>& const&)::operator()<std::shared_ptr<btcsignals::signal<void (int), btcsignals::null_value>::connection_holder>>(std::function<void (int)>& const&) const Unexecuted instantiation: auto btcsignals::connection btcsignals::signal<void (bool), btcsignals::null_value>::connect<std::function<void (bool)>&>(std::function<void (bool)>&)::'lambda'(std::function<void (bool)>& const&)::operator()<std::shared_ptr<btcsignals::signal<void (bool), btcsignals::null_value>::connection_holder>>(std::function<void (bool)>& const&) const Unexecuted instantiation: interfaces.cpp:auto btcsignals::connection btcsignals::signal<void (SynchronizationState, CBlockIndex const&, double), btcsignals::null_value>::connect<node::(anonymous namespace)::NodeImpl::handleNotifyBlockTip(std::function<void (SynchronizationState, interfaces::BlockTip, double)>)::'lambda'(SynchronizationState, CBlockIndex const&, double)>(node::(anonymous namespace)::NodeImpl::handleNotifyBlockTip(std::function<void (SynchronizationState, interfaces::BlockTip, double)>)::'lambda'(SynchronizationState, CBlockIndex const&, double)&&)::'lambda'(node::(anonymous namespace)::NodeImpl::handleNotifyBlockTip(std::function<void (SynchronizationState, interfaces::BlockTip, double)>)::'lambda'(SynchronizationState, CBlockIndex const&, double) const&)::operator()<std::shared_ptr<btcsignals::signal<void (SynchronizationState, CBlockIndex const&, double), btcsignals::null_value>::connection_holder>>(node::(anonymous namespace)::NodeImpl::handleNotifyBlockTip(std::function<void (SynchronizationState, interfaces::BlockTip, double)>)::'lambda'(SynchronizationState, CBlockIndex const&, double) const&) const Unexecuted instantiation: interfaces.cpp:auto btcsignals::connection btcsignals::signal<void (SynchronizationState, long, long, bool), btcsignals::null_value>::connect<node::(anonymous namespace)::NodeImpl::handleNotifyHeaderTip(std::function<void (SynchronizationState, interfaces::BlockTip, bool)>)::'lambda'(SynchronizationState, long, long, bool)>(node::(anonymous namespace)::NodeImpl::handleNotifyHeaderTip(std::function<void (SynchronizationState, interfaces::BlockTip, bool)>)::'lambda'(SynchronizationState, long, long, bool)&&)::'lambda'(node::(anonymous namespace)::NodeImpl::handleNotifyHeaderTip(std::function<void (SynchronizationState, interfaces::BlockTip, bool)>)::'lambda'(SynchronizationState, long, long, bool) const&)::operator()<std::shared_ptr<btcsignals::signal<void (SynchronizationState, long, long, bool), btcsignals::null_value>::connection_holder>>(node::(anonymous namespace)::NodeImpl::handleNotifyHeaderTip(std::function<void (SynchronizationState, interfaces::BlockTip, bool)>)::'lambda'(SynchronizationState, long, long, bool) const&) const auto btcsignals::connection btcsignals::signal<void (bilingual_str const&, unsigned int), btcsignals::null_value>::connect<void (&)(bilingual_str const&, unsigned int)>(void (&)(bilingual_str const&, unsigned int))::'lambda'(void (& const&)(bilingual_str const&, unsigned int))::operator()<std::shared_ptr<btcsignals::signal<void (bilingual_str const&, unsigned int), btcsignals::null_value>::connection_holder>>(void (& const&)(bilingual_str const&, unsigned int)) const Line | Count | Source | 293 | 142 | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); |
auto btcsignals::connection btcsignals::signal<bool (bilingual_str const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int), btcsignals::any_of>::connect<bool (&)(bilingual_str const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int)>(bool (&)(bilingual_str const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int))::'lambda'(bool (& const&)(bilingual_str const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int))::operator()<std::shared_ptr<btcsignals::signal<bool (bilingual_str const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int), btcsignals::any_of>::connection_holder>>(bool (& const&)(bilingual_str const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int)) const Line | Count | Source | 293 | 142 | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); |
Unexecuted instantiation: auto btcsignals::connection btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int), btcsignals::null_value>::connect<std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)>&>(std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)>&)::'lambda'(std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)>& const&)::operator()<std::shared_ptr<btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int), btcsignals::null_value>::connection_holder>>(std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)>& const&) const Unexecuted instantiation: interfaces.cpp:auto btcsignals::connection btcsignals::signal<void (wallet::CWallet*), btcsignals::null_value>::connect<wallet::(anonymous namespace)::WalletImpl::handleStatusChanged(std::function<void ()>)::'lambda'(wallet::CWallet*)>(wallet::(anonymous namespace)::WalletImpl::handleStatusChanged(std::function<void ()>)::'lambda'(wallet::CWallet*)&&)::'lambda'(wallet::(anonymous namespace)::WalletImpl::handleStatusChanged(std::function<void ()>)::'lambda'(wallet::CWallet*) const&)::operator()<std::shared_ptr<btcsignals::signal<void (wallet::CWallet*), btcsignals::null_value>::connection_holder>>(wallet::(anonymous namespace)::WalletImpl::handleStatusChanged(std::function<void ()>)::'lambda'(wallet::CWallet*) const&) const Unexecuted instantiation: interfaces.cpp:auto btcsignals::connection btcsignals::signal<void (std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, wallet::AddressPurpose, ChangeType), btcsignals::null_value>::connect<wallet::(anonymous namespace)::WalletImpl::handleAddressBookChanged(std::function<void (std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, wallet::AddressPurpose, ChangeType)>)::'lambda'(std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, wallet::AddressPurpose, ChangeType)>(wallet::(anonymous namespace)::WalletImpl::handleAddressBookChanged(std::function<void (std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, wallet::AddressPurpose, ChangeType)>)::'lambda'(std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, wallet::AddressPurpose, ChangeType)&&)::'lambda'(wallet::(anonymous namespace)::WalletImpl::handleAddressBookChanged(std::function<void (std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, wallet::AddressPurpose, ChangeType)>)::'lambda'(std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, wallet::AddressPurpose, ChangeType) const&)::operator()<std::shared_ptr<btcsignals::signal<void (std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, wallet::AddressPurpose, ChangeType), btcsignals::null_value>::connection_holder>>(wallet::(anonymous namespace)::WalletImpl::handleAddressBookChanged(std::function<void (std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, wallet::AddressPurpose, ChangeType)>)::'lambda'(std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, wallet::AddressPurpose, ChangeType) const&) const Unexecuted instantiation: interfaces.cpp:auto btcsignals::connection btcsignals::signal<void (transaction_identifier<false> const&, ChangeType), btcsignals::null_value>::connect<wallet::(anonymous namespace)::WalletImpl::handleTransactionChanged(std::function<void (transaction_identifier<false> const&, ChangeType)>)::'lambda'(transaction_identifier<false> const&, ChangeType)>(wallet::(anonymous namespace)::WalletImpl::handleTransactionChanged(std::function<void (transaction_identifier<false> const&, ChangeType)>)::'lambda'(transaction_identifier<false> const&, ChangeType)&&)::'lambda'(wallet::(anonymous namespace)::WalletImpl::handleTransactionChanged(std::function<void (transaction_identifier<false> const&, ChangeType)>)::'lambda'(transaction_identifier<false> const&, ChangeType) const&)::operator()<std::shared_ptr<btcsignals::signal<void (transaction_identifier<false> const&, ChangeType), btcsignals::null_value>::connection_holder>>(wallet::(anonymous namespace)::WalletImpl::handleTransactionChanged(std::function<void (transaction_identifier<false> const&, ChangeType)>)::'lambda'(transaction_identifier<false> const&, ChangeType) const&) const wallet.cpp:auto btcsignals::connection btcsignals::signal<void (), btcsignals::null_value>::connect<wallet::CWallet::ConnectScriptPubKeyManNotifiers()::$_0>(wallet::CWallet::ConnectScriptPubKeyManNotifiers()::$_0&&)::'lambda'(wallet::CWallet::ConnectScriptPubKeyManNotifiers()::$_0 const&)::operator()<std::shared_ptr<btcsignals::signal<void (), btcsignals::null_value>::connection_holder>>(wallet::CWallet::ConnectScriptPubKeyManNotifiers()::$_0 const&) const Line | Count | Source | 293 | 3.69k | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); |
wallet.cpp:auto btcsignals::connection btcsignals::signal<void (wallet::ScriptPubKeyMan const*, long), btcsignals::null_value>::connect<wallet::CWallet::ConnectScriptPubKeyManNotifiers()::$_1>(wallet::CWallet::ConnectScriptPubKeyManNotifiers()::$_1&&)::'lambda'(wallet::CWallet::ConnectScriptPubKeyManNotifiers()::$_1 const&)::operator()<std::shared_ptr<btcsignals::signal<void (wallet::ScriptPubKeyMan const*, long), btcsignals::null_value>::connection_holder>>(wallet::CWallet::ConnectScriptPubKeyManNotifiers()::$_1 const&) const Line | Count | Source | 293 | 3.69k | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); |
|
294 | | |
295 | 24.1k | const auto& entry = m_connections.emplace_back(std::make_shared<connection_holder>(std::forward<Callable>(func))); |
296 | 24.1k | return connection(entry); |
297 | 24.1k | } btcsignals::connection btcsignals::signal<void (int&), btcsignals::null_value>::connect<void (&)(int&)>(void (&)(int&)) Line | Count | Source | 289 | 8 | { | 290 | 8 | LOCK(m_mutex); | 291 | | | 292 | | // Garbage-collect disconnected connections to prevent unbounded growth | 293 | 8 | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); | 294 | | | 295 | 8 | const auto& entry = m_connections.emplace_back(std::make_shared<connection_holder>(std::forward<Callable>(func))); | 296 | 8 | return connection(entry); | 297 | 8 | } |
btcsignals_tests.cpp:btcsignals::connection btcsignals::signal<void (), btcsignals::null_value>::connect<btcsignals_tests::callback_destruction::test_method()::$_0>(btcsignals_tests::callback_destruction::test_method()::$_0&&) Line | Count | Source | 289 | 1 | { | 290 | 1 | LOCK(m_mutex); | 291 | | | 292 | | // Garbage-collect disconnected connections to prevent unbounded growth | 293 | 1 | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); | 294 | | | 295 | 1 | const auto& entry = m_connections.emplace_back(std::make_shared<connection_holder>(std::forward<Callable>(func))); | 296 | 1 | return connection(entry); | 297 | 1 | } |
btcsignals_tests.cpp:btcsignals::connection btcsignals::signal<void (), btcsignals::null_value>::connect<btcsignals_tests::callback_destruction::test_method()::$_1>(btcsignals_tests::callback_destruction::test_method()::$_1&&) Line | Count | Source | 289 | 1 | { | 290 | 1 | LOCK(m_mutex); | 291 | | | 292 | | // Garbage-collect disconnected connections to prevent unbounded growth | 293 | 1 | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); | 294 | | | 295 | 1 | const auto& entry = m_connections.emplace_back(std::make_shared<connection_holder>(std::forward<Callable>(func))); | 296 | 1 | return connection(entry); | 297 | 1 | } |
btcsignals_tests.cpp:btcsignals::connection btcsignals::signal<void (), btcsignals::null_value>::connect<btcsignals_tests::self_disconnect_destruction::test_method()::$_0>(btcsignals_tests::self_disconnect_destruction::test_method()::$_0&&) Line | Count | Source | 289 | 1 | { | 290 | 1 | LOCK(m_mutex); | 291 | | | 292 | | // Garbage-collect disconnected connections to prevent unbounded growth | 293 | 1 | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); | 294 | | | 295 | 1 | const auto& entry = m_connections.emplace_back(std::make_shared<connection_holder>(std::forward<Callable>(func))); | 296 | 1 | return connection(entry); | 297 | 1 | } |
btcsignals_tests.cpp:btcsignals::connection btcsignals::signal<void (), btcsignals::null_value>::connect<btcsignals_tests::concurrent_disconnect_destruction::test_method()::$_0>(btcsignals_tests::concurrent_disconnect_destruction::test_method()::$_0&&) Line | Count | Source | 289 | 1 | { | 290 | 1 | LOCK(m_mutex); | 291 | | | 292 | | // Garbage-collect disconnected connections to prevent unbounded growth | 293 | 1 | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); | 294 | | | 295 | 1 | const auto& entry = m_connections.emplace_back(std::make_shared<connection_holder>(std::forward<Callable>(func))); | 296 | 1 | return connection(entry); | 297 | 1 | } |
btcsignals::connection btcsignals::signal<bool (), btcsignals::any_of>::connect<bool (&)()>(bool (&)()) Line | Count | Source | 289 | 3 | { | 290 | 3 | LOCK(m_mutex); | 291 | | | 292 | | // Garbage-collect disconnected connections to prevent unbounded growth | 293 | 3 | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); | 294 | | | 295 | 3 | const auto& entry = m_connections.emplace_back(std::make_shared<connection_holder>(std::forward<Callable>(func))); | 296 | 3 | return connection(entry); | 297 | 3 | } |
btcsignals_tests.cpp:btcsignals::connection btcsignals::signal<void (), btcsignals::null_value>::connect<btcsignals_tests::thread_safety::test_method()::$_0>(btcsignals_tests::thread_safety::test_method()::$_0&&) Line | Count | Source | 289 | 1 | { | 290 | 1 | LOCK(m_mutex); | 291 | | | 292 | | // Garbage-collect disconnected connections to prevent unbounded growth | 293 | 1 | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); | 294 | | | 295 | 1 | const auto& entry = m_connections.emplace_back(std::make_shared<connection_holder>(std::forward<Callable>(func))); | 296 | 1 | return connection(entry); | 297 | 1 | } |
btcsignals_tests.cpp:btcsignals::connection btcsignals::signal<void (), btcsignals::null_value>::connect<btcsignals_tests::thread_safety::test_method()::$_2::operator()() const::'lambda'()>(btcsignals_tests::thread_safety::test_method()::$_2::operator()() const::'lambda'()&&) Line | Count | Source | 289 | 1.00k | { | 290 | 1.00k | LOCK(m_mutex); | 291 | | | 292 | | // Garbage-collect disconnected connections to prevent unbounded growth | 293 | 1.00k | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); | 294 | | | 295 | 1.00k | const auto& entry = m_connections.emplace_back(std::make_shared<connection_holder>(std::forward<Callable>(func))); | 296 | 1.00k | return connection(entry); | 297 | 1.00k | } |
btcsignals_tests.cpp:btcsignals::connection btcsignals::signal<void (), btcsignals::null_value>::connect<btcsignals_tests::recursion_safety::test_method()::$_0>(btcsignals_tests::recursion_safety::test_method()::$_0&&) Line | Count | Source | 289 | 1 | { | 290 | 1 | LOCK(m_mutex); | 291 | | | 292 | | // Garbage-collect disconnected connections to prevent unbounded growth | 293 | 1 | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); | 294 | | | 295 | 1 | const auto& entry = m_connections.emplace_back(std::make_shared<connection_holder>(std::forward<Callable>(func))); | 296 | 1 | return connection(entry); | 297 | 1 | } |
btcsignals_tests.cpp:btcsignals::connection btcsignals::signal<void (), btcsignals::null_value>::connect<btcsignals_tests::recursion_safety::test_method()::$_1>(btcsignals_tests::recursion_safety::test_method()::$_1&&) Line | Count | Source | 289 | 1 | { | 290 | 1 | LOCK(m_mutex); | 291 | | | 292 | | // Garbage-collect disconnected connections to prevent unbounded growth | 293 | 1 | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); | 294 | | | 295 | 1 | const auto& entry = m_connections.emplace_back(std::make_shared<connection_holder>(std::forward<Callable>(func))); | 296 | 1 | return connection(entry); | 297 | 1 | } |
btcsignals_tests.cpp:btcsignals::connection btcsignals::signal<void (), btcsignals::null_value>::connect<btcsignals_tests::recursion_safety::test_method()::$_2>(btcsignals_tests::recursion_safety::test_method()::$_2&&) Line | Count | Source | 289 | 1 | { | 290 | 1 | LOCK(m_mutex); | 291 | | | 292 | | // Garbage-collect disconnected connections to prevent unbounded growth | 293 | 1 | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); | 294 | | | 295 | 1 | const auto& entry = m_connections.emplace_back(std::make_shared<connection_holder>(std::forward<Callable>(func))); | 296 | 1 | return connection(entry); | 297 | 1 | } |
btcsignals_tests.cpp:btcsignals::connection btcsignals::signal<void (), btcsignals::null_value>::connect<btcsignals_tests::recursion_safety::test_method()::$_2::operator()() const::'lambda'()>(btcsignals_tests::recursion_safety::test_method()::$_2::operator()() const::'lambda'()&&) Line | Count | Source | 289 | 1 | { | 290 | 1 | LOCK(m_mutex); | 291 | | | 292 | | // Garbage-collect disconnected connections to prevent unbounded growth | 293 | 1 | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); | 294 | | | 295 | 1 | const auto& entry = m_connections.emplace_back(std::make_shared<connection_holder>(std::forward<Callable>(func))); | 296 | 1 | return connection(entry); | 297 | 1 | } |
btcsignals_tests.cpp:btcsignals::connection btcsignals::signal<void (int&), btcsignals::null_value>::connect<btcsignals_tests::disconnect_thread_safety::test_method()::$_0>(btcsignals_tests::disconnect_thread_safety::test_method()::$_0&&) Line | Count | Source | 289 | 1 | { | 290 | 1 | LOCK(m_mutex); | 291 | | | 292 | | // Garbage-collect disconnected connections to prevent unbounded growth | 293 | 1 | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); | 294 | | | 295 | 1 | const auto& entry = m_connections.emplace_back(std::make_shared<connection_holder>(std::forward<Callable>(func))); | 296 | 1 | return connection(entry); | 297 | 1 | } |
rescan_tests.cpp:btcsignals::connection btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int), btcsignals::null_value>::connect<wallet::rescan_tests::scan_for_wallet_transactions_tip_extension::test_method()::$_0>(wallet::rescan_tests::scan_for_wallet_transactions_tip_extension::test_method()::$_0&&) Line | Count | Source | 289 | 1 | { | 290 | 1 | LOCK(m_mutex); | 291 | | | 292 | | // Garbage-collect disconnected connections to prevent unbounded growth | 293 | 1 | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); | 294 | | | 295 | 1 | const auto& entry = m_connections.emplace_back(std::make_shared<connection_holder>(std::forward<Callable>(func))); | 296 | 1 | return connection(entry); | 297 | 1 | } |
btcsignals::connection btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&), btcsignals::null_value>::connect<void (&)(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)>(void (&)(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)) Line | Count | Source | 289 | 2.81k | { | 290 | 2.81k | LOCK(m_mutex); | 291 | | | 292 | | // Garbage-collect disconnected connections to prevent unbounded growth | 293 | 2.81k | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); | 294 | | | 295 | 2.81k | const auto& entry = m_connections.emplace_back(std::make_shared<connection_holder>(std::forward<Callable>(func))); | 296 | 2.81k | return connection(entry); | 297 | 2.81k | } |
init.cpp:btcsignals::connection btcsignals::signal<void (SynchronizationState, CBlockIndex const&, double), btcsignals::null_value>::connect<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_9>(AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_9&&) Line | Count | Source | 289 | 1 | { | 290 | 1 | LOCK(m_mutex); | 291 | | | 292 | | // Garbage-collect disconnected connections to prevent unbounded growth | 293 | 1 | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); | 294 | | | 295 | 1 | const auto& entry = m_connections.emplace_back(std::make_shared<connection_holder>(std::forward<Callable>(func))); | 296 | 1 | return connection(entry); | 297 | 1 | } |
Unexecuted instantiation: btcsignals::connection btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&), btcsignals::null_value>::connect<std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)>&>(std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)>&) Unexecuted instantiation: btcsignals::connection btcsignals::signal<void (bilingual_str const&, unsigned int), btcsignals::null_value>::connect<std::function<void (bilingual_str const&, unsigned int)>&>(std::function<void (bilingual_str const&, unsigned int)>&) Unexecuted instantiation: btcsignals::connection btcsignals::signal<bool (bilingual_str const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int), btcsignals::any_of>::connect<std::function<bool (bilingual_str const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int)>&>(std::function<bool (bilingual_str const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int)>&) Unexecuted instantiation: btcsignals::connection btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, bool), btcsignals::null_value>::connect<std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, bool)>&>(std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, bool)>&) Unexecuted instantiation: btcsignals::connection btcsignals::signal<void (), btcsignals::null_value>::connect<std::function<void ()>&>(std::function<void ()>&) Unexecuted instantiation: btcsignals::connection btcsignals::signal<void (int), btcsignals::null_value>::connect<std::function<void (int)>&>(std::function<void (int)>&) Unexecuted instantiation: btcsignals::connection btcsignals::signal<void (bool), btcsignals::null_value>::connect<std::function<void (bool)>&>(std::function<void (bool)>&) Unexecuted instantiation: interfaces.cpp:btcsignals::connection btcsignals::signal<void (SynchronizationState, CBlockIndex const&, double), btcsignals::null_value>::connect<node::(anonymous namespace)::NodeImpl::handleNotifyBlockTip(std::function<void (SynchronizationState, interfaces::BlockTip, double)>)::'lambda'(SynchronizationState, CBlockIndex const&, double)>(node::(anonymous namespace)::NodeImpl::handleNotifyBlockTip(std::function<void (SynchronizationState, interfaces::BlockTip, double)>)::'lambda'(SynchronizationState, CBlockIndex const&, double)&&) Unexecuted instantiation: interfaces.cpp:btcsignals::connection btcsignals::signal<void (SynchronizationState, long, long, bool), btcsignals::null_value>::connect<node::(anonymous namespace)::NodeImpl::handleNotifyHeaderTip(std::function<void (SynchronizationState, interfaces::BlockTip, bool)>)::'lambda'(SynchronizationState, long, long, bool)>(node::(anonymous namespace)::NodeImpl::handleNotifyHeaderTip(std::function<void (SynchronizationState, interfaces::BlockTip, bool)>)::'lambda'(SynchronizationState, long, long, bool)&&) btcsignals::connection btcsignals::signal<void (bilingual_str const&, unsigned int), btcsignals::null_value>::connect<void (&)(bilingual_str const&, unsigned int)>(void (&)(bilingual_str const&, unsigned int)) Line | Count | Source | 289 | 1.58k | { | 290 | 1.58k | LOCK(m_mutex); | 291 | | | 292 | | // Garbage-collect disconnected connections to prevent unbounded growth | 293 | 1.58k | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); | 294 | | | 295 | 1.58k | const auto& entry = m_connections.emplace_back(std::make_shared<connection_holder>(std::forward<Callable>(func))); | 296 | 1.58k | return connection(entry); | 297 | 1.58k | } |
btcsignals::connection btcsignals::signal<bool (bilingual_str const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int), btcsignals::any_of>::connect<bool (&)(bilingual_str const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int)>(bool (&)(bilingual_str const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int)) Line | Count | Source | 289 | 1.58k | { | 290 | 1.58k | LOCK(m_mutex); | 291 | | | 292 | | // Garbage-collect disconnected connections to prevent unbounded growth | 293 | 1.58k | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); | 294 | | | 295 | 1.58k | const auto& entry = m_connections.emplace_back(std::make_shared<connection_holder>(std::forward<Callable>(func))); | 296 | 1.58k | return connection(entry); | 297 | 1.58k | } |
Unexecuted instantiation: btcsignals::connection btcsignals::signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int), btcsignals::null_value>::connect<std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)>&>(std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)>&) Unexecuted instantiation: interfaces.cpp:btcsignals::connection btcsignals::signal<void (wallet::CWallet*), btcsignals::null_value>::connect<wallet::(anonymous namespace)::WalletImpl::handleStatusChanged(std::function<void ()>)::'lambda'(wallet::CWallet*)>(wallet::(anonymous namespace)::WalletImpl::handleStatusChanged(std::function<void ()>)::'lambda'(wallet::CWallet*)&&) Unexecuted instantiation: interfaces.cpp:btcsignals::connection btcsignals::signal<void (std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, wallet::AddressPurpose, ChangeType), btcsignals::null_value>::connect<wallet::(anonymous namespace)::WalletImpl::handleAddressBookChanged(std::function<void (std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, wallet::AddressPurpose, ChangeType)>)::'lambda'(std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, wallet::AddressPurpose, ChangeType)>(wallet::(anonymous namespace)::WalletImpl::handleAddressBookChanged(std::function<void (std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, wallet::AddressPurpose, ChangeType)>)::'lambda'(std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, wallet::AddressPurpose, ChangeType)&&) Unexecuted instantiation: interfaces.cpp:btcsignals::connection btcsignals::signal<void (transaction_identifier<false> const&, ChangeType), btcsignals::null_value>::connect<wallet::(anonymous namespace)::WalletImpl::handleTransactionChanged(std::function<void (transaction_identifier<false> const&, ChangeType)>)::'lambda'(transaction_identifier<false> const&, ChangeType)>(wallet::(anonymous namespace)::WalletImpl::handleTransactionChanged(std::function<void (transaction_identifier<false> const&, ChangeType)>)::'lambda'(transaction_identifier<false> const&, ChangeType)&&) wallet.cpp:btcsignals::connection btcsignals::signal<void (), btcsignals::null_value>::connect<wallet::CWallet::ConnectScriptPubKeyManNotifiers()::$_0>(wallet::CWallet::ConnectScriptPubKeyManNotifiers()::$_0&&) Line | Count | Source | 289 | 8.55k | { | 290 | 8.55k | LOCK(m_mutex); | 291 | | | 292 | | // Garbage-collect disconnected connections to prevent unbounded growth | 293 | 8.55k | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); | 294 | | | 295 | 8.55k | const auto& entry = m_connections.emplace_back(std::make_shared<connection_holder>(std::forward<Callable>(func))); | 296 | 8.55k | return connection(entry); | 297 | 8.55k | } |
wallet.cpp:btcsignals::connection btcsignals::signal<void (wallet::ScriptPubKeyMan const*, long), btcsignals::null_value>::connect<wallet::CWallet::ConnectScriptPubKeyManNotifiers()::$_1>(wallet::CWallet::ConnectScriptPubKeyManNotifiers()::$_1&&) Line | Count | Source | 289 | 8.55k | { | 290 | 8.55k | LOCK(m_mutex); | 291 | | | 292 | | // Garbage-collect disconnected connections to prevent unbounded growth | 293 | 8.55k | std::erase_if(m_connections, [](const auto& holder) { return !holder->connected(); }); | 294 | | | 295 | 8.55k | const auto& entry = m_connections.emplace_back(std::make_shared<connection_holder>(std::forward<Callable>(func))); | 296 | 8.55k | return connection(entry); | 297 | 8.55k | } |
|
298 | | |
299 | | /* |
300 | | * Returns true if there are no enabled callbacks |
301 | | */ |
302 | | [[nodiscard]] bool empty() const EXCLUSIVE_LOCKS_REQUIRED(!m_mutex) |
303 | 2.23k | { |
304 | 2.23k | LOCK(m_mutex); |
305 | 2.23k | return std::ranges::none_of(m_connections, [](const auto& holder) { |
306 | 1.51k | return holder->connected(); |
307 | 1.51k | }); auto btcsignals::signal<void (int&), btcsignals::null_value>::empty() const::'lambda'(auto const&)::operator()<std::shared_ptr<btcsignals::signal<void (int&), btcsignals::null_value>::connection_holder>>(auto const&) const Line | Count | Source | 305 | 8 | return std::ranges::none_of(m_connections, [](const auto& holder) { | 306 | 8 | return holder->connected(); | 307 | 8 | }); |
auto btcsignals::signal<void (), btcsignals::null_value>::empty() const::'lambda'(auto const&)::operator()<std::shared_ptr<btcsignals::signal<void (), btcsignals::null_value>::connection_holder>>(auto const&) const Line | Count | Source | 305 | 1.50k | return std::ranges::none_of(m_connections, [](const auto& holder) { | 306 | 1.50k | return holder->connected(); | 307 | 1.50k | }); |
|
308 | 2.23k | } btcsignals::signal<void (int&), btcsignals::null_value>::empty() const Line | Count | Source | 303 | 6 | { | 304 | 6 | LOCK(m_mutex); | 305 | 6 | return std::ranges::none_of(m_connections, [](const auto& holder) { | 306 | 6 | return holder->connected(); | 307 | 6 | }); | 308 | 6 | } |
btcsignals::signal<void (), btcsignals::null_value>::empty() const Line | Count | Source | 303 | 2.22k | { | 304 | 2.22k | LOCK(m_mutex); | 305 | 2.22k | return std::ranges::none_of(m_connections, [](const auto& holder) { | 306 | 2.22k | return holder->connected(); | 307 | 2.22k | }); | 308 | 2.22k | } |
|
309 | | }; |
310 | | |
311 | | } // namespace btcsignals |
312 | | |
313 | | #endif // BITCOIN_UTIL_BTCSIGNALS_H |