Mantid
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
Mantid::Kernel::ConfigPropertyObserver Class Referenceabstract

The ConfigObserver is used to observe changes to the value of a single configuration property based on notifications sent from the ConfigService. More...

#include <ConfigPropertyObserver.h>

Inheritance diagram for Mantid::Kernel::ConfigPropertyObserver:
Mantid::Kernel::ConfigObserver ConfigPropertyObserverWrapper

Public Member Functions

 ConfigPropertyObserver (std::string propertyName)
 Begins listening for change notifications from the global ConfigService concerning the property with the specified name. More...
 
virtual ~ConfigPropertyObserver ()=default
 

Protected Member Functions

virtual void onPropertyValueChanged (const std::string &newValue, const std::string &prevValue)=0
 
void onValueChanged (const std::string &name, const std::string &newValue, const std::string &prevValue) override
 Filters out change notifications concerning other properties. More...
 

Private Attributes

std::string m_propertyName
 

Additional Inherited Members

- Private Member Functions inherited from Mantid::Kernel::ConfigObserver
 ConfigObserver ()
 Begins listening to notifications from the global ConfigService. More...
 
 ConfigObserver (const ConfigObserver &other)
 Copying a config observer is the same as default constructing one. More...
 
void notifyValueChanged (ConfigValChangeNotification_ptr notification)
 Called when a config property's value is changed. More...
 
void notifyValueChanged (const std::string &name, const std::string &newValue, const std::string &prevValue)
 Called when a config property's value is changed. More...
 
ConfigObserveroperator= (const ConfigObserver &other)
 Nothing to do but we must overload the = operator to prevent a default copy which would produce incorrect results. More...
 
virtual ~ConfigObserver () noexcept
 
virtual void onValueChanged (const std::string &name, const std::string &newValue, const std::string &prevValue)=0
 

Detailed Description

The ConfigObserver is used to observe changes to the value of a single configuration property based on notifications sent from the ConfigService.

Definition at line 17 of file ConfigPropertyObserver.h.

Constructor & Destructor Documentation

◆ ConfigPropertyObserver()

Mantid::Kernel::ConfigPropertyObserver::ConfigPropertyObserver ( std::string  propertyName)

Begins listening for change notifications from the global ConfigService concerning the property with the specified name.

Definition at line 16 of file ConfigPropertyObserver.cpp.

◆ ~ConfigPropertyObserver()

virtual Mantid::Kernel::ConfigPropertyObserver::~ConfigPropertyObserver ( )
virtualdefault

Member Function Documentation

◆ onPropertyValueChanged()

virtual void Mantid::Kernel::ConfigPropertyObserver::onPropertyValueChanged ( const std::string &  newValue,
const std::string &  prevValue 
)
protectedpure virtual

Implemented in ConfigPropertyObserverWrapper.

Referenced by onValueChanged().

◆ onValueChanged()

void Mantid::Kernel::ConfigPropertyObserver::onValueChanged ( const std::string &  name,
const std::string &  newValue,
const std::string &  prevValue 
)
overrideprotectedvirtual

Filters out change notifications concerning other properties.

Implements Mantid::Kernel::ConfigObserver.

Definition at line 21 of file ConfigPropertyObserver.cpp.

References m_propertyName, and onPropertyValueChanged().

Member Data Documentation

◆ m_propertyName

std::string Mantid::Kernel::ConfigPropertyObserver::m_propertyName
private

Definition at line 28 of file ConfigPropertyObserver.h.

Referenced by onValueChanged().


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