Mantid
Loading...
Searching...
No Matches
ConfigPropertyObserver.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
9
10namespace Mantid::Kernel {
11
16ConfigPropertyObserver::ConfigPropertyObserver(std::string propertyName) : m_propertyName(std::move(propertyName)) {}
17
21void ConfigPropertyObserver::onValueChanged(const std::string &name, const std::string &newValue,
22 const std::string &prevValue) {
23 if (name == m_propertyName)
24 onPropertyValueChanged(newValue, prevValue);
25}
26} // namespace Mantid::Kernel
ConfigPropertyObserver(std::string propertyName)
Begins listening for change notifications from the global ConfigService concerning the property with ...
void onValueChanged(const std::string &name, const std::string &newValue, const std::string &prevValue) override
Filters out change notifications concerning other properties.
virtual void onPropertyValueChanged(const std::string &newValue, const std::string &prevValue)=0
STL namespace.