From 6ed8f5151719fbc14ec0ac6d28a346d1f74cf2ca Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Fri, 2 Jan 2026 22:42:31 +0100 Subject: Initial commit --- src/spawner.hh | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/spawner.hh (limited to 'src/spawner.hh') diff --git a/src/spawner.hh b/src/spawner.hh new file mode 100644 index 0000000..c4f511b --- /dev/null +++ b/src/spawner.hh @@ -0,0 +1,49 @@ +#ifndef SPAWNER_HH +#define SPAWNER_HH + +#include +#include +#include + +namespace io { +class Reader; +class Writer; +}; // namespace io + +class Process { + public: + virtual ~Process() = default; + + virtual io::Reader& reader() const = 0; + virtual io::Writer& writer() const = 0; + + protected: + Process() = default; + Process(Process const&) = delete; + Process& operator=(Process const&) = delete; +}; + +class Spawner { + public: + enum class Exec : uint8_t { + kImageProcessor, + }; + + enum class Error : uint8_t { + kError, + }; + + virtual ~Spawner() = default; + + [[nodiscard]] + virtual std::expected, Error> run(Exec exec) = 0; + + static std::expected, Error> create(); + + protected: + Spawner() = default; + Spawner(Spawner const&) = delete; + Spawner& operator=(Spawner const&) = delete; +}; + +#endif // SPAWNER_HH -- cgit v1.2.3-70-g09d2