Bitcoin Core 29.99.0
P2P Digital Currency
Public Member Functions | Public Attributes | List of all members
mp::ProxyClient< Thread > Struct Reference

#include <proxy-io.h>

Inheritance diagram for mp::ProxyClient< Thread >:
[legend]
Collaboration diagram for mp::ProxyClient< Thread >:
[legend]

Public Member Functions

 ProxyClient (const ProxyClient &)=delete
 
 ~ProxyClient ()
 
void setCleanup (const std::function< void()> &fn)
 
 ProxyClientBase (typename Interface::Client client, Connection *connection, bool destroy_connection)
 
- Public Member Functions inherited from mp::ProxyClientBase< Thread, ::capnp::Void >
 ProxyClientBase (typename Interface::Client client, Connection *connection, bool destroy_connection)
 
 ~ProxyClientBase () noexcept
 

Public Attributes

std::optional< CleanupItm_cleanup_it
 Cleanup function to run when the connection is closed. More...
 
- Public Attributes inherited from mp::ProxyClientBase< Thread, ::capnp::Void >
Interface::Client m_client
 
ProxyContext m_context
 

Additional Inherited Members

- Public Types inherited from mp::ProxyClientBase< Thread, ::capnp::Void >
using Interface = Thread
 
using Impl = ::capnp::Void
 
using Sub = ProxyClient< Interface >
 
using Super = ProxyClientBase< Interface, Impl >
 
- Static Public Member Functions inherited from mp::ProxyClientBase< Thread, ::capnp::Void >
static void construct (Super &)
 
static void destroy (Super &)
 

Detailed Description

Definition at line 59 of file proxy-io.h.

Constructor & Destructor Documentation

◆ ProxyClient()

mp::ProxyClient< Thread >::ProxyClient ( const ProxyClient< Thread > &  )
delete

◆ ~ProxyClient()

mp::ProxyClient< Thread >::~ProxyClient ( )

Definition at line 313 of file proxy.cpp.

Member Function Documentation

◆ ProxyClientBase()

mp::ProxyClientBase< Interface, Impl >::ProxyClientBase ( typename Interface::Client  client,
Connection connection,
bool  destroy_connection 
)

Definition at line 70 of file proxy-io.h.

◆ setCleanup()

void mp::ProxyClient< Thread >::setCleanup ( const std::function< void()> &  fn)

Definition at line 323 of file proxy.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ m_cleanup_it

std::optional<CleanupIt> mp::ProxyClient< Thread >::m_cleanup_it

Cleanup function to run when the connection is closed.

If the Connection gets destroyed before this ProxyClient<Thread> object, this cleanup callback lets it destroy this object and remove its entry in the thread's request_threads or callback_threads map (after resetting m_cleanup_it so the destructor does not try to access it). But if this object gets destroyed before the Connection, there's no need to run the cleanup function and the destructor will unregister it.

Definition at line 75 of file proxy-io.h.


The documentation for this struct was generated from the following files: