BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
FitObserver< T > Class Template Reference

Contains collection of observers and call them at specified intervals. More...

Public Types

using observer_t = std::function< void(const T &)>
 

Public Member Functions

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)
 

Detailed Description

template<class T>
class FitObserver< T >

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.

Member Function Documentation

◆ addObserver()

template<class T >
void FitObserver< T >::addObserver ( int  every_nth,
typename FitObserver< T >::observer_t  observer 
)

Adds observer to the list.

Parameters
every_nthAn observer function will be called every_nth iterations.
observerObserver function to be called.

Definition at line 64 of file FitObserver.h.

◆ notify()

template<class T >
void FitObserver< T >::notify ( const T &  data)

Notifies all observers at their personally specified intervals.

Parameters
dataThe data which will be passed to the observer.

Definition at line 69 of file FitObserver.h.


The documentation for this class was generated from the following file: