R3BROOT
R3B analysis software
Toggle main menu visibility
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
24
constexpr
auto
UCESB_NULL_STR_MSG
=
"Can't retrieve error message as last_error returns nullptr!"
;
25
26
namespace
bpv2 = boost::process::v2;
27
28
namespace
R3B
29
{
30
class
UcesbServerLauncher
31
{
32
public
:
33
struct
ResolveResult
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_
;
53
ResolveResult
launch_strings_
{};
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
UCESB_NULL_STR_MSG
constexpr auto UCESB_NULL_STR_MSG
Definition
R3BUcesbLauncher.h:24
R3B::UcesbServerLauncher::ucesb_server_
std::unique_ptr< bpv2::process > ucesb_server_
Definition
R3BUcesbLauncher.h:52
R3B::UcesbServerLauncher::Launch
void Launch()
Definition
R3BUcesbLauncher.cxx:155
R3B::UcesbServerLauncher::Close
void Close()
Definition
R3BUcesbLauncher.cxx:173
R3B::UcesbServerLauncher::SetLaunchCmd
void SetLaunchCmd(const std::string &command_string)
Definition
R3BUcesbLauncher.cxx:138
R3B::UcesbServerLauncher::launch_strings_
ResolveResult launch_strings_
Definition
R3BUcesbLauncher.h:53
R3B::UcesbServerLauncher::UcesbServerLauncher
UcesbServerLauncher(ext_data_clnt *client)
Definition
R3BUcesbLauncher.h:41
R3B::UcesbServerLauncher::ios_
boost::asio::io_context ios_
Definition
R3BUcesbLauncher.h:55
R3B::UcesbServerLauncher::server_pipe_
boost::asio::readable_pipe server_pipe_
Definition
R3BUcesbLauncher.h:56
R3B::UcesbServerLauncher::client_
ext_data_clnt * client_
Definition
R3BUcesbLauncher.h:51
R3B::UcesbServerLauncher::launch_args
std::vector< std::string > launch_args
Definition
R3BUcesbLauncher.h:54
R3B
Definition
R3BNeulandAnalysisApp.cxx:44
R3B::UcesbServerLauncher::ResolveResult
Definition
R3BUcesbLauncher.h:34
R3B::UcesbServerLauncher::ResolveResult::lmds
std::vector< std::string > lmds
Definition
R3BUcesbLauncher.h:37
R3B::UcesbServerLauncher::ResolveResult::executable
std::string executable
Definition
R3BUcesbLauncher.h:35
R3B::UcesbServerLauncher::ResolveResult::options
std::vector< std::string > options
Definition
R3BUcesbLauncher.h:36
R3B::UcesbServerLauncher::ResolveResult::others
std::vector< std::string > others
Definition
R3BUcesbLauncher.h:38
r3bsource
base
utils
R3BUcesbLauncher.h
Generated by
1.18.0