BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
DataLoaders1D.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/DataLoaders/DataLoaders1D.h
6 //! @brief Defines class DataLoaders1D
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2021
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI_COREGUI_DATALOADERS_DATALOADERS1D_H
16 #define BORNAGAIN_GUI_COREGUI_DATALOADERS_DATALOADERS1D_H
17 
18 #include <QVector>
19 
20 class AbstractDataLoader;
22 
23 //! Collection of all available data loaders for 1D files
24 
26 public:
27  DataLoaders1D();
29 
30  //! The one and only instance
31  static DataLoaders1D& instance();
32 
33  //! all defined loaders. A null element in the list defines a separator
34  //! The returned pointers are the same over the lifetime of the DataLoaders instance, therefore
35  //! they can be used for comparison.
36  QVector<AbstractDataLoader*> loaders() const;
37 
38  //! The last 10 recently used loaders.
39  QVector<AbstractDataLoader*> recentlyUsedLoaders() const;
40 
41  //! Notify loader was recently used
43 
44  //! Clone the loader and create a user defined loader with its current settings and the given
45  //! name
46  void cloneAsUserDefinedLoader(AbstractDataLoader* loader, const QString& name);
47 
48  //! Create loader from the given persistent name
49  AbstractDataLoader1D* createFromPersistentName(const QString& persistentClassName);
50 
51 private:
52  //! create all default built in loaders
53  void initBuiltInLoaders();
54 
55 private:
57  QVector<AbstractDataLoader*> m_builtInLoaders;
58  QVector<AbstractDataLoader*> m_recentlyUsedLoaders;
59  QVector<AbstractDataLoader*> m_userDefinedLoaders;
60 };
61 
62 #endif // BORNAGAIN_GUI_COREGUI_DATALOADERS_DATALOADERS1D_H
Base class for data loaders for 1D import.
Base class for all data loaders (classes which can import real data)
Collection of all available data loaders for 1D files.
Definition: DataLoaders1D.h:25
QVector< AbstractDataLoader * > recentlyUsedLoaders() const
The last 10 recently used loaders.
void cloneAsUserDefinedLoader(AbstractDataLoader *loader, const QString &name)
Clone the loader and create a user defined loader with its current settings and the given name.
QVector< AbstractDataLoader * > m_userDefinedLoaders
Definition: DataLoaders1D.h:59
void setRecentlyUsedLoader(const AbstractDataLoader *loader)
Notify loader was recently used.
void initBuiltInLoaders()
create all default built in loaders
static DataLoaders1D & instance()
The one and only instance.
AbstractDataLoader1D * createFromPersistentName(const QString &persistentClassName)
Create loader from the given persistent name.
static DataLoaders1D * m_instance
Definition: DataLoaders1D.h:56
QVector< AbstractDataLoader * > m_recentlyUsedLoaders
Definition: DataLoaders1D.h:58
QVector< AbstractDataLoader * > m_builtInLoaders
Definition: DataLoaders1D.h:57
QVector< AbstractDataLoader * > loaders() const
all defined loaders.
QString const & name(EShape k)
Definition: particles.cpp:21