SourceXtractorPlusPlus  0.11
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BasicParameter.cpp
Go to the documentation of this file.
1 
25 
26 namespace ModelFitting {
27 
28 using namespace std;
29 
31 
32 void 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 
40  m_last_obs_id += 1;
41  m_observer_map.emplace(m_last_obs_id, std::move(observer));
42  return m_last_obs_id;
43 }
44 
46  return m_observer_map.erase(id);
47 }
48 
50  return !m_observer_map.empty();
51 }
52 
53 }// namespace ModelFitting
virtual void setValue(const double new_value)
bool removeObserver(std::size_t id)
T move(T...args)
std::size_t addObserver(ParameterObserver observer)
The addObserver method adding observer to the member list.