BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
compatibilityutils.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/compatibilityutils.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_COMPATIBILITYUTILS_H
16 #define BORNAGAIN_MVVM_MODEL_MVVM_SERIALIZATION_COMPATIBILITYUTILS_H
17 
18 //! @file mvvm/model/mvvm/serialization/compatibilityutils.h
19 //! @brief Place for utils to fix back compatibility of serialized projects.
20 
21 #include "mvvm/model_export.h"
22 #include <memory>
23 
24 namespace ModelView {
25 
26 class SessionItemData;
27 class SessionItemContainer;
28 class TagInfo;
29 
30 namespace Compatibility {
31 
32 //! Returns `true` if given TagInfo is compatible with given container.
33 //! See explanations in the code.
34 
35 MVVM_MODEL_EXPORT
36 bool IsCompatibleUniversalTag(const SessionItemContainer& container, const TagInfo& taginfo);
37 
38 //! Returns `true` if given TagInfo is a single property tag which is compatible with given
39 //! container. See more explanations in the code.
40 
41 MVVM_MODEL_EXPORT
42 bool IsCompatibleSinglePropertyTag(const SessionItemContainer& container, const TagInfo& taginfo);
43 
44 //! Returns `true` if given TagInfo is a tag from GroupItem which is compatible with given
45 //! container. See more explanations in the code.
46 
47 MVVM_MODEL_EXPORT bool IsCompatibleGroupTag(const SessionItemContainer& container,
48  const TagInfo& taginfo);
49 
50 } // namespace Compatibility
51 
52 } // namespace ModelView
53 
54 #endif // BORNAGAIN_MVVM_MODEL_MVVM_SERIALIZATION_COMPATIBILITYUTILS_H
Holds collection of SessionItem objects related to the same tag.
Holds info about single tag for SessionItem.
Definition: taginfo.h:28
Handles all data roles for SessionItem.
MVVM_MODEL_EXPORT bool IsCompatibleSinglePropertyTag(const SessionItemContainer &container, const TagInfo &taginfo)
Returns true if given TagInfo is a single property tag which is compatible with given container.
MVVM_MODEL_EXPORT bool IsCompatibleUniversalTag(const SessionItemContainer &container, const TagInfo &taginfo)
Returns true if given TagInfo is compatible with given container.
MVVM_MODEL_EXPORT bool IsCompatibleGroupTag(const SessionItemContainer &container, const TagInfo &taginfo)
Returns true if given TagInfo is a tag from GroupItem which is compatible with given container.
materialitems.h Collection of materials to populate MaterialModel.