BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
ItemCatalog.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/Model/MakeItem/ItemCatalog.h
6 //! @brief Defines class ItemCatalog
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI_MODEL_MAKEITEM_ITEMCATALOG_H
16 #define BORNAGAIN_GUI_MODEL_MAKEITEM_ITEMCATALOG_H
17 
18 #include "Base/Util/IFactory.h"
19 #include <QString>
20 #include <memory>
21 
22 class SessionItem;
23 
24 //! Catalog of SessionItem%s. A single instance is created and used in ItemFactory.cpp.
25 
26 class ItemCatalog {
27 public:
28  ItemCatalog();
29 
30  static ItemCatalog& instance();
31 
32  std::unique_ptr<SessionItem> createItemPtr(const QString& modelType) const;
33 
34 private:
35  template <typename T>
36  void addItem();
37 
38  IFactory<QString, SessionItem> m_data;
39 };
40 
41 #endif // BORNAGAIN_GUI_MODEL_MAKEITEM_ITEMCATALOG_H
Catalog of SessionItems. A single instance is created and used in ItemFactory.cpp.
Definition: ItemCatalog.h:26
static ItemCatalog & instance()
Definition: ItemCatalog.cpp:80
void addItem()
Definition: ItemCatalog.cpp:93
std::unique_ptr< SessionItem > createItemPtr(const QString &modelType) const
Definition: ItemCatalog.cpp:86
IFactory< QString, SessionItem > m_data
Definition: ItemCatalog.h:38
Base class for a GUI data item.
Definition: SessionItem.h:204