59 template <
typename... Args>
62 auto p = std::make_shared<ChildProcess>();
64 if (! p->start (std::forward<Args> (args)...))
68 timer.startTimer (1000);
79 return listeners.addListener (std::move (listener));
87 return timer.isTimerRunning();
94 void checkProcesses();
97 detail::CallbackListenerList<ChildProcess*> listeners;
98 TimedCallback timer { [
this] { checkProcesses(); } };
Manages a set of ChildProcesses and periodically checks their return value.
auto addChildProcessExitedListener(std::function< void(ChildProcess *)> listener)
Registers a callback function that is called for every ChildProcess that terminated.
auto hasRunningProcess() const
Returns true if the ChildProcessManager contains any running ChildProcesses that it's monitoring.
std::shared_ptr< ChildProcess > createAndStartManagedChildProcess(Args &&... args)
Creates a new ChildProcess and starts it with the provided arguments.
Launches and monitors a child process.
Classes derived from this will be automatically deleted when the application exits.
#define JUCE_DECLARE_SINGLETON_SINGLETHREADED_MINIMAL(Classname)
Macro to declare member variables and methods for a singleton class.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...