5 #ifndef BITCOIN_INTERFACES_IPC_H 6 #define BITCOIN_INTERFACES_IPC_H 43 virtual ~Ipc() =
default;
46 virtual std::unique_ptr<Init>
spawnProcess(
const char* exe_name) = 0;
55 template<
typename Interface>
56 void addCleanup(Interface& iface, std::function<
void()> cleanup)
58 addCleanup(
typeid(Interface), &iface, std::move(cleanup));
64 virtual void addCleanup(std::type_index type,
void* iface, std::function<
void()> cleanup) = 0;
68 std::unique_ptr<Ipc>
MakeIpc(
const char* exe_name,
const char* process_argv0, Init&
init);
71 #endif // BITCOIN_INTERFACES_IPC_H void addCleanup(Interface &iface, std::function< void()> cleanup)
Add cleanup callback to remote interface that will run when the interface is deleted.
virtual bool startSpawnedProcess(int argc, char *argv[], int &exit_status)=0
If this is a spawned process, block and handle requests from the parent process by forwarding them to...
std::unique_ptr< Ipc > MakeIpc(const char *exe_name, const char *process_argv0, Init &init)
Return implementation of Ipc interface.
virtual std::unique_ptr< Init > spawnProcess(const char *exe_name)=0
Spawn a child process returning pointer to its Init interface.
Interface providing access to interprocess-communication (IPC) functionality.