~mir-team/qtmir/trunk

« back to all changes in this revision

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

  • Committer: Bileto Bot
  • Author(s): Daniel d'Andrada
  • Date: 2016-07-04 13:58:01 UTC
  • mfrom: (520.1.5 dbusFocusInfo)
  • Revision ID: ci-train-bot@canonical.com-20160704135801-055x20tgh6j9edbp
com.canonical.Unity.FocusInfo D-Bus service for providing focus information

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2016 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
#ifndef QTMIR_CGMANAGER_H
 
18
#define QTMIR_CGMANAGER_H
 
19
 
 
20
#include <QDBusConnection>
 
21
 
 
22
namespace qtmir {
 
23
 
 
24
class CGManager : public QObject {
 
25
    Q_OBJECT
 
26
public:
 
27
    CGManager(QObject *parent = nullptr);
 
28
    virtual ~CGManager();
 
29
 
 
30
    QString getCGroupOfPid(const QString &controller, pid_t pid);
 
31
 
 
32
    QSet<pid_t> getTasks(const QString &controller, const QString &cgroup);
 
33
 
 
34
private:
 
35
    const QString m_interface{"org.linuxcontainers.cgmanager0_0"};
 
36
    const QString m_path{"/org/linuxcontainers/cgmanager"};
 
37
    QDBusConnection getConnection();
 
38
};
 
39
 
 
40
} // namespace qtmir
 
41
 
 
42
#endif // QTMIR_CGMANAGER_H