|
BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Provides registration of SessionItem pointers and their unique identifiers in global memory pool. More...
Public Member Functions | |
| ItemPool ()=default | |
| ItemPool (const ItemPool &)=delete | |
| ItemPool (ItemPool &&)=delete | |
| SessionItem * | item_for_key (const identifier_type &key) const |
| identifier_type | key_for_item (const SessionItem *item) const |
| ItemPool & | operator= (const ItemPool &)=delete |
| ItemPool & | operator= (ItemPool &&)=delete |
| identifier_type | register_item (SessionItem *item, identifier_type key={}) |
| size_t | size () const |
| void | unregister_item (SessionItem *item) |
Private Attributes | |
| std::map< const SessionItem *, identifier_type > | m_item_to_key |
| std::map< identifier_type, SessionItem * > | m_key_to_item |
Provides registration of SessionItem pointers and their unique identifiers in global memory pool.
Definition at line 29 of file itempool.h.
|
default |
|
delete |
|
delete |
| SessionItem * ItemPool::item_for_key | ( | const identifier_type & | key | ) | const |
Definition at line 72 of file itempool.cpp.
References m_key_to_item.
| identifier_type ItemPool::key_for_item | ( | const SessionItem * | item | ) | const |
Definition at line 63 of file itempool.cpp.
References m_item_to_key.
| identifier_type ItemPool::register_item | ( | SessionItem * | item, |
| identifier_type | key = {} |
||
| ) |
Definition at line 28 of file itempool.cpp.
References ModelView::UniqueIdGenerator::generate(), m_item_to_key, and m_key_to_item.
| size_t ItemPool::size | ( | ) | const |
Definition at line 21 of file itempool.cpp.
References m_item_to_key, and m_key_to_item.
Referenced by TEST_F().
| void ItemPool::unregister_item | ( | SessionItem * | item | ) |
|
private |
Definition at line 48 of file itempool.h.
Referenced by key_for_item(), register_item(), size(), and unregister_item().
|
private |
Definition at line 47 of file itempool.h.
Referenced by item_for_key(), register_item(), size(), and unregister_item().