Loading...
Searching...
No Matches
juce_ConnectedChildProcess.h
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2022 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
The code included in this file is provided under the terms of the ISC license
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
To use, copy, modify, and/or distribute this software for any purpose with or
without fee is hereby granted provided that the above copyright notice and
this permission notice appear in all copies.
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
//==============================================================================
class JUCE_API ChildProcessWorker
{
public:
ChildProcessWorker();
virtual ~ChildProcessWorker();
bool initialiseFromCommandLine (const String& commandLine,
const String& commandLineUniqueID,
int timeoutMs = 0);
//==============================================================================
virtual void handleMessageFromCoordinator (const MemoryBlock& mb);
[[deprecated ("Replaced by handleMessageFromCoordinator.")]]
virtual void handleMessageFromMaster (const MemoryBlock&) {}
virtual void handleConnectionMade();
virtual void handleConnectionLost();
bool sendMessageToCoordinator (const MemoryBlock&);
[[deprecated ("Replaced by sendMessageToCoordinator.")]]
bool sendMessageToMaster (const MemoryBlock& mb) { return sendMessageToCoordinator (mb); }
private:
struct Connection;
std::unique_ptr<Connection> connection;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ChildProcessWorker)
};
using ChildProcessSlave [[deprecated ("Replaced by ChildProcessWorker.")]] = ChildProcessWorker;
//==============================================================================
class JUCE_API ChildProcessCoordinator
{
public:
ChildProcessCoordinator();
virtual ~ChildProcessCoordinator();
bool launchWorkerProcess (const File& executableToLaunch,
const String& commandLineUniqueID,
int timeoutMs = 0,
int streamFlags = ChildProcess::wantStdOut | ChildProcess::wantStdErr);
[[deprecated ("Replaced by launchWorkerProcess.")]]
bool launchSlaveProcess (const File& executableToLaunch,
const String& commandLineUniqueID,
int timeoutMs = 0,
int streamFlags = ChildProcess::wantStdOut | ChildProcess::wantStdErr)
{
return launchWorkerProcess (executableToLaunch, commandLineUniqueID, timeoutMs, streamFlags);
}
void killWorkerProcess();
[[deprecated ("Replaced by killWorkerProcess.")]]
void killSlaveProcess() { killWorkerProcess(); }
virtual void handleMessageFromWorker (const MemoryBlock&);
[[deprecated ("Replaced by handleMessageFromWorker")]]
virtual void handleMessageFromSlave (const MemoryBlock&) {}
virtual void handleConnectionLost();
bool sendMessageToWorker (const MemoryBlock&);
[[deprecated ("Replaced by sendMessageToWorker.")]]
bool sendMessageToSlave (const MemoryBlock& mb) { return sendMessageToWorker (mb); }
private:
std::shared_ptr<ChildProcess> childProcess;
struct Connection;
std::unique_ptr<Connection> connection;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ChildProcessCoordinator)
};
using ChildProcessMaster [[deprecated ("Replaced by ChildProcessCoordinator.")]] = ChildProcessCoordinator;
} // namespace juce
juce::ChildProcessCoordinator
Definition juce_ConnectedChildProcess.h:141
juce::ChildProcessCoordinator::ChildProcessCoordinator
ChildProcessCoordinator()
juce::ChildProcessCoordinator::launchWorkerProcess
bool launchWorkerProcess(const File &executableToLaunch, const String &commandLineUniqueID, int timeoutMs=0, int streamFlags=ChildProcess::wantStdOut|ChildProcess::wantStdErr)
Definition juce_ConnectedChildProcess.cpp:156
juce::ChildProcessWorker
Definition juce_ConnectedChildProcess.h:48
juce::ChildProcessWorker::ChildProcessWorker
ChildProcessWorker()
juce::ChildProcessWorker::~ChildProcessWorker
virtual ~ChildProcessWorker()
juce::ChildProcessWorker::handleMessageFromCoordinator
virtual void handleMessageFromCoordinator(const MemoryBlock &mb)
Definition juce_ConnectedChildProcess.cpp:265
juce::ChildProcessWorker::initialiseFromCommandLine
bool initialiseFromCommandLine(const String &commandLine, const String &commandLineUniqueID, int timeoutMs=0)
Definition juce_ConnectedChildProcess.cpp:283
juce::File
Definition juce_File.h:45
juce::MemoryBlock
Definition juce_MemoryBlock.h:33
juce::String
Definition juce_String.h:53