MCPcopy Create free account
hub / github.com/alandefreitas/matplotplusplus / run_command

Method run_command

source/matplot/backend/gnuplot.cpp:294–312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292 }
293
294 void gnuplot::run_command(const std::string &command) {
295 if (!pipe_.opened()) {
296 return;
297 }
298 size_t pipe_capacity = gnuplot_pipe_capacity(pipe_.file());
299 if (command.size() + bytes_in_pipe_ > pipe_capacity) {
300 flush_commands();
301 bytes_in_pipe_ = 0;
302 }
303 if (!command.empty()) {
304 pipe_.write(command);
305 }
306 // proc_write(&pipe_, "; ");
307 pipe_.write("\n");
308 bytes_in_pipe_ += command.size();
309 if constexpr (trace_commands) {
310 std::cout << command << std::endl;
311 }
312 }
313
314 void gnuplot::include_comment(const std::string &comment) {
315 if (include_comments_) {

Callers

nothing calls this directly

Calls 6

gnuplot_pipe_capacityFunction · 0.85
openedMethod · 0.80
fileMethod · 0.80
emptyMethod · 0.80
sizeMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected