TYPE3
[iec.git] / src / type3_AndroidCloud / anbox-master / external / process-cpp-minimal / include / core / posix / process_group.h
1 /*
2  * Copyright © 2013 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program 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
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Thomas Voß <thomas.voss@canonical.com>
17  */
18
19 #ifndef CORE_POSIX_PROCESS_GROUP_H_
20 #define CORE_POSIX_PROCESS_GROUP_H_
21
22 #include <core/posix/signalable.h>
23 #include <core/posix/visibility.h>
24
25 #include <memory>
26
27 namespace core
28 {
29 namespace posix
30 {
31 class Process;
32
33 /**
34  * @brief The ProcessGroup class models a signalable group of process.
35  *
36  * Summary from http://en.wikipedia.org/wiki/Process_group:
37  *
38  * In POSIX-conformant operating systems, a process group denotes a collection
39  * of one or more processes. Process groups are used to control the distribution
40  * of signals. A signal directed to a process group is delivered individually to
41  * all of the processes that are members of the group.
42  */
43 class CORE_POSIX_DLL_PUBLIC ProcessGroup : public Signalable
44 {
45 public:
46     /**
47      * @brief Accesses the id of this process group.
48      * @return The id of this process group.
49      */
50     virtual pid_t id() const;
51
52     static ProcessGroup invalid();
53
54 protected:
55     friend class Process;
56     CORE_POSIX_DLL_LOCAL ProcessGroup(pid_t id);
57
58 private:
59     struct CORE_POSIX_DLL_LOCAL Private;
60     std::shared_ptr<Private> d;
61 };
62 }
63 }
64
65 #endif // CORE_POSIX_PROCESS_GROUP_H_