DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
okssystem
include
okssystem
Process.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/Process.h to include/okssystem/Process.hpp).
5
6
/*
7
* Process.h
8
* OksSystem
9
*
10
* Created by Matthias Wiesmann on 18.01.05.
11
* Copyright 2005 CERN. All rights reserved.
12
*
13
*/
14
15
#ifndef OKSSYSTEM_PROCESS
16
#define OKSSYSTEM_PROCESS
17
18
#include <sys/types.h>
19
#include <string>
20
21
namespace
OksSystem
{
22
29
30
class
Process
{
31
protected
:
32
pid_t
m_process_id
;
33
std::string
m_process_name
;
34
static
const
char
*
const
SYS_EXITS_NAMES
[] ;
35
static
const
char
*
const
TEST_EXITS_NAMES
[] ;
36
static
const
char
*
const
OK_EXIT_NAME
;
37
static
const
char
*
const
SIGNAL_EXIT_NAME
;
38
static
const
int
TEST_BASE_VALUE
;
39
static
const
int
TEST_MAX_VALUE
;
40
static
const
int
TERMINATION_WAIT
;
41
static
Process
*
s_instance
;
42
public
:
43
static
const
char
*
exit_text
(
int
return_value) ;
44
static
std::string
exit_pretty
(
int
return_value) ;
45
static
const
Process
*
instance
() throw() ;
46
static
void
set_name
(const
std
::
string
&name) throw() ;
47
Process
();
48
Process
(const
Process
&other) ;
49
Process
(pid_t pid) ;
50
Process
(pid_t pid, const
std
::
string
&name);
51
~
Process
() throw() ;
52
operator pid_t() const throw() ;
53
int
join
(
bool
throw_non_zero=false) const ;
54
void
signal
(
int
signal
) const ;
55
bool
exists
() const ;
56
bool
equals
(const
Process
&other) const throw() ;
57
void
terminate
() const ;
58
pid_t
process_id
() const throw();
59
std
::
string
to_string
() const throw();
60
} ;
// Process
61
62
}
// OksSystem
63
64
std
::ostream& operator<<(
std
::ostream& stream, const
OksSystem
::
Process
&proc) ;
65
bool
operator ==(const
OksSystem
::
Process
&a, const
OksSystem
::
Process
&b) throw();
66
bool
operator !=(const
OksSystem
::
Process
&a, const
OksSystem
::
Process
&b) throw();
67
68
#endif
OksSystem::Process::TERMINATION_WAIT
static const int TERMINATION_WAIT
wait time before deciding a termination signal did not work
Definition
Process.hpp:40
OksSystem::Process::instance
static const Process * instance()
Definition
Process.cpp:77
OksSystem::Process::OK_EXIT_NAME
static const char *const OK_EXIT_NAME
string to describe 0 exit value
Definition
Process.hpp:36
OksSystem::Process::exit_text
static const char * exit_text(int return_value)
the textual description of standard exit codes
Definition
Process.cpp:47
OksSystem::Process::join
int join(bool throw_non_zero=false) const
Waits for the process to terminate.
Definition
Process.cpp:151
OksSystem::Process::SIGNAL_EXIT_NAME
static const char *const SIGNAL_EXIT_NAME
string to describe signal exited value
Definition
Process.hpp:37
OksSystem::Process::equals
bool equals(const Process &other) const
Comparison method.
Definition
Process.cpp:198
OksSystem::Process::TEST_BASE_VALUE
static const int TEST_BASE_VALUE
first value for test manager exit codes
Definition
Process.hpp:38
OksSystem::Process::signal
void signal(int signal) const
Sends a signal to the process.
Definition
Process.cpp:174
OksSystem::Process::m_process_id
pid_t m_process_id
process identifier
Definition
Process.hpp:32
OksSystem::Process::terminate
void terminate() const
Terminate the process.
Definition
Process.cpp:207
OksSystem::Process::SYS_EXITS_NAMES
static const char *const SYS_EXITS_NAMES[]
names for standard system exit values
Definition
Process.hpp:34
OksSystem::Process::set_name
static void set_name(const std::string &name)
Definition
Process.cpp:88
OksSystem::Process::TEST_MAX_VALUE
static const int TEST_MAX_VALUE
last value for test manager exit codes
Definition
Process.hpp:39
OksSystem::Process::exit_pretty
static std::string exit_pretty(int return_value)
Definition
Process.cpp:60
OksSystem::Process::exists
bool exists() const
Does the process exist?
Definition
Process.cpp:188
OksSystem::Process::TEST_EXITS_NAMES
static const char *const TEST_EXITS_NAMES[]
names for testing exit values
Definition
Process.hpp:36
OksSystem::Process::process_id
pid_t process_id() const
the id of the process
Definition
Process.cpp:249
OksSystem::Process::s_instance
static Process * s_instance
singleton instance
Definition
Process.hpp:41
OksSystem::Process::m_process_name
std::string m_process_name
process name - only to be used for display
Definition
Process.hpp:33
OksSystem::Process::Process
Process()
Builds a process representing the current process.
Definition
Process.cpp:98
OksSystem::Process::to_string
std::string to_string() const
String conversion method.
Definition
Process.cpp:237
OksSystem
Definition
Descriptor.hpp:22
std
Definition
SchemaUtils.hpp:118
Generated on
for DUNE-DAQ by
1.17.0