BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
itembackupstrategy.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/interfaces/itembackupstrategy.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_INTERFACES_ITEMBACKUPSTRATEGY_H
16 #define BORNAGAIN_MVVM_MODEL_MVVM_INTERFACES_ITEMBACKUPSTRATEGY_H
17 
18 #include "mvvm/model_export.h"
19 #include <memory>
20 
21 namespace ModelView {
22 
23 class SessionItem;
24 
25 //! Interface to backup items for later restore.
26 
27 class MVVM_MODEL_EXPORT ItemBackupStrategy {
28 public:
29  virtual ~ItemBackupStrategy() = default;
30 
31  //! Restore item from saved content.
32  virtual std::unique_ptr<SessionItem> restoreItem() const = 0;
33 
34  //! Save item's content.
35  virtual void saveItem(const SessionItem*) = 0;
36 };
37 
38 } // namespace ModelView
39 
40 #endif // BORNAGAIN_MVVM_MODEL_MVVM_INTERFACES_ITEMBACKUPSTRATEGY_H
Interface to backup items for later restore.
virtual void saveItem(const SessionItem *)=0
Save item's content.
virtual ~ItemBackupStrategy()=default
virtual std::unique_ptr< SessionItem > restoreItem() const =0
Restore item from saved content.
The main object representing an editable/displayable/serializable entity.
Definition: sessionitem.h:38
materialitems.h Collection of materials to populate MaterialModel.