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> // IWYU pragma: associated
6
7#include <interfaces/ipc.h>
8
9#include <memory>
10
11namespace init {
12namespace {
13class BitcoinBasicInit : public interfaces::Init
14{
15public:
16 BitcoinBasicInit(const char* exe_name, const char* process_argv0) : m_ipc(interfaces::MakeIpc(exe_name, process_argv0, *this)) {}
17 interfaces::Ipc* ipc() override { return m_ipc.get(); }
18private:
19 std::unique_ptr<interfaces::Ipc> m_ipc;
20};
21} // namespace
22} // namespace init
23
24namespace interfaces {
25std::unique_ptr<Init> MakeBasicInit(const char* exe_name, const char* process_argv0)
26{
27 return std::make_unique<init::BitcoinBasicInit>(exe_name, process_argv0);
28}
29} // namespace interfaces
std::unique_ptr< interfaces::Ipc > m_ipc
Definition: basic.cpp:19
Initial interface created when a process is first started, and used to give and get access to other i...
Definition: init.h:39
Interface providing access to interprocess-communication (IPC) functionality.
Definition: ipc.h:52
Definition: basic.cpp:11
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:25
std::unique_ptr< Ipc > MakeIpc(const char *exe_name, const char *process_argv0, Init &init)
Return implementation of Ipc interface.
Definition: interfaces.cpp:137
Definition: ipc.h:14