diff --git a/NOTES.txt b/NOTES.txt index 51fc45153..f7b567bc0 100644 --- a/NOTES.txt +++ b/NOTES.txt @@ -317,8 +317,8 @@ PostgreSQL: NULL values: ----- -In this case Int, Short, LongLong, ... are QMetaType-s that are passed to the QVariant ctor to -create the NULL QVariant eg. QVariant(QMetaType(QMetaType::Int)). +In this case Int, Short, LongLong, ... are QMetaType-s that are passed to the QVariant constructor +to create the NULL QVariant eg. QVariant(QMetaType(QMetaType::Int)). bool smallint smallint_u int int_u bigint bigint_u double decimal MySQL Char Short UShort Int UInt LongLong ULongLong Double Double @@ -342,7 +342,7 @@ methods to support the Default Attribute values. All instance allocation are on the stack unless otherwise noted. Model: - ctors + constructors instance() on() query() @@ -1782,12 +1782,12 @@ Add code below to class you want to optimize and set breakpoints inside and you Torrent(const Torrent &torrent) : Model(torrent) { - qDebug() << "Torrent copy ctor"; + qDebug() << "Torrent copy constructor"; } Torrent(Torrent &&torrent) noexcept : Model(std::move(torrent)) { - qDebug() << "Torrent move ctor"; + qDebug() << "Torrent move constructor"; } Torrent &operator=(const Torrent &torrent) { @@ -2153,8 +2153,8 @@ tmp notes - Queryable columns: // } -Model copy ctor: ----------------- +Model copy constructor: +----------------------- template Model::Model(const Model &model) @@ -3212,7 +3212,7 @@ struct T1 c++ library confusions: ----------------------- - - std::unordered_map reserve() vs ctor(size_type), they are the same + - std::unordered_map reserve() vs constructor(size_type), they are the same - shared_ptr and unique_ptr complete vs incomplete type: - https://en.cppreference.com/w/cpp/memory/unique_ptr diff --git a/include/orm/basegrammar.hpp b/include/orm/basegrammar.hpp index 428137fe6..6ce58215d 100644 --- a/include/orm/basegrammar.hpp +++ b/include/orm/basegrammar.hpp @@ -116,7 +116,7 @@ namespace Query column alias (select expression)). */ static QStringList getSegmentsFromAlias(const QString &aliasedExpression); - // FEATURE qt6, use everywhere QLatin1String("") instead of = "", BUT Qt6 has char8_t ctor, so u"" can be used, I will wait with this problem silverqx + // FEATURE qt6, use everywhere QLatin1String("") instead of = "", BUT Qt6 has char8_t constructor, so u"" can be used, I will wait with this problem silverqx /*! The grammar table prefix. */ QString m_tablePrefix; }; diff --git a/include/orm/tiny/concerns/hasattributes.hpp b/include/orm/tiny/concerns/hasattributes.hpp index 7e61fe502..dd9984e9b 100644 --- a/include/orm/tiny/concerns/hasattributes.hpp +++ b/include/orm/tiny/concerns/hasattributes.hpp @@ -453,7 +453,7 @@ namespace Orm::Tiny::Concerns /* Casting Attributes */ /* Has to be static because of setAttribute - isDateAttribute - ... - getCasts: auto casts = model.getUserCasts() - Called from Models ctor. */ + Called from Models' constructors. */ /*! The attributes that should be cast. */ T_THREAD_LOCAL inline static std::unordered_map u_casts; diff --git a/include/orm/tiny/exceptions/modelnotfounderror.hpp b/include/orm/tiny/exceptions/modelnotfounderror.hpp index ef0b0fa6c..69a5d92d5 100644 --- a/include/orm/tiny/exceptions/modelnotfounderror.hpp +++ b/include/orm/tiny/exceptions/modelnotfounderror.hpp @@ -19,7 +19,7 @@ namespace Orm::Tiny::Exceptions { public: // FEATURE dilemma primarykey, Model::KeyType vs QVariant silverqx - // TODO perf add overload ctor for QList, better QList silverqx + // TODO perf add overload constructor for QList, better QList silverqx /*! const char * constructor. */ explicit ModelNotFoundError(const char *model, const QList &ids = {}); diff --git a/include/orm/tiny/model.hpp b/include/orm/tiny/model.hpp index c6b6bb258..1a81d7416 100644 --- a/include/orm/tiny/model.hpp +++ b/include/orm/tiny/model.hpp @@ -460,7 +460,7 @@ namespace Orm::Tiny instance that is not yet initialized. */ inline static void throwIfCRTPctorProblem(const QList &attributes); - /*! The QDateTime attribute detected, causes CRTP ctor problem. */ + /*! The QDateTime attribute detected, causes CRTP constructor problem. */ static void throwIfQDateTimeAttribute(const QList &attributes); /*! Throw if an attempt to fill a guarded attribute is detected (mass assignment). */ @@ -1254,7 +1254,7 @@ namespace Orm::Tiny // Ownership of the std::shared_ptr auto query = newBaseQueryBuilder(); - /* Model is passed to the TinyBuilder ctor, because of that setModel() + /* Model is passed to the TinyBuilder constructor because of that setModel() isn't used here. Can't be const because of passed non-const model to the TinyBuilder. */ return newTinyBuilder(std::move(query)); @@ -2214,7 +2214,7 @@ TINYORM_END_COMMON_NAMESPACE // BUG clang on mingw inline static initialization with another static in the same class defined line before, all other compilers (on Linux too) works silverqx // CUR docs mdx syntax highlight prism Treeview https://prismjs.com/plugins/treeview/ silverqx // CUR docs IdealImage silverqx -// TODO cache static_cast<>(*this) in the model()/basemodel() CRTP as a class data member std::optional> m_model = std::nullopt, but I will have to create copy ctor to set m_model {std::nullopt}, the same for other similar model() methods like Model::model(), then I can to check if (m_model) and return right away and I will call static_cast or dynamic_cast only once for every instance, it is cast every time now 😟 silverqx +// TODO cache static_cast<>(*this) in the model()/basemodel() CRTP as a class data member std::optional> m_model = std::nullopt, but I will have to create copy constructor to set m_model {std::nullopt}, the same for other similar model() methods like Model::model(), then I can to check if (m_model) and return right away and I will call static_cast or dynamic_cast only once for every instance, it is cast every time now 😟 silverqx // CUR docs exceptions, which methods throw which exceptions, so user know which exception classes to define in a catch blocks silverqx // SEC fix LoadLibrary() before qsql plugin loads? https://www.qt.io/blog/security-advisory-qlockfile-qauthenticator-windows-platform-plugin silverqx // CUR cmake, make TinyUtils_target in TinyTestCommon.cmake optional, not always needed to link to silverqx diff --git a/include/orm/tiny/relations/belongsto.hpp b/include/orm/tiny/relations/belongsto.hpp index 4539fa675..9e1bb6902 100644 --- a/include/orm/tiny/relations/belongsto.hpp +++ b/include/orm/tiny/relations/belongsto.hpp @@ -195,7 +195,7 @@ namespace Orm::Tiny::Relations std::unique_ptr &&related, Model &child, const QString &foreignKey, const QString &ownerKey, const QString &relation) { - // Relations have private ctors, std::make_unique() can't be used + // Relations have private constructors, std::make_unique() can't be used auto instance = std::unique_ptr>( new BelongsTo(std::move(related), child, foreignKey, diff --git a/include/orm/tiny/relations/belongstomany.hpp b/include/orm/tiny/relations/belongstomany.hpp index 177ac2886..6f1208cbb 100644 --- a/include/orm/tiny/relations/belongstomany.hpp +++ b/include/orm/tiny/relations/belongstomany.hpp @@ -431,7 +431,7 @@ namespace Orm::Tiny::Relations const QString &relatedPivotKey, const QString &parentKey, const QString &relatedKey, const QString &relation) { - // Relations have private ctors, std::make_unique() can't be used + // Relations have private constructors, std::make_unique() can't be used auto instance = std::unique_ptr>( new BelongsToMany( diff --git a/include/orm/tiny/relations/hasmany.hpp b/include/orm/tiny/relations/hasmany.hpp index 4809e0939..dd36d55e1 100644 --- a/include/orm/tiny/relations/hasmany.hpp +++ b/include/orm/tiny/relations/hasmany.hpp @@ -98,7 +98,7 @@ namespace Orm::Tiny::Relations std::unique_ptr &&related, Model &parent, const QString &foreignKey, const QString &localKey) { - // Relations have private ctors, std::make_unique() can't be used + // Relations have private constructors, std::make_unique() can't be used auto instance = std::unique_ptr>( new HasMany(std::move(related), parent, foreignKey, localKey)); diff --git a/include/orm/tiny/relations/hasone.hpp b/include/orm/tiny/relations/hasone.hpp index 9690fe586..b112961c5 100644 --- a/include/orm/tiny/relations/hasone.hpp +++ b/include/orm/tiny/relations/hasone.hpp @@ -108,7 +108,7 @@ namespace Orm::Tiny::Relations std::unique_ptr &&related, Model &parent, const QString &foreignKey, const QString &localKey) { - // Relations have private ctors, std::make_unique() can't be used + // Relations have private constructors, std::make_unique() can't be used auto instance = std::unique_ptr>( new HasOne(std::move(related), parent, foreignKey, localKey)); diff --git a/include/orm/tiny/support/stores/queriesrelationshipsstore.hpp b/include/orm/tiny/support/stores/queriesrelationshipsstore.hpp index 16cbfdf67..6ec295011 100644 --- a/include/orm/tiny/support/stores/queriesrelationshipsstore.hpp +++ b/include/orm/tiny/support/stores/queriesrelationshipsstore.hpp @@ -105,7 +105,7 @@ namespace Support::Stores it only holds store type which can be handled by currently instantiated QueriesRelationshipsStore (instantiated means template instance generated by the compiler, not a class instance), because the QueriesRelationshipsStore class - can handle 3 store types, the nested store type is used on the base of ctor's + can handle 3 store types, the nested store type is used based on constructor's 'relations' argument. */ /* public */ diff --git a/include/orm/tiny/tinybuilder.hpp b/include/orm/tiny/tinybuilder.hpp index b043d5b91..6c3a1090e 100644 --- a/include/orm/tiny/tinybuilder.hpp +++ b/include/orm/tiny/tinybuilder.hpp @@ -60,7 +60,7 @@ namespace Orm::Tiny /*! Deleted copy assignment operator (not needed). */ Builder &operator=(const Builder &) = delete; - /*! Move constructor (copy ctor needed so enable also the move ctor). */ + /*! Move constructor (copy constructor needed so enable also the move ctor). */ Builder(Builder &&) noexcept = default; /*! Deleted move assignment operator (not needed). */ Builder &operator=(Builder &&) = delete; diff --git a/tests/auto/functional/orm/tiny/model_conn_indep/tst_model_connection_independent.cpp b/tests/auto/functional/orm/tiny/model_conn_indep/tst_model_connection_independent.cpp index 46d700a05..fc3a909f5 100644 --- a/tests/auto/functional/orm/tiny/model_conn_indep/tst_model_connection_independent.cpp +++ b/tests/auto/functional/orm/tiny/model_conn_indep/tst_model_connection_independent.cpp @@ -209,14 +209,14 @@ void tst_Model_Connection_Independent::cleanupTestCase() const void tst_Model_Connection_Independent:: defaultAttributeValues_WithQDateTime_DefaultCtor() const { - // Default ctor must throw because of the QDateTime + // Default constructor must throw because of the QDateTime TVERIFY_THROWS_EXCEPTION(InvalidArgumentError, TorrentEager()); } void tst_Model_Connection_Independent:: defaultAttributeValues_WithQDateTime_ConvertingAttributesCtor() const { - // Attributes converting ctor must throw because of the QDateTime + // Attributes converting constructor must throw because of the QDateTime TVERIFY_THROWS_EXCEPTION(InvalidArgumentError, TorrentEager({ {NAME, "test22"}, @@ -341,7 +341,7 @@ defaultAttributeValues_WithQDateTime_InstanceAttributesMethod_WithConnection() c void tst_Model_Connection_Independent:: defaultAttributeValues_WithoutQDateTime_DefaultCtor() const { - // The default ctor without QDateTime must work well + // The default constructor without QDateTime must work well TorrentEager_Without_QDateTime torrent; QVERIFY(!torrent.exists); @@ -359,7 +359,7 @@ defaultAttributeValues_WithoutQDateTime_ConvertingAttributesCtor() const const auto name = sl("test22"); const auto note = sl("Torrent::instance()"); - // The converting attributes ctor without QDateTime must work well + // The converting attributes constructor without QDateTime must work well TorrentEager_Without_QDateTime torrent({ {NAME, name}, {NOTE, note}, @@ -382,7 +382,7 @@ defaultAttributeValues_WithoutQDateTime_ListInitializationCtor() const const auto name = sl("test22"); const auto note = sl("Torrent::instance()"); - /* The list initialization ctor without QDateTime + /* The list initialization constructor without QDateTime using the std::initializer_list must work well. */ TorrentEager_Without_QDateTime torrent { {NAME, name}, diff --git a/tom/include/tom/concerns/interactswithio.hpp b/tom/include/tom/concerns/interactswithio.hpp index a42a4c913..58c716b9b 100644 --- a/tom/include/tom/concerns/interactswithio.hpp +++ b/tom/include/tom/concerns/interactswithio.hpp @@ -44,7 +44,7 @@ namespace Concerns { Q_DISABLE_COPY_MOVE(InteractsWithIO) - // To access private ctor and errorWallInternal() (used by logException()) + // To access private constructor and errorWallInternal() (used by logException()) friend Tom::Application; public: diff --git a/tom/include/tom/terminal.hpp b/tom/include/tom/terminal.hpp index 75ee33da3..fde26479a 100644 --- a/tom/include/tom/terminal.hpp +++ b/tom/include/tom/terminal.hpp @@ -16,7 +16,8 @@ TINYORM_BEGIN_COMMON_NAMESPACE namespace Tom { - /* std::w/ostream don't have copy ctor, so need to check for const std::ostream &. */ + /* std::w/ostream don't have a copy constructor so need to check + for const std::ostream &. */ /*! Concept for the ostream and wostream. */ template concept OStreamConcept = std::convertible_to || diff --git a/tom/src/tom/concerns/callscommands.cpp b/tom/src/tom/concerns/callscommands.cpp index 4f289e3fb..078b34aa3 100644 --- a/tom/src/tom/concerns/callscommands.cpp +++ b/tom/src/tom/concerns/callscommands.cpp @@ -33,9 +33,9 @@ int CallsCommands::runCommand(const QString &command, QStringList &&arguments) c application.initializeParser(parser); - /* Parse needed also here because InteractiveIO ctor calls isSet(). Also no error - handling needed here, it will be handled in the Command::run(), this is only - pre-parse because of isSet() in the InteractiveIO ctor. */ + /* Parse needed also here because InteractiveIO constructor calls isSet(). + Also, no error handling needed here, it will be handled in the Command::run(), + this is only pre-parse because of isSet() in the InteractiveIO constructor. */ auto currentArguments = application.arguments(); parser.parse(currentArguments);