Smithy Qt 0.1.0-pre
Internal development documentation
Loading...
Searching...
No Matches
model_p.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2013-2025 Paul Colby <git@colby.id.au>
2// SPDX-License-Identifier: LGPL-3.0-or-later
3
4/*!
5 * \file
6 * Declares the ModelPrivate class.
7 */
8
9#ifndef QTSMITHY_MODEL_P_H
10#define QTSMITHY_MODEL_P_H
11
12#include <qtsmithy/model.h>
13#include <qtsmithy/shapeid.h>
14
15#include <QCoreApplication>
16#include <QLoggingCategory>
17#include <QVersionNumber>
18
20
22{
23Q_DECLARE_TR_FUNCTIONS(Model);
24
25public:
26 explicit ModelPrivate(Model * const q);
27
28 static QJsonObject mergeMetadata(const QMultiHash<QString, QJsonValue> &metadata);
29 static QVersionNumber smithyVersion(const QJsonObject &ast);
30
31protected:
32 Model * q_ptr; ///< Internal q-pointer.
33 static Q_LOGGING_CATEGORY(lc, "smithy.Model", QtInfoMsg); ///< Logging category for Model.
34
35private:
36 Model::Error error;
37 QMultiHash<QString, QJsonValue> allMetadata;
38 QMultiHash<ShapeId, Shape> allShapes;
39 QJsonObject mergedMetadata;
40 QHash<ShapeId, Shape> mergedShapes;
41
42 Q_DECLARE_PUBLIC(Model)
44};
45
47
48#endif // QTSMITHY_MODEL_P_H
ModelPrivate(Model *const q)
Definition model.cpp:257
Model * q_ptr
Internal q-pointer.
Definition model_p.h:32
static Q_LOGGING_CATEGORY(lc, "smithy.Model", QtInfoMsg)
Logging category for Model.
The Model class provides a Qt representation of a Smithy semantic model.
Definition model.h:26
Declares the Model class.
#define QTSMITHY_EXPORT
QtSmithy library export/import macro.
#define QTSMITHY_BEGIN_NAMESPACE
Macro for starting the QtSmithy library's top-most namespace (if one is defined).
#define QTSMITHY_BEFRIEND_TEST(Class)
Macro for befriending a related unit test class, but only when QT_TESTLIB_LIB is defined.
#define QTSMITHY_END_NAMESPACE
Macro for ending the QtSmithy library's top-most namespace (if one is defined).
Declares the ShapeId class.