BUILD_RTI=OFF: 1902/1902 Targets erfolgreich, DDS-Stubs vervollständigt
Neue Stub-Header für BUILD_RTI=OFF Konfiguration: - include/DDS/Generic/generic_base.h: Topic-Name-Templates, Helper-Funktionen - include/DDS/Generic/generic_logger.h: Logger-Wrapper mit DataType-Enum - include/DDS/Generic/ddsgen_export.h: Export-Makros (leer für OFF) - include/DDS/Generic/generic_data_reader.h: Data Reader Template-Stub - include/DDS/DTC/generic_dtc.h: Minimale DDS-Typen für DTC - include/LtsUtils/LtsUtilsCore/data_modification_enum.h: DataModification Enum - include/FileManagement/flm_dtc_impl.h: Virtuelle Methoden für Name-Helper - include/OperatorManagement/opm_dtc_impl.h: DtcImpl ohne Q_OBJECT Wichtige Änderungen: - QObject-Basisklasse entfernt für DatabaseInterfaceImpl und DtcImpl (BUILD_RTI=OFF) - Logger-Stub verwendet Qt-Logging (qDebug/qWarning/qCritical) - FileStatus als int-Alias statt enum class für BUILD_RTI=OFF - CMake: DDS-Bibliotheken als leere INTERFACE-Targets für BUILD_RTI=OFF - std::optional: is_set() → has_value(), get() → value() - QList → std::vector Konversionen korrigiert - qAsConst-Fehler mit rvalue expressions behoben Build-Status: 1902/1902 Targets erfolgreich (BUILD_RTI=OFF) Tests: Nicht ausführbar ohne RTI Connext DDS (BUILD_RTI=ON erforderlich)
This commit is contained in:
1 parent
eafbbbbbe9
commit
851d47e114
17 files changed
+606
-40
No files matched your search
@@ -91,7 +91,7 @@ public:
|
||||
, m_exerciseId(std::nullopt)
|
||||
, m_phaseId(std::nullopt)
|
||||
, m_size(0)
|
||||
, m_fileStatus(FileStatus::Valid)
|
||||
, m_fileStatus(FileStatus_Valid)
|
||||
, m_fileCategory(FileCategory::Global)
|
||||
, m_fileType(FileType::Unknown)
|
||||
, m_isTemplate(false)
|
||||
@@ -121,7 +121,7 @@ public:
|
||||
FileCategory fileCategory() const { return m_fileCategory; }
|
||||
FileType fileType() const { return m_fileType; }
|
||||
bool isTemplate() const { return m_isTemplate; }
|
||||
bool isDeleted() const { return m_fileStatus == FileStatus::Deleted; }
|
||||
bool isDeleted() const { return m_fileStatus == FileStatus_Deleted; }
|
||||
bool isHidden() const { return m_hidden; }
|
||||
bool isUsedBy() const { return m_used; }
|
||||
std::string usedBy() const { return m_usedBy; }
|
||||
|
||||
@@ -6,8 +6,62 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <FileManagement/flm_db.h>
|
||||
#include <ngldb/nsqlquery.h>
|
||||
|
||||
// Minimal Logger stub for BUILD_RTI=OFF
|
||||
namespace NGL
|
||||
{
|
||||
enum class LogLevel
|
||||
{
|
||||
Undefined = 0,
|
||||
Trace = 64,
|
||||
Debug = 96,
|
||||
Info = 128,
|
||||
Warning = 150,
|
||||
Error = 182,
|
||||
Fatal = 214,
|
||||
};
|
||||
|
||||
class Logger
|
||||
{
|
||||
public:
|
||||
bool isTraceEnabled() const { return false; }
|
||||
bool isDebugEnabled() const { return true; }
|
||||
bool isInfoEnabled() const { return true; }
|
||||
bool isWarningEnabled() const { return true; }
|
||||
bool isErrorEnabled() const { return true; }
|
||||
bool isFatalEnabled() const { return true; }
|
||||
};
|
||||
}
|
||||
|
||||
// Logger macros (simplified for Qt6) - work with pointer
|
||||
#define LOGFUNCTION Q_FUNC_INFO
|
||||
|
||||
#ifdef LTS_DEBUG
|
||||
#define TRACE_LOG(logger) \
|
||||
for (bool log_level_enabled = (logger)->isDebugEnabled(); log_level_enabled; log_level_enabled = false) \
|
||||
qDebug() << "[TRACE]" << __FILE__ << ":" << __LINE__ << Q_FUNC_INFO
|
||||
#else
|
||||
#define TRACE_LOG(logger) \
|
||||
if (false) qDebug()
|
||||
#endif
|
||||
|
||||
#define DEBUG_LOG(logger) \
|
||||
if (!(logger)->isDebugEnabled()) {} else qDebug() << "[DEBUG]" << __FILE__ << ":" << __LINE__ << Q_FUNC_INFO
|
||||
|
||||
#define INFO_LOG(logger) \
|
||||
if (!(logger)->isInfoEnabled()) {} else qDebug() << "[INFO]" << __FILE__ << ":" << __LINE__ << Q_FUNC_INFO
|
||||
|
||||
#define WARNING_LOG(logger) \
|
||||
if (!(logger)->isWarningEnabled()) {} else qWarning() << "[WARNING]" << __FILE__ << ":" << __LINE__ << Q_FUNC_INFO
|
||||
|
||||
#define ERROR_LOG(logger) \
|
||||
if (!(logger)->isErrorEnabled()) {} else qCritical() << "[ERROR]" << __FILE__ << ":" << __LINE__ << Q_FUNC_INFO
|
||||
|
||||
#define FATAL_LOG(logger) \
|
||||
if (!(logger)->isFatalEnabled()) {} else qCritical() << "[FATAL]" << __FILE__ << ":" << __LINE__ << Q_FUNC_INFO
|
||||
|
||||
namespace FileManagement
|
||||
{
|
||||
@@ -18,16 +72,33 @@ namespace FileManagement
|
||||
* This class is normally generated by CODEGEN_DATABASE macro.
|
||||
* This stub provides minimal interface for BUILD_RTI=OFF builds.
|
||||
*/
|
||||
class DatabaseInterfaceImpl : public QObject
|
||||
class DatabaseInterfaceImpl
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DatabaseInterfaceImpl(QObject *parent = nullptr) : QObject(parent) {}
|
||||
virtual ~DatabaseInterfaceImpl() = default;
|
||||
DatabaseInterfaceImpl()
|
||||
: m_logger(nullptr)
|
||||
, m_query(nullptr)
|
||||
{
|
||||
m_logger = new NGL::Logger();
|
||||
m_query = new NSqlQuery(QSqlDatabase());
|
||||
}
|
||||
virtual ~DatabaseInterfaceImpl()
|
||||
{
|
||||
delete m_logger;
|
||||
delete m_query;
|
||||
}
|
||||
|
||||
// Virtual methods that can be overridden by custom implementations
|
||||
virtual bool updateStatus(int fileId, const FileStatus &status, int operatorId) = 0;
|
||||
virtual bool setUsedBy(int fileId, const bool &usedBy, int usedNo, int operatorId) = 0;
|
||||
|
||||
protected:
|
||||
// Member variables expected by custom implementations
|
||||
NGL::Logger* m_logger;
|
||||
NSqlQuery* m_query;
|
||||
|
||||
// Helper methods expected by custom implementations
|
||||
QString getTableName(const QString &baseName) const { return baseName; }
|
||||
};
|
||||
|
||||
} // namespace FileManagement
|
||||
@@ -0,0 +1,86 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* FileManagement DTC Implementation
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Stub-Header für Qt6-Migration - ersetzt DDS-generierten Header
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <FileManagement/flm_db_impl.h>
|
||||
#include <DDS/DTC/generic_dtc.h>
|
||||
#include <memory>
|
||||
|
||||
// Forward declarations für DDS
|
||||
namespace DDSConnector
|
||||
{
|
||||
class DdsConnector;
|
||||
}
|
||||
|
||||
// Stub für DDS DataReader - wird normalerweise von DDS generiert
|
||||
template<typename T>
|
||||
class DdsDataReaderStub
|
||||
{
|
||||
public:
|
||||
struct LoanedSamplesWrapper
|
||||
{
|
||||
auto begin() { return m_samples.begin(); }
|
||||
auto end() { return m_samples.end(); }
|
||||
std::vector<T> m_samples;
|
||||
};
|
||||
|
||||
LoanedSamplesWrapper readAlive() { return LoanedSamplesWrapper{}; }
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------
|
||||
namespace FileManagement
|
||||
{
|
||||
namespace Interface
|
||||
{
|
||||
/**
|
||||
* @brief DtcImpl - Basisklasse für FileManagement DTC
|
||||
*
|
||||
* Stellt Logger und DDS-DataReader für Custom-Implementierungen bereit
|
||||
* Erbt von DatabaseInterfaceImpl für Datenbank-Zugriff
|
||||
*/
|
||||
class DtcImpl : public DatabaseInterfaceImpl
|
||||
{
|
||||
public:
|
||||
explicit DtcImpl(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector)
|
||||
: DatabaseInterfaceImpl()
|
||||
, m_ddsConnector(ddsConnector)
|
||||
, m_dtcFileContent(std::make_unique<DdsDataReaderStub<FileContent>>())
|
||||
, m_dtcFolder(std::make_unique<DdsDataReaderStub<Folder>>())
|
||||
{
|
||||
// Logger wird von DatabaseInterfaceImpl bereitgestellt
|
||||
// m_logger ist in DatabaseInterfaceImpl definiert
|
||||
}
|
||||
|
||||
~DtcImpl() override = default;
|
||||
|
||||
// Virtuelle Methoden für Custom-Implementierung
|
||||
virtual bool getAllTemplates(QList<FileContent> &allTemplates) = 0;
|
||||
virtual bool getAllFiles(const FileType &fileType, int folderId, QStringList &allFiles, bool showHidden = false) = 0;
|
||||
virtual bool getFilesOperator(const FileType &fileType, int folderId, int operatorId, QStringList &allFiles) = 0;
|
||||
virtual bool getFile(const FileType &fileType, int folderId, const QString &fileName, FileContent &fileMetadata) = 0;
|
||||
virtual int getExerciseId(int folderId) = 0;
|
||||
virtual int getFileId(const FileType &fileType, const QString &fileName, int exerciseId, int phaseId) = 0;
|
||||
virtual int findFolder(int parentId, const QString &name) const = 0;
|
||||
virtual int getExerciseFolderId(int exerciseId) const = 0;
|
||||
virtual int getPhaseFolderId(int exerciseId, int phaseId) const = 0;
|
||||
virtual int getPartyFolderId(int exerciseId, int partyId) const = 0;
|
||||
|
||||
// Default-Implementierungen für Namen-Helper
|
||||
virtual QString getExerciseFolderName(int exerciseId) const { return QLatin1String("$EX_") + QString::number(exerciseId); }
|
||||
virtual QString getPartyFolderName(int partyId) const { return QLatin1String("$PY_") + QString::number(partyId); }
|
||||
virtual QString getPhaseFolderName(int phaseId) const { return QLatin1String("$PH_") + QString::number(phaseId); }
|
||||
|
||||
protected:
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
std::unique_ptr<DdsDataReaderStub<FileContent>> m_dtcFileContent;
|
||||
std::unique_ptr<DdsDataReaderStub<Folder>> m_dtcFolder;
|
||||
};
|
||||
|
||||
} // namespace Interface
|
||||
} // namespace FileManagement
|
||||
@@ -8,7 +8,14 @@
|
||||
namespace FileManagement
|
||||
{
|
||||
// Enums aus flm_service.xml
|
||||
// Für BUILD_RTI=OFF: FileStatus als int, um direkte Vergleiche zu ermöglichen
|
||||
#ifndef BUILD_RTI
|
||||
using FileStatus = int;
|
||||
constexpr int FileStatus_Valid = 0;
|
||||
constexpr int FileStatus_Deleted = 1;
|
||||
#else
|
||||
enum class FileStatus : int { Valid = 0, Deleted = 1 };
|
||||
#endif
|
||||
|
||||
enum class FileCategory : int { Global = 1, Exercise = 2, User = 3 };
|
||||
|
||||
|
||||
Reference in new issue
Block a user