process_pipeline.hpp
#ifndef BTLLIB_PROCESS_PIPELINE_HPP
#define BTLLIB_PROCESS_PIPELINE_HPP
#include <atomic>
#include <cstdio>
#include <string>
namespace btllib {
using PipeId = unsigned long;
using PipelineId = unsigned long;
class ProcessPipeline
{
public:
ProcessPipeline(const std::string& cmd);
~ProcessPipeline() { end(); }
void close_in();
void close_out();
void end();
FILE *in = nullptr, *out = nullptr;
std::atomic<bool> in_closed{ false };
std::atomic<bool> out_closed{ false };
private:
PipelineId id = 0;
std::atomic<bool> ended{ false };
};
} // namespace btllib
#endif
btllib::ProcessPipeline
Definition: process_pipeline.hpp:18
btllib::ProcessPipeline::ProcessPipeline
ProcessPipeline(const std::string &cmd)
btllib
Definition: bloom_filter.hpp:16