Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / workspace / libs / ksysguard / processcore / processes_local_p.h
blob202f4bf7d9eb97a14fae3cdc19421d4a396de365
1 /* This file is part of the KDE project
3 Copyright (C) 2007 John Tapsell <tapsell@kde.org>
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
22 #ifndef PROCESSES_LOCAL_H_
23 #define PROCESSES_LOCAL_H_
25 #include "processes_base_p.h"
26 #include <unistd.h> //For sysconf
29 #include <QSet>
31 namespace KSysGuard
33 class Process;
35 /**
36 * This is the OS specific code to get process information for the local host.
38 class ProcessesLocal : public AbstractProcesses {
39 public:
40 ProcessesLocal();
41 virtual ~ProcessesLocal();
42 virtual QSet<long> getAllPids();
43 virtual long getParentPid(long pid);
44 virtual bool updateProcessInfo(long pid, Process *process);
45 virtual bool sendSignal(long pid, int sig);
46 virtual bool setNiceness(long pid, int priority);
47 virtual bool setScheduler(long pid, int priorityClass, int priority);
48 virtual long long totalPhysicalMemory();
49 virtual bool setIoNiceness(long pid, int priorityClass, int priority);
50 virtual bool supportsIoNiceness();
51 virtual long numberProcessorCores()
52 #ifdef _SC_NPROCESSORS_ONLN
53 { return sysconf(_SC_NPROCESSORS_ONLN); } // Should work on any recent posix system
54 #else
56 #endif
57 virtual void updateAllProcesses() { emit processesUpdated(); } //For local machine, there is no delay
59 private:
60 /**
61 * You can use this for whatever data you want. Be careful about preserving state in between getParentPid and updateProcessInfo calls
62 * if you chose to do that. getParentPid may be called several times for different pids before the relevant updateProcessInfo calls are made.
63 * This is because the tree structure has to be sorted out first.
65 class Private;
66 Private *d;
70 #endif