aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/init.h
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2017-12-05 15:57:12 -0500
committerRussell Yanofsky <russ@yanofsky.org>2021-04-23 03:02:50 -0500
commit745c9cebd50fea1664efef571dc1ee1bddc96102 (patch)
treeba0df6ca2e6080b542e941703cf801a51e29394e /src/interfaces/init.h
parent5d62d7f6cd48bbc4e9f37ecc369f38d5e1e0036c (diff)
downloadbitcoin-745c9cebd50fea1664efef571dc1ee1bddc96102.tar.xz
multiprocess: Add Ipc and Init interface definitions
Diffstat (limited to 'src/interfaces/init.h')
-rw-r--r--src/interfaces/init.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/interfaces/init.h b/src/interfaces/init.h
new file mode 100644
index 0000000000..8ffd017656
--- /dev/null
+++ b/src/interfaces/init.h
@@ -0,0 +1,36 @@
+// Copyright (c) 2021 The Bitcoin Core developers
+// Distributed under the MIT software license, see the accompanying
+// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+
+#ifndef BITCOIN_INTERFACES_INIT_H
+#define BITCOIN_INTERFACES_INIT_H
+
+#include <memory>
+
+struct NodeContext;
+
+namespace interfaces {
+class Chain;
+class Ipc;
+class Node;
+class WalletClient;
+
+//! Initial interface created when a process is first started, and used to give
+//! and get access to other interfaces (Node, Chain, Wallet, etc).
+//!
+//! There is a different Init interface implementation for each process
+//! (bitcoin-gui, bitcoin-node, bitcoin-wallet, bitcoind, bitcoin-qt) and each
+//! implementation can implement the make methods for interfaces it supports.
+//! The default make methods all return null.
+class Init
+{
+public:
+ virtual ~Init() = default;
+ virtual std::unique_ptr<Node> makeNode();
+ virtual std::unique_ptr<Chain> makeChain();
+ virtual std::unique_ptr<WalletClient> makeWalletClient(Chain& chain);
+ virtual Ipc* ipc();
+};
+} // namespace interfaces
+
+#endif // BITCOIN_INTERFACES_INIT_H