BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Tracks changes in all models. More...
Classes | |
struct | ProjectChangedControllerImpl |
Public Types | |
using | callback_t = std::function< void()> |
Public Member Functions | |
ProjectChangedController (const std::vector< SessionModel * > &models, callback_t project_changed_callback={}) | |
~ProjectChangedController () | |
bool | hasChanged () const |
Returns true if the change in the models has been registered since the last call of resetChanged. More... | |
void | resetChanged () |
Reset controller to initial state, pretending that no changes has been registered. More... | |
Private Attributes | |
std::unique_ptr< ProjectChangedControllerImpl > | p_impl |
Tracks changes in all models.
Allows to check if one or more models have been changed since last call of ::resetChanged(). This is intended to work together with the Project class. It will take care of calling resetChanged after own saving. To avoid extra signaling while being in already "changed" mode, the controller reports only once.
Definition at line 36 of file projectchangecontroller.h.
using ModelView::ProjectChangedController::callback_t = std::function<void()> |
Definition at line 38 of file projectchangecontroller.h.
ProjectChangedController::ProjectChangedController | ( | const std::vector< SessionModel * > & | models, |
callback_t | project_changed_callback = {} |
||
) |
Definition at line 61 of file projectchangecontroller.cpp.
|
default |
bool ProjectChangedController::hasChanged | ( | ) | const |
Returns true if the change in the models has been registered since the last call of resetChanged.
Definition at line 72 of file projectchangecontroller.cpp.
References p_impl.
Referenced by TEST_F().
void ProjectChangedController::resetChanged | ( | ) |
Reset controller to initial state, pretending that no changes has been registered.
Definition at line 79 of file projectchangecontroller.cpp.
References p_impl.
Referenced by ModelView::Project::ProjectImpl::process(), and TEST_F().
|
private |
Definition at line 49 of file projectchangecontroller.h.
Referenced by hasChanged(), and resetChanged().