FreeNOS
ApplicationLauncher.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2020 Niek Linnenbank
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef __LIB_LIBAPP_APPLICATIONLAUNCHER_H
19#define __LIB_LIBAPP_APPLICATIONLAUNCHER_H
20
21#include <Types.h>
22#include <String.h>
23
36{
37 public:
38
49
50 public:
51
58 ApplicationLauncher(const char *path, const char **argv);
59
65 const ProcessID getPid() const;
66
72 const int getExitCode() const;
73
79 Result exec();
80
86 Result terminate() const;
87
93 Result wait();
94
95 private:
96
99
101 const char **m_argv;
102
105
108};
109
115#endif /* __LIB_LIBAPP_APPLICATIONLAUNCHER_H */
Helper class to launch an external program.
int m_exitCode
Exit code after the program has terminated.
Result wait()
Wait for the program to terminate.
const String m_path
Absolute path to the program to run.
Result exec()
Runs the external program.
Result terminate() const
Terminate the program.
const int getExitCode() const
Retrieve exit code of the program.
const ProcessID getPid() const
Retrieve Process Identifier of the program.
const char ** m_argv
Array with pointers to program arguments.
ProcessID m_pid
PID of the DatastoreServer.
Abstraction of strings.
Definition String.h:42
u32 ProcessID
Process Identification Number.
Definition Types.h:140