Adds immediate migration results
This commit is contained in:
2395 files changed
+357322
-2524
No files matched your search
@@ -42,7 +42,7 @@ NGL_TARGET_LINK_LIBRARIES(svcScmCommon
|
||||
PRIVATE
|
||||
RTI::nddscpp2
|
||||
PUBLIC
|
||||
Qt5::Core
|
||||
Qt6::Core
|
||||
ddscore
|
||||
NGLLogger
|
||||
ngldb
|
||||
@@ -164,7 +164,7 @@ ENDIF()
|
||||
NGL_ADD_SVC_ICON(SRCS_exe)
|
||||
NGL_ADD_EXECUTABLE(SV AAR svcServiceManagement ${SRCS_exe})
|
||||
NGL_TARGET_LINK_LIBRARIES(svcServiceManagement
|
||||
Qt5::Core
|
||||
Qt6::Core
|
||||
svcCoreClient
|
||||
ddsconnector
|
||||
codegen_base
|
||||
|
||||
+2
-2
@@ -28,8 +28,8 @@ IF(BUILD_TESTING AND TARGET svcScmCommon)
|
||||
ddsdtc
|
||||
ddsQoS
|
||||
ProjectConfig
|
||||
Qt5::Core
|
||||
Qt5::Test
|
||||
Qt6::Core
|
||||
Qt6::Test
|
||||
)
|
||||
|
||||
ADD_TEST(NAME scmDtUnitTest COMMAND $<TARGET_FILE:scmDtUnitTest>)
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "group.h"
|
||||
#include <utility>
|
||||
|
||||
#include <QtCore/QDateTime>
|
||||
#include <QtCore/QThread>
|
||||
@@ -52,7 +53,7 @@ Group::Group(const std::shared_ptr<DdsHandler> &ddsHandler,
|
||||
Group::~Group()
|
||||
{
|
||||
setRunningState(Core::RunningState::StoppedNormally);
|
||||
for (ServiceProcess *serviceProc :qAsConst(m_serviceProcs))
|
||||
for (ServiceProcess *serviceProc :std::as_const(m_serviceProcs))
|
||||
m_ddsHandler->dts()->removeServiceInformationByKey(serviceProc->serviceProcessId());
|
||||
qDeleteAll(m_serviceProcs); // in Service they are removed via ServiceProcess::destroyed signal
|
||||
m_ddsHandler->dts()->removeGroupInformationByKey(m_groupId);
|
||||
@@ -60,7 +61,7 @@ Group::~Group()
|
||||
|
||||
void Group::init()
|
||||
{
|
||||
for (int serviceId : qAsConst(m_scheme->services))
|
||||
for (int serviceId : std::as_const(m_scheme->services))
|
||||
{
|
||||
if (m_serviceProcs.contains(serviceId))
|
||||
continue;
|
||||
@@ -92,11 +93,11 @@ bool Group::setRunningState(Core::RunningState newState)
|
||||
case Core::RunningState::Starting:
|
||||
// make sure all services are there
|
||||
init();
|
||||
for (ServiceProcess *serviceProc : qAsConst(m_serviceProcs))
|
||||
for (ServiceProcess *serviceProc : std::as_const(m_serviceProcs))
|
||||
serviceProc->start();
|
||||
return true;
|
||||
case Core::RunningState::StoppedNormally:
|
||||
for (ServiceProcess *serviceProc : qAsConst(m_serviceProcs))
|
||||
for (ServiceProcess *serviceProc : std::as_const(m_serviceProcs))
|
||||
serviceProc->terminate();
|
||||
return true;
|
||||
default:
|
||||
@@ -118,7 +119,7 @@ void Group::startCore()
|
||||
init();
|
||||
|
||||
// ExerciseManagement must be started ...
|
||||
for (ServiceProcess *proc : qAsConst(m_serviceProcs))
|
||||
for (ServiceProcess *proc : std::as_const(m_serviceProcs))
|
||||
{
|
||||
if (proc->serviceName() == QLatin1String("ExerciseManagement"))
|
||||
{
|
||||
@@ -160,7 +161,7 @@ void Group::start()
|
||||
// make sure all services are there
|
||||
init();
|
||||
// get list of prio
|
||||
for (ServiceProcess *proc : qAsConst(m_serviceProcs))
|
||||
for (ServiceProcess *proc : std::as_const(m_serviceProcs))
|
||||
{
|
||||
if ( !prioList.contains(proc->prio()))
|
||||
{
|
||||
@@ -176,7 +177,7 @@ void Group::start()
|
||||
// m_actPrio = getNextPrio(prioList);
|
||||
//}
|
||||
|
||||
for (ServiceProcess *proc : qAsConst(m_serviceProcs))
|
||||
for (ServiceProcess *proc : std::as_const(m_serviceProcs))
|
||||
{
|
||||
if ( m_actPrio == proc->prio())
|
||||
{
|
||||
@@ -198,7 +199,7 @@ void Group::start()
|
||||
|
||||
void Group::stop()
|
||||
{
|
||||
for (ServiceProcess *proc : qAsConst(m_serviceProcs))
|
||||
for (ServiceProcess *proc : std::as_const(m_serviceProcs))
|
||||
{
|
||||
if (proc->state() != QProcess::NotRunning)
|
||||
proc->stopFromRequest();
|
||||
@@ -209,7 +210,7 @@ void Group::restart()
|
||||
{
|
||||
// make sure all services are there
|
||||
init();
|
||||
for (ServiceProcess *proc : qAsConst(m_serviceProcs))
|
||||
for (ServiceProcess *proc : std::as_const(m_serviceProcs))
|
||||
proc->restart();
|
||||
}
|
||||
|
||||
@@ -269,7 +270,7 @@ void Group::onNewServiceInfo()
|
||||
m_elapsedTimer.start();
|
||||
std::vector<int32_t> serviceIds;
|
||||
serviceIds.reserve(m_serviceProcs.size());
|
||||
for (ServiceProcess *proc : qAsConst(m_serviceProcs))
|
||||
for (ServiceProcess *proc : std::as_const(m_serviceProcs))
|
||||
serviceIds.push_back(proc->serviceProcessId());
|
||||
|
||||
GroupInformation info(m_groupId,
|
||||
@@ -297,7 +298,7 @@ void Group::onCompleteCoreTick()
|
||||
ServiceProcess *exmProc = nullptr;
|
||||
|
||||
// get EXM proc
|
||||
for (ServiceProcess *proc : qAsConst(m_serviceProcs))
|
||||
for (ServiceProcess *proc : std::as_const(m_serviceProcs))
|
||||
{
|
||||
if (proc->serviceName() == QLatin1String("ExerciseManagement"))
|
||||
{
|
||||
@@ -315,7 +316,7 @@ void Group::onCompleteCoreTick()
|
||||
if (exmProc->runningState() == Core::RunningState::Running)
|
||||
{
|
||||
// get list of prio
|
||||
for (ServiceProcess *proc : qAsConst(m_serviceProcs))
|
||||
for (ServiceProcess *proc : std::as_const(m_serviceProcs))
|
||||
{
|
||||
if ( !prioList.contains(proc->prio()))
|
||||
{
|
||||
@@ -327,7 +328,7 @@ void Group::onCompleteCoreTick()
|
||||
}
|
||||
|
||||
// start rest of group core
|
||||
for (ServiceProcess *proc : qAsConst(m_serviceProcs))
|
||||
for (ServiceProcess *proc : std::as_const(m_serviceProcs))
|
||||
{
|
||||
if (proc->state() != QProcess::Running && proc->prio() == m_actPrio)
|
||||
{
|
||||
@@ -352,7 +353,7 @@ void Group::onCompleteCoreTick()
|
||||
|
||||
ServiceProcess *Group::procFromPid(Q_PID pid)
|
||||
{
|
||||
for (ServiceProcess *proc :qAsConst(m_serviceProcs))
|
||||
for (ServiceProcess *proc :std::as_const(m_serviceProcs))
|
||||
{
|
||||
if (proc->pid() == pid)
|
||||
return proc;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "group_handler.h"
|
||||
#include <utility>
|
||||
#include "group.h"
|
||||
#include "heartbeat_listener.h"
|
||||
#include "service_donator.h"
|
||||
@@ -65,7 +66,7 @@ QVector<Group *> GroupHandler::groups() const
|
||||
|
||||
GroupScheme *GroupHandler::groupSchemeFromType(Core::ServiceGroupType type)
|
||||
{
|
||||
for (GroupScheme *scheme : qAsConst(m_groupSchemes))
|
||||
for (GroupScheme *scheme : std::as_const(m_groupSchemes))
|
||||
{
|
||||
if (scheme->groupType == type)
|
||||
return scheme;
|
||||
@@ -240,7 +241,7 @@ Core::FunctionReplyObject GroupHandler::onStopAllForExercise(int domainId, int e
|
||||
|
||||
int cntStopped = 0;
|
||||
int cntAlive = 0;
|
||||
for (Group *group : qAsConst(m_groups))
|
||||
for (Group *group : std::as_const(m_groups))
|
||||
{
|
||||
if (group->exercisePartitionId() == exercisePartitionId &&
|
||||
group->domainId() == domainId)
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "licence_handler.h"
|
||||
#include <utility>
|
||||
#include "dds_handler.h"
|
||||
#include <QFile>
|
||||
#include <LtsLicence/aes_crypt.h>
|
||||
@@ -28,7 +29,7 @@ LicenceHandler::LicenceHandler(const std::shared_ptr<DdsHandler> &ddsHandler, co
|
||||
|
||||
LicenceHandler::~LicenceHandler()
|
||||
{
|
||||
for (const LtsLicence::Licence &info : qAsConst(m_licenceVec))
|
||||
for (const LtsLicence::Licence &info : std::as_const(m_licenceVec))
|
||||
m_ddsHandler->dts()->removeLicenceInformationByKey(info.name.toStdString());
|
||||
} // end of dtor()
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -302,7 +303,7 @@ QString LicenceHandler::dumpLicenceInformation(const LtsLicence::Licence &licenc
|
||||
|
||||
void LicenceHandler::publishAllData()
|
||||
{
|
||||
for (const LtsLicence::Licence &info : qAsConst(m_licenceVec))
|
||||
for (const LtsLicence::Licence &info : std::as_const(m_licenceVec))
|
||||
publishData(info);
|
||||
} // end of publishAllData()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "service.h"
|
||||
#include <utility>
|
||||
|
||||
#include <QtCore/QProcess>
|
||||
|
||||
@@ -83,7 +84,7 @@ ServiceManagement::ServiceProcess *ServiceManagement::Service::toServiceProcess(
|
||||
|
||||
ServiceManagement::ServiceProcess *ServiceManagement::Service::procFromPid(qint64 pid)
|
||||
{
|
||||
for (ServiceProcess *currentProc : qAsConst(m_procs))
|
||||
for (ServiceProcess *currentProc : std::as_const(m_procs))
|
||||
{
|
||||
if (currentProc->usablePid() == pid)
|
||||
return currentProc;
|
||||
@@ -93,7 +94,7 @@ ServiceManagement::ServiceProcess *ServiceManagement::Service::procFromPid(qint6
|
||||
|
||||
ServiceManagement::ServiceProcess *ServiceManagement::Service::procFromServiceProcId(int32_t id)
|
||||
{
|
||||
for (ServiceProcess *currentProc : qAsConst(m_procs))
|
||||
for (ServiceProcess *currentProc : std::as_const(m_procs))
|
||||
{
|
||||
if (currentProc->serviceProcessId() == id)
|
||||
return currentProc;
|
||||
@@ -103,13 +104,13 @@ ServiceManagement::ServiceProcess *ServiceManagement::Service::procFromServicePr
|
||||
|
||||
void ServiceManagement::Service::stopAllProcs()
|
||||
{
|
||||
for (ServiceProcess *currentProc : qAsConst(m_procs))
|
||||
for (ServiceProcess *currentProc : std::as_const(m_procs))
|
||||
currentProc->terminate();
|
||||
}
|
||||
|
||||
void ServiceManagement::Service::waitForStopped()
|
||||
{
|
||||
for (ServiceProcess *currentProc : qAsConst(m_procs))
|
||||
for (ServiceProcess *currentProc : std::as_const(m_procs))
|
||||
currentProc->waitForFinished(5000);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "service_handler.h"
|
||||
#include <utility>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDateTime>
|
||||
@@ -111,9 +112,9 @@ void ServiceManagement::ServiceHandler::stopAllServices()
|
||||
INFO_LOG(m_logger) << "Stopping all Services ...";
|
||||
|
||||
// shutdown async
|
||||
for (Service *service : qAsConst(m_services))
|
||||
for (Service *service : std::as_const(m_services))
|
||||
service->stopAllProcs();
|
||||
for (Service *service : qAsConst(m_services))
|
||||
for (Service *service : std::as_const(m_services))
|
||||
service->waitForStopped();
|
||||
|
||||
INFO_LOG(m_logger) << "... all Services stopped :)";
|
||||
@@ -147,9 +148,9 @@ void ServiceManagement::ServiceHandler::onNewServiceInfoFromDds(const Core::Curr
|
||||
if (proc == nullptr)
|
||||
{
|
||||
bool found = false;
|
||||
for (Service *currentService : qAsConst(m_services))
|
||||
for (Service *currentService : std::as_const(m_services))
|
||||
{
|
||||
for (ServiceProcess *currentProc : qAsConst(currentService->allProcs()))
|
||||
for (ServiceProcess *currentProc : std::as_const(currentService->allProcs()))
|
||||
{
|
||||
if (currentProc->remotePid() == data.pid())
|
||||
{
|
||||
@@ -182,7 +183,7 @@ void ServiceManagement::ServiceHandler::onNewServiceInfoFromDds(const Core::Curr
|
||||
|
||||
ServiceManagement::Service *ServiceManagement::ServiceHandler::serviceFromId(int id)
|
||||
{
|
||||
for (Service *service : qAsConst(m_services))
|
||||
for (Service *service : std::as_const(m_services))
|
||||
{
|
||||
if (service->id() == id)
|
||||
return service;
|
||||
@@ -192,7 +193,7 @@ ServiceManagement::Service *ServiceManagement::ServiceHandler::serviceFromId(int
|
||||
|
||||
ServiceManagement::ServiceProcess *ServiceManagement::ServiceHandler::serviceProcessFromPid(qint64 pid)
|
||||
{
|
||||
for (Service *service : qAsConst(m_services))
|
||||
for (Service *service : std::as_const(m_services))
|
||||
{
|
||||
ServiceProcess *result = service->procFromPid(pid);
|
||||
if (result)
|
||||
@@ -203,7 +204,7 @@ ServiceManagement::ServiceProcess *ServiceManagement::ServiceHandler::servicePro
|
||||
|
||||
ServiceManagement::ServiceProcess *ServiceManagement::ServiceHandler::serviceProcessFromServiceProcId(int32_t id)
|
||||
{
|
||||
for (Service *service : qAsConst(m_services))
|
||||
for (Service *service : std::as_const(m_services))
|
||||
{
|
||||
ServiceProcess *result = service->procFromServiceProcId(id);
|
||||
if (result)
|
||||
@@ -218,9 +219,9 @@ void ServiceManagement::ServiceHandler::onHeartBeatObserverTimerTimeout()
|
||||
const qint64 minHeartbeatAge = tNow - HEARTBEAT_OBSERVER_INTERVAL;
|
||||
const qint64 minHeartbeatAgeStartup = tNow - HEARTBEAT_OBSERVER_INTERVAL * 6;
|
||||
|
||||
for (Service *currentService : qAsConst(m_services))
|
||||
for (Service *currentService : std::as_const(m_services))
|
||||
{
|
||||
for (ServiceProcess *currentProc : qAsConst(currentService->allProcs()))
|
||||
for (ServiceProcess *currentProc : std::as_const(currentService->allProcs()))
|
||||
{
|
||||
// dev mode for this proc -> we're not repsonsible for
|
||||
if (currentProc->devMode())
|
||||
|
||||
Reference in new issue
Block a user