Bitcoin Core 32.99.0
P2P Digital Currency
Loading...
Searching...
No Matches
Classes | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
btcsignals::connection Class Reference

#include <btcsignals.h>

Classes

class  liveness
 Track liveness. More...
 

Public Member Functions

constexpr connection () noexcept=default
 The default constructor creates a connection with no associated signal.
 
void disconnect ()
 If a callback is associated with this connection, prevent it from being called in the future.
 
bool connected () const
 Returns true if this connection was created by a signal and has not been disabled.
 

Private Member Functions

 connection (std::shared_ptr< liveness > &&state)
 Only a signal can create an enabled connection.
 

Private Attributes

std::shared_ptr< liveness > m_state {}
 connections have shared_ptr-like copy and move semantics.
 

Friends

template<typename Signature , typename Combiner >
class signal
 

Detailed Description

Definition at line 88 of file btcsignals.h.

Constructor & Destructor Documentation

◆ connection() [1/2]

btcsignals::connection::connection ( std::shared_ptr< liveness > &&  state)
inlineexplicitprivate

Only a signal can create an enabled connection.

Definition at line 124 of file btcsignals.h.

◆ connection() [2/2]

constexpr btcsignals::connection::connection ( )
constexprdefaultnoexcept

The default constructor creates a connection with no associated signal.

Member Function Documentation

◆ connected()

bool btcsignals::connection::connected ( ) const
inline

Returns true if this connection was created by a signal and has not been disabled.

Definition at line 155 of file btcsignals.h.

◆ disconnect()

void btcsignals::connection::disconnect ( )
inline

If a callback is associated with this connection, prevent it from being called in the future.

If a connection is disabled as part of a signal's callback function, it will not be executed in the current signal invocation.

The callback object is destroyed here (or when the last concurrently executing invocation of it completes). The empty holder entry is not removed from the owning signal; it is garbage collected in signal::connect().

Definition at line 144 of file btcsignals.h.

Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ signal

Definition at line 91 of file btcsignals.h.

Member Data Documentation

◆ m_state

std::shared_ptr<liveness> btcsignals::connection::m_state {}
private

connections have shared_ptr-like copy and move semantics.

Definition at line 119 of file btcsignals.h.


The documentation for this class was generated from the following file: