BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
itemcopystrategy.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/itemcopystrategy.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_ITEMCOPYSTRATEGY_H
16 #define BORNAGAIN_MVVM_MODEL_MVVM_INTERFACES_ITEMCOPYSTRATEGY_H
17 
18 #include "mvvm/model_export.h"
19 #include <memory>
20 
21 namespace ModelView {
22 
23 class SessionItem;
24 
25 //! Interface for deep item copying.
26 
27 class MVVM_MODEL_EXPORT ItemCopyStrategy {
28 public:
29  virtual ~ItemCopyStrategy() = default;
30 
31  //! Creates item copy by deep copying all children. SessionItem identifiers will be regenerated.
32  virtual std::unique_ptr<SessionItem> createCopy(const SessionItem* item) const = 0;
33 };
34 
35 } // namespace ModelView
36 
37 #endif // BORNAGAIN_MVVM_MODEL_MVVM_INTERFACES_ITEMCOPYSTRATEGY_H
Interface for deep item copying.
virtual ~ItemCopyStrategy()=default
virtual std::unique_ptr< SessionItem > createCopy(const SessionItem *item) const =0
Creates item copy by deep copying all children. SessionItem identifiers will be regenerated.
The main object representing an editable/displayable/serializable entity.
Definition: sessionitem.h:38
materialitems.h Collection of materials to populate MaterialModel.