Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
@@ -200,6 +200,8 @@ 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()
|
||||
@@ -266,7 +268,7 @@ bool StructBuilder::buildStructures()
|
||||
const ServiceTypeStruct sts = extractServiceAndTypeFromTypename(tti.name);
|
||||
if (!sts.isExternalType())
|
||||
{
|
||||
ERROR_LOG() << "Invalid external topic type name: '" << tti.name << "'";
|
||||
ERROR_LOG(m_logger) << "Invalid external topic type name: '" << tti.name << "'";
|
||||
return false;
|
||||
}
|
||||
if (!handleIdlStructInfo(tti, m_externalTopicTypes, sts.service))
|
||||
@@ -287,7 +289,7 @@ bool StructBuilder::handleEnum(const EnumInformation &ei)
|
||||
QSharedPointer<TableInformation> ti = m_xmlReader->getTable(ei.tableName);
|
||||
if (ti.isNull())
|
||||
{
|
||||
WARNING_LOG() << "Could not find table information for enum: "
|
||||
WARNING_LOG(m_logger) << "Could not find table information for enum: "
|
||||
<< ei.enumName << ", table: " << ei.tableName;
|
||||
return false;
|
||||
}
|
||||
@@ -323,12 +325,12 @@ EnumInformation StructBuilder::enumInformationByType(const QString &type, bool c
|
||||
{
|
||||
if (!checkExternals)
|
||||
{
|
||||
ERROR_LOG() << "Could not find enumeration '" << type << "'";
|
||||
ERROR_LOG(m_logger) << "Could not find enumeration '" << type << "'";
|
||||
return EnumInformation();
|
||||
}
|
||||
if (extInfo.type.isEmpty())
|
||||
{
|
||||
WARNING_LOG() << "Could not parse external enumeration '" << type << "'";
|
||||
WARNING_LOG(m_logger) << "Could not parse external enumeration '" << type << "'";
|
||||
return EnumInformation();
|
||||
}
|
||||
return m_xmlReader->getExternalEnumeration(extInfo.service, extInfo.type, verbose);
|
||||
@@ -340,13 +342,13 @@ EnumInformation StructBuilder::enumInformationByType(const QString &type, bool c
|
||||
return ei;
|
||||
}
|
||||
if (verbose)
|
||||
ERROR_LOG() << "Could not find enumeration '" << type << "'";
|
||||
ERROR_LOG(m_logger) << "Could not find enumeration '" << type << "'";
|
||||
return EnumInformation();
|
||||
}
|
||||
|
||||
CompleteTopicTypeInformation StructBuilder::topicTypeInformationByStructType(const QString &type, bool checkExternals)
|
||||
{
|
||||
DEBUG_LOG() << "topicTypeInformationByStructType(" << type << ")";
|
||||
DEBUG_LOG(m_logger) << "topicTypeInformationByStructType(" << type << ")";
|
||||
if (type.isEmpty())
|
||||
return CompleteTopicTypeInformation();
|
||||
|
||||
@@ -364,26 +366,26 @@ CompleteTopicTypeInformation StructBuilder::topicTypeInformationByStructType(con
|
||||
return csi;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "Type '" << type << "' not found in idlStructs - maybe not yet exported or an enum";
|
||||
DEBUG_LOG(m_logger) << "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() << "Found not yet exported type " << type;
|
||||
DEBUG_LOG(m_logger) << "Found not yet exported type " << type;
|
||||
if (!handleIdlStructInfo(tti, m_topicTypeInfos))
|
||||
return CompleteTopicTypeInformation();
|
||||
return topicTypeInformationByStructType(type);
|
||||
}
|
||||
}
|
||||
ERROR_LOG() << "Could not find type '" << type << "' in idlStructs";
|
||||
ERROR_LOG(m_logger) << "Could not find type '" << type << "' in idlStructs";
|
||||
return CompleteTopicTypeInformation();
|
||||
}
|
||||
|
||||
CompleteTopicTypeInformation StructBuilder::externalTopicTypeByStructType(const ServiceTypeStruct &sts)
|
||||
{
|
||||
const QString typeToSearch = sts.fqType();
|
||||
DEBUG_LOG() << "externalTopicTypeByStructType " << typeToSearch;
|
||||
DEBUG_LOG(m_logger) << "externalTopicTypeByStructType " << typeToSearch;
|
||||
for (const CompleteTopicTypeInformation &ctti : std::as_const(m_externalTopicTypes))
|
||||
{
|
||||
if (ctti.name == typeToSearch)
|
||||
@@ -396,13 +398,13 @@ CompleteTopicTypeInformation StructBuilder::externalTopicTypeByStructType(const
|
||||
|
||||
bool StructBuilder::loadExternalTopicType(const ServiceTypeStruct &sts)
|
||||
{
|
||||
DEBUG_LOG() << "loadExternalTopicType(" << sts.fqType() << ")";
|
||||
DEBUG_LOG(m_logger) << "loadExternalTopicType(" << sts.fqType() << ")";
|
||||
|
||||
|
||||
const TopicTypeInformation tti = m_xmlReader->loadExternalTopicType(sts.service, sts.type);
|
||||
if (!tti.isValid())
|
||||
{
|
||||
DEBUG_LOG() << "Could not find external topic '" << sts.fqType() << "'";
|
||||
DEBUG_LOG(m_logger) << "Could not find external topic '" << sts.fqType() << "'";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -473,11 +475,11 @@ bool StructBuilder::handleTable(const ServiceStructInformation &ssi)
|
||||
QVector<QString> tableNames;
|
||||
if (!getColumnsFromTable(ssi.primaryTable, columns, tableNames))
|
||||
{
|
||||
WARNING_LOG() << "Could not retrieve columns from table "
|
||||
WARNING_LOG(m_logger) << "Could not retrieve columns from table "
|
||||
<< ssi.primaryTable;
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << "Got " << columns.size() << " columns for table "
|
||||
DEBUG_LOG(m_logger) << "Got " << columns.size() << " columns for table "
|
||||
<< ssi.primaryTable;
|
||||
|
||||
QSet<QString> sqlTables;
|
||||
@@ -487,12 +489,12 @@ bool StructBuilder::handleTable(const ServiceStructInformation &ssi)
|
||||
MemberInformation miPkFirstTable, miPkLastTable;
|
||||
for (const ColumnInformationEx &ci : std::as_const(columns))
|
||||
{
|
||||
DEBUG_LOG() << "handling column " << ci.columnName;
|
||||
DEBUG_LOG(m_logger) << "handling column " << ci.columnName;
|
||||
|
||||
const QSharedPointer<TableInformation> ti = ci.table;
|
||||
if (ti.isNull())
|
||||
{
|
||||
WARNING_LOG() << "Could not find table for column " << ci.columnName
|
||||
WARNING_LOG(m_logger) << "Could not find table for column " << ci.columnName
|
||||
<< " primary table is " << ssi.primaryTable.data();
|
||||
return false;
|
||||
}
|
||||
@@ -560,14 +562,14 @@ bool StructBuilder::handleTable(const ServiceStructInformation &ssi)
|
||||
camelCaseString(fki->destination.tableName, true);
|
||||
|
||||
EnumInformation ei = enumInformationByType(enumType, true, false);
|
||||
DEBUG_LOG() << "Checking if " << enumType << " is an enum: " << ei.isValid();
|
||||
DEBUG_LOG(m_logger) << "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() << "Checking if " << enumType << " is an enum: " << ei.isValid();
|
||||
DEBUG_LOG(m_logger) << "Checking if " << enumType << " is an enum: " << ei.isValid();
|
||||
}
|
||||
if (ei.isValid() &&
|
||||
ei.tableName == fki->destination.tableName)
|
||||
@@ -676,8 +678,8 @@ bool StructBuilder::handleIdlStructInfo(const TopicTypeInformation &tti,
|
||||
|
||||
if (idlData.isKey && idlData.isOptional)
|
||||
{
|
||||
ERROR_LOG() << "Column option isKey & isOptional are mutually exclusive!";
|
||||
ERROR_LOG() << "Change column '" << tti.name << "."
|
||||
ERROR_LOG(m_logger) << "Column option isKey & isOptional are mutually exclusive!";
|
||||
ERROR_LOG(m_logger) << "Change column '" << tti.name << "."
|
||||
<< idlData.name << "'' to have either key or optional parameter ";
|
||||
return false;
|
||||
}
|
||||
@@ -1045,7 +1047,7 @@ bool StructBuilder::fixupQVariantConversions(MemberInformation &mi) const
|
||||
}
|
||||
else
|
||||
{
|
||||
ERROR_LOG() << "Unknown cpp datatype: " << mi.cpp.type;
|
||||
ERROR_LOG(m_logger) << "Unknown cpp datatype: " << mi.cpp.type;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -1080,7 +1082,7 @@ QVector<MemberInformation> StructBuilder::buildDbTableInformationFromIdlData(con
|
||||
const CompleteTopicTypeInformation cttiChild = topicTypeInformationByStructType(member.type);
|
||||
if (!cttiChild.isValid())
|
||||
{
|
||||
ERROR_LOG() << "Can not find structure '" << member.type << "'";
|
||||
ERROR_LOG(m_logger) << "Can not find structure '" << member.type << "'";
|
||||
continue;
|
||||
}
|
||||
QString pre;
|
||||
@@ -1100,7 +1102,7 @@ QVector<MemberInformation> StructBuilder::buildDbTableInformationFromIdlData(con
|
||||
const CompleteTopicTypeInformation &cttiChild = topicTypeInformationByStructType(member.dataTypeInfo->innerDataType()->idlType());
|
||||
if (!cttiChild.isValid())
|
||||
{
|
||||
ERROR_LOG() << "Can not find structure '" << member.type << "'";
|
||||
ERROR_LOG(m_logger) << "Can not find structure '" << member.type << "'";
|
||||
continue;
|
||||
}
|
||||
buildDbTableInformationFromIdlData(cttiChild,
|
||||
@@ -1194,7 +1196,7 @@ bool StructBuilder::buildJSonStructureInformationFromIdlData(const CompleteTopic
|
||||
const CompleteTopicTypeInformation cttiChild = topicTypeInformationByStructType(member.type);
|
||||
if (!cttiChild.isValid())
|
||||
{
|
||||
ERROR_LOG() << "Can not find structure '" << member.type << "'";
|
||||
ERROR_LOG(m_logger) << "Can not find structure '" << member.type << "'";
|
||||
continue;
|
||||
}
|
||||
if (!buildJSonStructureInformationFromIdlData(cttiChild))
|
||||
@@ -1221,7 +1223,7 @@ bool StructBuilder::buildJSonStructureInformationFromIdlData(const CompleteTopic
|
||||
return false;
|
||||
}
|
||||
else
|
||||
WARNING_LOG() << "Can not find structure '" << member.type << "'";
|
||||
WARNING_LOG(m_logger) << "Can not find structure '" << member.type << "'";
|
||||
}
|
||||
|
||||
|
||||
@@ -1316,11 +1318,11 @@ QMap<QString, CompleteTableInformation> StructBuilder::getRecordingTopicTables()
|
||||
continue;
|
||||
if (!ctti.isDataObject)
|
||||
{
|
||||
WARNING_LOG() << "Trying to record topic '" << ctti.name
|
||||
WARNING_LOG(m_logger) << "Trying to record topic '" << ctti.name
|
||||
<< "' which is not directly published - ignoring!";
|
||||
continue;
|
||||
}
|
||||
DEBUG_LOG() << "Rec table: " << ctti.name;
|
||||
DEBUG_LOG(m_logger) << "Rec table: " << ctti.name;
|
||||
miPrimaryKey.db.table = ctti.name;
|
||||
ret.insert(ctti.name, getRecordingTopicTable(ctti, miPrimaryKey));
|
||||
}
|
||||
@@ -1402,7 +1404,7 @@ StructBuilder::ServiceTypeStruct StructBuilder::extractServiceAndTypeFromTypenam
|
||||
extTypeRef = sl.at(1);
|
||||
}
|
||||
else
|
||||
WARNING_LOG() << "Error parsing type: " << type;
|
||||
WARNING_LOG(m_logger) << "Error parsing type: " << type;
|
||||
StructBuilder::ServiceTypeStruct ret;
|
||||
if (!extServiceRef.isEmpty())
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user