R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BUcesbLauncher.h
Go to the documentation of this file.
1#pragma once
2
3/******************************************************************************
4 * Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
5 * Copyright (C) 2019-2025 Members of R3B Collaboration *
6 * *
7 * This software is distributed under the terms of the *
8 * GNU General Public Licence (GPL) version 3, *
9 * copied verbatim in the file "LICENSE". *
10 * *
11 * In applying this license GSI does not waive the privileges and immunities *
12 * granted to it by virtue of its status as an Intergovernmental Organization *
13 * or submit itself to any jurisdiction. *
14 ******************************************************************************/
15#include <boost/asio.hpp>
16#include <boost/process.hpp>
17#include <ext_data_clnt.hh>
18
19constexpr auto UCESB_NULL_STR_MSG = "Can't retrieve error message as last_error returns nullptr!";
20
21namespace R3B
22{
24 {
25 public:
27 {
28 std::string executable;
29 std::vector<std::string> options;
30 std::vector<std::string> lmds;
31 std::vector<std::string> others;
32 };
33
34 explicit UcesbServerLauncher(ext_data_clnt* client)
35 : client_{ client }
36 {
37 }
38 void Launch();
39 // void Setup(ext_data_struct_info& struct_info, size_t event_struct_size);
40 void SetLaunchCmd(const std::string& command_string);
41 void Close();
42
43 private:
44 ext_data_clnt* client_ = nullptr;
45 ResolveResult launch_strings_{};
46 std::vector<std::string> launch_args;
47 std::unique_ptr<boost::process::child> ucesb_server_;
48 boost::asio::io_service ios_;
49 boost::process::async_pipe server_pipe_{ ios_ };
50 };
51
52} // namespace R3B
constexpr auto UCESB_NULL_STR_MSG
void SetLaunchCmd(const std::string &command_string)
UcesbServerLauncher(ext_data_clnt *client)