log0.1
This commit is contained in:
0
src/api/ipc_dbus/Ipc_dbus.cpp
Normal file
0
src/api/ipc_dbus/Ipc_dbus.cpp
Normal file
62
src/api/ipc_dbus/Ipc_dbus.h
Normal file
62
src/api/ipc_dbus/Ipc_dbus.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/**
|
||||
* @file Ipc_dbus.h
|
||||
* @brief D-Bus 服务接口 - 提供核心服务状态和负载查询
|
||||
*/
|
||||
|
||||
#ifndef IPC_DBUS_H
|
||||
#define IPC_DBUS_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
|
||||
/**
|
||||
* @brief D-Bus 服务适配器 - 暴露核心服务接口
|
||||
*/
|
||||
class IpcDBus : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", "com.softbus.Daemon")
|
||||
|
||||
public:
|
||||
explicit IpcDBus(CoreService* coreService, QObject* parent = nullptr);
|
||||
~IpcDBus();
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* @brief 检查核心服务是否运行
|
||||
* @return true 如果核心服务正在运行
|
||||
*/
|
||||
bool isRunning() const;
|
||||
|
||||
/**
|
||||
* @brief 获取核心服务状态信息
|
||||
* @return JSON 格式的状态信息
|
||||
*/
|
||||
QString getStatus() const;
|
||||
|
||||
|
||||
/**
|
||||
* @brief 获取守护进程的进程ID
|
||||
* @return 进程ID,如果无法获取则返回0
|
||||
*/
|
||||
qint64 getPid() const;
|
||||
|
||||
/**
|
||||
* @brief 关闭守护进程
|
||||
*/
|
||||
void shutdown();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private slots:
|
||||
void updateLoadInfo();
|
||||
|
||||
private:
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // IPC_DBUS_H
|
||||
|
||||
Reference in New Issue
Block a user