BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
jsonitemformatassistant.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // qt-mvvm: Model-view-view-model framework for large GUI applications
4 //
5 //! @file mvvm/model/mvvm/serialization/jsonitemformatassistant.h
6 //! @brief Defines class CLASS?
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2020
11 //! @authors Gennady Pospelov et al, Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_MVVM_MODEL_MVVM_SERIALIZATION_JSONITEMFORMATASSISTANT_H
16 #define BORNAGAIN_MVVM_MODEL_MVVM_SERIALIZATION_JSONITEMFORMATASSISTANT_H
17 
19 #include <QString>
20 #include <memory>
21 
22 namespace ModelView {
23 
24 class ItemFactoryInterface;
25 
26 //! Utility class to determine, whether given JSON object can represent various parts of
27 //! SessionModel. It is made a class (and not a set of free functions) to allow different formats in
28 //! the future.
29 
30 class MVVM_MODEL_EXPORT JsonItemFormatAssistant {
31 public:
32  static inline const QString modelKey = "model";
33  static inline const QString itemDataKey = "itemData";
34  static inline const QString itemTagsKey = "itemTags";
35  static inline const QString defaultTagKey = "defaultTag";
36  static inline const QString containerKey = "containers";
37  static inline const QString tagInfoKey = "tagInfo";
38  static inline const QString itemsKey = "items";
39  static inline const QString sessionModelKey = "sessionmodel";
40  static inline const QString versionKey = "version";
41  static inline const QString roleKey = "role";
42  static inline const QString variantKey = "variant";
43 
44  bool isSessionItem(const QJsonObject& json) const;
45  bool isSessionItemData(const QJsonObject& json) const;
46  bool isSessionItemTags(const QJsonObject& json) const;
47  bool isSessionItemContainer(const QJsonObject& json) const;
48  bool isSessionModel(const QJsonObject& object) const;
49 };
50 
51 } // namespace ModelView
52 
53 #endif // BORNAGAIN_MVVM_MODEL_MVVM_SERIALIZATION_JSONITEMFORMATASSISTANT_H
Utility class to determine, whether given JSON object can represent various parts of SessionModel.
Defines class CLASS?
materialitems.h Collection of materials to populate MaterialModel.