DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
okssystem
include
okssystem
Executable.hpp
Go to the documentation of this file.
1
// DUNE DAQ modification notice:
2
// This file has been modified from the original ATLAS system source for the DUNE DAQ project.
3
// Fork baseline commit: system-00-00-20 (2020-09-25).
4
// Renamed since fork: yes (from system/Executable.h to include/okssystem/Executable.hpp).
5
6
/*
7
* Executable.h
8
* OksSystem
9
*
10
* Created by Matthias Wiesmann on 06.01.05.
11
* Copyright 2005 CERN. All rights reserved.
12
*
13
*/
14
15
#ifndef OKSSYSTEM_EXECUTABLE
16
#define OKSSYSTEM_EXECUTABLE
17
18
#include <map>
19
#include <vector>
20
21
#include "
okssystem/File.hpp
"
22
#include "
okssystem/Process.hpp
"
23
24
namespace
OksSystem
{
25
33
34
class
Executable
:
public
File
35
{
36
37
public
:
38
typedef
std::vector<std::string>
param_collection
;
39
typedef
std::map<std::string, std::string>
env_collection
;
40
41
protected
:
42
void
exec
(
char
** argv)
const
;
43
void
exec
(
char
**
const
argv,
char
**
const
env)
44
const
;
45
static
const
char
*
const
SHELL_COMMAND
;
46
static
const
char
*
const
SHELL_COMMAND_PARAM
;
47
static
void
copy_fd
(
int
fd,
48
std::ostream& target);
49
public
:
50
static
std::string
okssystem
(
const
std::string& command);
51
52
Executable
(
const
OksSystem::File
& file);
53
Executable
(
const
char
* filename);
54
Executable
(
const
std::string& filename);
55
~Executable
();
56
57
void
exec
()
const
;
58
void
exec
(
const
param_collection
& params)
const
;
59
std::string
pipe_in
(
const
param_collection
& params)
const
;
60
std::string
pipe_in
(
const
param_collection
& params,
const
env_collection
& envs)
const
;
61
Process
pipe_out
(
const
param_collection
& params,
62
const
File
& input_file,
63
const
File
& output_file,
64
const
File
& error_file,
65
mode_t perm)
const
;
66
Process
pipe_out
(
const
param_collection
& params,
67
const
env_collection
& envs,
68
const
File
& input_file,
69
const
File
& output_file,
70
const
File
& error_file,
71
mode_t perm)
const
;
72
void
exec
(
const
param_collection
& params,
const
env_collection
& envs)
const
;
73
Process
start
(
const
param_collection
& params)
const
;
74
Process
start_and_forget
(
const
param_collection
& params)
75
const
;
76
Process
start
(
const
param_collection
& params,
77
const
env_collection
& envs)
const
;
78
79
std::string
to_string
(
const
param_collection
& params)
80
const
;
81
82
};
// Executable
83
84
}
// OksSystem
85
86
#endif
File.hpp
Process.hpp
OksSystem::Executable::start_and_forget
Process start_and_forget(const param_collection ¶ms) const
start the executable in another process; do not wait for termination of child
Definition
Executable.cpp:274
OksSystem::Executable::Executable
Executable(const OksSystem::File &file)
Definition
Executable.cpp:60
OksSystem::Executable::pipe_in
std::string pipe_in(const param_collection ¶ms) const
run the executable and pipe results back
Definition
Executable.cpp:345
OksSystem::Executable::pipe_out
Process pipe_out(const param_collection ¶ms, const File &input_file, const File &output_file, const File &error_file, mode_t perm) const
Definition
Executable.cpp:450
OksSystem::Executable::SHELL_COMMAND
static const char *const SHELL_COMMAND
command to execute in a shell
Definition
Executable.hpp:45
OksSystem::Executable::param_collection
std::vector< std::string > param_collection
Definition
Executable.hpp:38
OksSystem::Executable::env_collection
std::map< std::string, std::string > env_collection
Definition
Executable.hpp:39
OksSystem::Executable::start
Process start(const param_collection ¶ms) const
start the executable in another process
Definition
Executable.cpp:222
OksSystem::Executable::exec
void exec(char **argv) const
does the actual exec
Definition
Executable.cpp:82
OksSystem::Executable::okssystem
static std::string okssystem(const std::string &command)
execute a command in a shell
Definition
Executable.cpp:51
OksSystem::Executable::SHELL_COMMAND_PARAM
static const char *const SHELL_COMMAND_PARAM
parameter to execute in a shell
Definition
Executable.hpp:46
OksSystem::Executable::to_string
std::string to_string(const param_collection ¶ms) const
converts executable name and a parameter sequence into a string
Definition
Executable.cpp:643
OksSystem::Executable::exec
void exec() const
run the executable
OksSystem::Executable::copy_fd
static void copy_fd(int fd, std::ostream &target)
copies the content of a file descriptor into a STL stream
Definition
Executable.cpp:328
OksSystem::File
Wrapper for file operations.
Definition
File.hpp:38
OksSystem::File::File
File(const std::string &name)
Definition
File.cpp:327
OksSystem::Process
Wrapper for process manipulation.
Definition
Process.hpp:31
OksSystem
Definition
Descriptor.hpp:22
Generated on
for DUNE-DAQ by
1.18.0