BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Contains collection of observers and call them at specified intervals. More...
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) |
Adds observer to the list. More... | |
void | notify (const T &data) |
Notifies all observers at their personally specified intervals. More... | |
void | notify_all (const T &data) |
Private Member Functions | |
bool | need_notify (int every_nth) |
Private Attributes | |
int | m_notify_count |
std::vector< ObserverData > | m_observers |
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 30 of file FitObserver.h.
using FitObserver< T >::observer_t = std::function<void(const T&)> |
Definition at line 32 of file FitObserver.h.
FitObserver< T >::FitObserver |
Definition at line 64 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 67 of file FitObserver.h.
Referenced by FitStatus::addObserver().
|
private |
Definition at line 90 of file FitObserver.h.
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 72 of file FitObserver.h.
Referenced by FitStatus::update().
void FitObserver< T >::notify_all | ( | const T & | data | ) |
|
private |
Definition at line 61 of file FitObserver.h.
|
private |
Definition at line 60 of file FitObserver.h.