-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgnuplot_backend.hpp
More file actions
41 lines (33 loc) · 1.04 KB
/
gnuplot_backend.hpp
File metadata and controls
41 lines (33 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once
#include "gnuplotpp/plot.hpp"
#include <memory>
#include <string>
namespace gnuplotpp {
/**
* @brief Gnuplot-backed renderer that emits .dat/.gp artifacts and runs gnuplot.
*/
class GnuplotBackend final : public IPlotBackend {
public:
/**
* @brief Construct backend with a gnuplot executable name/path.
* @param executable Command used to invoke gnuplot.
*/
explicit GnuplotBackend(std::string executable = "gnuplot");
/**
* @brief Render figure to requested output formats.
* @param fig Figure to render.
* @param out_dir Destination directory.
* @return Render status and generated output paths.
*/
RenderResult render(const Figure& fig,
const std::filesystem::path& out_dir) override;
private:
std::string executable_;
};
/**
* @brief Factory helper for backend creation.
* @param executable Command used to invoke gnuplot.
* @return Shared backend instance.
*/
std::shared_ptr<IPlotBackend> make_gnuplot_backend(std::string executable = "gnuplot");
} // namespace gnuplotpp