Bitcoin Core 31.99.0
P2P Digital Currency
basic.cpp
Go to the documentation of this file.
1// Copyright (c) 2025 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#include <interfaces/init.h>
6#include <interfaces/ipc.h>
7
8namespace init {
9namespace {
10class BitcoinBasicInit : public interfaces::Init
11{
12public:
13 BitcoinBasicInit(const char* exe_name, const char* process_argv0) : m_ipc(interfaces::MakeIpc(exe_name, process_argv0, *this)) {}
14 interfaces::Ipc* ipc() override { return m_ipc.get(); }
15private:
16 std::unique_ptr<interfaces::Ipc> m_ipc;
17};
18} // namespace
19} // namespace init
20
21namespace interfaces {
22std::unique_ptr<Init> MakeBasicInit(const char* exe_name, const char* process_argv0)
23{
24 return std::make_unique<init::BitcoinBasicInit>(exe_name, process_argv0);
25}
26} // namespace interfaces
std::unique_ptr< interfaces::Ipc > m_ipc
Definition: basic.cpp:16
Initial interface created when a process is first started, and used to give and get access to other i...
Definition: init.h:32
Interface providing access to interprocess-communication (IPC) functionality.
Definition: ipc.h:51
Definition: basic.cpp:8
std::unique_ptr< Init > MakeBasicInit(const char *exe_name, const char *process_argv0)
Return implementation of Init interface for a basic IPC client that doesn't provide any IPC services ...
Definition: basic.cpp:22
std::unique_ptr< Ipc > MakeIpc(const char *exe_name, const char *process_argv0, Init &init)
Return implementation of Ipc interface.
Definition: interfaces.cpp:135
Definition: ipc.h:13