Skip to content

Commit

Permalink
fixtypo ctor
Browse files Browse the repository at this point in the history
  • Loading branch information
silverqx committed Aug 27, 2024
1 parent 8c599b0 commit 13486e6
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 30 deletions.
16 changes: 8 additions & 8 deletions NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -2153,8 +2153,8 @@ tmp notes - Queryable columns:
// }


Model copy ctor:
----------------
Model copy constructor:
-----------------------

template<typename Derived, AllRelationsConcept ...AllRelations>
Model<Derived, AllRelations...>::Model(const Model &model)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/orm/basegrammar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
2 changes: 1 addition & 1 deletion include/orm/tiny/concerns/hasattributes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<QString, CastItem> u_casts;
Expand Down
2 changes: 1 addition & 1 deletion include/orm/tiny/exceptions/modelnotfounderror.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace Orm::Tiny::Exceptions
{
public:
// FEATURE dilemma primarykey, Model::KeyType vs QVariant silverqx
// TODO perf add overload ctor for QList<quint64>, better QList<Model::KeyType> silverqx
// TODO perf add overload constructor for QList<quint64>, better QList<Model::KeyType> silverqx
/*! const char * constructor. */
explicit ModelNotFoundError(const char *model,
const QList<QVariant> &ids = {});
Expand Down
6 changes: 3 additions & 3 deletions include/orm/tiny/model.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ namespace Orm::Tiny
instance that is not yet initialized. */
inline static void
throwIfCRTPctorProblem(const QList<AttributeItem> &attributes);
/*! The QDateTime attribute detected, causes CRTP ctor problem. */
/*! The QDateTime attribute detected, causes CRTP constructor problem. */
static void throwIfQDateTimeAttribute(const QList<AttributeItem> &attributes);
/*! Throw if an attempt to fill a guarded attribute is detected
(mass assignment). */
Expand Down Expand Up @@ -1254,7 +1254,7 @@ namespace Orm::Tiny
// Ownership of the std::shared_ptr<QueryBuilder>
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));
Expand Down Expand Up @@ -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<std::reference_wrapper<Derived>> 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<std::reference_wrapper<Derived>> 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
Expand Down
2 changes: 1 addition & 1 deletion include/orm/tiny/relations/belongsto.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ namespace Orm::Tiny::Relations
std::unique_ptr<Related> &&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<BelongsTo<Model, Related>>(
new BelongsTo(std::move(related), child, foreignKey,
Expand Down
2 changes: 1 addition & 1 deletion include/orm/tiny/relations/belongstomany.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<BelongsToMany<Model, Related, PivotType>>(
new BelongsToMany<Model, Related, PivotType>(
Expand Down
2 changes: 1 addition & 1 deletion include/orm/tiny/relations/hasmany.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ namespace Orm::Tiny::Relations
std::unique_ptr<Related> &&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<HasMany<Model, Related>>(
new HasMany(std::move(related), parent, foreignKey, localKey));
Expand Down
2 changes: 1 addition & 1 deletion include/orm/tiny/relations/hasone.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ namespace Orm::Tiny::Relations
std::unique_ptr<Related> &&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<HasOne<Model, Related>>(
new HasOne(std::move(related), parent, foreignKey, localKey));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion include/orm/tiny/tinybuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down Expand Up @@ -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);
Expand All @@ -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},
Expand All @@ -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<AttributeItem> must work well. */
TorrentEager_Without_QDateTime torrent {
{NAME, name},
Expand Down
2 changes: 1 addition & 1 deletion tom/include/tom/concerns/interactswithio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion tom/include/tom/terminal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<typename T>
concept OStreamConcept = std::convertible_to<T, const std::ostream &> ||
Expand Down
6 changes: 3 additions & 3 deletions tom/src/tom/concerns/callscommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 13486e6

Please sign in to comment.