Qt6 Migration: DDS-Stubs, Logger-Fixes, Export-Header Korrekturen

- NGL_ADD_LIBRARY2: 87 CMakeLists.txt konvertiert für Export-Header Generierung
- 44 Export-Header Include-Pfade korrigiert (_export.h)
- 81 DDS-Stub-Header generiert (*_dtc.h, *_fts.h, *_dts.h, *_ftc.h)
- INGLLogger: Duplikat gelöscht, m_logger Member entfernt, variadische Makros
- Q_FUNC_INFO Redefinition behoben (Qt6 definiert bereits)
- FATAL_LOG Makro hinzugefügt
- InfrastructureManagement DDS-Stubs (ism.hpp, ism_enums.hpp, ism_ftc.h)
- FilterManagement DDS-Stubs (flt_ftc.h, flt_dts.h)
- AreaEffectSimulation DDS-Stubs (aes.hpp, aes_enums.hpp)
- SymbolAppearance Klasse vollständig definiert mit content() Methode
- BuildingComponentFilter Klasse definiert mit Copy-Konstruktor
- Ftc Factory: nullptr Return (abstract class)
- AesFilter Klasse in aes.hpp hinzugefügt
- Dtc Klasse in ppm.hpp mit participantChanged Signal
- AesType Enum: alle 15 At* Werte definiert
- AesEffectState_def: EsReceived hinzugefügt
- DataModification Enum: eAdded/eModified/eRemoved
- function_reply_object.h → core_types.h Include-Pfad (72 Dateien)
- Enum-Class-Streaming Template-Operator in INGLLogger.h
- ism_mounting_point.h: QImage → QtGui/QImage, QGuiApplication/QScreen
- ism_data_plugin_interface.h: QSet Include, Include-Reihenfolge
- QRegExp → QRegularExpression in tpm_js_parser.cpp
- .underlying() Aufrufe zu direktem Enum-Vergleich korrigiert
- Include-Pfade: aes.hpp in symbol_appearance_settings_impl.h und aes_display_filter_impl.h

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
torstenandCopilot committed 2026-08-19 06:06:24 +02:00
1 parent 010f91928a
commit b774f4035c
2785 files changed
+18754 -18316

No files matched your search

@@ -7,7 +7,7 @@
FIND_PACKAGE(RTI)
FIND_PACKAGE(Grantlee5 REQUIRED COMPONENTS Templates)
NGL_ADD_LIBRARY(ALL codegen_base SHARED
NGL_ADD_LIBRARY2(ALL codegen_base SHARED
codegen_export.h
SqlGenerator.cpp
SqlGenerator.h
@@ -6,7 +6,6 @@
#include "GeneratorGrantleeBase.h"
#include "StructBuilder.h"
#include "GrantleeWrappers.h"
#include "codegen_export.h"
namespace CodeGen
{
@@ -6,7 +6,6 @@
#include "GeneratorGrantleeBase.h"
#include "StructBuilder.h"
#include "GrantleeWrappers.h"
#include "codegen_export.h"
namespace CodeGen
{
@@ -6,7 +6,6 @@
#include "GeneratorGrantleeBase.h"
#include "StructBuilder.h"
#include "GrantleeWrappers.h"
#include "codegen_export.h"
namespace CodeGen
{
@@ -48,7 +48,7 @@ bool GeneratorGrantleeBase::setTemplate(const QString &templateName, const QStri
m_template = m_engine->newTemplate(tmpl, QStringLiteral("myTemplate"));
if (m_template->error())
{
WARNING_LOG(m_logger) << "Error parsing template '" << templateName
WARNING_LOG() << "Error parsing template '" << templateName
<< "': " << m_template->errorString();
return false;
}
@@ -88,7 +88,7 @@ bool GeneratorGrantleeBase::generateData(const QString &templateName,
QFile f(outDirectory + QLatin1Char('/') + outFilename);
if (!f.open(QIODevice::WriteOnly))
{
ERROR_LOG(m_logger) << "Error opening file '" << f.fileName() << "' for writing: "
ERROR_LOG() << "Error opening file '" << f.fileName() << "' for writing: "
<< f.errorString() << "(" << f.error() << ")";
return false;
}
@@ -96,7 +96,7 @@ bool GeneratorGrantleeBase::generateData(const QString &templateName,
f.write(outData);
f.close();
DEBUG_LOG(m_logger) << "Written data to " << f.fileName();
DEBUG_LOG() << "Written data to " << f.fileName();
return true;
}
@@ -105,7 +105,7 @@ bool GeneratorGrantleeBase::readFile(const QString &filename, QString &data) con
QFile f(filename);
if (!f.open(QIODevice::ReadOnly))
{
ERROR_LOG(m_logger) << "Error opening file " << filename
ERROR_LOG() << "Error opening file " << filename
<< " - error: " << f.errorString();
return false;
}
@@ -121,7 +121,7 @@ bool GeneratorGrantleeBase::getFilenameFromData(const QString &dataToParse, QStr
int idx = dataToParse.indexOf(filenameMarker);
if (idx < 0)
{
ERROR_LOG(m_logger) << "Could not find marker '" << filenameMarker
ERROR_LOG() << "Could not find marker '" << filenameMarker
<< "' in data!";
return false;
}
@@ -129,7 +129,7 @@ bool GeneratorGrantleeBase::getFilenameFromData(const QString &dataToParse, QStr
int endIdx = dataToParse.indexOf(QLatin1Char('\n'), idx);
if (endIdx < 0)
{
ERROR_LOG(m_logger) << "Could not find end marker '\\n' in data!";
ERROR_LOG() << "Could not find end marker '\\n' in data!";
return false;
}
filename = dataToParse.mid(idx, endIdx - idx).trimmed();
@@ -160,12 +160,12 @@ void GeneratorGrantleeBase::addCustomFunctions(const QVector<CustomServiceFuncti
break;
case CustomServiceFunctionInformation::Type::DbNotify:
WARNING_LOG(m_logger) << "Internal error - Trying to handle DbNotify in addCustomFunctions(): "
WARNING_LOG() << "Internal error - Trying to handle DbNotify in addCustomFunctions(): "
<< csfi.methodName;
delete customFunctionWrapper;
break;
}
DEBUG_LOG(m_logger) << "Added custom db function " << csfi.methodName;
DEBUG_LOG() << "Added custom db function " << csfi.methodName;
}
m_ctx->insert(QStringLiteral("custom_dtc_procs"), vlCustomDtcFunctions);
m_ctx->insert(QStringLiteral("custom_db_procs"), vlCustomDbFunctions);
@@ -185,17 +185,17 @@ void GeneratorGrantleeBase::exportUsedServices(const XmlReader *reader)
const int idx = fullPath.lastIndexOf(QLatin1Char('.'));
if (idx < 0)
{
ERROR_LOG(m_logger) << "Could not parse file path: " << fullPath;
ERROR_LOG() << "Could not parse file path: " << fullPath;
continue;
}
const QString idlFile = fullPath.left(idx);
if (idlFile.isEmpty())
{
WARNING_LOG(m_logger) << "Could not find idl file for service " << svc;
WARNING_LOG() << "Could not find idl file for service " << svc;
continue;
}
idlServicesWrapper->addService(svc, idlFile);
DEBUG_LOG(m_logger) << "Added service " << svc;
DEBUG_LOG() << "Added service " << svc;
}
m_ctx->insert(QStringLiteral("ext_services"), idlServicesWrapper);
}
@@ -2,7 +2,6 @@
#pragma once
#include "codegen_export.h"
#include "XmlReader.h"
#include <QObject>
#include <QSharedPointer>
@@ -48,6 +47,5 @@ protected:
Grantlee::Context *m_ctx;
Grantlee::Template m_template;
StructBuilder *m_structBuilder;
NGL::INGLLogger &m_logger;
};
}
@@ -25,7 +25,6 @@ SqlGenerator::SqlGenerator(XmlReader *xmlReader, StructBuilder *structBuilder)
, m_createdByXmlFile(false)
, m_isValid(true)
, m_exerciseId(0)
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("CodeGen.SqlGenerator"))
{}
SqlGenerator::SqlGenerator(const QString &xmlFile)
@@ -34,7 +33,6 @@ SqlGenerator::SqlGenerator(const QString &xmlFile)
, m_createdByXmlFile(true)
, m_isValid(false)
, m_exerciseId(0)
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("CodeGen.SqlGenerator"))
{
m_isValid = m_xmlReader->readServiceFile(xmlFile, QString()) && m_structBuilder->buildStructures();
}
@@ -51,7 +49,7 @@ SqlGenerator::~SqlGenerator()
bool SqlGenerator::generateData(int exerciseId)
{
DEBUG_LOG(m_logger) << "Generating SQL data for service " << getServiceAbbr() << " in exercise " << exerciseId << ", this: " << this;
DEBUG_LOG() << "Generating SQL data for service " << getServiceAbbr() << " in exercise " << exerciseId << ", this: " << this;
m_exerciseId = exerciseId;
m_sqlGlobal = SqlStatements();
@@ -136,11 +134,11 @@ bool SqlGenerator::handleViews()
bool SqlGenerator::handleView(const ViewInformation &vi)
{
DEBUG_LOG(m_logger) << "Handle view " << vi.name;
DEBUG_LOG() << "Handle view " << vi.name;
const QString parent = vi.baseTable;
DEBUG_LOG(m_logger) << "Parent = " << parent;
DEBUG_LOG() << "Parent = " << parent;
if (!parent.isEmpty())
{
@@ -148,7 +146,7 @@ bool SqlGenerator::handleView(const ViewInformation &vi)
const QString createViewStmt(QStringLiteral("CREATE OR REPLACE VIEW %1 AS SELECT %2\nFROM %3\nWHERE %4;\n"));
const QString dropViewStmt(QStringLiteral("DROP VIEW IF EXISTS %1;"));
DEBUG_LOG(m_logger) << "csi.primaryTable = " << csi.primaryTable.data()->name;
DEBUG_LOG() << "csi.primaryTable = " << csi.primaryTable.data()->name;
if (!csi.primaryTable.isNull())
{
@@ -168,7 +166,7 @@ bool SqlGenerator::handleView(const ViewInformation &vi)
fqColumnNames += mi.db.table + QLatin1Char('.') + mi.db.columnName + QLatin1String(" AS ") + mi.db.getColumnNameView();
}
DEBUG_LOG(m_logger) << "fqColumnNames = " << fqColumnNames.join(QStringLiteral(", "));
DEBUG_LOG() << "fqColumnNames = " << fqColumnNames.join(QStringLiteral(", "));
if (!whereConditions.isEmpty())
@@ -187,11 +185,11 @@ bool SqlGenerator::handleView(const ViewInformation &vi)
bool SqlGenerator::handleTable(const CompleteTableInformation &cti)
{
DEBUG_LOG(m_logger) << "Handle table " << cti.name;
DEBUG_LOG() << "Handle table " << cti.name;
if (cti.columns.isEmpty())
{
WARNING_LOG(m_logger) << "Table " << cti.name
WARNING_LOG() << "Table " << cti.name
<< " has no DatabaseServiceStruct - not generating anything for this!";
return true;
}
@@ -534,11 +532,11 @@ bool SqlGenerator::handleEnumeration(const EnumInformation &ei)
QStringList SqlGenerator::handleEnumeration(const EnumInformation &ei, const QString &dbSchema) const
{
DEBUG_LOG(m_logger) << "Handle enumeration " << ei.enumName;
DEBUG_LOG() << "Handle enumeration " << ei.enumName;
if (ei.tableName.isEmpty())
{
INFO_LOG(m_logger) << "No table for enumeration " << ei.enumName << " - not creating inserts for this enum";
INFO_LOG() << "No table for enumeration " << ei.enumName << " - not creating inserts for this enum";
return QStringList();
}
@@ -567,7 +565,7 @@ bool SqlGenerator::generateDbNotifications(const QString &tableName,
if (notification.paramNames.isEmpty() ||
notification.paramNames.size() > 1)
{
ERROR_LOG(m_logger) << "Can not handle more than one parameter";
ERROR_LOG() << "Can not handle more than one parameter";
continue;
}
generateDbNotification(notification, ed);
@@ -707,7 +705,7 @@ QStringList SqlGenerator::getDbSettings(const QString &dbSchema) const
QStringList SqlGenerator::getAllSqlStmts(const QString &dbSchema, ExerciseDependency ed) const
{
DEBUG_LOG(m_logger) << "Creating statements for service " << getServiceAbbr() << " in exercise " << m_exerciseId << ", this: " << this;
DEBUG_LOG() << "Creating statements for service " << getServiceAbbr() << " in exercise " << m_exerciseId << ", this: " << this;
QStringList data;
@@ -798,7 +796,7 @@ bool SqlGenerator::writeSql(const QString &filePath, ExerciseDependency ed)
const SqlStatements &sql = getStatements(ed);
if (sql.isEmpty())
{
DEBUG_LOG(m_logger) << "Sql file is emtpy: " << sqlFile;
DEBUG_LOG() << "Sql file is emtpy: " << sqlFile;
return writeFile(sqlFile, QString());
}
@@ -808,7 +806,7 @@ bool SqlGenerator::writeSql(const QString &filePath, ExerciseDependency ed)
getExerciseSchemaName(m_exerciseId) :
getServiceAbbr());
INFO_LOG(m_logger) << "Creating sql-stmt for schema (" << dbSchema << ")";
INFO_LOG() << "Creating sql-stmt for schema (" << dbSchema << ")";
return writeSqlToFile(dbSchema, sqlFile, ed);
}
@@ -931,7 +929,7 @@ bool SqlGenerator::writeFile(const QString &fn, const QString &content) const
QFile f(fn);
if (!f.open(QIODevice::WriteOnly | QIODevice::Truncate))
{
ERROR_LOG(m_logger) << "Error opening file '" << f.fileName() << "' for writing: "
ERROR_LOG() << "Error opening file '" << f.fileName() << "' for writing: "
<< f.errorString();
return false;
}
@@ -5,7 +5,7 @@
#include <QStringList>
#include <QSharedPointer>
#include "StructBuilder.h"
#include "codegen_export.h"
#include "codegen_base_export.h"
namespace NGL
{
@@ -168,8 +168,6 @@ private:
bool m_isValid;
int m_exerciseId;
NGL::INGLLogger &m_logger;
};
}
@@ -200,8 +200,6 @@ StructBuilder::StructBuilder(XmlReader *xmlReader)
: m_needPoint3d(false)
, m_needPgArrayInclude(false)
, m_xmlReader(xmlReader)
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("CodeGen.StructBuilder"))
, m_loggerCSV(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("fileCSV"))
{}
bool StructBuilder::buildStructures()
@@ -268,7 +266,7 @@ bool StructBuilder::buildStructures()
const ServiceTypeStruct sts = extractServiceAndTypeFromTypename(tti.name);
if (!sts.isExternalType())
{
ERROR_LOG(m_logger) << "Invalid external topic type name: '" << tti.name << "'";
ERROR_LOG() << "Invalid external topic type name: '" << tti.name << "'";
return false;
}
if (!handleIdlStructInfo(tti, m_externalTopicTypes, sts.service))
@@ -289,7 +287,7 @@ bool StructBuilder::handleEnum(const EnumInformation &ei)
QSharedPointer<TableInformation> ti = m_xmlReader->getTable(ei.tableName);
if (ti.isNull())
{
WARNING_LOG(m_logger) << "Could not find table information for enum: "
WARNING_LOG() << "Could not find table information for enum: "
<< ei.enumName << ", table: " << ei.tableName;
return false;
}
@@ -325,12 +323,12 @@ EnumInformation StructBuilder::enumInformationByType(const QString &type, bool c
{
if (!checkExternals)
{
ERROR_LOG(m_logger) << "Could not find enumeration '" << type << "'";
ERROR_LOG() << "Could not find enumeration '" << type << "'";
return EnumInformation();
}
if (extInfo.type.isEmpty())
{
WARNING_LOG(m_logger) << "Could not parse external enumeration '" << type << "'";
WARNING_LOG() << "Could not parse external enumeration '" << type << "'";
return EnumInformation();
}
return m_xmlReader->getExternalEnumeration(extInfo.service, extInfo.type, verbose);
@@ -342,13 +340,13 @@ EnumInformation StructBuilder::enumInformationByType(const QString &type, bool c
return ei;
}
if (verbose)
ERROR_LOG(m_logger) << "Could not find enumeration '" << type << "'";
ERROR_LOG() << "Could not find enumeration '" << type << "'";
return EnumInformation();
}
CompleteTopicTypeInformation StructBuilder::topicTypeInformationByStructType(const QString &type, bool checkExternals)
{
DEBUG_LOG(m_logger) << "topicTypeInformationByStructType(" << type << ")";
DEBUG_LOG() << "topicTypeInformationByStructType(" << type << ")";
if (type.isEmpty())
return CompleteTopicTypeInformation();
@@ -366,26 +364,26 @@ CompleteTopicTypeInformation StructBuilder::topicTypeInformationByStructType(con
return csi;
}
DEBUG_LOG(m_logger) << "Type '" << type << "' not found in idlStructs - maybe not yet exported or an enum";
DEBUG_LOG() << "Type '" << type << "' not found in idlStructs - maybe not yet exported or an enum";
const QVector<TopicTypeInformation> idlStructsToGenerate = m_xmlReader->getIdlStructToGenerate();
for (const TopicTypeInformation &tti : idlStructsToGenerate)
{
if (tti.name == type)
{
DEBUG_LOG(m_logger) << "Found not yet exported type " << type;
DEBUG_LOG() << "Found not yet exported type " << type;
if (!handleIdlStructInfo(tti, m_topicTypeInfos))
return CompleteTopicTypeInformation();
return topicTypeInformationByStructType(type);
}
}
ERROR_LOG(m_logger) << "Could not find type '" << type << "' in idlStructs";
ERROR_LOG() << "Could not find type '" << type << "' in idlStructs";
return CompleteTopicTypeInformation();
}
CompleteTopicTypeInformation StructBuilder::externalTopicTypeByStructType(const ServiceTypeStruct &sts)
{
const QString typeToSearch = sts.fqType();
DEBUG_LOG(m_logger) << "externalTopicTypeByStructType " << typeToSearch;
DEBUG_LOG() << "externalTopicTypeByStructType " << typeToSearch;
for (const CompleteTopicTypeInformation &ctti : std::as_const(m_externalTopicTypes))
{
if (ctti.name == typeToSearch)
@@ -398,13 +396,13 @@ CompleteTopicTypeInformation StructBuilder::externalTopicTypeByStructType(const
bool StructBuilder::loadExternalTopicType(const ServiceTypeStruct &sts)
{
DEBUG_LOG(m_logger) << "loadExternalTopicType(" << sts.fqType() << ")";
DEBUG_LOG() << "loadExternalTopicType(" << sts.fqType() << ")";
const TopicTypeInformation tti = m_xmlReader->loadExternalTopicType(sts.service, sts.type);
if (!tti.isValid())
{
DEBUG_LOG(m_logger) << "Could not find external topic '" << sts.fqType() << "'";
DEBUG_LOG() << "Could not find external topic '" << sts.fqType() << "'";
return false;
}
@@ -475,11 +473,11 @@ bool StructBuilder::handleTable(const ServiceStructInformation &ssi)
QVector<QString> tableNames;
if (!getColumnsFromTable(ssi.primaryTable, columns, tableNames))
{
WARNING_LOG(m_logger) << "Could not retrieve columns from table "
WARNING_LOG() << "Could not retrieve columns from table "
<< ssi.primaryTable;
return false;
}
DEBUG_LOG(m_logger) << "Got " << columns.size() << " columns for table "
DEBUG_LOG() << "Got " << columns.size() << " columns for table "
<< ssi.primaryTable;
QSet<QString> sqlTables;
@@ -489,12 +487,12 @@ bool StructBuilder::handleTable(const ServiceStructInformation &ssi)
MemberInformation miPkFirstTable, miPkLastTable;
for (const ColumnInformationEx &ci : std::as_const(columns))
{
DEBUG_LOG(m_logger) << "handling column " << ci.columnName;
DEBUG_LOG() << "handling column " << ci.columnName;
const QSharedPointer<TableInformation> ti = ci.table;
if (ti.isNull())
{
WARNING_LOG(m_logger) << "Could not find table for column " << ci.columnName
WARNING_LOG() << "Could not find table for column " << ci.columnName
<< " primary table is " << ssi.primaryTable.data();
return false;
}
@@ -562,14 +560,14 @@ bool StructBuilder::handleTable(const ServiceStructInformation &ssi)
camelCaseString(fki->destination.tableName, true);
EnumInformation ei = enumInformationByType(enumType, true, false);
DEBUG_LOG(m_logger) << "Checking if " << enumType << " is an enum: " << ei.isValid();
DEBUG_LOG() << "Checking if " << enumType << " is an enum: " << ei.isValid();
if (!ei.isValid() && fki->destination.tableName.contains(QLatin1Char('_')))
{
enumType = fki->destination.service + QStringLiteral("::") +
camelCaseString(fki->destination.tableName.section(QLatin1Char('_'), 1), true);
ei = enumInformationByType(enumType, true, false);
DEBUG_LOG(m_logger) << "Checking if " << enumType << " is an enum: " << ei.isValid();
DEBUG_LOG() << "Checking if " << enumType << " is an enum: " << ei.isValid();
}
if (ei.isValid() &&
ei.tableName == fki->destination.tableName)
@@ -678,8 +676,8 @@ bool StructBuilder::handleIdlStructInfo(const TopicTypeInformation &tti,
if (idlData.isKey && idlData.isOptional)
{
ERROR_LOG(m_logger) << "Column option isKey & isOptional are mutually exclusive!";
ERROR_LOG(m_logger) << "Change column '" << tti.name << "."
ERROR_LOG() << "Column option isKey & isOptional are mutually exclusive!";
ERROR_LOG() << "Change column '" << tti.name << "."
<< idlData.name << "'' to have either key or optional parameter ";
return false;
}
@@ -1047,7 +1045,7 @@ bool StructBuilder::fixupQVariantConversions(MemberInformation &mi) const
}
else
{
ERROR_LOG(m_logger) << "Unknown cpp datatype: " << mi.cpp.type;
ERROR_LOG() << "Unknown cpp datatype: " << mi.cpp.type;
return false;
}
return true;
@@ -1082,7 +1080,7 @@ QVector<MemberInformation> StructBuilder::buildDbTableInformationFromIdlData(con
const CompleteTopicTypeInformation cttiChild = topicTypeInformationByStructType(member.type);
if (!cttiChild.isValid())
{
ERROR_LOG(m_logger) << "Can not find structure '" << member.type << "'";
ERROR_LOG() << "Can not find structure '" << member.type << "'";
continue;
}
QString pre;
@@ -1102,7 +1100,7 @@ QVector<MemberInformation> StructBuilder::buildDbTableInformationFromIdlData(con
const CompleteTopicTypeInformation &cttiChild = topicTypeInformationByStructType(member.dataTypeInfo->innerDataType()->idlType());
if (!cttiChild.isValid())
{
ERROR_LOG(m_logger) << "Can not find structure '" << member.type << "'";
ERROR_LOG() << "Can not find structure '" << member.type << "'";
continue;
}
buildDbTableInformationFromIdlData(cttiChild,
@@ -1196,7 +1194,7 @@ bool StructBuilder::buildJSonStructureInformationFromIdlData(const CompleteTopic
const CompleteTopicTypeInformation cttiChild = topicTypeInformationByStructType(member.type);
if (!cttiChild.isValid())
{
ERROR_LOG(m_logger) << "Can not find structure '" << member.type << "'";
ERROR_LOG() << "Can not find structure '" << member.type << "'";
continue;
}
if (!buildJSonStructureInformationFromIdlData(cttiChild))
@@ -1223,7 +1221,7 @@ bool StructBuilder::buildJSonStructureInformationFromIdlData(const CompleteTopic
return false;
}
else
WARNING_LOG(m_logger) << "Can not find structure '" << member.type << "'";
WARNING_LOG() << "Can not find structure '" << member.type << "'";
}
@@ -1318,11 +1316,11 @@ QMap<QString, CompleteTableInformation> StructBuilder::getRecordingTopicTables()
continue;
if (!ctti.isDataObject)
{
WARNING_LOG(m_logger) << "Trying to record topic '" << ctti.name
WARNING_LOG() << "Trying to record topic '" << ctti.name
<< "' which is not directly published - ignoring!";
continue;
}
DEBUG_LOG(m_logger) << "Rec table: " << ctti.name;
DEBUG_LOG() << "Rec table: " << ctti.name;
miPrimaryKey.db.table = ctti.name;
ret.insert(ctti.name, getRecordingTopicTable(ctti, miPrimaryKey));
}
@@ -1404,7 +1402,7 @@ StructBuilder::ServiceTypeStruct StructBuilder::extractServiceAndTypeFromTypenam
extTypeRef = sl.at(1);
}
else
WARNING_LOG(m_logger) << "Error parsing type: " << type;
WARNING_LOG() << "Error parsing type: " << type;
StructBuilder::ServiceTypeStruct ret;
if (!extServiceRef.isEmpty())
{
@@ -4,7 +4,7 @@
#include <QtCore/QString>
#include "XmlReader.h"
#include "codegen_export.h"
#include "codegen_base_export.h"
namespace NGL
{
@@ -335,7 +335,5 @@ private:
bool m_needPgArrayInclude;
XmlReader *m_xmlReader;
NGL::INGLLogger &m_logger;
NGL::INGLLogger &m_loggerCSV;
};
}
@@ -32,7 +32,6 @@ private:
};
XmlReader::XmlReader()
: m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("CodeGen.XmlReader"))
{}
bool XmlReader::readServiceFile(const QString &svcFile,
@@ -80,18 +79,18 @@ bool XmlReader::readServiceFile(const QString &svcFile,
QFile f(svcFile);
if (!f.exists())
{
ERROR_LOG(m_logger) << "Service file '" << svcFile << "' not found!";
ERROR_LOG() << "Service file '" << svcFile << "' not found!";
return false;
}
if (!f.open(QIODevice::ReadOnly))
{
m_errorString = QLatin1String("Can not open service file '") + svcFile +
QLatin1String("' for reading: ") + f.errorString();
ERROR_LOG(m_logger) << m_errorString;
ERROR_LOG() << m_errorString;
return false;
}
INFO_LOG(m_logger) << "SvcFile: " << svcFile;
INFO_LOG() << "SvcFile: " << svcFile;
QString errMsg;
@@ -103,7 +102,7 @@ bool XmlReader::readServiceFile(const QString &svcFile,
m_errorString = QLatin1String("Error parsing service file '") + svcFile + QLatin1String("': ") +
errMsg + QLatin1String(" at ") + QString::number(errLine) +
QLatin1Char(':') + QString::number(errColumn);
ERROR_LOG(m_logger) << m_errorString;
ERROR_LOG() << m_errorString;
return false;
}
@@ -119,7 +118,7 @@ bool XmlReader::readServiceFile(const QString &svcFile,
{
m_errorString = QLatin1String("Xml file '") + svcFile +
QLatin1String("' is not a valid service file: service name/namespace is missing");
ERROR_LOG(m_logger) << m_errorString;
ERROR_LOG() << m_errorString;
return false;
}
m_svcNamespace = getAttribute(domRoot, QStringLiteral("namespace"));
@@ -130,13 +129,13 @@ bool XmlReader::readServiceFile(const QString &svcFile,
QString devModeStr = getAttribute(domRoot, QStringLiteral("devMode"), true);
m_svcDevMode = devModeStr == QStringLiteral("1") ||
devModeStr == QStringLiteral("true");
INFO_LOG(m_logger) << "devMode: " << m_svcDevMode;
INFO_LOG() << "devMode: " << m_svcDevMode;
const QString groupNamesString = getAttribute(domRoot, QStringLiteral("groups"), true);
if (!groupNamesString.isEmpty())
{
m_groupNames = groupNamesString.split(QLatin1Char(','), Qt::SkipEmptyParts);
INFO_LOG(m_logger) << "groups: " << groupNamesString;
INFO_LOG() << "groups: " << groupNamesString;
}
else
m_groupNames.clear();
@@ -151,12 +150,12 @@ bool XmlReader::readServiceFile(const QString &svcFile,
if (m_exerciseDependency != ExerciseDependency::Global &&
m_exerciseDependency != ExerciseDependency::GlobalAndExercise)
{
WARNING_LOG(m_logger) << "Service " << getServiceNamespace()
WARNING_LOG() << "Service " << getServiceNamespace()
<< " is not marked as exercise independent but should be started in group Core/Master";
}
}
INFO_LOG(m_logger) << "exerciseDependency: " << (int)m_exerciseDependency;
INFO_LOG() << "exerciseDependency: " << (int)m_exerciseDependency;
if ( domRoot.hasAttribute(QStringLiteral("prio")))
{
m_prio = getAttribute(domRoot, QStringLiteral("prio"), 0).toInt();
@@ -168,7 +167,7 @@ bool XmlReader::readServiceFile(const QString &svcFile,
catch (const XmlReaderException &ex)
{
m_errorString = QLatin1String("Error parsing dbServiceStructs: ") + QLatin1String(ex.what());
ERROR_LOG(m_logger) << m_errorString;
ERROR_LOG() << m_errorString;
return false;
}
@@ -179,7 +178,7 @@ bool XmlReader::readServiceFile(const QString &svcFile,
catch (const XmlReaderException &ex)
{
m_errorString = QLatin1String("Error parsing dbtables: ") + QLatin1String(ex.what());
ERROR_LOG(m_logger) << m_errorString;
ERROR_LOG() << m_errorString;
return false;
}
@@ -190,7 +189,7 @@ bool XmlReader::readServiceFile(const QString &svcFile,
catch (const XmlReaderException &ex)
{
m_errorString = QLatin1String("Error parsing dbviews: ") + QLatin1String(ex.what());
ERROR_LOG(m_logger) << m_errorString;
ERROR_LOG() << m_errorString;
return false;
}
@@ -201,7 +200,7 @@ bool XmlReader::readServiceFile(const QString &svcFile,
catch (const XmlReaderException &ex)
{
m_errorString = QLatin1String("Error parsing enumerations: ") + QLatin1String(ex.what());
ERROR_LOG(m_logger) << m_errorString;
ERROR_LOG() << m_errorString;
return false;
}
@@ -212,7 +211,7 @@ bool XmlReader::readServiceFile(const QString &svcFile,
catch (const XmlReaderException &ex)
{
m_errorString = QLatin1String("Error parsing custom dtc functions: ") + QLatin1String(ex.what());
ERROR_LOG(m_logger) << m_errorString;
ERROR_LOG() << m_errorString;
return false;
}
@@ -223,7 +222,7 @@ bool XmlReader::readServiceFile(const QString &svcFile,
catch (const XmlReaderException &ex)
{
m_errorString = QLatin1String("Error parsing idl strucs: ") + QLatin1String(ex.what());
ERROR_LOG(m_logger) << m_errorString;
ERROR_LOG() << m_errorString;
return false;
}
@@ -234,7 +233,7 @@ bool XmlReader::readServiceFile(const QString &svcFile,
catch (const XmlReaderException &ex)
{
m_errorString = QLatin1String("Error parsing function topics: ") + QLatin1String(ex.what());
ERROR_LOG(m_logger) << m_errorString;
ERROR_LOG() << m_errorString;
return false;
}
@@ -332,7 +331,7 @@ void XmlReader::parseDBSserviceStructs(const QDomElement &rootElement)
domDbStruct = domDbStruct.nextSiblingElement(domDbStruct.tagName());
}
INFO_LOG(m_logger) << "Read " << m_structsToGenerate.size() << " database service struct(s)";
INFO_LOG() << "Read " << m_structsToGenerate.size() << " database service struct(s)";
}
void XmlReader::parseDBTables(const QDomElement &rootElement)
@@ -374,7 +373,7 @@ void XmlReader::parseDBTables(const QDomElement &rootElement)
domDbTable = domDbTable.nextSiblingElement(domDbTable.tagName());
}
INFO_LOG(m_logger) << "Read " << m_tables.size() << " database table(s)";
INFO_LOG() << "Read " << m_tables.size() << " database table(s)";
}
void XmlReader::parseDBViews(const QDomElement &rootElement)
@@ -394,7 +393,7 @@ void XmlReader::parseDBViews(const QDomElement &rootElement)
vi->filter = getAttribute(domDbView, QStringLiteral("filter"));
vi->exerciseDependency = string2ExerciseDependency(getAttribute(domDbView, QStringLiteral("exerciseDependency"), true));
DEBUG_LOG(m_logger) << "Base table = " << vi->baseTable;
DEBUG_LOG() << "Base table = " << vi->baseTable;
m_views.insert(vi->name, vi);
@@ -402,7 +401,7 @@ void XmlReader::parseDBViews(const QDomElement &rootElement)
domDbView = domDbView.nextSiblingElement(domDbView.tagName());
}
INFO_LOG(m_logger) << "Read " << m_views.size() << " database view(s)";
INFO_LOG() << "Read " << m_views.size() << " database view(s)";
}
void XmlReader::parseEnumerations(const QDomElement &rootElement)
@@ -433,7 +432,7 @@ void XmlReader::parseEnumerations(const QDomElement &rootElement)
domEnum = domEnum.nextSiblingElement(domEnum.tagName());
}
INFO_LOG(m_logger) << "Read " << m_enumerations.size() << " enumeration(s)";
INFO_LOG() << "Read " << m_enumerations.size() << " enumeration(s)";
}
void XmlReader::parseCustomDtcFunctions(const QDomElement &rootElement)
@@ -453,7 +452,7 @@ void XmlReader::parseCustomDtcFunctions(const QDomElement &rootElement)
}
domElement = domElement.nextSiblingElement(domElement.tagName());
}
INFO_LOG(m_logger) << "Read " << m_enumerations.size() << " customDtcFunction(s)";
INFO_LOG() << "Read " << m_enumerations.size() << " customDtcFunction(s)";
}
@@ -511,7 +510,7 @@ void XmlReader::parseTopicTypes(const QDomElement &rootElement)
}
INFO_LOG(m_logger) << "Read " << m_idlStructsToGenerate.size() << " idl struct(s)";
INFO_LOG() << "Read " << m_idlStructsToGenerate.size() << " idl struct(s)";
}
void XmlReader::parseFunctionTopics(const QDomElement &rootElement)
@@ -567,7 +566,7 @@ ColumnInformation XmlReader::parseTableColumn(const QDomElement &column, const Q
}
if (ci.columnName.toLower() != ci.columnName)
WARNING_LOG(m_logger) << "Column " << ci.columnName << " in Table "
WARNING_LOG() << "Column " << ci.columnName << " in Table "
<< tableName << " has has upper-case chars which is not allowed!";
return ci;
@@ -727,18 +726,18 @@ DbNotifcationInformation XmlReader::parseDbNotification(const QDomElement &custo
TopicTypeInformation XmlReader::loadExternalTopicType(const QString &externalServiceName, const QString &topicTypeName)
{
DEBUG_LOG(m_logger) << "externalServiceName: " << externalServiceName << ", topicTypeName: " << topicTypeName;
DEBUG_LOG() << "externalServiceName: " << externalServiceName << ", topicTypeName: " << topicTypeName;
if (!loadExternalService(externalServiceName))
{
WARNING_LOG(m_logger) << "Could not find service " << externalServiceName
WARNING_LOG() << "Could not find service " << externalServiceName
<< " referenced by external topic " << topicTypeName;
return TopicTypeInformation();
}
auto extXmlReader = m_externalXmlInformations.value(externalServiceName);
if (!extXmlReader)
{
ERROR_LOG(m_logger) << "Could not find service xml file for service '" << externalServiceName << "'";
ERROR_LOG() << "Could not find service xml file for service '" << externalServiceName << "'";
return TopicTypeInformation();
}
@@ -750,7 +749,7 @@ TopicTypeInformation XmlReader::loadExternalTopicType(const QString &externalSer
m_usedServices[externalServiceName] = true;
return tti;
}
WARNING_LOG(m_logger) << "Could not find topic " << topicTypeName
WARNING_LOG() << "Could not find topic " << topicTypeName
<< " in external service definition for service "
<< externalServiceName;
return TopicTypeInformation();
@@ -758,18 +757,18 @@ TopicTypeInformation XmlReader::loadExternalTopicType(const QString &externalSer
EnumInformation XmlReader::getExternalEnumeration(const QString &externalServiceName, const QString &enumName, bool verbose)
{
DEBUG_LOG(m_logger) << "externalServiceName: " << externalServiceName << ", topicTypeName: " << enumName;
DEBUG_LOG() << "externalServiceName: " << externalServiceName << ", topicTypeName: " << enumName;
if (!loadExternalService(externalServiceName))
{
WARNING_LOG(m_logger) << "Could not find service '" << externalServiceName << "'"
WARNING_LOG() << "Could not find service '" << externalServiceName << "'"
<< " referenced by external enumeration " << enumName;
return EnumInformation();
}
auto extXmlReader = m_externalXmlInformations.value(externalServiceName);
if (!extXmlReader)
{
ERROR_LOG(m_logger) << "Could not find service xml file for service '" << externalServiceName << "'";
ERROR_LOG() << "Could not find service xml file for service '" << externalServiceName << "'";
return EnumInformation();
}
@@ -784,7 +783,7 @@ EnumInformation XmlReader::getExternalEnumeration(const QString &externalService
}
if (verbose)
{
WARNING_LOG(m_logger) << "Could not find enumeration " << enumName
WARNING_LOG() << "Could not find enumeration " << enumName
<< " in external service definition for '"
<< externalServiceName << "'";
}
@@ -822,11 +821,11 @@ bool XmlReader::loadExternalService(const QString &serviceName)
if (fileName.isEmpty())
return false;
DEBUG_LOG(m_logger) << "xml file for " << serviceName << ": " << fileName;
DEBUG_LOG() << "xml file for " << serviceName << ": " << fileName;
auto extXmlReader = QSharedPointer<XmlReader>(new XmlReader);
if (!extXmlReader->readServiceFile(fileName, QString(), this))
{
WARNING_LOG(m_logger) << "Error reading service file " << fileName
WARNING_LOG() << "Error reading service file " << fileName
<< " for service " << serviceName;
return false;
}
@@ -843,7 +842,7 @@ void XmlReader::loadIdlInfofile(const QString &idlServiceInfoFile)
QFile f(idlServiceInfoFile);
if (!f.open(QIODevice::ReadOnly))
{
WARNING_LOG(m_logger) << "Could not read idl service info file " << idlServiceInfoFile;
WARNING_LOG() << "Could not read idl service info file " << idlServiceInfoFile;
return;
}
const QList<QByteArray> files = f.readAll().split('\n');
@@ -860,7 +859,7 @@ void XmlReader::loadIdlInfofile(const QString &idlServiceInfoFile)
{
const auto svcAbbreveation = fn.split(QLatin1Char('.')).at(0).split(QLatin1Char('_')).at(0);
m_xmlFiles[svcAbbreveation] = fileName;
DEBUG_LOG(m_logger) << "xml: " << svcAbbreveation << " = " << fileName;
DEBUG_LOG() << "xml: " << svcAbbreveation << " = " << fileName;
}
else
{
@@ -868,7 +867,7 @@ void XmlReader::loadIdlInfofile(const QString &idlServiceInfoFile)
if (svcAbbreveation.endsWith(QLatin1String("_enums")))
continue;
m_idlFiles[svcAbbreveation] = fileName;
DEBUG_LOG(m_logger) << "idl: " << svcAbbreveation << " = " << fileName;
DEBUG_LOG() << "idl: " << svcAbbreveation << " = " << fileName;
}
}
}
@@ -894,7 +893,7 @@ void XmlReader::getServiceNameInfoFromFilePath(const QStringList &parts)
const QString abbreviation = parts.last().split(QLatin1Char('.')).first().split(QLatin1Char('_')).first();
const QString serviceName = parts.at(parts.size() - 2);
DEBUG_LOG(m_logger) << "serviceName: " << serviceName << " = " << abbreviation;
DEBUG_LOG() << "serviceName: " << serviceName << " = " << abbreviation;
m_fullServiceName2Abbreviation[serviceName] = abbreviation;
}
@@ -20,7 +20,7 @@
#endif
#endif
#include "codegen_export.h"
#include "codegen_base_export.h"
namespace NGL
{
@@ -434,7 +434,5 @@ private:
QStringList m_groupNames;
int m_prio;
bool m_svcDevMode{false};
NGL::INGLLogger &m_logger;
};
}
@@ -343,7 +343,7 @@ class OperatorRights(object):
outfile.write('\n')
outfile.write('enum Groups_%s\n' % parser.module_name)
outfile.write('{\n')
pattern = re.compile('[\W]+')
pattern = re.compile(r'\W+')
for r in parser.op_rights:
offsetPlugin = globalOffset + (r.offset << 16)
for group in r.groups:
@@ -77,20 +77,20 @@ int main(int argc, char **argv)
QScopedPointer<CodeGen::XmlReader> reader(new CodeGen::XmlReader);
DEBUG_LOG(m_logger) << "ServiceFile: " << options.serviceFile();
DEBUG_LOG(m_logger) << "IdlInfoFile: " << options.idlInfoFile();
DEBUG_LOG() << "ServiceFile: " << options.serviceFile();
DEBUG_LOG() << "IdlInfoFile: " << options.idlInfoFile();
if (!reader->readServiceFile(options.serviceFile(), options.idlInfoFile()))
{
ERROR_LOG(m_logger) << "Error parsing service file '" << options.serviceFile()
ERROR_LOG() << "Error parsing service file '" << options.serviceFile()
<< ": " << reader->errorString();
return 2;
}
QDir dir(options.outDir());
DEBUG_LOG(m_logger) << "Directory: " << options.outDir();
DEBUG_LOG() << "Directory: " << options.outDir();
if (!dir.exists() && !dir.mkpath(options.outDir()))
{
ERROR_LOG(m_logger) << "Directory '" << options.outDir()
ERROR_LOG() << "Directory '" << options.outDir()
<< "' does not exist and can not be created!";
return 3;
}
@@ -98,7 +98,7 @@ int main(int argc, char **argv)
QScopedPointer<CodeGen::StructBuilder> structBuilder(new CodeGen::StructBuilder(reader.data()));
if (!structBuilder->buildStructures())
{
ERROR_LOG(m_logger) << "Error building up structures";
ERROR_LOG() << "Error building up structures";
return 4;
}
@@ -123,7 +123,7 @@ int main(int argc, char **argv)
if (!sql.writeSql(dir.absolutePath() + QLatin1Char('/'), CodeGen::ExerciseDependency::Exercise))
{
ERROR_LOG(m_logger) << "Error while writing sql information for service " << sql.getServiceAbbr();
ERROR_LOG() << "Error while writing sql information for service " << sql.getServiceAbbr();
return 10;
}
@@ -133,7 +133,7 @@ int main(int argc, char **argv)
if (!sql.writeSql(dir.absolutePath() + QLatin1Char('/'), CodeGen::ExerciseDependency::Exercise))
{
ERROR_LOG(m_logger) << "Error while writing sql information for service " << sql.getServiceAbbr();
ERROR_LOG() << "Error while writing sql information for service " << sql.getServiceAbbr();
return 10;
}
@@ -141,20 +141,20 @@ int main(int argc, char **argv)
sql.generateData(0);
if (!sql.writeSql(dir.absolutePath() + QLatin1Char('/'), CodeGen::ExerciseDependency::Global))
{
ERROR_LOG(m_logger) << "Error while writing sql information for service " << sql.getServiceAbbr();
ERROR_LOG() << "Error while writing sql information for service " << sql.getServiceAbbr();
return 10;
}
return 0;
}
else
{
ERROR_LOG(m_logger) << "Invalid action '" << options.action() << "' given!";
ERROR_LOG() << "Invalid action '" << options.action() << "' given!";
return 5;
}
if (!generator->init(reader.data(), structBuilder.data()))
{
ERROR_LOG(m_logger) << "Error initializing generator!";
ERROR_LOG() << "Error initializing generator!";
return 6;
}