added new option for disable strong validation of the template type of DataPacks
All checks were successful
buildbot/AndroidBuilder_v8 Build finished.
buildbot/AndroidBuilder_v7 Build finished.
buildbot/DocsGenerator Build finished.
buildbot/IOSCMakeBuilder Build finished.
buildbot/LinuxCMakeBuilder Build finished.
buildbot/WindowsCMakeBuilder Build finished.
buildbot/AndroidBuilder_v8Qt6 Build finished.
buildbot/LinuxCMakeBuilderQt6 Build finished.

This commit is contained in:
Andrei Yankovich 2023-04-24 21:58:58 +02:00
parent 01429a41c2
commit 64cdc993cb
3 changed files with 7 additions and 0 deletions

View File

@ -35,6 +35,7 @@ endif()
option(HEART_STATIC_SSL "This option enable or disabled static link ssl libraryes" OFF)
option(HEART_PRINT_PACKAGES "This option enable or disabled log of add incoming network packages" OFF)
option(HEART_PRINT_SQL_QUERIES "This option enable or disabled log of all sql queries" OFF)
option(HEART_VALIDATE_PACKS "This option enable or disabled validation of child classes of the DataPack class" ON)
option(BUILD_SHARED_LIBS "Enable or disable shared libraryes" OFF)

View File

@ -25,6 +25,10 @@ if (HEART_PRINT_PACKAGES)
add_definitions(-DHEART_PRINT_PACKAGES)
endif()
if (HEART_VALIDATE_PACKS)
add_definitions(-DHEART_VALIDATE_PACKS)
endif()
set(SLL_DEFINE "WITHOUT_SSL")
if (HEART_SSL)

View File

@ -31,8 +31,10 @@ public:
DataPack(const QList<QSharedPointer<Package>> &newPackData = {}) {
setPackData(newPackData);
#ifdef HEART_VALIDATE_PACKS
static_assert(std::is_base_of_v<UniversalData, Package> &&
"The template class of DataPack must be child of the UniversalData class");
#endif
}
/**