CCIMXDesktop
 
Loading...
Searching...
No Matches
ProcessBroswer.h
1#ifndef PROCESSBROSWER_H
2#define PROCESSBROSWER_H
3
4#include <QObject>
5#include <QTimer>
6
7/* Forward declaration of platform-specific driver */
9
15class ProcessBroswer : public QObject {
16 Q_OBJECT
17public:
22 explicit ProcessBroswer(QObject* parent = nullptr);
23
28
33 struct ProcessInfo {
34 int pid;
35 int ppid;
36 QString name;
37 QString fullPath;
40 double cpuPercent;
41 QString userName;
42 };
43
49 void set_flush_freq(const int msecs) { flush_msecs = msecs; }
50
56 void set_capture_state(bool st);
57
58signals:
64 void fetch_finish(const QList<ProcessBroswer::ProcessInfo>& infos);
65
66private:
67 CCIMX_AbstractProcessBroswerDriver* platform_driver_base { nullptr };
68
73 void setup_platform_relative();
74
79 void flush_once();
80
81 int flush_msecs { 1500 };
82 QList<ProcessInfo> process_list;
83 QTimer flush_timer;
84};
85
92public:
94 virtual ~CCIMX_AbstractProcessBroswerDriver() = default;
95
101 virtual void factory(QList<ProcessBroswer::ProcessInfo>& lists) = 0;
102};
103
104#endif // PROCESSBROSWER_H
The CCIMX_AbstractProcessBroswerDriver class Abstract base class for platform-specific process browse...
Definition ProcessBroswer.h:91
virtual void factory(QList< ProcessBroswer::ProcessInfo > &lists)=0
factory Populate the list with current system processes information.
The ProcessBroswer class Provides an interface to retrieve and monitor system processes information....
Definition ProcessBroswer.h:15
~ProcessBroswer()
Destructor cleans up resources.
Definition ProcessBroswer.cpp:14
void fetch_finish(const QList< ProcessBroswer::ProcessInfo > &infos)
fetch_finish Signal emitted when process data is fetched and ready.
void set_capture_state(bool st)
set_capture_state Enables or disables process data capturing.
Definition ProcessBroswer.cpp:21
void set_flush_freq(const int msecs)
set_flush_freq Sets the frequency (in milliseconds) at which process data is refreshed.
Definition ProcessBroswer.h:49
The ProcessInfo struct Holds detailed information about a system process.
Definition ProcessBroswer.h:33
int pid
Process ID.
Definition ProcessBroswer.h:34
qint64 memoryUsageKB
Memory usage in kilobytes.
Definition ProcessBroswer.h:39
QString userName
User who owns the process.
Definition ProcessBroswer.h:41
int ppid
Parent Process ID.
Definition ProcessBroswer.h:35
int threadCount
Number of threads in the process.
Definition ProcessBroswer.h:38
QString name
Process name.
Definition ProcessBroswer.h:36
double cpuPercent
CPU usage percentage.
Definition ProcessBroswer.h:40
QString fullPath
Full executable path of the process.
Definition ProcessBroswer.h:37