dfx 0.1.0
Linux-based dynamic dataflow executor
Loading...
Searching...
No Matches
ProcessStorage.hpp
1// SPDX-FileCopyrightText: 2025 Vincent Leroy
2// SPDX-License-Identifier: MIT
3//
4// This file is part of dfx.
5//
6// Licensed under the MIT License. See the LICENSE file in the project root
7// for full license information.
8
9#pragma once
10
11// Standard includes
12#include <memory>
13#include <vector>
14
15// Project includes
16#include "Process.hpp"
18
19namespace dfx::FdWatch
20{
21class Poller;
22} // !namespace dfx::FdWatch
23
24namespace dfx::Subprocess
25{
26using ProcessPtr = std::unique_ptr<Process>;
27
28class ProcessStorage
29{
30public:
31 ProcessStorage(FdWatch::Poller & poller);
32 DISABLE_COPY_AND_MOVE(ProcessStorage);
33
34 Process & createProcess(Process::Config config);
35 void destroyProcess(Process const & process, bool defer = true);
36
37private:
38 FdWatch::Poller & _poller;
39 std::vector<ProcessPtr> _processes;
40};
41} // !namespace dfx::Subprocess
Convenience macros to explicitly control copy and move semantics.
#define DISABLE_COPY_AND_MOVE(ClassName)
Disable both copy and move.
Definition CopyMoveControl.hpp:37
Abstract interface for FD-based event polling.
Definition Poller.hpp:37
Subprocess wrapper with optional stdio piping/capture and event-driven callbacks.
Definition Process.hpp:59
Definition SocketClient.hpp:23
Definition Process.hpp:34
Process spawn and I/O configuration.
Definition Process.hpp:123