|
BornAgain
1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Classes | |
| class | ObserverData |
Public Types | |
| using | observer_t = std::function< void(const T &)> |
Public Member Functions | |
| FitObserver () | |
| void | addObserver (int every_nth, observer_t observer) |
| void | notify (const T &data) |
| void | notify_all (const T &data) |
Private Member Functions | |
| bool | need_notify (int every_nth) |
Private Attributes | |
| std::vector< ObserverData > | m_observers |
| int | m_notify_count |
Contains collection of observers and call them at specified intervals.
Each observer will be called at first iteration and every-nth iterations.
Definition at line 25 of file FitObserver.h.
| using FitObserver< T >::observer_t = std::function<void(const T&)> |
Definition at line 28 of file FitObserver.h.
| FitObserver< T >::FitObserver |
Definition at line 61 of file FitObserver.h.
| void FitObserver< T >::addObserver | ( | int | every_nth, |
| typename FitObserver< T >::observer_t | observer | ||
| ) |
Adds observer to the list.
| every_nth | An observer function will be called every_nth iterations. |
| observer | Observer function to be called. |
Definition at line 64 of file FitObserver.h.
Referenced by FitStatus::addObserver().
| void FitObserver< T >::notify | ( | const T & | data | ) |
Notifies all observers at their personally specified intervals.
| data | The data which will be passed to the observer. |
Definition at line 69 of file FitObserver.h.
Referenced by FitStatus::update().
| void FitObserver< T >::notify_all | ( | const T & | data | ) |
|
private |
Definition at line 87 of file FitObserver.h.
|
private |
Definition at line 57 of file FitObserver.h.
|
private |
Definition at line 58 of file FitObserver.h.