Qt remote objects IPC

This commit is contained in:
pokamest 2021-02-02 01:47:40 +03:00
parent c4df9c004b
commit 048a673d31
18 changed files with 340 additions and 25 deletions

32
ipc/ipcserver.h Normal file
View file

@ -0,0 +1,32 @@
#ifndef IPCSERVER_H
#define IPCSERVER_H
#include <QObject>
#include "ipc.h"
#include "ipcserverprocess.h"
#include "rep_ipcinterface_source.h"
class IpcServer : public IpcInterfaceSource
{
public:
explicit IpcServer(QObject *parent = nullptr);
virtual int createPrivilegedProcess() override;
private:
int m_localpid = 0;
struct ProcessDescriptor {
ProcessDescriptor (QObject *parent = nullptr) {
serverNode = QSharedPointer<QRemoteObjectHost>(new QRemoteObjectHost(parent));
ipcProcess = QSharedPointer<IpcServerProcess>(new IpcServerProcess(parent));
}
QSharedPointer<IpcServerProcess> ipcProcess;
QSharedPointer<QRemoteObjectHost> serverNode;
};
QMap<int, ProcessDescriptor> m_processes;
};
#endif // IPCSERVER_H