Major Changes:
- Merged latest Qt5 devel content from dlbo (292 files changed, 7 new dirs)
- Consolidated forward-declarations and include folders
- Removed unneeded modules per Niklas' repo check list
Build System Fixes:
- Fixed CMake VERSION_GREATER syntax in ParticipantManagement/CMakeLists.txt
- Added VLC packages (libvlc-dev, vlc-plugin-base) to docker_build.sh
- Added PostgreSQL dev packages (libpq-dev, postgresql-server-dev-all) to Dockerfile
- Fixed locale warnings (ANSI_X3.4-1968 → C.UTF-8)
- Fixed ArcGIS SDK path warnings when BUILD_ARCGIS=OFF
Code Generation Fixes:
- Fixed IDL enum collisions (PortType→CorePortType/DdsutPortType, PdmEventType)
- Fixed Grantlee template svc_translation.cpp.grantlee:
- Changed {{ idl_enum.name }}_def:: to {{ idl_enum.name }}::
- Fixed .underlying() calls for C++11 scoped enums (enum class)
- Removed generated files from repo (moc_*, *_dtc.h, *_ftc.h)
Validation:
- BUILD_RTI=ON: SUCCESS
- BUILD_RTI=OFF: SUCCESS
- C++17 standard maintained for RTI 7.7 compatibility
- Ubuntu 26.04 Docker environment verified
Remaining Warnings (expected):
- BgViewer, KDChart, KDReports, Poppler-Qt6 not found (optional features)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
99 lines
2.9 KiB
C++
99 lines
2.9 KiB
C++
/**
|
|
* The ServiceProcess class represents a service which was startet as a process
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Hannes Baeuerle, SLSE, 2016-02-15
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <QtCore/QProcess>
|
|
#include <QtCore/QDateTime>
|
|
|
|
#include <DDS/Core/core.hpp>
|
|
#include <ServiceManagement/scm.hpp>
|
|
#include "logger.h"
|
|
|
|
namespace ServiceManagement
|
|
{
|
|
class Service;
|
|
class ServiceInformation;
|
|
|
|
class ServiceProcess : public QProcess
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit ServiceProcess(const GroupRequest &groupData, Service *parentService);
|
|
~ServiceProcess();
|
|
|
|
Core::RunningState runningState() const;
|
|
int serviceProcessId() const;
|
|
qint64 lastHeartbeatMSec() const;
|
|
void setLastHeartbeatMSec(qint64 lastHeartbeatMSec);
|
|
int32_t domainId() const { return m_groupData.domainId(); }
|
|
int32_t prio() const { return m_prio; }
|
|
int32_t exercisePartitionId() const { return m_groupData.exercisePartitionId(); }
|
|
int32_t replayPartitionId() const { return m_groupData.replayPartitionId(); }
|
|
QString serviceName() const;
|
|
QString abbreviation() const;
|
|
dds::core::optional<std::vector<Core::PortInformation>> ports() const;
|
|
bool devMode() const;
|
|
bool stoppedFromRequest() const;
|
|
|
|
void setNewStateFromChangeRequest(const Core::RunningState &newState);
|
|
void setNewStateFromHeartbeat(const Core::CurrentRunningState &data);
|
|
void killallRemote();
|
|
qint64 usablePid() const
|
|
{
|
|
#ifdef WIN32
|
|
auto myPid = pid();
|
|
if (!myPid)
|
|
return 0;
|
|
return myPid->dwProcessId;
|
|
#else
|
|
return pid();
|
|
#endif
|
|
}
|
|
|
|
void restart();
|
|
void stopFromRequest();
|
|
int remotePid() {return m_remotePid;};
|
|
unsigned short failedStartingAttempts() const;
|
|
|
|
void addStartAttempt();
|
|
QString debugInfo() const;
|
|
Q_SIGNALS:
|
|
void newServiceInformation(const ServiceInformation &info);
|
|
|
|
public Q_SLOTS:
|
|
virtual bool start(OpenMode mode = ReadWrite);
|
|
|
|
private Q_SLOTS:
|
|
void onNewInfoFromProc(QProcess::ProcessState state);
|
|
void doRestart();
|
|
void onDataFromPidProc();
|
|
|
|
private:
|
|
const int m_serviceId;
|
|
const int m_serviceProcessId;
|
|
const QString m_abbreviation;
|
|
const QString m_name;
|
|
const int m_prio;
|
|
const GroupRequest m_groupData;
|
|
int m_remotePid;
|
|
Core::RunningState m_runningState;
|
|
dds::core::optional<std::vector<Core::PortInformation>> m_ports;
|
|
qint64 m_lastHeartbeatMSec;
|
|
Service *m_parentService;
|
|
bool m_hasLicence;
|
|
bool m_isInDevMode;
|
|
unsigned short m_failedStartAttemptCounter;
|
|
bool m_stoppedFromRequest;
|
|
QProcess *m_pidProc;
|
|
LOGGER_T m_logger;
|
|
|
|
static int s_serviceProcessIdCounter;
|
|
};
|
|
} // namespace ServiceManagement
|