BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Catalogue for item constructions. More...
Classes | |
struct | ItemCatalogueImpl |
Public Member Functions | |
ItemCatalogue () | |
ItemCatalogue (const ItemCatalogue &other) | |
~ItemCatalogue () | |
bool | contains (const std::string &modelType) const |
std::unique_ptr< SessionItem > | create (const std::string &modelType) const |
int | itemCount () const |
std::vector< std::string > | labels () const |
void | merge (const ItemCatalogue &other) |
Adds content of other catalogue to this. More... | |
std::vector< std::string > | modelTypes () const |
ItemCatalogue & | operator= (const ItemCatalogue &other) |
template<typename T > | |
void | registerItem (const std::string &label={}) |
void | registerItem (const std::string &modelType, item_factory_func_t func, const std::string &label) |
Private Attributes | |
std::unique_ptr< ItemCatalogueImpl > | p_impl |
Catalogue for item constructions.
Contains collection of factory functions associated with item's modelType and optional label.
Definition at line 30 of file itemcatalogue.h.
ItemCatalogue::ItemCatalogue | ( | ) |
Definition at line 32 of file itemcatalogue.cpp.
|
default |
ItemCatalogue::ItemCatalogue | ( | const ItemCatalogue & | other | ) |
Definition at line 34 of file itemcatalogue.cpp.
References p_impl.
bool ItemCatalogue::contains | ( | const std::string & | modelType | ) | const |
std::unique_ptr< SessionItem > ItemCatalogue::create | ( | const std::string & | modelType | ) | const |
int ItemCatalogue::itemCount | ( | ) | const |
std::vector< std::string > ItemCatalogue::labels | ( | ) | const |
void ItemCatalogue::merge | ( | const ItemCatalogue & | other | ) |
Adds content of other catalogue to this.
Definition at line 90 of file itemcatalogue.cpp.
References contains(), p_impl, and registerItem().
Referenced by TEST_F().
std::vector< std::string > ItemCatalogue::modelTypes | ( | ) | const |
ItemCatalogue & ItemCatalogue::operator= | ( | const ItemCatalogue & | other | ) |
Definition at line 39 of file itemcatalogue.cpp.
References p_impl, and swap().
void ModelView::ItemCatalogue::registerItem | ( | const std::string & | label = {} | ) |
Definition at line 60 of file itemcatalogue.h.
void ItemCatalogue::registerItem | ( | const std::string & | modelType, |
item_factory_func_t | func, | ||
const std::string & | label | ||
) |
Definition at line 48 of file itemcatalogue.cpp.
References p_impl.
|
private |
Definition at line 57 of file itemcatalogue.h.
Referenced by ItemCatalogue(), contains(), create(), itemCount(), labels(), merge(), modelTypes(), operator=(), and registerItem().