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)
104 lines
2.9 KiB
C++
104 lines
2.9 KiB
C++
/**
|
|
* @RDE_HEADER@
|
|
* Stub header for CODEGEN_DATABASE generated code (BUILD_RTI=OFF)
|
|
* This file is generated by CODEGEN_DATABASE macro when BUILD_RTI=ON
|
|
* For BUILD_RTI=OFF builds, this stub provides the minimal interface
|
|
*/
|
|
#pragma once
|
|
|
|
#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
|
|
{
|
|
|
|
/**
|
|
* @brief Base class for database interface implementation
|
|
*
|
|
* This class is normally generated by CODEGEN_DATABASE macro.
|
|
* This stub provides minimal interface for BUILD_RTI=OFF builds.
|
|
*/
|
|
class DatabaseInterfaceImpl
|
|
{
|
|
public:
|
|
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
|