Qt6 Migration: Complete migration with DDS/RTI support and build validation
Major Changes:
- Merged latest Qt5 devel content from dlbo (292 files changed, 7 new dirs)
- Consolidated forward-declarations and include folders
- Removed unneeded modules per Niklas' repo check list
Build System Fixes:
- Fixed CMake VERSION_GREATER syntax in ParticipantManagement/CMakeLists.txt
- Added VLC packages (libvlc-dev, vlc-plugin-base) to docker_build.sh
- Added PostgreSQL dev packages (libpq-dev, postgresql-server-dev-all) to Dockerfile
- Fixed locale warnings (ANSI_X3.4-1968 → C.UTF-8)
- Fixed ArcGIS SDK path warnings when BUILD_ARCGIS=OFF
Code Generation Fixes:
- Fixed IDL enum collisions (PortType→CorePortType/DdsutPortType, PdmEventType)
- Fixed Grantlee template svc_translation.cpp.grantlee:
- Changed {{ idl_enum.name }}_def:: to {{ idl_enum.name }}::
- Fixed .underlying() calls for C++11 scoped enums (enum class)
- Removed generated files from repo (moc_*, *_dtc.h, *_ftc.h)
Validation:
- BUILD_RTI=ON: SUCCESS
- BUILD_RTI=OFF: SUCCESS
- C++17 standard maintained for RTI 7.7 compatibility
- Ubuntu 26.04 Docker environment verified
Remaining Warnings (expected):
- BgViewer, KDChart, KDReports, Poppler-Qt6 not found (optional features)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
18662 files changed
+4115092
-5435
No files matched your search
@@ -0,0 +1,180 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Generate SQL statements from Xml service files
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QStringList>
|
||||
#include <QSharedPointer>
|
||||
#include "StructBuilder.h"
|
||||
#include "codegen_export.h"
|
||||
|
||||
namespace NGL
|
||||
{
|
||||
class INGLLogger;
|
||||
}
|
||||
|
||||
namespace CodeGen
|
||||
{
|
||||
struct ColumnInformation;
|
||||
struct ConstraintInformation;
|
||||
struct EnumInformation;
|
||||
struct ForeignKeyInformation;
|
||||
struct TableInformation;
|
||||
class XmlReader;
|
||||
|
||||
class CODEGEN_BASE_EXPORT SqlGenerator final
|
||||
{
|
||||
public:
|
||||
struct SqlStatements
|
||||
{
|
||||
QStringList dropViews;
|
||||
QStringList dropTables;
|
||||
QStringList dropSequences;
|
||||
QStringList dropConstraints;
|
||||
|
||||
QStringList createTables;
|
||||
QStringList createSequences;
|
||||
QStringList createPrimaryKeys;
|
||||
QStringList createForeignKeys;
|
||||
QStringList createViews;
|
||||
QStringList createConstraints;
|
||||
|
||||
QStringList enumerationValues; // tables are created within createTables
|
||||
QStringList dbFunctions;
|
||||
QStringList dbFunctionTrigger;
|
||||
|
||||
bool isEmpty() const
|
||||
{
|
||||
return dropViews.isEmpty() && dropTables.isEmpty() && dropSequences.isEmpty() && dropConstraints.isEmpty();
|
||||
}
|
||||
};
|
||||
|
||||
struct SqlItems
|
||||
{
|
||||
QStringList tables; // all tables (just names)
|
||||
QStringList sequences; // all sequences (just names)
|
||||
QStringList primaryKeys;
|
||||
QStringList foreignKeys;
|
||||
QStringList constraints;
|
||||
};
|
||||
|
||||
public:
|
||||
Q_DISABLE_COPY(SqlGenerator)
|
||||
|
||||
explicit SqlGenerator(XmlReader *xmlReader, StructBuilder *structBuilder);
|
||||
explicit SqlGenerator(const QString &xmlFile);
|
||||
|
||||
~SqlGenerator();
|
||||
|
||||
bool isValid() const { return m_isValid; }
|
||||
// exerciseId -> use exerciseId if ExerciseDependent tables are found
|
||||
bool generateData(int exerciseId);
|
||||
|
||||
bool createStatementsForTable(const QString &tableName, const QString &tableNameOut);
|
||||
|
||||
SqlStatements getStatements(ExerciseDependency ed) const
|
||||
{
|
||||
return (ed == ExerciseDependency::Exercise ? m_sqlExercise : m_sqlGlobal);
|
||||
}
|
||||
|
||||
SqlItems getSqlItems(ExerciseDependency ed) const
|
||||
{
|
||||
return (ed == ExerciseDependency::Exercise ? m_sqlItemsExercise : m_sqlItemsGlobal);
|
||||
}
|
||||
|
||||
QStringList getEnumerationInsertValues(const QString &table, const QString &dbSchema) const;
|
||||
QStringList getReferencedServices() const // returns the abbreviations
|
||||
{
|
||||
return m_referencedSevices;
|
||||
}
|
||||
|
||||
QStringList getDbSettings(const QString &dbSchema) const;
|
||||
|
||||
// Writes
|
||||
bool writeSql(const QString &filePath, ExerciseDependency ed);
|
||||
|
||||
bool writeSqlToFile(const QString &dbSchema, const QString &sqlFile, ExerciseDependency ed) const;
|
||||
|
||||
// Methods from XmlReader
|
||||
QString getServiceAbbr() const { return m_xmlReader->getServiceAbbr(); }
|
||||
bool isServiceExerciseIndependent() const { return m_xmlReader->isServiceExerciseIndependent(); }
|
||||
bool isServiceGlobal() const { return (m_xmlReader->defaultExerciseDependency() == CodeGen::ExerciseDependency::Global || m_xmlReader->defaultExerciseDependency() == CodeGen::ExerciseDependency::GlobalAndExercise); }
|
||||
CodeGen::ExerciseDependency getExerciseDependency() const { return m_xmlReader->defaultExerciseDependency();}
|
||||
QStringList getGroupNames() const { return m_xmlReader->getGroupNames(); }
|
||||
|
||||
QStringList getAllSqlStmts(const QString &dbSchema, ExerciseDependency ed) const;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
bool handleTables();
|
||||
bool handleViews();
|
||||
bool handleTable(const CompleteTableInformation &cti);
|
||||
bool handleView(const ViewInformation &vi);
|
||||
QString getTableColumnCreateStatements(const QString &tableName,
|
||||
const QVector<MemberInformation> &columns,
|
||||
QStringList *tableComments, ExerciseDependency ed);
|
||||
QString generateSequence(const QString &tableName, const FullQualifiedColumnInformation &ci, ExerciseDependency ed);
|
||||
void generatePrimaryKey(const QString &tableName, const FullQualifiedColumnInformation &ci, ExerciseDependency ed);
|
||||
void generateForeignKeys(const QVector<QSharedPointer<ForeignKeyInformation> > &foreignKeys, ExerciseDependency ed);
|
||||
void generateForeignKey(const QSharedPointer<ForeignKeyInformation> &foreignKey, ExerciseDependency ed);
|
||||
void generateConstraints(const QString &tableName, const QVector<ConstraintInformation> &constraints, ExerciseDependency ed);
|
||||
void generateConstraint(const QString &tableName, const ConstraintInformation &constraint, ExerciseDependency ed);
|
||||
bool handleEnumerations();
|
||||
bool handleEnumeration(const EnumInformation &ei);
|
||||
QStringList handleEnumeration(const EnumInformation &ei, const QString &dbSchema) const;
|
||||
bool generateDbNotifications(const QString &tableName, const QVector<DbNotifcationInformation> ¬ifications, ExerciseDependency ed);
|
||||
void generateDbNotification(const DbNotifcationInformation ¬ification, ExerciseDependency ed);
|
||||
bool generateDbNotificationTrigger(const QString &tableName, const DbNotifcationInformation ¬ification, ExerciseDependency ed);
|
||||
QString getNotificationFunctionName(const DbNotifcationInformation ¬ification) const;
|
||||
static QString fixupComment(const QString &comment);
|
||||
|
||||
private:
|
||||
XmlReader *m_xmlReader;
|
||||
StructBuilder *m_structBuilder;
|
||||
bool m_createdByXmlFile;
|
||||
|
||||
void addToDropSequences(const QString &stmt, ExerciseDependency ed);
|
||||
void addToDropTables(const QString &stmt, ExerciseDependency ed);
|
||||
void addToDropViews(const QString &stmt, ExerciseDependency ed);
|
||||
void addToDropConstraints(const QString &stmt, ExerciseDependency ed);
|
||||
|
||||
void addToCreateConstraints(const QString &stmt, ExerciseDependency ed);
|
||||
void addToCreateFks(const QString &stmt, ExerciseDependency ed);
|
||||
void addToCreatePks(const QString &stmt, ExerciseDependency ed);
|
||||
void addToCreateSequences(const QString &stmt, ExerciseDependency ed);
|
||||
void addToCreateTables(const QString &stmt, ExerciseDependency ed);
|
||||
void addToCreateTables(const QStringList &stmts, ExerciseDependency ed);
|
||||
void addToCreateViews(const QString &stmt, ExerciseDependency ed);
|
||||
|
||||
void addToDbFunctions(const QString &stmt, ExerciseDependency ed);
|
||||
void addToDbFunctionTrigger(const QString &stmt, ExerciseDependency ed);
|
||||
|
||||
void addToConstraints(const QString &name, ExerciseDependency ed);
|
||||
void addToFks(const QString &name, ExerciseDependency ed);
|
||||
void addToPks(const QString &name, ExerciseDependency ed);
|
||||
void addToSequences(const QString &name, ExerciseDependency ed);
|
||||
void addToTables(const QString &name, ExerciseDependency ed);
|
||||
|
||||
bool writeFile(const QString &fn, const QString &content) const;
|
||||
|
||||
SqlStatements m_sqlGlobal;
|
||||
SqlStatements m_sqlExercise;
|
||||
|
||||
SqlItems m_sqlItemsGlobal;
|
||||
SqlItems m_sqlItemsExercise;
|
||||
|
||||
QStringList m_referencedSevices;
|
||||
|
||||
bool m_isValid;
|
||||
int m_exerciseId;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
} // namespace CodeGen
|
||||
Reference in new issue
Block a user