15 #ifndef OPENSCENARIO_INTERPRETER__RECORD_HPP_
16 #define OPENSCENARIO_INTERPRETER__RECORD_HPP_
20 #ifndef OPENSCENARIO_INTERPRETER_VERBOSE_RECORD
23 #include <sys/types.h>
26 #include <boost/algorithm/string.hpp>
39 template <
typename... Ts>
42 const std::vector<std::string> command{
43 "python3", boost::algorithm::replace_all_copy(
concealer::dollar(
"which ros2"),
"\n",
""),
"bag",
44 "record", std::forward<decltype(xs)>(
xs)...};
48 throw std::system_error(errno, std::system_category());
51 #ifndef OPENSCENARIO_INTERPRETER_VERBOSE_RECORD
52 if (
const auto fd = ::open(
"/dev/null", O_WRONLY)) {
53 ::dup2(fd, STDOUT_FILENO);
58 std::cerr << std::system_error(errno, std::system_category()).what() << std::endl;
59 std::exit(EXIT_FAILURE);
auto dollar(const std::string &command) -> std::string
Definition: execute.cpp:57
auto execute(const std::vector< std::string > &) -> int
Definition: execute.cpp:36
auto stop() -> void
Definition: record.cpp:27
pid_t process_id
Definition: record.cpp:25
auto start(Ts &&... xs) -> pid_t
Definition: record.hpp:40
Definition: escape_sequence.hpp:22
Definition: junit5.hpp:25