~alan-griffiths/qtmir/migrate-to-mir-Server-API

« back to all changes in this revision

Viewing changes to src/modules/Unity/Application/processcontroller.h

  • Committer: Gerry Boland
  • Date: 2014-07-01 13:38:06 UTC
  • mto: This revision was merged to the branch mainline in revision 158.
  • Revision ID: gerry.boland@canonical.com-20140701133806-lwfnplkijthydzj4
Update QML plugin: rename to Unity.Application, merge latest unity-mir changes, add tests (not passing yet) and use category logging

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2014 Canonical, Ltd.
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify it under
 
5
 * the terms of the GNU Lesser General Public License version 3, as published by
 
6
 * the Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful, but WITHOUT
 
9
 * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
 
10
 * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
11
 * 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
 */
 
17
 
 
18
#ifndef PROCESS_CONTROLLER_H
 
19
#define PROCESS_CONTROLLER_H
 
20
 
 
21
#include <QSharedPointer>
 
22
 
 
23
#include <sys/types.h>
 
24
 
 
25
namespace qtmir
 
26
{
 
27
 
 
28
class ProcessController
 
29
{
 
30
public:
 
31
    class OomController
 
32
    {
 
33
    public:
 
34
        OomController();
 
35
        OomController(const OomController&) = delete;
 
36
        virtual ~OomController() = default;
 
37
 
 
38
        OomController& operator=(const OomController&) = delete;
 
39
 
 
40
        virtual void ensureProcessLikelyToBeKilled(pid_t);
 
41
        virtual void ensureProcessUnlikelyToBeKilled(pid_t);
 
42
    };
 
43
 
 
44
    ProcessController();
 
45
    ProcessController(const ProcessController&) = delete;
 
46
    virtual ~ProcessController();
 
47
 
 
48
    ProcessController& operator=(const ProcessController&) = delete;
 
49
 
 
50
    virtual const QSharedPointer<OomController>& oomController() const;
 
51
 
 
52
    virtual bool sigStopProcessGroupForPid(pid_t pid) const;
 
53
    virtual bool sigContinueProcessGroupForPid(pid_t pid) const;
 
54
 
 
55
protected:
 
56
    QSharedPointer<OomController> m_oomController;
 
57
};
 
58
 
 
59
} // namespace qtmir
 
60
 
 
61
#endif // PROCESS_CONTROLLER_H