SourceXtractorPlusPlus 1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
BasicParameter.cpp
Go to the documentation of this file.
1
23
25
26namespace ModelFitting {
27
28using namespace std;
29
31
32void BasicParameter::setValue(const double new_value) {
33 m_value = new_value;
34 for (auto& observer : m_observer_map) {
35 observer.second(m_value);
36 }
37}
38
44
46 return m_observer_map.erase(id);
47}
48
50 return !m_observer_map.empty();
51}
52
53}// namespace ModelFitting
bool removeObserver(std::size_t id)
virtual void setValue(const double new_value)
std::function< void(double)> ParameterObserver
std::map< std::size_t, ParameterObserver > m_observer_map
std::size_t addObserver(ParameterObserver observer)
The addObserver method adding observer to the member list.
T move(T... args)