Instrument Neutral Distributed Interface INDI
2.2.5
integs
ProcessController.h
Go to the documentation of this file.
1
/*******************************************************************************
2
Copyright(c) 2022 Ludovic Pollet. All rights reserved.
3
4
This library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Library General Public
6
License version 2 as published by the Free Software Foundation.
7
8
This library is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
Library General Public License for more details.
12
13
You should have received a copy of the GNU Library General Public License
14
along with this library; see the file COPYING.LIB. If not, write to
15
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16
Boston, MA 02110-1301, USA.
17
*******************************************************************************/
18
19
#ifndef PROCESS_CONTROLLER_H_
20
#define PROCESS_CONTROLLER_H_ 1
21
22
#include <string>
23
#include <vector>
24
#include <list>
25
26
30
class
ProcessController
{
31
pid_t pid;
32
int
status;
33
std::string cmd;
34
35
void
finish();
36
public
:
37
ProcessController
();
38
~ProcessController
();
39
40
void
start
(
const
std::string & path,
const
std::vector<std::string> & args);
41
42
void
expectDone
();
43
void
expectAlive
();
44
void
expectExitCode
(
int
e);
45
void
join
();
46
void
kill
();
47
48
void
waitProcessEnd
(
int
expectedExitCode);
49
50
// Returns 0 on some system. Use checkOpenFdCount for actual verification
51
int
getOpenFdCount
();
52
53
void
checkOpenFdCount
(
int
expected,
const
std::string & msg);
54
};
55
56
57
#endif
// PROCESS_CONTROLLER_H_
ProcessController
Definition
ProcessController.h:30
ProcessController::kill
void kill()
Definition
ProcessController.cpp:106
ProcessController::join
void join()
Definition
ProcessController.cpp:113
ProcessController::expectAlive
void expectAlive()
Definition
ProcessController.cpp:141
ProcessController::expectExitCode
void expectExitCode(int e)
Definition
ProcessController.cpp:157
ProcessController::ProcessController
ProcessController()
Definition
ProcessController.cpp:15
ProcessController::getOpenFdCount
int getOpenFdCount()
Definition
ProcessController.cpp:25
ProcessController::~ProcessController
~ProcessController()
Definition
ProcessController.cpp:21
ProcessController::start
void start(const std::string &path, const std::vector< std::string > &args)
Definition
ProcessController.cpp:64
ProcessController::expectDone
void expectDone()
Definition
ProcessController.cpp:124
ProcessController::checkOpenFdCount
void checkOpenFdCount(int expected, const std::string &msg)
Definition
ProcessController.cpp:52
ProcessController::waitProcessEnd
void waitProcessEnd(int expectedExitCode)
Definition
ProcessController.cpp:101
Generated on Thu Oct 22 2026 14:46:48 for Instrument Neutral Distributed Interface INDI by
1.9.8