Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/Lts/Common/LtsSession/lts_session_manager.h
T
berrux-dev 855b0a6101 Remove modules not compiled by this branch's release build
Lts/Common: drop the 17 submodules excluded from the RELEASE_BUILD
branch of Lts/Common/CMakeLists.txt (CodeGen, LtsAppManager, LtsBotan,
LtsCoordinate, LtsElevation, LtsLogin, LtsMultiMonitor,
LtsPluginManager, LtsPrinting, LtsProjectionWorkstation,
LtsScriptTimeline, LtsSession, LtsTimeline, LtsTimelineClassic,
LtsVirtualKeyboard, LtsWidgets, TopicEditorBase). Only the 13
subdirectories actually built remain.

TrainingAreaBase: drop sources of targets excluded by
IF(NOT RELEASE_BUILD) / IF(BUILD_RTI) (svcTabClient, svcTabServer,
svcTrainingAreaBase exe, RecordReplayPlugin customization) and the 7
plugin directories not added in the release path (AdlerJson,
ApacheHlaJson, DebugJsonDir, HlaJson, Nmea, UAS, WlsTetra). Only
tabTelegrams, svcTabCommon and the TetraJson plugin are compiled.

Cross-checked: no kept compiled source includes headers from the
removed modules (GuiPluginInterface - the only LtsWidgets consumer -
is itself NOT RELEASE_BUILD-guarded).
2026-10-13 19:19:55 +02:00

127 lines
3.1 KiB
C++

/**
* @RDE_HEADER@
* Manages all the Sessions
* $Id$
* $HeadURL$
* $Author$
*
* Created by Mike Wille, SLSE, 2016-05-15
*/
#pragma once
#ifdef BUILD_RTI
#include <Lts/Common/ProjectConfig/project_defines.h>
#include <LtsPluginManager/lts_plugin_loader.h>
#include <LtsPluginManager/lts_plugin_manager.h>
#include <LtsSession/ltssession_export.h>
#include <QtCore/QMap>
#include <QtCore/QObject>
#include <QtCore/QString>
#include <QtCore/QVector>
#include <memory>
namespace NGL
{
class INGLLogger;
}
namespace DeveloperTools
{
class AppWidget;
}
namespace LtsSession
{
class LtsSession;
struct DdsConnectionParams;
class LTSSESSION_EXPORT LtsSessionManager : public QObject
{
Q_OBJECT
public:
LtsSessionManager();
~LtsSessionManager();
// create a new session, return old session if already exists [allowClosingSession => true => base layout close =
// close session | false => base layout close = base layout hide + session still open]
LtsSession* createSession(const DdsConnectionParams& connParams, bool hasBaseLayout = true, bool payloads = true,
bool hidden = false);
// return an already created session or null
LtsSession* getSession(IDL::PartitionType partitionType, int partitionId);
bool init(const DdsConnectionParams& connParams, const QVector<LtsPluginManager::AppPluginInstance>& dataPluginList,
const QVector<LtsPluginManager::AppPluginInstance>& guiPluginList, LtsAppDescriptor::App appId,
const QString& workspaceId, bool headless, bool hidden);
int sessionCount() const
{
return m_sessionMap.count();
}
LtsAppDescriptor::App appId() const
{
return m_appId;
}
bool isHeadless() const
{
return m_headless;
}
QVector<LtsSession*> sessions();
void softQuit();
private:
friend class DeveloperTools::DevDialog;
friend class DeveloperTools::AppWidget;
struct SessionKey
{
SessionKey(IDL::PartitionType pt = IDL::PartitionType::Any, int pId = 0) : partitionType(pt), partitionId(pId)
{
}
IDL::PartitionType partitionType;
int partitionId;
bool operator<(const SessionKey& o) const
{
if (partitionType != o.partitionType)
return partitionType < o.partitionType;
return partitionId < o.partitionId;
}
};
void logout();
void addPayloads(LtsSession* session);
QMap<SessionKey, LtsSession*> m_sessionMap;
QVector<LtsPluginManager::AppPluginInstance> m_dataPluginList;
QVector<LtsPluginManager::AppPluginInstance> m_guiPluginList;
LtsAppDescriptor::App m_appId;
bool m_headless;
NGL::INGLLogger& m_logger;
private slots:
void slotCloseSession();
signals:
/**
* @brief signalStopBlock (see slotCloseRequest)
*/
void signalStopBlock();
void signalLogout();
void signalQuit();
void signalInitializationFinished();
void signalInitializationAborted();
void hideAllOtherBLWs(QObject* caller);
void taskSwitch(QObject* caller);
};
} // namespace LtsSession
#endif // BUILD_RTI