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
public
:
37
typedef
std::vector<std::string>
param_collection
;
38
typedef
std::map<std::string, std::string>
env_collection
;
39
protected
:
40
void
exec
(
char
** argv)
const
;
41
void
exec
(
char
**
const
argv,
char
**
const
env)
const
;
42
static
const
char
*
const
SHELL_COMMAND
;
43
static
const
char
*
const
SHELL_COMMAND_PARAM
;
44
static
void
copy_fd
(
int
fd, std::ostream &target) ;
45
public
:
46
static
std::string
okssystem
(
const
std::string &command);
47
48
Executable
(
const
OksSystem::File
&file) ;
49
Executable
(
const
char
*
filename
) ;
50
Executable
(
const
std::string &
filename
) ;
51
~Executable
() ;
52
53
void
exec
()
const
;
54
void
exec
(
const
param_collection
¶ms)
const
;
55
std::string
pipe_in
(
const
param_collection
¶ms)
const
;
56
std::string
pipe_in
(
const
param_collection
¶ms,
const
env_collection
&envs)
const
;
57
Process
pipe_out
(
const
param_collection
¶ms,
const
File
&input_file,
const
File
&output_file,
const
File
&error_file, mode_t perm)
const
;
58
Process
pipe_out
(
const
param_collection
¶ms,
const
env_collection
&envs,
const
File
&input_file,
const
File
&output_file,
const
File
&error_file, mode_t perm)
const
;
59
void
exec
(
const
param_collection
¶ms,
const
env_collection
&envs)
const
;
60
Process
start
(
const
param_collection
¶ms)
const
;
61
Process
start_and_forget
(
const
param_collection
¶ms)
const
;
62
Process
start
(
const
param_collection
¶ms,
const
env_collection
&envs)
const
;
63
64
std::string
to_string
(
const
param_collection
¶ms)
const
;
65
66
} ;
// Executable
67
68
}
// OksSystem
69
70
#endif
71
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:261
OksSystem::Executable::Executable
Executable(const OksSystem::File &file)
Definition
Executable.cpp:59
OksSystem::Executable::pipe_in
std::string pipe_in(const param_collection ¶ms) const
run the executable and pipe results back
Definition
Executable.cpp:330
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:430
OksSystem::Executable::SHELL_COMMAND
static const char *const SHELL_COMMAND
command to execute in a shell
Definition
Executable.hpp:42
OksSystem::Executable::param_collection
std::vector< std::string > param_collection
Definition
Executable.hpp:37
OksSystem::Executable::env_collection
std::map< std::string, std::string > env_collection
Definition
Executable.hpp:38
OksSystem::Executable::~Executable
~Executable()
Definition
Executable.cpp:62
OksSystem::Executable::start
Process start(const param_collection ¶ms) const
start the executable in another process
Definition
Executable.cpp:209
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:43
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:614
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:316
OksSystem::File
Wrapper for file operations.
Definition
File.hpp:37
OksSystem::File::File
File(const std::string &name)
Definition
File.cpp:301
OksSystem::Process
Wrapper for process manipulation.
Definition
Process.hpp:30
OksSystem
Definition
Descriptor.hpp:22
tablepositions::filename
@ filename
Definition
ui_constants.hpp:11
Generated on
for DUNE-DAQ by
1.17.0