BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
childrenstrategyinterface.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/viewmodel/mvvm/interfaces/childrenstrategyinterface.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_VIEWMODEL_MVVM_INTERFACES_CHILDRENSTRATEGYINTERFACE_H
16 #define BORNAGAIN_MVVM_VIEWMODEL_MVVM_INTERFACES_CHILDRENSTRATEGYINTERFACE_H
17 
18 #include "mvvm/viewmodel_export.h"
19 #include <vector>
20 
21 namespace ModelView {
22 
23 class SessionItem;
24 
25 //! Base class for strategies to find children, actual of fictional, of given item.
26 
27 //! Reported vector of children might be different from actual children of given item.
28 //! The strategy is used in context of AbstractViewModel while exposing SessionModel to Qt.
29 //! Thanks to this strategy ViewModel decides which items to visit.
30 
31 class MVVM_VIEWMODEL_EXPORT ChildrenStrategyInterface {
32 public:
33  virtual ~ChildrenStrategyInterface() = default;
34 
35  //! Returns vector of children of given item.
36  virtual std::vector<SessionItem*> children(const SessionItem* item) const = 0;
37 };
38 
39 } // namespace ModelView
40 
41 #endif // BORNAGAIN_MVVM_VIEWMODEL_MVVM_INTERFACES_CHILDRENSTRATEGYINTERFACE_H
Base class for strategies to find children, actual of fictional, of given item.
virtual std::vector< SessionItem * > children(const SessionItem *item) const =0
Returns vector of children of given item.
virtual ~ChildrenStrategyInterface()=default
The main object representing an editable/displayable/serializable entity.
Definition: sessionitem.h:38
materialitems.h Collection of materials to populate MaterialModel.