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
16#include <boost/asio/io_context.hpp>
17#include <boost/asio/readable_pipe.hpp>
18#include <boost/process/v2/process.hpp>
19#include <ext_data_clnt.hh>
20#include <memory>
21#include <string>
22#include <vector>
23
24constexpr auto UCESB_NULL_STR_MSG = "Can't retrieve error message as last_error returns nullptr!";
25
26namespace bpv2 = boost::process::v2;
27
28namespace R3B
29{
31 {
32 public:
34 {
35 std::string executable;
36 std::vector<std::string> options;
37 std::vector<std::string> lmds;
38 std::vector<std::string> others;
39 };
40
41 explicit UcesbServerLauncher(ext_data_clnt* client)
42 : client_{ client }
43 {
44 }
45 void Launch();
46 // void Setup(ext_data_struct_info& struct_info, size_t event_struct_size);
47 void SetLaunchCmd(const std::string& command_string);
48 void Close();
49
50 private:
51 ext_data_clnt* client_ = nullptr;
52 std::unique_ptr<bpv2::process> ucesb_server_;
54 std::vector<std::string> launch_args;
55 boost::asio::io_context ios_;
56 boost::asio::readable_pipe server_pipe_{ ios_ };
57 };
58
59} // namespace R3B
constexpr auto UCESB_NULL_STR_MSG
std::unique_ptr< bpv2::process > ucesb_server_
void SetLaunchCmd(const std::string &command_string)
UcesbServerLauncher(ext_data_clnt *client)
boost::asio::io_context ios_
boost::asio::readable_pipe server_pipe_
std::vector< std::string > launch_args