107 lines
2.5 KiB
C++
Executable File
107 lines
2.5 KiB
C++
Executable File
|
|
|
|
|
|
#pragma once
|
|
|
|
#include <LtsSession/ltssession_export.h>
|
|
#include <LtsPluginManager/lts_plugin_loader.h>
|
|
#include <LtsPluginManager/lts_plugin_manager.h>
|
|
#include <Common/ProjectConfig/project_defines.h>
|
|
|
|
#include <memory>
|
|
#include <QString>
|
|
#include <QObject>
|
|
#include <QVector>
|
|
#include <QMap>
|
|
|
|
|
|
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();
|
|
|
|
|
|
LtsSession *createSession(const DdsConnectionParams &connParams,
|
|
bool hasBaseLayout = true,
|
|
bool payloads = true,
|
|
bool hidden = false);
|
|
|
|
|
|
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:
|
|
|
|
|
|
void signalStopBlock();
|
|
void signalLogout();
|
|
void signalQuit();
|
|
void signalInitializationFinished();
|
|
void signalInitializationAborted();
|
|
void hideAllOtherBLWs(QObject *caller);
|
|
void taskSwitch(QObject *caller);
|
|
};
|
|
|
|
}
|